Browse Source

Pull request #12499: REPORT-101167 【版本管理一期】集群环境,保存版本不生效 & REPORT-100954 版本中心交互问题 & REPORT-101063 【版本管理三期】模板已打开,打开版本管理,模板被自动关闭了 & REPORT-100958 【版本管理三期】还原或者预览版本,弹窗应该关闭 & REPORT-101045 【版本管理三期】回收站交互问题

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
parent
commit
e276f6169c
  1. 12
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 68
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  3. 4
      designer-base/src/main/java/com/fr/design/mainframe/vcs/RecycleAction.java
  4. 49
      designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsRecycleSettingHelper.java
  5. 32
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/AbstractSupportSelectTablePane.java
  6. 70
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java
  7. 103
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java
  8. 32
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/ToolTipTableCellRenderer.java
  9. 9
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java
  10. 55
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java
  11. 8
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsNewPane.java
  12. 4
      designer-base/src/main/resources/com/fr/design/standard/vcslist/vcs_sort_normal.svg

12
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -64,6 +64,8 @@ import com.fr.workspace.server.vcs.VcsConfig;
import com.fr.workspace.server.vcs.VcsOperator;
import com.fr.workspace.server.vcs.git.config.GcConfig;
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanOperator;
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanSchedule;
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanService;
import org.jetbrains.annotations.NotNull;
import javax.swing.BorderFactory;
@ -916,7 +918,8 @@ public class PreferencePane extends BasicPane {
defaultStringToFormulaBox.setSelected(false);
}
VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager();
if (WorkContext.getCurrent().isCluster()) {
//如果是集群并且是老版本则不可用
if (VcsHelper.getInstance().isLegacyMode() && WorkContext.getCurrent().isCluster()) {
vcsEnableCheckBox.setEnabled(false);
gcEnableCheckBox.setEnabled(false);
}
@ -1188,9 +1191,12 @@ public class PreferencePane extends BasicPane {
}
if (useVcsAutoCleanScheduleCheckBox.isSelected()) {
FineLoggerFactory.getLogger().info("[VcsV2] start auto clean!");
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).addOrUpdateVcsAutoCleanJob(getDay(autoCleanIntervalComboBox.getSelectedIndex()));
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).addOrUpdateVcsAutoCleanJob(
VcsAutoCleanService.VCS_AUTO_CLEAN_JOB_NAME,
getDay(autoCleanIntervalComboBox.getSelectedIndex()),
VcsAutoCleanSchedule.class);
} else {
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).stopVcsAutoCleanJob();
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).stopVcsAutoCleanJob(VcsAutoCleanService.VCS_AUTO_CLEAN_JOB_NAME);
}
}
return null;

68
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -46,6 +46,7 @@ import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.event.Event;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
@ -502,21 +503,24 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath();
path = StableUtils.pathJoin(ProjectConstants.REPORTLETS_NAME, path);
boolean currentEditing = isCurrentEditing(path);
// 如果模板已经打开了,关掉,避免出现2个同名tab(1个是模板,1个是版本)
closeOpenedTemplate(path, currentEditing);
if (VcsHelper.getInstance().isLegacyMode()) {
// 如果模板已经打开了,关掉,避免出现2个同名tab(1个是模板,1个是版本)
closeOpenedTemplate(path, currentEditing);
FileVersionsPanel fileVersionTablePanel = FileVersionsPanel.getInstance();
fileVersionTablePanel.showFileVersionsPane();
stateChange();
} else {
VcsNewPane panel = new VcsNewPane(path);
BasicDialog dialog = panel.showWindow(DesignerContext.getDesignerFrame(), false);
dialog.setVisible(true);
checkTemplateSavedAndShowVcsNewPane(path, currentEditing);
}
}
private void showVcsNewPane(String path) {
VcsNewPane panel = new VcsNewPane(path);
panel.showDialog();
}
/**
* 版本管理可用状态的监控
*/
@ -570,6 +574,60 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}
}
/**
* 如果指定模板已经打开
* <p>1.如果该模板已保存则正常打开新版本管理弹窗
* <p>2.如果该模板未保存触发保存逻辑
* <li>a.如果用户选择保存则保存并不关闭模板弹出新版本管理弹窗
* <li>b.如果用户选择不保存则关闭当前模板弹出新版本管理弹窗
* <li>c.如果用户选择取消, 则啥操作都不做
*
* @param path
* @param isCurrentEditing
*/
private void checkTemplateSavedAndShowVcsNewPane(String path, boolean isCurrentEditing) {
for (JTemplate jTemplate : HistoryTemplateListCache.getInstance().getHistoryList()) {
if (ComparatorUtils.equals(jTemplate.getEditingFILE().getPath(), path)) {
if (!jTemplate.isALLSaved()) {
MultiTemplateTabPane.getInstance().setIsCloseCurrent(isCurrentEditing);
MultiTemplateTabPane.getInstance().closeFormat(jTemplate);
confirmCloseAndShowVcsNewPane(jTemplate, path);
return;
}
showVcsNewPane(path);
}
}
}
private void confirmCloseAndShowVcsNewPane(JTemplate<?, ?> specifiedTemplate, String path) {
if (specifiedTemplate == null) {
return;
}
if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) {
specifiedTemplate.stopEditing();
int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?",
Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) {
CallbackSaveWorker worker = specifiedTemplate.save();
worker.addSuccessCallback(() -> {
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName()));
showVcsNewPane(path);
});
worker.start(specifiedTemplate.getRuntimeId());
} else if (returnVal == JOptionPane.NO_OPTION) {
closeTpl(specifiedTemplate);
showVcsNewPane(path);
}
} else {
showVcsNewPane(path);
}
}
private void closeTpl(JTemplate<?, ?> specifiedTemplate) {
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
MultiTemplateTabPane.getInstance().closeAndFreeLock(specifiedTemplate);
MultiTemplateTabPane.getInstance().activePrevTemplateAfterClose();
}
}

4
designer-base/src/main/java/com/fr/design/mainframe/vcs/RecycleAction.java

@ -4,7 +4,7 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.ui.RecyclePane;
import com.fr.design.mainframe.vcs.ui.RecycleSettingPane;
import java.awt.event.ActionEvent;
@ -24,7 +24,7 @@ public class RecycleAction extends UpdateAction {
@Override
public void actionPerformed(ActionEvent e) {
RecyclePane pane = new RecyclePane();
RecycleSettingPane pane = new RecycleSettingPane();
BasicDialog dialog = pane.showWindow(DesignerContext.getDesignerFrame(), false);
dialog.setVisible(true);
}

49
designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsRecycleSettingHelper.java

@ -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);
}
});
}
}

32
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/AbstractSupportSelectTablePane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.vcs.ui;
import com.fr.base.svg.IconUtils;
import com.fr.design.data.tabledata.tabledatapane.loading.TipsPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -219,6 +220,17 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
//更新表头的勾选框状态
HeaderRenderer renderer = (HeaderRenderer) table.getTableHeader().getDefaultRenderer();
renderer.refreshHeader(table, selectCount >= table.getRowCount());
changeExtraComponentStatus();
}
/**
* 更新额外组件的状态
*/
protected void changeExtraComponentStatus() {
}
public int getSelectCount() {
return selectCount;
}
@ -242,6 +254,7 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
public HeaderRenderer(JTable table) {
this.tableHeader = table.getTableHeader();
tableHeader.setCursor(new Cursor(Cursor.HAND_CURSOR));
selectBox = new UICheckBox();
selectBox.setSelected(false);
tableHeader.addMouseListener(new MouseAdapter() {
@ -254,6 +267,7 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
selectBox.setSelected(value);
selectAllOrNull(value);
selectCount = value ? table.getRowCount() : 0;
changeExtraComponentStatus();
tableHeader.repaint();
model.fireTableDataChanged();
}
@ -290,8 +304,12 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
tableHeader = table.getTableHeader();
tableHeader.setReorderingAllowed(false);
String valueStr = (String) value;
JLabel label = new JLabel(valueStr);
label.setHorizontalAlignment(SwingConstants.LEFT);
UILabel label = new UILabel(valueStr);
if (needIcon4Head(column)) {
label.setIcon(IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_sort"));
label.setHorizontalTextPosition(JLabel.LEFT);
label.setHorizontalAlignment(SwingConstants.LEFT);
}
selectBox.setHorizontalAlignment(SwingConstants.CENTER);
selectBox.setBorderPainted(true);
JComponent component = (column == 0) ? selectBox : label;
@ -320,6 +338,7 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
setColumnClass(classes);
this.setDefaultEditor(Boolean.class, new BooleanEditor());
this.setDefaultRenderer(Boolean.class, new BooleanRenderer());
this.setDefaultRenderer(UILabel.class, new ToolTipTableCellRenderer());
}
@Override
@ -375,5 +394,14 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
}
/**
* 表头的某列是否需要icon
*
* @param col
* @return
*/
protected boolean needIcon4Head(int col) {
return col != 0;
}
}

70
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java

@ -1,10 +1,12 @@
package com.fr.design.mainframe.vcs.ui;
import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsOperatorWorker;
import com.fr.design.mainframe.vcs.TableEntity;
import com.fr.design.mainframe.vcs.TableValueOperator;
@ -37,8 +39,10 @@ import static com.fr.design.i18n.Toolkit.i18nText;
*/
public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity> {
public static final Icon ICON_SEARCH = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_recycle_search");
public static final Icon ICON_REFRESH = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_recycle_restore");
public static final Icon ICON_DELETE = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_recycle_delete");
public static final Icon ICON_REFRESH = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_restore", IconUtils.ICON_TYPE_NORMAL);
public static final Icon ICON_REFRESH_DISABLE = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_restore", IconUtils.ICON_TYPE_DISABLED);
public static final Icon ICON_DELETE = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_delete", IconUtils.ICON_TYPE_NORMAL);
public static final Icon ICON_DELETE_DISABLE = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_delete", IconUtils.ICON_TYPE_DISABLED);
protected UITextField searchTextField;
@ -47,7 +51,9 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
protected UILabel restoreLabel;
private static final int COLUMNS_COUNT = 15;
private BasicDialog dialog;
private BasicDialog parent;
private List<VcsTableEntity> tableEntities;
public RecyclePane() {
@ -73,7 +79,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
Toolkit.i18nText("Fine-Design_Vcs_Recycle_Size"),
Toolkit.i18nText("Fine-Design_Vcs_Delete_Time"),
Toolkit.i18nText("Fine-Design_Vcs_Time")
}, true);
}, false);
}
public RecyclePane(String title, TableValueOperator<VcsTableEntity> operators, boolean needBorder) {
@ -111,17 +117,33 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
if (isNeedRestore()) {
restoreLabel = new UILabel(ICON_REFRESH);
restoreLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
restoreLabel.setDisabledIcon(ICON_REFRESH_DISABLE);
restoreLabel.setEnabled(false);
rightPane.add(restoreLabel);
}
if (isNeedDelete()) {
deleteLabel = new UILabel(ICON_DELETE);
deleteLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
deleteLabel.setDisabledIcon(ICON_DELETE_DISABLE);
deleteLabel.setEnabled(false);
rightPane.add(deleteLabel);
}
tableTopPane.add(leftPane, BorderLayout.EAST);
tableTopPane.add(rightPane, BorderLayout.WEST);
}
@Override
protected void changeExtraComponentStatus() {
boolean canUseLabel = getSelectCount() > 0;
if (restoreLabel != null) {
restoreLabel.setEnabled(canUseLabel);
}
if (deleteLabel != null) {
deleteLabel.setEnabled(canUseLabel);
}
}
@Override
protected void initTopPaneListener() {
initSearchTextFiledListener();
@ -177,6 +199,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
}
private void fireListener(VcsResponseListener listener, boolean isDelete) {
List<VcsEntity> selectList = model.getList().stream().filter(TableEntity::isSelect).map(VcsTableEntity::getEntity).collect(Collectors.toList());
if (selectList.size() > 0) {
@ -196,6 +219,47 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
}
/**
* 显示弹窗
*
*/
public void showDialog() {
dialog = this.showWindow(DesignerContext.getDesignerFrame(), false);
dialog.setVisible(true);
}
/**
* 依据父弹窗显示弹窗
*
* @param parent 父弹窗
*/
public void showDialog(BasicDialog parent) {
this.parent = parent;
dialog = this.showWindow(parent, false);
dialog.setVisible(true);
}
/**
* 关闭弹窗如果有父弹窗则一起关闭
*
*/
public void closeDialog() {
if (dialog != null) {
dialog.dispose();
}
if (parent != null) {
parent.dispose();
}
}
public BasicDialog getDialog() {
return dialog;
}
public void setDialog(BasicDialog dialog) {
this.dialog = dialog;
}
/**
* 删除范围
*

103
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java

@ -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");
}
}

32
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/ToolTipTableCellRenderer.java

@ -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;
}
}

9
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java

@ -125,6 +125,12 @@ public class VcsCenterPane extends VcsNewPane {
});
}
@Override
protected boolean needIcon4Head(int col) {
return col != 0 && col != OPERATOR_COL;
}
private void initOpenListener() {
open.addMouseListener(new MouseAdapter() {
@Override
@ -153,8 +159,7 @@ public class VcsCenterPane extends VcsNewPane {
return entity.getFilename()+Toolkit.i18nText("Fine-Design_Vcs_Version_Tips");
}
};
BasicDialog dialog = pane.showWindow(DesignerContext.getDesignerFrame(), false);
dialog.setVisible(true);
pane.showDialog(getDialog());
}
}
});

55
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsMovePanel.java

@ -5,6 +5,7 @@ import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
@ -26,6 +27,7 @@ import com.fr.workspace.server.vcs.v2.move.VcsMoveStrategy;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
@ -265,9 +267,7 @@ public class VcsMovePanel extends BasicPane {
@Override
public void actionPerformed(ActionEvent e) {
VcsCenterPane vcsCenterPane = new VcsCenterPane();
BasicDialog dialog = vcsCenterPane.showWindow(DesignerContext.getDesignerFrame(), false);
dialog.setVisible(true);
vcsCenterPane.showDialog();
}
});
}
@ -279,18 +279,7 @@ public class VcsMovePanel extends BasicPane {
BasicDialog dlg = choosePane.showMediumWindow(SwingUtilities.getWindowAncestor(VcsMovePanel.this), new DialogActionAdapter() {
@Override
public void doOk() {
//进度条面板
initProcessPane();
VcsMovePanel.this.getParentCard().next(getParentPane());
VcsMoveStrategy strategy;
if (moveDefaultButton.isSelected()) {
strategy = VcsMoveStrategy.createNumStrategy((int) spinner.getValue());
} else if (moveNothingButton.isSelected()) {
strategy = VcsMoveStrategy.ALL_GIVE_UP;
} else {
strategy = VcsMoveStrategy.ALL_RETAIN;
}
new MoveWorker(strategy).execute();
createConfirmPane(VcsMovePanel.this);
}
});
dlg.setVisible(true);
@ -298,6 +287,42 @@ public class VcsMovePanel extends BasicPane {
});
}
private void createConfirmPane(Component parent) {
VerticalFlowLayout layout = new VerticalFlowLayout(VerticalFlowLayout.TOP);
layout.setAlignLeft(true);
JPanel panel = new JPanel();
panel.setLayout(layout);
UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Move_Tip_Title"));
UILabel firstLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Move_Tip_First"));
UILabel secondLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Move_Tip_Second"));
titleLabel.setForeground(TIP_COLOR);
firstLabel.setForeground(TIP_COLOR);
secondLabel.setForeground(TIP_COLOR);
panel.add(new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Move_Right_Now")));
panel.add(titleLabel);
panel.add(firstLabel);
panel.add(secondLabel);
int value = FineJOptionPane.showConfirmDialog(parent, panel, Toolkit.i18nText("Fine-Design_Vcs_Move_Title"), JOptionPane.YES_NO_OPTION);
processMove(value);
}
private void processMove(int value) {
if (value == YES_OPTION) {
//进度条面板
initProcessPane();
VcsMovePanel.this.getParentCard().next(getParentPane());
VcsMoveStrategy strategy;
if (moveDefaultButton.isSelected()) {
strategy = VcsMoveStrategy.createStrategy((int) spinner.getValue());
} else if (moveNothingButton.isSelected()) {
strategy = VcsMoveStrategy.createStrategy(0);
} else {
strategy = VcsMoveStrategy.createStrategy(Integer.MAX_VALUE);
}
new MoveWorker(strategy).execute();
}
}
private void initSuccessPane() {
JPanel successPane = new JPanel();
JPanel body = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();

8
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsNewPane.java

@ -113,6 +113,7 @@ public class VcsNewPane extends RecyclePane {
this.operatorPane = createOperatorPane();
this.model.setDefaultEditor(VcsOperatorPane.class, new VcsCellEditor(createOperatorPane()));
this.model.setDefaultRenderer(VcsOperatorPane.class, new VcsCellRender(createOperatorPane()));
this.model.setDefaultRenderer(UILabel.class, new ToolTipTableCellRenderer());
}
@ -159,6 +160,7 @@ public class VcsNewPane extends RecyclePane {
JOptionPane.QUESTION_MESSAGE);
if (selVal == JOptionPane.YES_OPTION) {
restoreEntity(entity);
VcsNewPane.this.closeDialog();
}
}
}
@ -228,6 +230,7 @@ public class VcsNewPane extends RecyclePane {
if (o instanceof VcsTableEntity) {
VcsEntity entity = ((VcsTableEntity) o).getEntity();
previewEntity(entity);
VcsNewPane.this.closeDialog();
}
}
});
@ -339,4 +342,9 @@ public class VcsNewPane extends RecyclePane {
};
dialog.setVisible(true);
}
@Override
protected boolean needIcon4Head(int col) {
return col != 0 && col != OPERATOR_COL;
}
}

4
designer-base/src/main/resources/com/fr/design/standard/vcslist/vcs_sort_normal.svg

@ -0,0 +1,4 @@
<svg width="16" height="17" viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.2462 6.17654C14.3492 6.30778 14.2557 6.5 14.0889 6.5H11.9999V13.9768C11.9999 14.0873 11.9104 14.1768 11.7999 14.1768H11.1999C11.0895 14.1768 10.9999 14.0873 10.9999 13.9768V6.5H8.91119C8.74436 6.5 8.65086 6.30779 8.75384 6.17654L11.3426 2.87732C11.4227 2.77527 11.5772 2.77527 11.6573 2.87731L14.2462 6.17654Z" fill="#333334"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.04297 10.801C2.93999 10.6698 3.03349 10.4775 3.20032 10.4775H5.28927V3.00074C5.28927 2.89028 5.37881 2.80074 5.48927 2.80074H6.08927C6.19972 2.80074 6.28927 2.89028 6.28927 3.00074V10.4775H8.378C8.54482 10.4775 8.63832 10.6698 8.53534 10.801L5.94661 14.1002C5.86653 14.2023 5.712 14.2023 5.63192 14.1002L3.04297 10.801Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 874 B

Loading…
Cancel
Save