Browse Source

Pull request #6320: REPORT-61302 【FR11】【组件背景分离】&【固定布局-原布局推荐4.1】决策报表-组件背景分离做过一个组件移入tab块,组件悬停在tab上超过1s就判断为移入tab内部,现在和10.0的效果不一样了

Merge in DESIGN/design from ~HADES/design:final/11.0 to final/11.0

* commit '0a72458f03d62304f3d13c9ecf191ffcd98383b2':
  REPORT-61302 【FR11】【组件背景分离】&【固定布局-原布局推荐4.1】决策报表-组件背景分离做过一个组件移入tab块,组件悬停在tab上超过1s就判断为移入tab内部,现在和10.0的效果不一样了
final/11.0
Hades 3 years ago
parent
commit
7f5e88bafe
  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