Browse Source

修改代码格式

master
mengao 7 years ago
parent
commit
6a1ac3880e
  1. 63
      designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java
  2. 8
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  3. 2
      designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java

63
designer_base/src/com/fr/design/javascript/ParameterJavaScriptPane.java

@ -18,63 +18,64 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJava
private UITextField itemNameTextField; private UITextField itemNameTextField;
public ParameterJavaScriptPane(){ public ParameterJavaScriptPane() {
this(null, false); this(null, false);
} }
public ParameterJavaScriptPane(HashMap hyperLinkEditorMap, boolean needRenamePane){ public ParameterJavaScriptPane(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane); super(hyperLinkEditorMap, needRenamePane);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);
if(needRenamePane()){ if (needRenamePane()) {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH);
} }
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("JavaScript-Dynamic_Parameters"); return Inter.getLocText("JavaScript-Dynamic_Parameters");
} }
@Override @Override
public void populateBean(ParameterJavaScript ob){ public void populateBean(ParameterJavaScript ob) {
ParameterProvider[] parameters = ob.getParameters(); ParameterProvider[] parameters = ob.getParameters();
if (parameters.length == 0){ if (parameters.length == 0) {
// TODO ALEX_SEP // TODO ALEX_SEP
// parameters = DesignUtils.getEditingTemplateReport().getTemplateWorkBook().getParameters(); // parameters = DesignUtils.getEditingTemplateReport().getTemplateWorkBook().getParameters();
} }
parameterViewPane.populate(parameters); parameterViewPane.populate(parameters);
if(itemNameTextField != null){ if (itemNameTextField != null) {
itemNameTextField.setText(ob.getItemName()); itemNameTextField.setText(ob.getItemName());
} }
} }
@Override @Override
public ParameterJavaScript updateBean(){ public ParameterJavaScript updateBean() {
ParameterJavaScript js = new ParameterJavaScript(); ParameterJavaScript js = new ParameterJavaScript();
updateBean(js); updateBean(js);
if(this.itemNameTextField != null){ if (this.itemNameTextField != null) {
js.setItemName(itemNameTextField.getText()); js.setItemName(itemNameTextField.getText());
} }
return js; return js;
} }
public void updateBean(ParameterJavaScript parameter) { public void updateBean(ParameterJavaScript parameter) {
List<ParameterProvider> parameterList = parameterViewPane.update(); List<ParameterProvider> parameterList = parameterViewPane.update();
parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()])); parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()]));
if(this.itemNameTextField != null){ if (this.itemNameTextField != null) {
parameter.setItemName(itemNameTextField.getText()); parameter.setItemName(itemNameTextField.getText());
} }
} }
public static class CHART_NO_RENAME extends ParameterJavaScriptPane{ public static class CHART_NO_RENAME extends ParameterJavaScriptPane {
protected int getChartParaType() { protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE; return ParameterTableModel.CHART_NORMAL_USE;
} }
protected boolean needRenamePane(){
protected boolean needRenamePane() {
return false; return false;
} }
} }

8
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -22,6 +22,7 @@ import com.fr.design.hyperlink.WebHyperlinkPane;
import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.JavaScriptImplPane;
import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ParameterJavaScriptPane;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.js.EmailJavaScript; import com.fr.js.EmailJavaScript;
@ -79,13 +80,13 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
return constructor.newInstance(plot.getHyperLinkEditorMap(), false); return constructor.newInstance(plot.getHyperLinkEditorMap(), false);
} catch (InstantiationException e) { } catch (InstantiationException e) {
throw new RuntimeException(e); FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
throw new RuntimeException(e); FRLogger.getLogger().error(e.getMessage(), e);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
return super.createPaneByCreators(creator); return super.createPaneByCreators(creator);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
e.printStackTrace(); FRLogger.getLogger().error(e.getMessage(), e);
} }
return null; return null;
} }
@ -122,6 +123,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
} }
public void populate(TargetComponent elementCasePane) { public void populate(TargetComponent elementCasePane) {
//populate
} }
/** /**

2
designer_chart/src/com/fr/plugin/chart/designer/component/ChartUIMenuNameableCreator.java

@ -35,7 +35,7 @@ public class ChartUIMenuNameableCreator extends UIMenuNameableCreator {
try { try {
if (hyperLinkEditorMap != null) { if (hyperLinkEditorMap != null) {
Constructor<? extends BasicBeanPane> constructor = paneClazz.getConstructor(HashMap.class, boolean.class); Constructor<? extends BasicBeanPane> constructor = paneClazz.getConstructor(HashMap.class, boolean.class);
return constructor.newInstance(hyperLinkEditorMap,true); return constructor.newInstance(hyperLinkEditorMap, true);
} }
} catch (Exception e) { } catch (Exception e) {
return super.getPane(); return super.getPane();

Loading…
Cancel
Save