Browse Source

修改代码质量

master
mengao 7 years ago
parent
commit
7f49ecbea4
  1. 2
      designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java
  2. 30
      designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java

2
designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java

@ -124,7 +124,7 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane<ReportletHyper
@Override
public void checkEnabled() {
//do nothing
}
}

30
designer_base/src/com/fr/design/javascript/JavaScriptImplPane.java

@ -74,7 +74,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
OneListTableModel<String> model = new OneListTableModel<String>(Inter.getLocText("ReportServerP-Import_JavaScript"), this) {
public UITableEditAction[] createAction() {
return new UITableEditAction[] { getAddAction(),new DeleteAction(this.component), new MoveUpAction(), new MoveDownAction() };
return new UITableEditAction[]{getAddAction(), new DeleteAction(this.component), new MoveUpAction(), new MoveDownAction()};
}
@Override
@ -97,14 +97,15 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 12, 0));
this.setLayout(new BorderLayout());
this.add(topPane,BorderLayout.NORTH) ;
this.add(jsPane,BorderLayout.CENTER);
this.add(topPane, BorderLayout.NORTH);
this.add(jsPane, BorderLayout.CENTER);
this.reLayoutForChart();
}
/**
*参数改变
* 参数改变
*
* @param list 参数列表.
*/
public void parameterChanger(List<ParameterProvider> list) {
@ -119,6 +120,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
/**
* title for popup window 弹出界面标题
*
* @return 标题.
*/
public String title4PopupWindow() {
@ -146,7 +148,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
parameterPane.populate(javaScriptImpl.getParameters());
jsPane.populate(javaScriptImpl.getContent());
if(itemNameTextField != null){
if (itemNameTextField != null) {
itemNameTextField.setText(javaScriptImpl.getItemName());
}
}
@ -169,7 +171,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
javaScript.setParameters(parameterList.toArray(new Parameter[parameterList.size()]));
javaScript.setContent(jsPane.update());
if(this.itemNameTextField != null){
if (this.itemNameTextField != null) {
javaScript.setItemName(itemNameTextField.getText());
}
}
@ -187,36 +189,38 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
return c;
}
protected void reLayoutForChart(){
if(needRenamePane()){
protected void reLayoutForChart() {
if (needRenamePane()) {
this.removeAll();
itemNameTextField = new UITextField();
JPanel topPane = GUICoreUtils.createBorderLayoutPane(
GUICoreUtils.createNamedPane(itemNameTextField,Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH,
GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH,
importedJsPane, BorderLayout.CENTER,
parameterPane, BorderLayout.EAST
);
topPane.setPreferredSize(new Dimension(300, 150));
this.setLayout(new BorderLayout());
this.add(topPane,BorderLayout.NORTH) ;
this.add(jsPane,BorderLayout.CENTER);
this.add(topPane, BorderLayout.NORTH);
this.add(jsPane, BorderLayout.CENTER);
this.repaint();
}
}
public static class CHART_NO_RENAME extends JavaScriptImplPane{
public static class CHART_NO_RENAME extends JavaScriptImplPane {
protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE;
}
protected boolean needRenamePane(){
protected boolean needRenamePane() {
return false;
}
}
/**
* 判断类型
*
* @param ob 判断目标
* @return 返回是否符合类型.
*/

Loading…
Cancel
Save