diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 6730fb79ef..15787348fe 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -184,10 +184,6 @@ public class VcsHelper implements JTemplateActionListener { private String getEditingFilename() { JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); - return getFilename(jt); - } - - private String getFilename(JTemplate jt) { String editingFilePath = jt.getEditingFILE().getPath(); return VcsFileUtils.dealWithFilePath(editingFilePath); } @@ -219,7 +215,7 @@ public class VcsHelper implements JTemplateActionListener { fireVcs.execute(new Runnable() { @Override public void run() { - String fileName = getFilename(jt); + String fileName = getEditingFilename(); VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class); VcsEntity entity = operator.getFileVersionByIndex(fileName, 0); boolean replace = needDeleteVersion(entity); diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index d3321e8b14..5145214122 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -86,6 +86,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP private static final int PARA_IMAGE_SHIFT_X = -4; private static final int FORM_AREA_PADDING_LEFT = 13; + private UpdateAction[] mainActions; + private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); public FormParaDesigner() { @@ -342,6 +344,16 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return designerActions.toArray(new UpdateAction[designerActions.size()]); } + public UpdateAction[] getMainActions() { + if (mainActions == null) { + mainActions = new UpdateAction[]{new CutAction(this), new CopyAction(this), new PasteAction(this), + new FormDeleteAction(this)}; + } + return mainActions; + } + + + private boolean searchQueryCreators(XLayoutContainer rootContainer) { boolean b = false; for (int i = 0; i < rootContainer.getXCreatorCount(); i++) { @@ -736,8 +748,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * @return 按钮组 a */ public JComponent[] toolBarButton4Form() { - return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), - new FormDeleteAction(this).createToolBarComponent()}; + UpdateAction[] actions = getMainActions(); + JComponent[] components = new JComponent[actions.length]; + for (int i = 0; i < actions.length; i++) { + components[i] = actions[i].createToolBarComponent(); + } + return components; } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index c79055a910..c9ab115e3c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -776,6 +776,9 @@ public class FormDesigner extends TargetComponent