Browse Source

KERNEL-7974 看下新的控件式组件做成插件支持需要开放什么接口

feature/10.0
kerry 4 years ago
parent
commit
b5a2274d48
  1. 8
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  2. 29
      designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java
  3. 19
      designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java

8
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -5,11 +5,13 @@ package com.fr.design.designer.creator;
import com.fr.base.GraphHelper;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.events.DesignerEditor;
import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.fun.ShareWidgetUIProcessor;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.layout.FRGUIPaneFactory;
@ -298,6 +300,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
@Override
public JComponent createToolPane(BaseJForm jform, FormDesigner formEditor) {
if (!DesignerMode.isAuthorityEditing()) {
ShareWidgetUIProcessor exportProcessor = ExtraDesignClassManager.getInstance().getSingle(ShareWidgetUIProcessor.MARK_STRING);
if (exportProcessor != null) {
return exportProcessor.createToolPane(this, jform, formEditor);
}
if (isDedicateContainer() && this.getComponentCount() > 0) {
// 图表块和报表块由于控件树处不显示,但对应的属性表要显示,此处处理下
XCreator child = ((XLayoutContainer) this).getXCreator(0);
@ -789,7 +795,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public boolean isTopable() {
return true;
}
}

29
designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java

@ -0,0 +1,29 @@
package com.fr.design.fun;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.FormDesigner;
import com.fr.stable.fun.mark.Immutable;
import javax.swing.JComponent;
/**
* Created by kerry on 5/28/21
*/
public interface ShareWidgetUIProcessor extends Immutable {
String MARK_STRING = "ShareWidgetUIProcessor";
int CURRENT_LEVEL = 1;
/**
* 生成属性配置界面
*
* @param xCreator 选中的Xcreator
* @param formDesigner 表单设计器
* @return 属性配置界面
*/
JComponent createToolPane(XCreator xCreator, BaseJForm jform, FormDesigner formDesigner);
}

19
designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java

@ -0,0 +1,19 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.ShareWidgetUIProcessor;
import com.fr.stable.fun.mark.API;
/**
* Created by kerry on 5/28/21
*/
@API(level = ShareWidgetUIProcessor.CURRENT_LEVEL)
public abstract class AbstractShareWidgetUIProcessor implements ShareWidgetUIProcessor {
public int currentAPILevel() {
return CURRENT_LEVEL;
}
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}
Loading…
Cancel
Save