Browse Source

REPORT-56134 js提交事件报错中添加定位信息

final/10.0
Yuan.Wang 3 years ago
parent
commit
c19f6811e7
  1. 5
      designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java
  2. 84
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java
  3. 86
      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
public Listener updateBean() {
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());
FurtherBasicBeanPane<? extends JavaScript> pane = this.cards.get(this.styleBox.getSelectedIndex());
this.listener.setAction(pane.updateBean());

84
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) {
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));
BasicDialog dialog = javaScriptPane.showWindow(SwingUtilities.getWindowAncestor(ButtonPane.this));
@ -539,27 +542,28 @@ public class EditToolBar extends BasicPane {
}
};
/**
* 更新
* @param widget 对应组件
*/
public void populate(Widget widget) {
this.widget = widget;
card.show(centerPane, "none");
if (widget instanceof Button) {
populateDefault();
}
if (widget instanceof Export) {
populateExport();
} else if (widget instanceof AppendColumnRow) {
populateAppendColumnRow();
} else if (widget instanceof Submit) {
populateSubmit();
} else if (widget instanceof CustomToolBarButton) {
populateCustomToolBarButton();
} else if (widget instanceof Email) {
populateEmail();
}
/**
* 更新
*
* @param widget 对应组件
*/
public void populate(Widget widget) {
this.widget = widget;
card.show(centerPane, "none");
if (widget instanceof Button) {
populateDefault();
}
if (widget instanceof Export) {
populateExport();
} else if (widget instanceof AppendColumnRow) {
populateAppendColumnRow();
} else if (widget instanceof Submit) {
populateSubmit();
} else if (widget instanceof CustomToolBarButton) {
populateCustomToolBarButton();
} else if (widget instanceof Email) {
populateEmail();
}
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
@ -572,21 +576,22 @@ public class EditToolBar extends BasicPane {
count.setValue(((AppendColumnRow) widget).getCount());
}
private void populateExport(){
card.show(centerPane, "export");
Export export = (Export) widget;
this.pdf.setSelected(export.isPdfAvailable());
this.excelP.setSelected(export.isExcelPAvailable());
this.excelO.setSelected(export.isExcelOAvailable());
this.excelS.setSelected(export.isExcelSAvailable());
this.word.setSelected(export.isWordAvailable());
this.image.setSelected(export.isImageAvailable());
if(exportToolBarProviders != null){
for(int i=0; i<exportToolBarProviders.length; i++){
exportToolBarProviders[i].populate();;
}
}
}
private void populateExport() {
card.show(centerPane, "export");
Export export = (Export) widget;
this.pdf.setSelected(export.isPdfAvailable());
this.excelP.setSelected(export.isExcelPAvailable());
this.excelO.setSelected(export.isExcelOAvailable());
this.excelS.setSelected(export.isExcelSAvailable());
this.word.setSelected(export.isWordAvailable());
this.image.setSelected(export.isImageAvailable());
if (exportToolBarProviders != null) {
for (int i = 0; i < exportToolBarProviders.length; i++) {
exportToolBarProviders[i].populate();
;
}
}
}
private void populateEmail() {
card.show(centerPane, EMAIL);
@ -694,7 +699,10 @@ public class EditToolBar extends BasicPane {
if (customToolBarButton.getJSImpl() == null) {
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());
}

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

@ -55,29 +55,31 @@ public class WidgetEventPane extends UIListGroupControlPane {
public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{
new EventCreator(Widget.EVENT_STATECHANGE, WidgetEventListenerUpdatePane.class)
};
};
}
@Override
public void saveSettings() {
@Override
public void saveSettings() {
CellWidgetPropertyPane.getInstance().update(selection);
}
@Override
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event");
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event");
}
public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane {
private ElementCasePane epane;
private ElementCasePane epane;
// 反射会用到
public WidgetEventListenerUpdatePane() {
this(null);
}
public WidgetEventListenerUpdatePane(ElementCasePane epane){
this.epane = epane;
super.initComponents();
}
public WidgetEventListenerUpdatePane(ElementCasePane epane) {
this.epane = epane;
super.initComponents();
}
/**
* 根据有无单元格创建 DBManipulationPane
@ -88,41 +90,41 @@ public class WidgetEventPane extends UIListGroupControlPane {
return jTemplate.createDBManipulationPaneInWidget();
}
@Override
protected JavaScriptActionPane createJavaScriptActionPane() {
return new JavaScriptActionPane() {
@Override
protected JavaScriptActionPane createJavaScriptActionPane() {
return new JavaScriptActionPane() {
@Override
protected DBManipulationPane createDBManipulationPane() {
if(epane == null && DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) {
return autoCreateDBManipulationInWidgetEventPane();
}
@Override
protected DBManipulationPane createDBManipulationPane() {
if (epane == null && DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) {
return autoCreateDBManipulationInWidgetEventPane();
}
return new SmartInsertDBManipulationInWidgetEventPane(epane);
}
return new SmartInsertDBManipulationInWidgetEventPane(epane);
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Callback_Function");
}
@Override
protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Callback_Function");
}
@Override
protected boolean isForm() {
return false;
}
@Override
protected boolean isForm() {
return false;
}
protected String[] getDefaultArgs() {
return new String[0];
}
};
}
protected String[] getDefaultArgs() {
return new String[0];
}
};
}
@Override
protected boolean supportCellAction() {
return false;
}
@Override
protected boolean supportCellAction() {
return false;
}
}
}
public void populate(Widget widget) {
if (widget == null) {
@ -191,7 +193,13 @@ public class WidgetEventPane extends UIListGroupControlPane {
public void wrapperListener(Listener listener) {
if (listener.getAction() instanceof Commit2DBJavaScript) {
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