Browse Source

Merge pull request #570 in DESIGN/design from ~HADES/design:feature/10.0 to feature/10.0

* commit '005004fabaed3f86c3069ea78bd74663152c1a80':
  REPORT-11714 开放接口对应的设计器中的修改
  REPORT-11714 修改接口定义,修改后不用在插件中做判断
  参数名小写
  REPORT-11714 开放接口
research/10.0
Hades 6 years ago
parent
commit
b49b821b70
  1. 5
      designer-base/src/main/java/com/fr/design/designer/properties/PropertyTab.java
  2. 31
      designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java
  3. 19
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractParameterExpandablePaneUIProvider.java
  4. 18
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java
  5. 18
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

5
designer-base/src/main/java/com/fr/design/designer/properties/PropertyTab.java

@ -0,0 +1,5 @@
package com.fr.design.designer.properties;
public enum PropertyTab {
ATTR, MOBILE
}

31
designer-base/src/main/java/com/fr/design/fun/ParameterExpandablePaneUIProvider.java

@ -0,0 +1,31 @@
package com.fr.design.fun;
import com.fr.design.designer.properties.PropertyTab;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.stable.fun.mark.Mutable;
/**
* created by hades on 18/10/16
* 该接口支持在设计器cpt&frm参数界面的属性和移动端下添加一个UIExpandablePane可展开面板
*/
public interface ParameterExpandablePaneUIProvider extends Mutable {
String XML_TAG = "ParameterExpandablePaneUIProvider";
int CURRENT_LEVEL = 1;
/**
* 创建可展开面板并添加子容器
*
* @return UIExpandablePane
*/
UIExpandablePane createUIExpandablePane();
/**
* 指定添加UIExpandablePane到哪个PropertyTab下例如属性移动端
*
* @return PropertyTab
*/
PropertyTab addToWhichPropertyTab();
}

19
designer-base/src/main/java/com/fr/design/fun/impl/AbstractParameterExpandablePaneUIProvider.java

@ -0,0 +1,19 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.ParameterExpandablePaneUIProvider;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
@API(level = ParameterExpandablePaneUIProvider.CURRENT_LEVEL)
public abstract class AbstractParameterExpandablePaneUIProvider extends AbstractProvider implements ParameterExpandablePaneUIProvider{
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

18
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -1,14 +1,17 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.PropertyGroupPane; import com.fr.design.designer.creator.PropertyGroupPane;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.PropertyTab;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.ParameterExpandablePaneUIProvider;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -30,6 +33,7 @@ import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.util.Set;
/** /**
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
@ -63,9 +67,23 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
JPanel layoutPane = createBoundsPane(); JPanel layoutPane = createBoundsPane();
UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Size"), 280, 20, layoutPane); UIExpandablePane layoutExpandablePane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Size"), 280, 20, layoutPane);
this.add(layoutExpandablePane, BorderLayout.CENTER); this.add(layoutExpandablePane, BorderLayout.CENTER);
this.addExtraUIExpandablePaneFromPlugin();
} }
private void addExtraUIExpandablePaneFromPlugin() {
Set<ParameterExpandablePaneUIProvider> pluginCreators = ExtraDesignClassManager.getInstance().getArray(ParameterExpandablePaneUIProvider.XML_TAG);
JPanel panel = FRGUIPaneFactory.createYBoxEmptyBorderPane();
for (ParameterExpandablePaneUIProvider provider : pluginCreators) {
UIExpandablePane uiExpandablePane = provider.createUIExpandablePane();
PropertyTab propertyTab = provider.addToWhichPropertyTab();
if (uiExpandablePane != null && propertyTab == PropertyTab.ATTR) {
panel.add(uiExpandablePane);
}
}
this.add(panel, BorderLayout.SOUTH);
}
public JPanel createBoundsPane() { public JPanel createBoundsPane() {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;

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

@ -1,8 +1,11 @@
package com.fr.design.widget.ui.designer.mobile; package com.fr.design.widget.ui.designer.mobile;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.properties.PropertyTab;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.ParameterExpandablePaneUIProvider;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
@ -14,6 +17,7 @@ import com.fr.form.ui.container.WSortLayout;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.util.Set;
/** /**
* Created by plough on 2018/2/5. * Created by plough on 2018/2/5.
@ -33,9 +37,23 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner();
this.add(getMobileWidgetListPane(), BorderLayout.CENTER); this.add(getMobileWidgetListPane(), BorderLayout.CENTER);
this.addExtraUIExpandablePaneFromPlugin();
this.repaint(); this.repaint();
} }
private void addExtraUIExpandablePaneFromPlugin() {
Set<ParameterExpandablePaneUIProvider> pluginCreators = ExtraDesignClassManager.getInstance().getArray(ParameterExpandablePaneUIProvider.XML_TAG);
JPanel panel = FRGUIPaneFactory.createYBoxEmptyBorderPane();
for (ParameterExpandablePaneUIProvider provider : pluginCreators) {
UIExpandablePane uiExpandablePane = provider.createUIExpandablePane();
PropertyTab propertyTab = provider.addToWhichPropertyTab();
if (uiExpandablePane != null && propertyTab == PropertyTab.MOBILE) {
panel.add(uiExpandablePane);
}
}
this.add(panel, BorderLayout.SOUTH);
}
// 控件顺序 // 控件顺序
private UIExpandablePane getMobileWidgetListPane() { private UIExpandablePane getMobileWidgetListPane() {
mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData());

Loading…
Cancel
Save