|
|
|
@ -34,6 +34,9 @@ import com.fr.design.widget.ui.designer.AbstractDataModify;
|
|
|
|
|
import com.fr.design.widget.ui.designer.component.UIBoundSpinner; |
|
|
|
|
import com.fr.form.ui.container.WParameterLayout; |
|
|
|
|
import com.fr.general.Background; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
import com.fr.plugin.observer.PluginEvent; |
|
|
|
|
import com.fr.plugin.observer.PluginEventListener; |
|
|
|
|
import com.fr.report.stable.FormConstants; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
@ -64,6 +67,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
private boolean newForm; |
|
|
|
|
private PropertyGroupPane extraPropertyGroupPane; |
|
|
|
|
protected final List<BasicBeanPane<WParameterLayout>> extraPaneList = new ArrayList<>(); |
|
|
|
|
private JPanel backgroundPane; |
|
|
|
|
|
|
|
|
|
public RootDesignDefinePane(XCreator xCreator) { |
|
|
|
|
super(xCreator); |
|
|
|
@ -156,6 +160,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment); |
|
|
|
|
hAlignmentPane.setAllToolTips(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Left") |
|
|
|
|
, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Center"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_StyleAlignment_Right")}); |
|
|
|
|
backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
this.initExtraPane(); |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p, p, p, p}; |
|
|
|
@ -163,7 +169,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), getBackgroundPane()}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane}, |
|
|
|
|
new Component[]{displayReport, null}, |
|
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
|
@ -180,6 +186,54 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
return jPanel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initExtraPane() { |
|
|
|
|
initPluginListener(); |
|
|
|
|
refreshExtraAdvancedPane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initPluginListener() { |
|
|
|
|
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { |
|
|
|
|
@Override |
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
refreshExtraAdvancedPane(); |
|
|
|
|
} |
|
|
|
|
}, pluginContext -> pluginContext.getRuntime().contain(WidgetAdvancedPaneProvider.XML_TAG)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void refreshExtraAdvancedPane() { |
|
|
|
|
extraPaneList.clear(); |
|
|
|
|
backgroundPane.removeAll(); |
|
|
|
|
Set<WidgetAdvancedPaneProvider<WParameterLayout>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); |
|
|
|
|
for (WidgetAdvancedPaneProvider<WParameterLayout> provider : providers) { |
|
|
|
|
if (!provider.accept(creator)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane()); |
|
|
|
|
} |
|
|
|
|
if (extraPaneList.isEmpty()) { |
|
|
|
|
if (background == null) { |
|
|
|
|
background = new AccessibleBackgroundEditor(); |
|
|
|
|
} |
|
|
|
|
backgroundPane.add(background); |
|
|
|
|
} else { |
|
|
|
|
for (BasicBeanPane<WParameterLayout> pane : extraPaneList) { |
|
|
|
|
backgroundPane.add(pane); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 插入配置项面板 |
|
|
|
|
* |
|
|
|
|
* @param index 插入的位置 |
|
|
|
|
* @param pane 配置项面板 |
|
|
|
|
*/ |
|
|
|
|
public void insertShortCut(int index, BasicBeanPane<WParameterLayout> pane) { |
|
|
|
|
int size = extraPaneList.size(); |
|
|
|
|
index = Math.min(index, size); |
|
|
|
|
extraPaneList.add(index, pane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param |
|
|
|
|
* @Description: 获取新决策报表的AdvancePane |
|
|
|
@ -203,7 +257,8 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
fireAfterEditor.setSelected(false); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
backgroundPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
this.initExtraPane(); |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p, p, p}; |
|
|
|
@ -211,7 +266,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), getBackgroundPane()}, |
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background")), backgroundPane}, |
|
|
|
|
new Component[]{displayReport, null}, |
|
|
|
|
new Component[]{useParamsTemplate, null}, |
|
|
|
|
new Component[]{fireAfterEditor, null}, |
|
|
|
@ -353,19 +408,4 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
|
|
|
|
|
public DataCreatorUI dataUI() { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Component getBackgroundPane() { |
|
|
|
|
Set<WidgetAdvancedPaneProvider<WParameterLayout>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); |
|
|
|
|
if (providers != null) { |
|
|
|
|
for (WidgetAdvancedPaneProvider<WParameterLayout> provider : providers) { |
|
|
|
|
if (provider.accept(creator)) { |
|
|
|
|
BasicBeanPane<WParameterLayout> extraAdvancedPane = provider.createExtraAdvancedPane(); |
|
|
|
|
extraPaneList.add(extraAdvancedPane); |
|
|
|
|
return extraAdvancedPane; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
background = new AccessibleBackgroundEditor(); |
|
|
|
|
return background; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|