From 7b6df7ae61d5da9c73b5ed4fb67d8458e3809088 Mon Sep 17 00:00:00 2001 From: zpc Date: Fri, 22 Jul 2016 13:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E4=BA=86=E6=8F=92=E4=BB=B6=E5=90=8E,?= =?UTF-8?q?=20=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=88=96=E8=80=85=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 装了插件后, 可以设置显示或者不显示 --- .../fr/design/fun/ShowParameterWindow.java | 20 +++++++++++++ .../AbstractShowParameterWindowProvider.java | 30 +++++++++++++++++++ .../designer/creator/XWParameterLayout.java | 26 ++++++++++++++-- 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 designer_base/src/com/fr/design/fun/ShowParameterWindow.java create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractShowParameterWindowProvider.java diff --git a/designer_base/src/com/fr/design/fun/ShowParameterWindow.java b/designer_base/src/com/fr/design/fun/ShowParameterWindow.java new file mode 100644 index 0000000000..6775deaa45 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/ShowParameterWindow.java @@ -0,0 +1,20 @@ +package com.fr.design.fun; + +import com.fr.stable.fun.mark.Immutable; + + +/** + * Created by zpc on 16/7/21. + */ +public interface ShowParameterWindow extends Immutable { + + String MARK_STRING = "ShowParameter"; + + int CURRENT_LEVEL = 1; + + /** + * 生成属性表 + */ + void add(); +} + diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractShowParameterWindowProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractShowParameterWindowProvider.java new file mode 100644 index 0000000000..98d7d92b42 --- /dev/null +++ b/designer_base/src/com/fr/design/fun/impl/AbstractShowParameterWindowProvider.java @@ -0,0 +1,30 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.ShowParameterWindow; +import com.fr.stable.fun.mark.API; + + +/** + * Created by zpc on 2016/7/21. + */ +@API(level = ShowParameterWindow.CURRENT_LEVEL) +public abstract class AbstractShowParameterWindowProvider implements ShowParameterWindow { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + + + + /** + * 生成属性表 + */ + @Override + public void add() { + + } +} \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java index 9f92b97861..1b57aa5654 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWParameterLayout.java @@ -3,6 +3,7 @@ */ package com.fr.design.designer.creator; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter; import com.fr.design.form.util.XCreatorConstants; @@ -16,6 +17,7 @@ import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WParameterLayout; import com.fr.general.Background; import com.fr.general.Inter; +import com.fr.design.fun.ShowParameterWindow; import java.awt.*; import java.beans.IntrospectionException; @@ -51,19 +53,39 @@ public class XWParameterLayout extends XWAbsoluteLayout { * @throws java.beans.IntrospectionException */ public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - return new CRPropertyDescriptor[]{ + ShowParameterWindow processor = ExtraDesignClassManager.getInstance().getSingle(ShowParameterWindow.MARK_STRING); + if (processor == null) { + return new CRPropertyDescriptor[]{ + new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter + .getLocText("FR-Designer_Form-Widget_Name")), + new CRPropertyDescriptor("background", this.data.getClass()).setEditorClass(BackgroundEditor.class) + .setRendererClass(BackgroundRenderer.class).setI18NName(Inter.getLocText("Background")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), + new CRPropertyDescriptor("delayDisplayContent", this.data.getClass()).setEditorClass(BooleanEditor.class) + .setI18NName(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), + new CRPropertyDescriptor("position", this.data.getClass()).setEditorClass(WidgetDisplayPosition.class) + .setRendererClass(WidgetDisplayPositionRender.class).setI18NName(Inter.getLocText("FR-Designer_WidgetDisplyPosition")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), + }; + } + return new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter .getLocText("FR-Designer_Form-Widget_Name")), new CRPropertyDescriptor("background", this.data.getClass()).setEditorClass(BackgroundEditor.class) .setRendererClass(BackgroundRenderer.class).setI18NName(Inter.getLocText("Background")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), + new CRPropertyDescriptor("display", this.data.getClass()).setEditorClass(BooleanEditor.class) + .setI18NName(Inter.getLocText("ParameterD-Show_Parameter_Window")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("delayDisplayContent", this.data.getClass()).setEditorClass(BooleanEditor.class) .setI18NName(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), new CRPropertyDescriptor("position", this.data.getClass()).setEditorClass(WidgetDisplayPosition.class) - .setRendererClass(WidgetDisplayPositionRender.class).setI18NName(Inter.getLocText("FR-Designer_WidgetDisplyPosition")) + .setRendererClass(WidgetDisplayPositionRender.class).setI18NName(Inter.getLocText("FR-Designer_WidgetDisplyPosition")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), }; + } @Override