From 76856c4e5fe1a2681d7bd912b5c3ab2a0dd7843a Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 20 Oct 2016 15:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B8=AE=E5=8A=A9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=94=B9=E4=B8=80=E4=B8=8B=E6=96=B9=E6=A1=88=EF=BC=8C?= =?UTF-8?q?=E9=80=9A=E8=BF=87widget=E5=A2=9E=E5=8A=A0description=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/creator/XCreator.java | 22 +++++-------------- .../designer/creator/XCreatorUtils.java | 2 +- .../design/designer/creator/XElementCase.java | 2 +- .../src/com/fr/design/mainframe/JForm.java | 11 +++++++++- .../design/mainframe/ShareWidgetButton.java | 11 ---------- 5 files changed, 18 insertions(+), 30 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XCreator.java b/designer_form/src/com/fr/design/designer/creator/XCreator.java index d030104a23..d47009ff95 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreator.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java @@ -12,10 +12,6 @@ import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.*; import com.fr.design.utils.gui.LayoutUtils; -import com.fr.form.share.ShareLoader; -import com.fr.form.ui.AbstractFormSharableEditor; -import com.fr.form.ui.ElCaseBindInfo; -import com.fr.form.ui.FormSharableEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.stable.StableUtils; @@ -590,24 +586,18 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } /** - * 设置共享帮助信息 + * 设置描述信息 * @param msg 帮助信息 */ - public void setSharedMsg(String msg){} + public void setXDescrption(String msg){} /** - * 根据widget设置Xcreator共享信息 + * 根据widget设置Xcreator描述信息 * @param widget */ - public void setShareMsgByWidget(Widget widget){ - if (widget != null && (widget instanceof FormSharableEditor)) { - String shareId = ((AbstractFormSharableEditor) widget).getShareId(); - ElCaseBindInfo info = ShareLoader.getLoader().getElCaseBindInfoById(shareId); - if (info != null) { - - setSharedMsg(info.getGuideInfo()); - - } + public void setXDescrption(Widget widget){ + if (widget != null) { + setXDescrption(widget.getDescription()); } } diff --git a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java index 36158f821b..3c58e2f192 100644 --- a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java @@ -157,7 +157,7 @@ public class XCreatorUtils { FRContext.getLogger().error("Error to create xcreator!"); creator = new NullCreator(widget, d); } - creator.setShareMsgByWidget(widget);//设置共享信息 + creator.setXDescrption(widget);//设置描述信息 return creator; } diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 0e0d35637b..a056779a16 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -285,7 +285,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme } @Override - public void setSharedMsg(String msg) { + public void setXDescrption(String msg) { coverPanel.setHelpMsg(msg); } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index ef18f07135..679fcf9820 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -36,6 +36,8 @@ import com.fr.file.FILE; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; +import com.fr.form.share.ShareLoader; +import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WLayout; @@ -51,6 +53,7 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; +import java.util.ArrayList; import java.util.HashMap; public class JForm extends JTemplate implements BaseJForm { @@ -622,7 +625,13 @@ public class JForm extends JTemplate implements BaseJForm { } else { JPanel pane = new JPanel(); pane.setLayout(new BorderLayout()); - pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER); + //pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER); + ArrayList elCaseBindInfos = new ArrayList<>(); + for (ElCaseBindInfo info : + ShareLoader.getLoader().getAllBindInfos().values()) { + elCaseBindInfos.add(info); + } + pane.add(new ShareWidgetPane(elCaseBindInfos.toArray(new ElCaseBindInfo[elCaseBindInfos.size()])), BorderLayout.CENTER); EastRegionContainerPane.getInstance().replaceDownPane(pane); } } diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java index 531c52fee6..955e54822a 100644 --- a/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java +++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java @@ -6,9 +6,7 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.share.ShareLoader; -import com.fr.form.ui.AbstractFormSharableEditor; import com.fr.form.ui.ElCaseBindInfo; -import com.fr.form.ui.FormSharableEditor; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -120,7 +118,6 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot Object source = e.getSource(); Widget creatorSource = null; String shareId = StringUtils.EMPTY; - String helpMsg = StringUtils.EMPTY; if (source instanceof ShareWidgetButton) { ShareWidgetButton no = (ShareWidgetButton) e.getSource(); if (no == null) { @@ -128,15 +125,10 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot } shareId = no.getBindInfo().getId(); creatorSource = ShareLoader.getLoader().getElCaseEditorById(shareId); - ElCaseBindInfo info = ShareLoader.getLoader().getElCaseBindInfoById(shareId); - if (info != null) { - helpMsg = info.getGuideInfo(); - } } if (creatorSource != null) { XCreator xCreator = XCreatorUtils.createXCreator(creatorSource); xCreator.setShareId(shareId); - xCreator.setSharedMsg(helpMsg); WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); @@ -160,9 +152,6 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot ShareWidgetButton shareWidgetButton = (ShareWidgetButton) dge.getComponent(); if (shareWidgetButton != null) { Widget widget = ShareLoader.getLoader().getElCaseEditorById(shareWidgetButton.getBindInfo().getId()); - if (widget instanceof FormSharableEditor) { - ((AbstractFormSharableEditor) widget).setShareId(shareWidgetButton.getBindInfo().getId()); - } DragAndDropTransferable dragAndDropTransferable = new DragAndDropTransferable(widget); dge.startDrag(DragSource.DefaultCopyDrop, dragAndDropTransferable, this); }