Browse Source

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

fix-lag
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.file.HistoryTemplateListCache;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import java.awt.Component; import java.awt.Component;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JToolBar; import javax.swing.JToolBar;
public class UIToolbar extends JToolBar { public class UIToolbar extends JToolBar {
Map<Component, Boolean> componentState = new HashMap<>();
public UIToolbar() { public UIToolbar() {
this(FlowLayout.LEFT); this(FlowLayout.LEFT);
} }
@ -36,11 +41,26 @@ public class UIToolbar extends JToolBar {
} }
public void refreshUIToolBar() { public void refreshUIToolBar() {
refreshUIToolBar(false);
}
public void refreshUIToolBar(boolean forbid) {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null) { if (template != null) {
for (int i = 0; i < getComponentCount(); i++) { for (int i = 0; i < getComponentCount(); i++) {
Component component = getComponents()[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() { protected void refreshUIToolBar() {
refreshUIToolBar(false);
}
protected void refreshUIToolBar(boolean forbid) {
if (toolbarComponent instanceof UIToolbar) { if (toolbarComponent instanceof UIToolbar) {
((UIToolbar ) toolbarComponent).refreshUIToolBar(); ((UIToolbar) toolbarComponent).refreshUIToolBar();
} }
combineUp.refreshUIToolBar(); combineUp.refreshUIToolBar(forbid);
getToolBarMenuDock().updateEnable(); 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() { 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() { public void showCover() {
transparentPane.start(); transparentPane.start();
layeredPane.moveToFront(transparentPane); layeredPane.moveToFront(transparentPane);
DesignerContext.getDesignerFrame().refreshUIToolBar(); DesignerContext.getDesignerFrame().refreshUIToolBar(true);
EastRegionContainerPane.getInstance().updateAllPropertyPane(); EastRegionContainerPane.getInstance().updateAllPropertyPane();
JComponent downPane = WestRegionContainerPane.getInstance().getDownPane(); JComponent downPane = WestRegionContainerPane.getInstance().getDownPane();
if (downPane instanceof BasicTableDataTreePane) { if (downPane instanceof BasicTableDataTreePane) {

Loading…
Cancel
Save