Browse Source
Merge in DESIGN/design from ~DESTINY.LIN/design:release/11.0 to release/11.0 * commit '175de09e0b555c0f943dadd65975bccf146e8148': REPORT-100547 【版本管理二期】远程环境下,配置的保留历史版本数目不生效 REPORT-91839 模板版本管理二期 优化迁移面板 REPORT-101045 【版本管理三期】回收站交互问题 优化代码 REPORT-101063 【版本管理三期】模板已打开,打开版本管理,模板被自动关闭 优化代码 REPORT-101045 【版本管理三期】回收站交互问题 REPORT-100958 【版本管理三期】还原或者预览版本,弹窗应该关闭 修改注释位置 REPORT-100958 【版本管理三期】还原或者预览版本,弹窗应该关闭 REPORT-101063 【版本管理三期】模板已打开,打开版本管理,模板被自动关闭了 REPORT-100954 【版本管理三期】版本中心弹窗交互问题 REPORT-100954 【版本管理三期】版本中心弹窗交互问题 修改代码规范 REPORT-100954 【版本管理三期】版本中心弹窗交互问题 REPORT-101167 【版本管理一期】集群环境,保存版本不生效newui
Destiny.Lin-林锦龙
1 year ago
12 changed files with 414 additions and 32 deletions
@ -0,0 +1,49 @@
|
||||
package com.fr.design.mainframe.vcs; |
||||
|
||||
import com.fr.concurrent.NamedThreadFactory; |
||||
import com.fr.transaction.Configurations; |
||||
import com.fr.transaction.WorkerAdaptor; |
||||
import com.fr.workspace.WorkContext; |
||||
import com.fr.workspace.server.vcs.VcsConfig; |
||||
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanOperator; |
||||
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanService; |
||||
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoRecycleSchedule; |
||||
|
||||
import java.util.concurrent.ExecutorService; |
||||
import java.util.concurrent.Executors; |
||||
|
||||
/** |
||||
* 版本管理界面配置回收事件的处理类 |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/21 |
||||
*/ |
||||
public class VcsRecycleSettingHelper { |
||||
|
||||
private static ExecutorService executorService = Executors.newSingleThreadExecutor(new NamedThreadFactory("VcsRecycle")); |
||||
|
||||
|
||||
/** |
||||
* 更新任务 |
||||
* |
||||
* @param day |
||||
*/ |
||||
public static void updateJob(int day) { |
||||
executorService.execute(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
Configurations.update(new WorkerAdaptor(VcsConfig.class) { |
||||
@Override |
||||
public void run() { |
||||
VcsConfig.getInstance().setV2CleanRecycleInterval(day); |
||||
} |
||||
}); |
||||
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).addOrUpdateVcsAutoCleanJob( |
||||
VcsAutoCleanService.VCS_AUTO_CLEAN_RECYCLE_JOB_NAME, |
||||
1, |
||||
VcsAutoRecycleSchedule.class); |
||||
} |
||||
}); |
||||
} |
||||
} |
@ -0,0 +1,103 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.gui.frpane.UITabbedPane; |
||||
import com.fr.design.gui.ibutton.UIButton; |
||||
import com.fr.design.gui.icontainer.UIScrollPane; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.gui.ispinner.UISpinner; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.layout.VerticalFlowLayout; |
||||
import com.fr.design.mainframe.vcs.VcsRecycleSettingHelper; |
||||
import com.fr.workspace.server.vcs.VcsConfig; |
||||
|
||||
import javax.swing.JPanel; |
||||
import javax.swing.ScrollPaneConstants; |
||||
import javax.swing.border.EmptyBorder; |
||||
|
||||
import java.awt.*; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.ActionListener; |
||||
|
||||
|
||||
/** |
||||
* 回收站配置面板 |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/21 |
||||
*/ |
||||
public class RecycleSettingPane extends BasicPane { |
||||
|
||||
private static final int MIN_VALUE = 1; |
||||
|
||||
private static final int MAX_VALUE = 999; |
||||
|
||||
private static final int STEP = 1; |
||||
|
||||
private static final int DEFAULT_VALUE = 30; |
||||
|
||||
private UISpinner spinner; |
||||
|
||||
private UIButton button; |
||||
|
||||
public RecycleSettingPane() { |
||||
init(); |
||||
} |
||||
|
||||
private void init() { |
||||
|
||||
this.setLayout(new BorderLayout()); |
||||
UITabbedPane tabbedPane = new UITabbedPane(); |
||||
//回收站内容
|
||||
JPanel recyclePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); |
||||
UIScrollPane recycleScrollPane = patchScroll(recyclePane); |
||||
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Content"), recycleScrollPane); |
||||
recyclePane.add(new RecyclePane()); |
||||
//通用设置
|
||||
JPanel settingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); |
||||
UIScrollPane settingScrollPane = patchScroll(settingPane); |
||||
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Carton_General_Settings"), settingScrollPane); |
||||
settingPane.add(createSchedulePane()); |
||||
this.add(tabbedPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
private JPanel createSchedulePane() { |
||||
JPanel schedulePane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, VerticalFlowLayout.TOP, 0, 0); |
||||
JPanel spinnerPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); |
||||
JPanel buttonPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane_First0(); |
||||
spinnerPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Schedule"))); |
||||
spinner = new UISpinner(MIN_VALUE, MAX_VALUE, STEP, DEFAULT_VALUE); |
||||
spinner.setValue(VcsConfig.getInstance().getV2CleanRecycleInterval()); |
||||
spinnerPane.add(spinner); |
||||
spinnerPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Schedule_Day"))); |
||||
schedulePane.add(spinnerPane); |
||||
button = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Save")); |
||||
initButtonListener(); |
||||
buttonPane.add(button); |
||||
schedulePane.add(buttonPane); |
||||
return schedulePane; |
||||
} |
||||
|
||||
private void initButtonListener() { |
||||
button.addActionListener(new ActionListener() { |
||||
@Override |
||||
public void actionPerformed(ActionEvent e) { |
||||
VcsRecycleSettingHelper.updateJob((int) spinner.getValue()); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
|
||||
private UIScrollPane patchScroll(JPanel generalPane) { |
||||
UIScrollPane generalPanelWithScroll = new UIScrollPane(generalPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); |
||||
generalPanelWithScroll.setBorder(new EmptyBorder(0, 0, 0, 0)); |
||||
return generalPanelWithScroll; |
||||
} |
||||
|
||||
@Override |
||||
protected String title4PopupWindow() { |
||||
return Toolkit.i18nText("Fine-Design_Vcs_Recycle"); |
||||
} |
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.fr.design.mainframe.vcs.ui; |
||||
|
||||
import com.fr.general.GeneralUtils; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.JTable; |
||||
import javax.swing.JLabel; |
||||
import javax.swing.table.DefaultTableCellRenderer; |
||||
import java.awt.*; |
||||
|
||||
|
||||
/** |
||||
* 带ToolTip的UILabel的表格渲染类 |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/21 |
||||
*/ |
||||
public class ToolTipTableCellRenderer extends DefaultTableCellRenderer { |
||||
|
||||
@Override |
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { |
||||
Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); |
||||
if(component instanceof JLabel) { |
||||
String toolTipText = GeneralUtils.objectToString(value); |
||||
if (StringUtils.isNotEmpty(toolTipText)) { |
||||
((JLabel) component).setToolTipText(toolTipText); |
||||
} |
||||
} |
||||
return component; |
||||
} |
||||
} |
Loading…
Reference in new issue