Browse Source

Merge remote-tracking branch 'origin/release/11.0' into release/11.0

fix-lag
Hoky 3 years ago
parent
commit
0665863a67
  1. 8
      designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java
  2. 5
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  3. 6
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  4. 14
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  5. 10
      designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java

8
designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java

@ -34,6 +34,7 @@ import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -645,16 +646,15 @@ public class EditingMouseListener extends MouseInputAdapter {
selectionModel.selectACreatorAtMouseEvent(e); selectionModel.selectACreatorAtMouseEvent(e);
refreshTopXCreator(); refreshTopXCreator();
XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators(); XCreator[] xCreators = selectionModel.getSelection().getSelectedCreators();
if (ArrayUtils.getLength(xCreators) == 1) {
// 放到事件队尾执行 // 放到事件队尾执行
SwingUtilities.invokeLater(new Runnable() { SwingUtilities.invokeLater(new Runnable() {
@Override @Override
public void run() { public void run() {
for (XCreator xCreator : xCreators) { xCreators[0].setSelected(!e.isShiftDown() && !e.isControlDown());
xCreator.setSelected(!e.isShiftDown() && !e.isControlDown());
}
} }
}); });
}
} else if (clickedNonCardButton && uneditedTab && responseTabLayout(oldCreator, e)) { } else if (clickedNonCardButton && uneditedTab && responseTabLayout(oldCreator, e)) {
// do nothing // do nothing
} else { } else {

5
designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java

@ -189,7 +189,10 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
@Override @Override
public Listener updateBean() { public Listener updateBean() {
String actionLocaleName = ReportEngineEventMapping.getLocaleName(listener.getEventName()); String actionLocaleName = ReportEngineEventMapping.getLocaleName(listener.getEventName());
javaScriptActionPane.setResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.WEB_CONFIG, Toolkit.i18nText(actionLocaleName)));
JavaScriptResourceInfo.PathNode pathNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.WEB_CONFIG, Toolkit.i18nText(actionLocaleName));
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo().addFirstPathNode(pathNode);
javaScriptActionPane.setResourceInfo(javaScriptResourceInfo);
this.listener.setEventName(this.nameText.getText()); this.listener.setEventName(this.nameText.getText());
FurtherBasicBeanPane<? extends JavaScript> pane = this.cards.get(this.styleBox.getSelectedIndex()); FurtherBasicBeanPane<? extends JavaScript> pane = this.cards.get(this.styleBox.getSelectedIndex());
this.listener.setAction(pane.updateBean()); this.listener.setAction(pane.updateBean());

6
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -156,11 +156,15 @@ public class DesignerSocketIO {
private static String[] getSocketUri() throws IOException { private static String[] getSocketUri() throws IOException {
Workspace current = WorkContext.getCurrent(); Workspace current = WorkContext.getCurrent();
URL url = new URL(current.getPath()); URL url = new URL(current.getPath());
Integer[] ports = current.get(SocketInfoOperator.class).getPort(); Integer[] ports = WebSocketConfig.getInstance().getAvailablePorts();
WorkspaceConnection connection = current.getConnection(); WorkspaceConnection connection = current.getConnection();
// 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置 // 服务器配置https webSocket可能是wss也可能是ws webSocket的协议可以单独配置
WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol(); WebSocketProtocol webSocketProtocol = WebSocketConfig.getInstance().getProtocol();
currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS; currentProtocol = webSocketProtocol == WebSocketProtocol.PLAIN ? HTTP : HTTPS;
if (WebSocketConfig.getInstance().isUsingProxy()) {
// 如果配置了代理服务器跟随服务器协议
currentProtocol = url.getProtocol();
}
String[] result = new String[ports.length]; String[] result = new String[ports.length];
for (int i = 0; i < ports.length; i++) { for (int i = 0; i < ports.length; i++) {
result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s",

14
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -519,7 +519,10 @@ public class EditToolBar extends BasicPane {
if (javaScriptPane == null || ((CustomToolBarButton) widget).getJSImpl() == null) { if (javaScriptPane == null || ((CustomToolBarButton) widget).getJSImpl() == null) {
javaScriptPane = JavaScriptActionPane.createDefault(); javaScriptPane = JavaScriptActionPane.createDefault();
} }
javaScriptPane.setResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.WIDGET, ((Button) widget).getText()));
JavaScriptResourceInfo.PathNode pathNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.WIDGET, ((Button) widget).getText());
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo().addFirstPathNode(pathNode);
javaScriptPane.setResourceInfo(javaScriptResourceInfo);
javaScriptPane.setPreferredSize(new Dimension(750, 500)); javaScriptPane.setPreferredSize(new Dimension(750, 500));
BasicDialog dialog = javaScriptPane.showWindow(SwingUtilities.getWindowAncestor(ButtonPane.this)); BasicDialog dialog = javaScriptPane.showWindow(SwingUtilities.getWindowAncestor(ButtonPane.this));
@ -541,6 +544,7 @@ public class EditToolBar extends BasicPane {
/** /**
* 更新 * 更新
*
* @param widget 对应组件 * @param widget 对应组件
*/ */
public void populate(Widget widget) { public void populate(Widget widget) {
@ -583,7 +587,8 @@ public class EditToolBar extends BasicPane {
this.image.setSelected(export.isImageAvailable()); this.image.setSelected(export.isImageAvailable());
if (exportToolBarProviders != null) { if (exportToolBarProviders != null) {
for (int i = 0; i < exportToolBarProviders.length; i++) { for (int i = 0; i < exportToolBarProviders.length; i++) {
exportToolBarProviders[i].populate();; exportToolBarProviders[i].populate();
;
} }
} }
} }
@ -694,7 +699,10 @@ public class EditToolBar extends BasicPane {
if (customToolBarButton.getJSImpl() == null) { if (customToolBarButton.getJSImpl() == null) {
this.javaScriptPane = JavaScriptActionPane.createDefault(); this.javaScriptPane = JavaScriptActionPane.createDefault();
} }
javaScriptPane.setResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.CUSTOM_BUTTON, ((Button) widget).getText()));
JavaScriptResourceInfo.PathNode pathNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.CUSTOM_BUTTON, ((Button) widget).getText());
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo().addFirstPathNode(pathNode);
javaScriptPane.setResourceInfo(javaScriptResourceInfo);
customToolBarButton.setJSImpl(this.javaScriptPane.updateBean()); customToolBarButton.setJSImpl(this.javaScriptPane.updateBean());
} }

10
designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java

@ -70,10 +70,12 @@ public class WidgetEventPane extends UIListGroupControlPane {
public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane {
private ElementCasePane epane; private ElementCasePane epane;
// 反射会用到 // 反射会用到
public WidgetEventListenerUpdatePane() { public WidgetEventListenerUpdatePane() {
this(null); this(null);
} }
public WidgetEventListenerUpdatePane(ElementCasePane epane) { public WidgetEventListenerUpdatePane(ElementCasePane epane) {
this.epane = epane; this.epane = epane;
super.initComponents(); super.initComponents();
@ -191,7 +193,13 @@ public class WidgetEventPane extends UIListGroupControlPane {
public void wrapperListener(Listener listener) { public void wrapperListener(Listener listener) {
if (listener.getAction() instanceof Commit2DBJavaScript) { if (listener.getAction() instanceof Commit2DBJavaScript) {
Commit2DBJavaScript commit2DBJavaScript = (Commit2DBJavaScript) listener.getAction(); Commit2DBJavaScript commit2DBJavaScript = (Commit2DBJavaScript) listener.getAction();
commit2DBJavaScript.setJsResourceInfo(new JavaScriptResourceInfo(JavaScriptResourceInfo.Type.WIDGET, targetWidget.getWidgetName())); JavaScriptResourceInfo.PathNode widgetNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.WIDGET, targetWidget.getWidgetName());
JavaScriptResourceInfo.PathNode EventNode = JavaScriptResourceInfo.PathNode.create(JavaScriptResourceInfo.Type.EVENT, listener.getName());
JavaScriptResourceInfo javaScriptResourceInfo = new JavaScriptResourceInfo()
.addFirstPathNode(EventNode)
.addFirstPathNode(widgetNode);
commit2DBJavaScript.setJsResourceInfo(javaScriptResourceInfo);
} }
} }

Loading…
Cancel
Save