Browse Source

REPORT-27647 模板组件的安装下载-模板组件复用插件

调整暴露的接口,返回合适的接口
persist/11.0
Harrison 5 years ago
parent
commit
713b72cded
  1. 6
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java
  2. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  3. 12
      designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java
  4. 7
      designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java

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

@ -22,15 +22,14 @@ import com.fr.design.icon.IconPathConstants;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.form.share.SharableEditorProvider; import com.fr.form.share.SharableEditorProvider;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.SharableWidgetBindInfo;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JWindow; import javax.swing.JWindow;
import java.util.Map;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Point; import java.awt.Point;
@ -40,6 +39,7 @@ import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetEvent;
import java.util.Map;
/** /**
* 添加模式下鼠标事件处理器 * 添加模式下鼠标事件处理器
@ -99,7 +99,7 @@ public class FormCreatorDropTarget extends DropTarget {
if (addingXCreator.isShared()) { if (addingXCreator.isShared()) {
String shareId = addingXCreator.getShareId(); String shareId = addingXCreator.getShareId();
SharableEditorProvider sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId); SharableEditorProvider sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId);
SharableWidgetBindInfo bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId); SharableWidgetProvider bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId);
if (sharableEditor != null && bindInfo != null) { if (sharableEditor != null && bindInfo != null) {
Map<String, String> tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource()); Map<String, String> tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource());
//合并数据集之后,可能会有数据集名称变化,做一下联动 //合并数据集之后,可能会有数据集名称变化,做一下联动

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

@ -8,8 +8,8 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.SharableWidgetBindInfo;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.share.ShareConstants; import com.fr.share.ShareConstants;
@ -51,7 +51,7 @@ public class FormWidgetDetailPane extends FormDockView{
private UIScrollPane downPane; private UIScrollPane downPane;
private JPanel reuWidgetPanel; private JPanel reuWidgetPanel;
private UIComboBox comboBox; private UIComboBox comboBox;
private SharableWidgetBindInfo[] elCaseBindInfoList; private SharableWidgetProvider[] elCaseBindInfoList;
private UIButton deleteButton; private UIButton deleteButton;
private JPanel editPanel; private JPanel editPanel;
private JPanel resetPanel; private JPanel resetPanel;

12
designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java

@ -1,14 +1,13 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.iofile.attr.SharableAttrMark; import com.fr.base.iofile.attr.SharableAttrMark;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.SharableWidgetBindInfo;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -52,8 +51,9 @@ import java.io.Serializable;
* Time: 16:14 * Time: 16:14
*/ */
public class ShareWidgetButton extends JPanel implements MouseListener, MouseMotionListener, Serializable { public class ShareWidgetButton extends JPanel implements MouseListener, MouseMotionListener, Serializable {
private static final Dimension TAB_DEFAULT_SIZE = new Dimension(500, 300); private static final Dimension TAB_DEFAULT_SIZE = new Dimension(500, 300);
private SharableWidgetBindInfo bindInfo; private SharableWidgetProvider bindInfo;
private MouseEvent lastPressEvent; private MouseEvent lastPressEvent;
private JPanel reportPane; private JPanel reportPane;
private boolean isEdit; private boolean isEdit;
@ -72,7 +72,7 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot
} }
}; };
public ShareWidgetButton(SharableWidgetBindInfo bindInfo) { public ShareWidgetButton(SharableWidgetProvider bindInfo) {
this.bindInfo = bindInfo; this.bindInfo = bindInfo;
this.setPreferredSize(new Dimension(108, 68)); this.setPreferredSize(new Dimension(108, 68));
initUI(); initUI();
@ -149,11 +149,11 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot
}; };
} }
public SharableWidgetBindInfo getBindInfo() { public SharableWidgetProvider getBindInfo() {
return bindInfo; return bindInfo;
} }
public void setBindInfo(SharableWidgetBindInfo bindInfo) { public void setBindInfo(SharableWidgetProvider bindInfo) {
this.bindInfo = bindInfo; this.bindInfo = bindInfo;
} }

7
designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java

@ -1,7 +1,8 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.form.ui.SharableWidgetBindInfo;
import com.fr.form.share.SharableWidgetProvider;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -12,12 +13,12 @@ import java.awt.*;
*/ */
public class ShareWidgetPane extends JPanel { public class ShareWidgetPane extends JPanel {
public ShareWidgetPane(SharableWidgetBindInfo[] elCaseBindInfoList, boolean isEdit) { public ShareWidgetPane(SharableWidgetProvider[] elCaseBindInfoList, boolean isEdit) {
this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离 this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离
if (elCaseBindInfoList != null) { if (elCaseBindInfoList != null) {
int rowCount = (elCaseBindInfoList.length + 1) / 2; int rowCount = (elCaseBindInfoList.length + 1) / 2;
this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10));
for (SharableWidgetBindInfo rbModuleInfo : elCaseBindInfoList) { for (SharableWidgetProvider rbModuleInfo : elCaseBindInfoList) {
ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo);
widgetButton.setElementCaseEdit(isEdit); widgetButton.setElementCaseEdit(isEdit);
this.add(widgetButton); this.add(widgetButton);

Loading…
Cancel
Save