Browse Source

Pull request #5665: REPORT-56134 js提交事件报错中添加定位信息

Merge in DESIGN/design from ~YUAN.WANG/design:final/10.0 to final/10.0

* commit 'c19f6811e7f98abeed97626fad9c4636e44d83f4':
  REPORT-56134 js提交事件报错中添加定位信息
final/10.0
Yuan.Wang 3 years ago
parent
commit
3f231303f7
  1. 5
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  2. 20
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  3. 14
      designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java

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

@ -182,7 +182,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());

20
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) {
@ -572,7 +576,7 @@ public class EditToolBar extends BasicPane {
count.setValue(((AppendColumnRow) widget).getCount()); count.setValue(((AppendColumnRow) widget).getCount());
} }
private void populateExport(){ private void populateExport() {
card.show(centerPane, "export"); card.show(centerPane, "export");
Export export = (Export) widget; Export export = (Export) widget;
this.pdf.setSelected(export.isPdfAvailable()); this.pdf.setSelected(export.isPdfAvailable());
@ -581,9 +585,10 @@ public class EditToolBar extends BasicPane {
this.excelS.setSelected(export.isExcelSAvailable()); this.excelS.setSelected(export.isExcelSAvailable());
this.word.setSelected(export.isWordAvailable()); this.word.setSelected(export.isWordAvailable());
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());
} }

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

@ -70,11 +70,13 @@ 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();
} }
@ -94,7 +96,7 @@ public class WidgetEventPane extends UIListGroupControlPane {
@Override @Override
protected DBManipulationPane createDBManipulationPane() { protected DBManipulationPane createDBManipulationPane() {
if(epane == null && DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) { if (epane == null && DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) {
return autoCreateDBManipulationInWidgetEventPane(); return autoCreateDBManipulationInWidgetEventPane();
} }
@ -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