Browse Source

REPORT-83259 & REPORT-83263 【最强控件】控件样式跟随主题&开放自定义

new-design
Bruce.Deng 2 years ago
parent
commit
44f40a77f0
  1. 18
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java

18
designer-form/src/main/java/com/fr/design/widget/ui/designer/ButtonDefinePane.java

@ -48,19 +48,19 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
labelNameTextField = new UITextField(); labelNameTextField = new UITextField();
UILabel backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")); UILabel backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background"));
backgroundLabel.setVerticalAlignment(SwingConstants.TOP); backgroundLabel.setVerticalAlignment(SwingConstants.TOP);
initExtraPane(); initAdvancedPane();
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
boundsPane.add(extraPane); boundsPane.add(extraPane);
UIExpandablePane advancedPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, boundsPane); UIExpandablePane advancedPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, boundsPane);
this.add(advancedPane); this.add(advancedPane);
} }
private void initExtraPane() { private void initAdvancedPane() {
initPluginListener(); initPluginListener();
refreshExtraAdvancedPane(); refreshAdvancedPane();
} }
private void refreshExtraAdvancedPane() { private void refreshAdvancedPane() {
extraPaneList.clear(); extraPaneList.clear();
boolean containsExtraPane = false; boolean containsExtraPane = false;
Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); Set<WidgetAdvancedPaneProvider<T>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG);
@ -71,12 +71,16 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane()); insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane());
containsExtraPane = true; containsExtraPane = true;
} }
refreshAdvancedPane(containsExtraPane);
}
private void refreshAdvancedPane(boolean containsExtraPane) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
Component[] backgroundCompPane = createBackgroundComp(); Component[] backgroundCompPane = createBackgroundComp();
Component[] frFont = createFontPane(); Component[] frFont = createFontPane();
double rowSize[]; double[] rowSize;
double columnSize[]; double[] columnSize;
int[][] rowCount; int[][] rowCount;
Component[][] n_components; Component[][] n_components;
if (containsExtraPane) { if (containsExtraPane) {
@ -116,7 +120,7 @@ public abstract class ButtonDefinePane<T extends Button> extends AbstractDataMod
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {
refreshExtraAdvancedPane(); refreshAdvancedPane();
} }
}, pluginContext -> pluginContext.getRuntime().contain(WidgetAdvancedPaneProvider.XML_TAG)); }, pluginContext -> pluginContext.getRuntime().contain(WidgetAdvancedPaneProvider.XML_TAG));
} }

Loading…
Cancel
Save