|
|
@ -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)); |
|
|
@ -539,27 +542,28 @@ public class EditToolBar extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 更新 |
|
|
|
* 更新 |
|
|
|
* @param widget 对应组件 |
|
|
|
* |
|
|
|
*/ |
|
|
|
* @param widget 对应组件 |
|
|
|
public void populate(Widget widget) { |
|
|
|
*/ |
|
|
|
this.widget = widget; |
|
|
|
public void populate(Widget widget) { |
|
|
|
card.show(centerPane, "none"); |
|
|
|
this.widget = widget; |
|
|
|
if (widget instanceof Button) { |
|
|
|
card.show(centerPane, "none"); |
|
|
|
populateDefault(); |
|
|
|
if (widget instanceof Button) { |
|
|
|
} |
|
|
|
populateDefault(); |
|
|
|
if (widget instanceof Export) { |
|
|
|
} |
|
|
|
populateExport(); |
|
|
|
if (widget instanceof Export) { |
|
|
|
} else if (widget instanceof AppendColumnRow) { |
|
|
|
populateExport(); |
|
|
|
populateAppendColumnRow(); |
|
|
|
} else if (widget instanceof AppendColumnRow) { |
|
|
|
} else if (widget instanceof Submit) { |
|
|
|
populateAppendColumnRow(); |
|
|
|
populateSubmit(); |
|
|
|
} else if (widget instanceof Submit) { |
|
|
|
} else if (widget instanceof CustomToolBarButton) { |
|
|
|
populateSubmit(); |
|
|
|
populateCustomToolBarButton(); |
|
|
|
} else if (widget instanceof CustomToolBarButton) { |
|
|
|
} else if (widget instanceof Email) { |
|
|
|
populateCustomToolBarButton(); |
|
|
|
populateEmail(); |
|
|
|
} else if (widget instanceof Email) { |
|
|
|
} |
|
|
|
populateEmail(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG); |
|
|
|
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG); |
|
|
|
for (ExtraButtonToolBarProvider provider : extraButtonSet) { |
|
|
|
for (ExtraButtonToolBarProvider provider : extraButtonSet) { |
|
|
@ -572,21 +576,22 @@ 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()); |
|
|
|
this.excelP.setSelected(export.isExcelPAvailable()); |
|
|
|
this.excelP.setSelected(export.isExcelPAvailable()); |
|
|
|
this.excelO.setSelected(export.isExcelOAvailable()); |
|
|
|
this.excelO.setSelected(export.isExcelOAvailable()); |
|
|
|
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(); |
|
|
|
} |
|
|
|
; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void populateEmail() { |
|
|
|
private void populateEmail() { |
|
|
|
card.show(centerPane, EMAIL); |
|
|
|
card.show(centerPane, EMAIL); |
|
|
@ -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()); |
|
|
|
} |
|
|
|
} |
|
|
|