Browse Source

Pull request #4491: KERNEL-7974 && REPORT-53328 && REPORT-53314 交互修改 看下新的控件式组件做成插件支持需要开放什么接口

Merge in DESIGN/design from ~KERRY/design_10.0:feature/10.0 to feature/10.0

* commit '0c0ba054b9ff2e983150c4800514deccda0e98f1':
  REPORT-53328 && REPORT-53314 交互修改
  KERNEL-7974 看下新的控件式组件做成插件支持需要开放什么接口
feature/10.0
kerry 3 years ago
parent
commit
68869c55c6
  1. 19
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  2. 8
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  3. 29
      designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java
  4. 19
      designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java
  5. 6
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

19
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -12,6 +12,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.EventCreator;
import com.fr.form.event.Listener;
import com.fr.form.ui.Widget;
import com.fr.general.FRFont;
import com.fr.general.NameObject;
import com.fr.report.web.util.ReportEngineEventMapping;
import com.fr.stable.ArrayUtils;
@ -26,10 +27,13 @@ import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.lang.reflect.Constructor;
@ -456,7 +460,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
getHelper().popupEditDialog(null, this.selectNameEdList, this);
}
protected String getWrapperLabelText(){
protected String getWrapperLabelText() {
return StringUtils.EMPTY;
}
@ -466,9 +470,18 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L
public ListWrapperPane(String labelText, UINameEdList nameEdList) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel label = new UILabel(labelText + getWrapperLabelText());
UILabel label = new UILabel(labelText + getWrapperLabelText()) {
@Override
public void paint(Graphics g) {
((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f));
super.paint(g);
}
};
label.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0));
label.setBackground(Color.decode("#FFFFFF"));
label.setOpaque(true);
label.setBackground(Color.WHITE);
label.setForeground(Color.decode("#333334"));
label.setFont(label.getFont().deriveFont(10F));
label.setPreferredSize(new Dimension(224, 26));
this.nameEdList = nameEdList;
this.add(label, BorderLayout.NORTH);

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;
}
}

6
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIHeadGroup;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane;
@ -89,7 +90,7 @@ public class FormWidgetDetailPane extends FormDockView{
cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle());
}
};
headGroup.setSelectedIndex(ONLINE_TAB);
headGroup.setSelectedIndex(ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib() ? 0 : ONLINE_TAB);
this.add(headGroup, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}
@ -105,12 +106,11 @@ public class FormWidgetDetailPane extends FormDockView{
}
public void enterWidgetLib() {
public void enterWidgetLib() {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
ComponentReuseNotifyUtil.enterWidgetLibExtraAction(false);
}
/**
* 定位
*

Loading…
Cancel
Save