|
|
|
@ -18,6 +18,7 @@ import com.fr.design.designer.creator.XLayoutContainer;
|
|
|
|
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
|
|
|
|
import com.fr.design.designer.creator.XWFitLayout; |
|
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.icon.IconPathConstants; |
|
|
|
@ -31,12 +32,15 @@ import com.fr.form.share.SharableWidgetProvider;
|
|
|
|
|
import com.fr.form.share.ShareLoader; |
|
|
|
|
import com.fr.form.share.editor.SharableEditorProvider; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JWindow; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Point; |
|
|
|
@ -318,6 +322,24 @@ public class FormCreatorDropTarget extends DropTarget {
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public synchronized void drop(DropTargetDropEvent dtde) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
dropXCreator(dtde); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
if (addingModel.getXCreator().isShared()) { |
|
|
|
|
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Drag_Component_Error_Info"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), |
|
|
|
|
JOptionPane.ERROR_MESSAGE, |
|
|
|
|
UIManager.getIcon("OptionPane.errorIcon") |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
dtde.rejectDrop(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void dropXCreator(DropTargetDropEvent dtde) { |
|
|
|
|
Point loc = dtde.getLocation(); |
|
|
|
|
this.adding(designer.getRelativeX(loc.x), designer.getRelativeY(loc.y)); |
|
|
|
|
// 放到事件末尾执行
|
|
|
|
|