Browse Source

Merge pull request #8010 in DESIGN/design from release/11.0 to feature/x

* commit '579c860fa453ca02a164c334760855d14fe1d670':
  REPORT-66939
  REPORT-66947
  REPORT-66947 拖拽拖出可拖拽区域的时候,没有及时清理内存里残留的上次dropTarget对象,需要清理一下
  REPORT-58833 js编辑器埋点
feature/x
superman 3 years ago
parent
commit
a2908f997a
  1. 16
      designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java
  2. 13
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

16
designer-base/src/main/java/com/fr/design/javascript/JSContentWithDescriptionPane.java

@ -441,19 +441,21 @@ public class JSContentWithDescriptionPane extends JSContentPane implements KeyLi
Object value = helpDOCList.getSelectedValue(); Object value = helpDOCList.getSelectedValue();
if (value instanceof HelpDocument) { if (value instanceof HelpDocument) {
String url = ((HelpDocument) value).getDocumentUrl(); String url = ((HelpDocument) value).getDocumentUrl();
try { browse(url);
Desktop.getDesktop().browse(new URI(url));
} catch (IOException ex) {
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
} catch (URISyntaxException ex) {
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
}
} }
} }
} }
}); });
} }
private void browse(String url){
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException | URISyntaxException ex) {
FineLoggerFactory.getLogger().error(ex.getMessage(), ex);
}
}
private void initHelpDOCListRender() { private void initHelpDOCListRender() {
helpDOCList.setCellRenderer(new DefaultListCellRenderer() { helpDOCList.setCellRenderer(new DefaultListCellRenderer() {
@Override @Override

13
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -1248,7 +1248,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param currentDragEvent * @param currentDragEvent
*/ */
public void startDraggingNewWidget(XCreator xCreator, MouseEvent startDragEvent, MouseEvent currentDragEvent) { public void startDraggingNewWidget(XCreator xCreator, MouseEvent startDragEvent, MouseEvent currentDragEvent) {
if (currentDragEvent == null || this.getDropTarget() != null) { if (currentDragEvent == null) {
return; return;
} }
@ -1270,7 +1270,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param currentDragEvent * @param currentDragEvent
*/ */
public void startDraggingFormWidget(XCreator xCreator, MouseEvent startDragEvent, MouseEvent currentDragEvent) { public void startDraggingFormWidget(XCreator xCreator, MouseEvent startDragEvent, MouseEvent currentDragEvent) {
if (currentDragEvent == null || this.getDropTarget() != null) { if (currentDragEvent == null) {
return; return;
} }
backUpCreator(xCreator); backUpCreator(xCreator);
@ -1318,7 +1318,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
DraggingModel model = this.draggingModel; DraggingModel model = this.draggingModel;
MouseEvent dragEvent = model.getCurrentDragEvent(); MouseEvent dragEvent = model.getCurrentDragEvent();
XCreator hotspot = this.getComponentAt(dragEvent.getX(), dragEvent.getY()); XCreator hotspot = this.getComponentAt(dragEvent.getX(), dragEvent.getY());
return XCreatorUtils.getHotspotContainer(hotspot); XLayoutContainer container = XCreatorUtils.getHotspotContainer(hotspot);
XLayoutContainer topLayout = container.getTopLayout();
// REPORT-66939 Tab比较特殊,它是又多个LayoutContainer组成,直接返回container会导致误判,需要先找到最上层topLayout,取其父layout才是正确结果
if (topLayout != null && container != topLayout) {
return (XLayoutContainer) topLayout.getParent();
} else {
return container;
}
} }
/** /**

Loading…
Cancel
Save