Browse Source

REPORT-58513 设计器-表单保存-工具栏新引擎转化按钮变为可用

persist/11.0
Henry.Wang 3 years ago
parent
commit
97f1902490
  1. 22
      designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java
  2. 8
      designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java
  3. 6
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java

22
designer-base/src/main/java/com/fr/design/gui/itoolbar/UIToolbar.java

@ -2,13 +2,18 @@ package com.fr.design.gui.itoolbar;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate;
import java.awt.Component;
import java.awt.FlowLayout;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JToolBar;
public class UIToolbar extends JToolBar {
Map<Component, Boolean> componentState = new HashMap<>();
public UIToolbar() {
this(FlowLayout.LEFT);
}
@ -36,11 +41,26 @@ public class UIToolbar extends JToolBar {
}
public void refreshUIToolBar() {
refreshUIToolBar(false);
}
public void refreshUIToolBar(boolean forbid) {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) {
for (int i = 0; i < getComponentCount(); i++) {
Component component = getComponents()[i];
component.setEnabled(template.checkEnable());
if (forbid) {
componentState.put(component, component.isEnabled());
component.setEnabled(false);
} else {
Boolean enable = componentState.get(component);
if (enable != null) {
component.setEnabled(enable);
componentState.remove(component);
} else {
component.setEnabled(template.checkEnable());
}
}
}
}
}

8
designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java

@ -268,10 +268,14 @@ public class CenterRegionContainerPane extends JPanel {
}
protected void refreshUIToolBar() {
refreshUIToolBar(false);
}
protected void refreshUIToolBar(boolean forbid) {
if (toolbarComponent instanceof UIToolbar) {
((UIToolbar ) toolbarComponent).refreshUIToolBar();
((UIToolbar) toolbarComponent).refreshUIToolBar();
}
combineUp.refreshUIToolBar();
combineUp.refreshUIToolBar(forbid);
getToolBarMenuDock().updateEnable();
}

6
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -366,7 +366,11 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
}
public void refreshUIToolBar() {
CenterRegionContainerPane.getInstance().refreshUIToolBar();
refreshUIToolBar(false);
}
public void refreshUIToolBar(boolean forbid) {
CenterRegionContainerPane.getInstance().refreshUIToolBar(forbid);
}
/**

2
designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java

@ -122,7 +122,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener
public void showCover() {
transparentPane.start();
layeredPane.moveToFront(transparentPane);
DesignerContext.getDesignerFrame().refreshUIToolBar();
DesignerContext.getDesignerFrame().refreshUIToolBar(true);
EastRegionContainerPane.getInstance().updateAllPropertyPane();
JComponent downPane = WestRegionContainerPane.getInstance().getDownPane();
if (downPane instanceof BasicTableDataTreePane) {

Loading…
Cancel
Save