Browse Source

漏提交

master
zack 8 years ago
parent
commit
7636360011
  1. 11
      designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java

11
designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java

@ -6,7 +6,9 @@ import com.fr.design.designer.creator.XCreatorUtils;
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.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.AbstractFormSharableEditor;
import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.ElCaseBindInfo;
import com.fr.form.ui.FormSharableEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -118,6 +120,7 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot
Object source = e.getSource(); Object source = e.getSource();
Widget creatorSource = null; Widget creatorSource = null;
String shareId = StringUtils.EMPTY; String shareId = StringUtils.EMPTY;
String helpMsg = StringUtils.EMPTY;
if (source instanceof ShareWidgetButton) { if (source instanceof ShareWidgetButton) {
ShareWidgetButton no = (ShareWidgetButton) e.getSource(); ShareWidgetButton no = (ShareWidgetButton) e.getSource();
if (no == null) { if (no == null) {
@ -125,10 +128,15 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot
} }
shareId = no.getBindInfo().getId(); shareId = no.getBindInfo().getId();
creatorSource = ShareLoader.getLoader().getElCaseEditorById(shareId); creatorSource = ShareLoader.getLoader().getElCaseEditorById(shareId);
ElCaseBindInfo info = ShareLoader.getLoader().getElCaseBindInfoById(shareId);
if (info != null) {
helpMsg = info.getGuideInfo();
}
} }
if (creatorSource != null) { if (creatorSource != null) {
XCreator xCreator = XCreatorUtils.createXCreator(creatorSource); XCreator xCreator = XCreatorUtils.createXCreator(creatorSource);
xCreator.setShareId(shareId); xCreator.setShareId(shareId);
xCreator.setSharedMsg(helpMsg);
WidgetToolBarPane.getTarget().startDraggingBean(xCreator); WidgetToolBarPane.getTarget().startDraggingBean(xCreator);
lastPressEvent = null; lastPressEvent = null;
this.setBorder(null); this.setBorder(null);
@ -152,6 +160,9 @@ public class ShareWidgetButton extends JPanel implements MouseListener, MouseMot
ShareWidgetButton shareWidgetButton = (ShareWidgetButton) dge.getComponent(); ShareWidgetButton shareWidgetButton = (ShareWidgetButton) dge.getComponent();
if (shareWidgetButton != null) { if (shareWidgetButton != null) {
Widget widget = ShareLoader.getLoader().getElCaseEditorById(shareWidgetButton.getBindInfo().getId()); Widget widget = ShareLoader.getLoader().getElCaseEditorById(shareWidgetButton.getBindInfo().getId());
if (widget instanceof FormSharableEditor) {
((AbstractFormSharableEditor) widget).setShareId(shareWidgetButton.getBindInfo().getId());
}
DragAndDropTransferable dragAndDropTransferable = new DragAndDropTransferable(widget); DragAndDropTransferable dragAndDropTransferable = new DragAndDropTransferable(widget);
dge.startDrag(DragSource.DefaultCopyDrop, dragAndDropTransferable, this); dge.startDrag(DragSource.DefaultCopyDrop, dragAndDropTransferable, this);
} }

Loading…
Cancel
Save