Browse Source

REPORT-101605 【版本管理三期】版本中心进入的版本详情入口,删除模板所有版本后,版本中心没有刷新

new-design
Destiny.Lin 1 year ago
parent
commit
aadf904a33
  1. 19
      designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsTableOperatorListener.java
  2. 25
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java
  3. 7
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCenterPane.java
  4. 1
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsNewPane.java

19
designer-base/src/main/java/com/fr/design/mainframe/vcs/VcsTableOperatorListener.java

@ -0,0 +1,19 @@
package com.fr.design.mainframe.vcs;
import java.util.List;
/**
* 版本管理表格操作事件
*
* @author Destiny.Lin
* @since 11.0
* Created on 2023/7/27
*/
public interface VcsTableOperatorListener {
/**
* 处理操作
*/
void doOperator(List<VcsTableEntity> entityList);
}

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

@ -11,6 +11,7 @@ import com.fr.design.mainframe.vcs.VcsOperatorWorker;
import com.fr.design.mainframe.vcs.TableEntity; import com.fr.design.mainframe.vcs.TableEntity;
import com.fr.design.mainframe.vcs.TableValueOperator; import com.fr.design.mainframe.vcs.TableValueOperator;
import com.fr.design.mainframe.vcs.VcsTableEntity; import com.fr.design.mainframe.vcs.VcsTableEntity;
import com.fr.design.mainframe.vcs.VcsTableOperatorListener;
import com.fr.report.entity.VcsEntity; import com.fr.report.entity.VcsEntity;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -25,7 +26,9 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.fr.design.i18n.Toolkit.i18nText; import static com.fr.design.i18n.Toolkit.i18nText;
@ -44,6 +47,8 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
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 = 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); public static final Icon ICON_DELETE_DISABLE = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_delete", IconUtils.ICON_TYPE_DISABLED);
private Set<VcsTableOperatorListener> listenerSet = new HashSet<>();
protected UITextField searchTextField; protected UITextField searchTextField;
protected UILabel deleteLabel; protected UILabel deleteLabel;
@ -214,6 +219,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
model.setList(tableEntities); model.setList(tableEntities);
model.fireTableDataChanged(); model.fireTableDataChanged();
listener.doAfterChooseYes(selectList); listener.doAfterChooseYes(selectList);
fireVcsListener(model.getList());
} }
} }
} }
@ -274,6 +280,25 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
this.parentDialog = parentDialog; this.parentDialog = parentDialog;
} }
/**
* 添加版本管理表格操作事件
*
* @param listener 版本管理表格操作事件
*/
public void addVcsListener(VcsTableOperatorListener listener) {
listenerSet.add(listener);
}
/**
* 触发版本管理表格操作事件
*/
public void fireVcsListener(List<VcsTableEntity> tableEntities) {
for (VcsTableOperatorListener listener : listenerSet) {
listener.doOperator(tableEntities);
}
}
/** /**
* 删除范围 * 删除范围
* *

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

@ -10,6 +10,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.vcs.VcsOperatorWorker; import com.fr.design.mainframe.vcs.VcsOperatorWorker;
import com.fr.design.mainframe.vcs.VcsTableEntity; import com.fr.design.mainframe.vcs.VcsTableEntity;
import com.fr.design.mainframe.vcs.VcsTableOperatorListener;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.report.entity.VcsEntity; import com.fr.report.entity.VcsEntity;
@ -160,6 +161,12 @@ public class VcsCenterPane extends VcsNewPane {
return entity.getFilename()+Toolkit.i18nText("Fine-Design_Vcs_Version_Tips"); return entity.getFilename()+Toolkit.i18nText("Fine-Design_Vcs_Version_Tips");
} }
}; };
pane.addVcsListener(entities -> {
if (entities.size() == 0) {
model.getList().remove(o);
model.fireTableDataChanged();
}
});
pane.showDialog(getDialog()); pane.showDialog(getDialog());
} }
} }

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

@ -216,6 +216,7 @@ public class VcsNewPane extends RecyclePane {
model.getList().remove(o); model.getList().remove(o);
model.fireTableDataChanged(); model.fireTableDataChanged();
VcsOperatorWorker.createDeleteWorker().deleteTargetVersion(entity); VcsOperatorWorker.createDeleteWorker().deleteTargetVersion(entity);
fireVcsListener(model.getList());
} }
} }
} }

Loading…
Cancel
Save