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;
public ParameterJavaScriptPane(){
public ParameterJavaScriptPane() {
this(null, false);
}
public ParameterJavaScriptPane(HashMap hyperLinkEditorMap, boolean needRenamePane){
public ParameterJavaScriptPane(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
this.setLayout(new BorderLayout());
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER);
if(needRenamePane()){
this.setLayout(new BorderLayout());
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER);
if (needRenamePane()) {
itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH);
}
}
}
@Override
@Override
public String title4PopupWindow() {
return Inter.getLocText("JavaScript-Dynamic_Parameters");
}
return Inter.getLocText("JavaScript-Dynamic_Parameters");
}
@Override
public void populateBean(ParameterJavaScript ob){
ParameterProvider[] parameters = ob.getParameters();
if (parameters.length == 0){
// TODO ALEX_SEP
public void populateBean(ParameterJavaScript ob) {
ParameterProvider[] parameters = ob.getParameters();
if (parameters.length == 0) {
// TODO ALEX_SEP
// parameters = DesignUtils.getEditingTemplateReport().getTemplateWorkBook().getParameters();
}
parameterViewPane.populate(parameters);
if(itemNameTextField != null){
}
parameterViewPane.populate(parameters);
if (itemNameTextField != null) {
itemNameTextField.setText(ob.getItemName());
}
}
}
@Override
public ParameterJavaScript updateBean(){
ParameterJavaScript js = new ParameterJavaScript();
updateBean(js);
if(this.itemNameTextField != null){
public ParameterJavaScript updateBean() {
ParameterJavaScript js = new ParameterJavaScript();
updateBean(js);
if (this.itemNameTextField != null) {
js.setItemName(itemNameTextField.getText());
}
return js;
}
return js;
}
public void updateBean(ParameterJavaScript parameter) {
List<ParameterProvider> parameterList = parameterViewPane.update();
parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()]));
if(this.itemNameTextField != null){
List<ParameterProvider> parameterList = parameterViewPane.update();
parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()]));
if (this.itemNameTextField != null) {
parameter.setItemName(itemNameTextField.getText());
}
}
public static class CHART_NO_RENAME extends ParameterJavaScriptPane{
public static class CHART_NO_RENAME extends ParameterJavaScriptPane {
protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE;
}
protected boolean needRenamePane(){
protected boolean needRenamePane() {
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.ParameterJavaScriptPane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.js.EmailJavaScript;
@ -79,13 +80,13 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
return constructor.newInstance(plot.getHyperLinkEditorMap(), false);
} catch (InstantiationException e) {
throw new RuntimeException(e);
FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
FRLogger.getLogger().error(e.getMessage(), e);
} catch (NoSuchMethodException e) {
return super.createPaneByCreators(creator);
} catch (InvocationTargetException e) {
e.printStackTrace();
FRLogger.getLogger().error(e.getMessage(), e);
}
return null;
}
@ -122,6 +123,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
}
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 {
if (hyperLinkEditorMap != null) {
Constructor<? extends BasicBeanPane> constructor = paneClazz.getConstructor(HashMap.class, boolean.class);
return constructor.newInstance(hyperLinkEditorMap,true);
return constructor.newInstance(hyperLinkEditorMap, true);
}
} catch (Exception e) {
return super.getPane();

Loading…
Cancel
Save