Browse Source

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

调整暴露的接口,返回合适的接口
feature/big-screen
Harrison 5 years ago
parent
commit
d301796c95
  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. 7
      designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java

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

@ -23,8 +23,9 @@ 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.SharableWidgetBindInfo; import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -42,6 +43,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;
/** /**
* 添加模式下鼠标事件处理器 * 添加模式下鼠标事件处理器
@ -101,7 +103,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;

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