Browse Source

Merge branch 'final/11.0' of ssh://cloud.finedevelop.com:7999/~lanlan/design into final/11.0

final/11.0
Lanlan 3 years ago
parent
commit
8d0737a91c
  1. 3
      designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java
  2. 17
      designer-form/src/main/java/com/fr/design/mainframe/TabDragInner.java

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

@ -96,11 +96,13 @@ public class FormCreatorDropTarget extends DropTarget {
boolean formSubmit2Adapt = !addingModel.getXCreator().canEnterIntoAdaptPane() && container.acceptType(XWFitLayout.class);
if (model != null && !chartEnter2Para && !formSubmit2Adapt) {
tabDragInner.tryDragIn();
success = model.add2Container(designer, container, x, y);
}
cancelPromptWidgetForbidEnter();
}
if (success) {
tabDragInner.reset();
// 如果添加成功,则触发相应事件
XCreator xCreator = container.acceptType(XWParameterLayout.class) ? designer.getParaComponent() : designer.getRootComponent();
//SetSelection时要确保选中的是最顶层的布局
@ -143,7 +145,6 @@ public class FormCreatorDropTarget extends DropTarget {
designer.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget}));
designer.getEditListenerTable().fireCreatorModified(addingModel.getXCreator(), DesignerEvent.CREATOR_ADDED);
tabDragInner.tryDragIn();
} else {
Toolkit.getDefaultToolkit().beep();
// 拖入失败 取消选中

17
designer-form/src/main/java/com/fr/design/mainframe/TabDragInner.java

@ -1,7 +1,5 @@
package com.fr.design.mainframe;
import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
@ -64,16 +62,13 @@ public class TabDragInner {
*/
public void tryDragIn() {
if (belowXLayoutContainer != null && belowXLayoutContainer.isDragInAble()) {
EditingMouseListener editingMouseListener = new EditingMouseListener(designer);
editingMouseListener.refreshTopXCreator();
belowXLayoutContainer.setEditable(true);
if (editingMouseListener.stopEditing() && belowXLayoutContainer != designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, belowXLayoutContainer);
if (adapter != null) {
editingMouseListener.startEditing(belowXLayoutContainer, adapter.getDesignerEditor(), adapter);
belowXLayoutContainer.setDragInAble(false);
}
}
}
}
public void reset() {
if (belowXLayoutContainer != null) {
belowXLayoutContainer.setDragInAble(false);
}
}

Loading…
Cancel
Save