Browse Source

vcs问题待产品确认再修改

newui
renekton 6 months ago
parent
commit
43a6f35aab
  1. 6
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  2. 20
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  3. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

6
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() { private String getEditingFilename() {
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
return getFilename(jt);
}
private String getFilename(JTemplate jt) {
String editingFilePath = jt.getEditingFILE().getPath(); String editingFilePath = jt.getEditingFILE().getPath();
return VcsFileUtils.dealWithFilePath(editingFilePath); return VcsFileUtils.dealWithFilePath(editingFilePath);
} }
@ -219,7 +215,7 @@ public class VcsHelper implements JTemplateActionListener {
fireVcs.execute(new Runnable() { fireVcs.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
String fileName = getFilename(jt); String fileName = getEditingFilename();
VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class); VcsOperator operator = WorkContext.getCurrent().get(VcsOperator.class);
VcsEntity entity = operator.getFileVersionByIndex(fileName, 0); VcsEntity entity = operator.getFileVersionByIndex(fileName, 0);
boolean replace = needDeleteVersion(entity); boolean replace = needDeleteVersion(entity);

20
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 PARA_IMAGE_SHIFT_X = -4;
private static final int FORM_AREA_PADDING_LEFT = 13; 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"); private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png");
public FormParaDesigner() { public FormParaDesigner() {
@ -342,6 +344,16 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return designerActions.toArray(new UpdateAction[designerActions.size()]); 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) { private boolean searchQueryCreators(XLayoutContainer rootContainer) {
boolean b = false; boolean b = false;
for (int i = 0; i < rootContainer.getXCreatorCount(); i++) { for (int i = 0; i < rootContainer.getXCreatorCount(); i++) {
@ -736,8 +748,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
* @return 按钮组 a * @return 按钮组 a
*/ */
public JComponent[] toolBarButton4Form() { public JComponent[] toolBarButton4Form() {
return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), UpdateAction[] actions = getMainActions();
new FormDeleteAction(this).createToolBarComponent()}; JComponent[] components = new JComponent[actions.length];
for (int i = 0; i < actions.length; i++) {
components[i] = actions[i].createToolBarComponent();
}
return components;
} }
@Override @Override

7
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -776,6 +776,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
for (UpdateAction action : getActions()) { for (UpdateAction action : getActions()) {
action.update(); action.update();
} }
for (UpdateAction action : getMainActions()) {
action.update();
}
} }
} }
@ -1479,6 +1482,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
return designerActions.toArray(new UpdateAction[designerActions.size()]); return designerActions.toArray(new UpdateAction[designerActions.size()]);
} }
public UpdateAction[] getMainActions() {
return new UpdateAction[]{};
}
private List<UpdateAction> getBasicActions(){ private List<UpdateAction> getBasicActions(){
if (basicActions == null) { if (basicActions == null) {
basicActions = new ArrayList<UpdateAction>(); basicActions = new ArrayList<UpdateAction>();

Loading…
Cancel
Save