Browse Source

Merge branch 'release/10.0' of ssh://cloud.finedevelop.com:7999/~hzzz/design61 into release/10.0

final/10.0
hzzz 6 years ago
parent
commit
55e792cedb
  1. 9
      designer-base/pom.xml
  2. 2
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  3. 2
      designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java
  4. 2
      designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java
  5. 2
      designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java
  6. 6
      designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java
  7. 8
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  8. 8
      designer-base/src/main/java/com/fr/design/actions/help/FeedBackPane.java
  9. 4
      designer-base/src/main/java/com/fr/design/actions/help/SystemInfoPane.java
  10. 2
      designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java
  11. 2
      designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java
  12. 2
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  13. 12
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java
  14. 2
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java
  15. 2
      designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java
  16. 8
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java
  17. 2
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  18. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java
  19. 2
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java
  20. 2
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java
  21. 20
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java
  22. 25
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java
  23. 2
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java
  24. 41
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java
  25. 2
      designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java
  26. 25
      designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java
  27. 4
      designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java
  28. 4
      designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java
  29. 2
      designer-base/src/main/java/com/fr/design/editor/editor/BooleanEditor.java
  30. 2
      designer-base/src/main/java/com/fr/design/editor/editor/ParameterEditor.java
  31. 2
      designer-base/src/main/java/com/fr/design/editor/editor/TextEditor.java
  32. 2
      designer-base/src/main/java/com/fr/design/editor/editor/XMLANameEditor.java
  33. 2
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  34. 4
      designer-base/src/main/java/com/fr/design/extra/PluginUtils.java
  35. 8
      designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java
  36. 3
      designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java
  37. 2
      designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java
  38. 2
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  39. 2
      designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  40. 4
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  41. 2
      designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java
  42. 2
      designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java
  43. 212
      designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java
  44. 115
      designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java
  45. 112
      designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java
  46. 634
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  47. 112
      designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java
  48. 35
      designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java
  49. 2
      designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java
  50. 6
      designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java
  51. 15
      designer-base/src/main/java/com/fr/design/gui/controlpane/ShortCutListenerProvider.java
  52. 203
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  53. 880
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java
  54. 178
      designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java
  55. 112
      designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java
  56. 171
      designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java
  57. 2
      designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java
  58. 6
      designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java
  59. 11
      designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java
  60. 4
      designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java
  61. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/ImgChoosePane.java
  62. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java
  63. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java
  64. 8
      designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java
  65. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java
  66. 27
      designer-base/src/main/java/com/fr/design/gui/frpane/TemplateParameterPane.java
  67. 6
      designer-base/src/main/java/com/fr/design/gui/frpane/UIAdvancedTextPane.java
  68. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  69. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java
  70. 4
      designer-base/src/main/java/com/fr/design/gui/icombobox/DictionaryConstants.java
  71. 61
      designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java
  72. 386
      designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java
  73. 2
      designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java
  74. 2
      designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTableUI.java
  75. 2
      designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java
  76. 2
      designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java
  77. 6
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java
  78. 2
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java
  79. 4
      designer-base/src/main/java/com/fr/design/gui/itextfield/UISearchTextField.java
  80. 2
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java
  81. 26
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/ErrorStrip.java
  82. 4
      designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java
  83. 2
      designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java
  84. 2
      designer-base/src/main/java/com/fr/design/javascript/FormSubmitJavaScriptPane.java
  85. 6
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java
  86. 4
      designer-base/src/main/java/com/fr/design/javascript/ProcessParameterTableModel.java
  87. 11
      designer-base/src/main/java/com/fr/design/layout/TableLayoutTest.java
  88. 13
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  89. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  90. 2
      designer-base/src/main/java/com/fr/design/mainframe/NoSupportAuthorityEdit.java
  91. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java
  92. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java
  93. 2
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java
  94. 2
      designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java
  95. 28
      designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java
  96. 4
      designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java
  97. 4
      designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java
  98. 5
      designer-base/src/main/java/com/fr/design/parameter/ParameterManagerPane.java
  99. 19
      designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java
  100. 2
      designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java
  101. Some files were not shown because too many files have changed in this diff Show More

9
designer-base/pom.xml

@ -6,8 +6,11 @@
<parent> <parent>
<groupId>com.fr.report</groupId> <groupId>com.fr.report</groupId>
<artifactId>design</artifactId> <artifactId>design</artifactId>
<version>10.0-RELEASE-SNAPSHOT</version> <version>10.0</version>
</parent> </parent>
<groupId>com.fr.report</groupId>
<artifactId>designer-base</artifactId>
<version>${branch}-SNAPSHOT</version>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>io.socket</groupId> <groupId>io.socket</groupId>
@ -15,7 +18,5 @@
<version>0.7.0</version> <version>0.7.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<groupId>com.fr.report</groupId>
<artifactId>designer-base</artifactId>
<version>10.0-RELEASE-SNAPSHOT</version>
</project> </project>

2
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -208,7 +208,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
String installHome = StableUtils.getInstallHome(); String installHome = StableUtils.getInstallHome();
if (installHome != null && !".".equals(installHome)) { if (installHome != null && !".".equals(installHome)) {
String name = com.fr.design.i18n.Toolkit.i18nText("FR-Engine_DEFAULT"); String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT");
String envPath = designerEnvManager.getDefaultenvPath(installHome); String envPath = designerEnvManager.getDefaultenvPath(installHome);
designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath));
designerEnvManager.setCurEnvName(name); designerEnvManager.setCurEnvName(name);

2
designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java

@ -20,7 +20,7 @@ public class CopyAction extends TemplateComponentAction {
public CopyAction(TargetComponent t) { public CopyAction(TargetComponent t) {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Copy")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));

2
designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java

@ -24,7 +24,7 @@ public class CutAction extends TemplateComponentAction {
public CutAction(TargetComponent t) { public CutAction(TargetComponent t) {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Cut")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"));
this.setMnemonic('T'); this.setMnemonic('T');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));

2
designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java

@ -24,7 +24,7 @@ public class PasteAction extends TemplateComponentAction {
public PasteAction(TargetComponent t) { public PasteAction(TargetComponent t) {
super(t); super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Paste")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste"));
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER));

6
designer-base/src/main/java/com/fr/design/actions/file/EditEnvAction.java

@ -1,17 +1,17 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import java.awt.event.ActionEvent;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.TemplatePane; import com.fr.design.mainframe.TemplatePane;
import java.awt.event.ActionEvent;
public class EditEnvAction extends UpdateAction { public class EditEnvAction extends UpdateAction {
public EditEnvAction() { public EditEnvAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("M-Others") + "..."); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Others") + "...");
} }
@Override @Override

8
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -24,6 +24,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
@ -177,8 +178,8 @@ public class PreferencePane extends BasicPane {
functionPane.add(supportUndoCheckBox); functionPane.add(supportUndoCheckBox);
//添加maxUndoLimit //添加maxUndoLimit
//String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"}; //String[] undoTimes = {"最大撤销次数","5次","10次","15次","20次","50次"};
String[] undoTimes = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)"), MAX_UNDO_LIMIT_10 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)") String[] undoTimes = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Undo_Limit"), MAX_UNDO_LIMIT_5 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_10 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)")
, MAX_UNDO_LIMIT_15 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)"), MAX_UNDO_LIMIT_20 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)"), MAX_UNDO_LIMIT_50 + com.fr.design.i18n.Toolkit.i18nText("FR-Designer_time(s)")}; , MAX_UNDO_LIMIT_15 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_20 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)"), MAX_UNDO_LIMIT_50 + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Time(s)")};
maxUndoLimit = new UIComboBox(undoTimes); maxUndoLimit = new UIComboBox(undoTimes);
functionPane.add(maxUndoLimit); functionPane.add(maxUndoLimit);
@ -394,7 +395,8 @@ public class PreferencePane extends BasicPane {
int i = 0; int i = 0;
for (Map.Entry<Locale, String> entry : map.entrySet()) { for (Map.Entry<Locale, String> entry : map.entrySet()) {
keys[i] = entry.getKey(); keys[i] = entry.getKey();
values[i] = com.fr.design.i18n.Toolkit.i18nText(entry.getValue()); // 想要读取到,必需在这里 使用 Inter 才行。
values[i] = Inter.getLocText(entry.getValue());
i++; i++;
} }
UIDictionaryComboBox<Locale> languageComboBox = new UIDictionaryComboBox<>(keys, values); UIDictionaryComboBox<Locale> languageComboBox = new UIDictionaryComboBox<>(keys, values);

8
designer-base/src/main/java/com/fr/design/actions/help/FeedBackPane.java

@ -67,7 +67,7 @@ public class FeedBackPane extends BasicPane {
private static final int TEL_MAX_LENGTH = 11; private static final int TEL_MAX_LENGTH = 11;
private static final String ALLOWED_INTEGER_TYPE = "0123456789"; private static final String ALLOWED_INTEGER_TYPE = "0123456789";
private SwingWorker worker; private SwingWorker worker;
private JDialog dlg = new JDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Send"), true); private JDialog dlg = new JDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Send"), true);
private UIButton ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); private UIButton ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK"));
private UIButton cancle = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); private UIButton cancle = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel"));
private int ifHasBeenWriten = 0; private int ifHasBeenWriten = 0;
@ -219,7 +219,7 @@ public class FeedBackPane extends BasicPane {
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, GAP, 0)); JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, GAP, 0));
controlPane.add(buttonsPane, BorderLayout.EAST); controlPane.add(buttonsPane, BorderLayout.EAST);
sendButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Send")); sendButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Send"));
buttonsPane.add(sendButton); buttonsPane.add(sendButton);
buttonsPane.setBorder(SEND_BORDER); buttonsPane.setBorder(SEND_BORDER);
sendButton.addActionListener(new ActionListener() { sendButton.addActionListener(new ActionListener() {
@ -235,7 +235,7 @@ public class FeedBackPane extends BasicPane {
private void doWithSendPane() { private void doWithSendPane() {
Object[] options = new Object[]{ok, cancle}; Object[] options = new Object[]{ok, cancle};
send = new JOptionPane(com.fr.design.i18n.Toolkit.i18nText("sending"), send = new JOptionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sending"),
JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]);
ok.setEnabled(false); ok.setEnabled(false);
ok.addActionListener(new ActionListener() { ok.addActionListener(new ActionListener() {
@ -246,7 +246,7 @@ public class FeedBackPane extends BasicPane {
feedbackDialog.dispose(); feedbackDialog.dispose();
} else { } else {
ok.setEnabled(false); ok.setEnabled(false);
send.setMessage(com.fr.design.i18n.Toolkit.i18nText("sending")); send.setMessage(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sending"));
setWorker(send); setWorker(send);
worker.execute(); worker.execute();
} }

4
designer-base/src/main/java/com/fr/design/actions/help/SystemInfoPane.java

@ -25,8 +25,8 @@ public class SystemInfoPane extends JPanel {
return false; return false;
} }
}; };
tableModel.addColumn(com.fr.design.i18n.Toolkit.i18nText("Property")); tableModel.addColumn(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"));
tableModel.addColumn(com.fr.design.i18n.Toolkit.i18nText("Value")); tableModel.addColumn(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value"));
Properties properties = System.getProperties(); Properties properties = System.getProperties();
Object[] keys = new Object[properties.size()]; Object[] keys = new Object[properties.size()];

2
designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java

@ -83,7 +83,7 @@ public class GlobalParameterAction extends UpdateAction {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters");
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java

@ -33,7 +33,7 @@ public class PlatformManagerAction extends UpdateAction {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("M_Server-Platform_Manager"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager");
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -35,7 +35,7 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
JPanel propertyChangePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel propertyChangePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(propertyChangePane); this.add(propertyChangePane);
propertyChangePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Property") + ":", null)); propertyChangePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property") + ":", null));
// 选择要改变的属性. // 选择要改变的属性.
JPanel addItemPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel addItemPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();

12
designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java

@ -74,9 +74,9 @@ public class JDBCDefPane extends JPanel {
private IntegerEditor DBCP_MAX_WAIT = new IntegerEditor(); private IntegerEditor DBCP_MAX_WAIT = new IntegerEditor();
private UITextField DBCP_VALIDATION_QUERY = new UITextField(); private UITextField DBCP_VALIDATION_QUERY = new UITextField();
private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("No"), com.fr.design.i18n.Toolkit.i18nText("Yes")}); private UIComboBox DBCP_TESTONBORROW = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")});
private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("No"), com.fr.design.i18n.Toolkit.i18nText("Yes")}); private UIComboBox DBCP_TESTONRETURN = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")});
private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("No"), com.fr.design.i18n.Toolkit.i18nText("Yes")}); private UIComboBox DBCP_TESTWHILEIDLE = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Yes")});
private IntegerEditor DBCP_TIMEBETWEENEVICTIONRUNSMILLS = new IntegerEditor(); private IntegerEditor DBCP_TIMEBETWEENEVICTIONRUNSMILLS = new IntegerEditor();
private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor(); private IntegerEditor DBCP_NUMTESTSPEREVICTIONRUN = new IntegerEditor();
@ -131,13 +131,13 @@ public class JDBCDefPane extends JPanel {
JPanel userPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); JPanel userPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
userPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_UserName") + ":")); userPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_UserName") + ":"));
JPanel userComPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel userComPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
Component[][] userComComponents = {{userNameTextField, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Password") + ":"), passwordTextField}}; Component[][] userComComponents = {{userNameTextField, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":"), passwordTextField}};
double[] userRowSize = {p}; double[] userRowSize = {p};
double[] userColumnSize = {f, p, f}; double[] userColumnSize = {f, p, f};
userComPane = TableLayoutHelper.createCommonTableLayoutPane(userComComponents, userRowSize, userColumnSize, 4); userComPane = TableLayoutHelper.createCommonTableLayoutPane(userComComponents, userRowSize, userColumnSize, 4);
JPanel passwordPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); JPanel passwordPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
passwordPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Password") + ":")); passwordPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Password") + ":"));
Component[][] components = {{dbtypePane, dbtypeComPane}, {driverPane, driverComboBox}, {urlPane, urlComPane}, {userPane, userComPane},}; Component[][] components = {{dbtypePane, dbtypeComPane}, {driverPane, driverComboBox}, {urlPane, urlComPane}, {userPane, userComPane},};
@ -289,7 +289,7 @@ public class JDBCDefPane extends JPanel {
if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), ("Access"))) { if (ComparatorUtils.equals(dbtypeComboBox.getSelectedItem(), ("Access"))) {
// ben:这个能不能换种处理方案- - // ben:这个能不能换种处理方案- -
JFileChooser filechooser = new JFileChooser(); JFileChooser filechooser = new JFileChooser();
filechooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Open")); filechooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open"));
filechooser.setMultiSelectionEnabled(false); filechooser.setMultiSelectionEnabled(false);
filechooser.addChoosableFileFilter(new ChooseFileFilter(new String[]{"accdb", "mdb"}, "Microsoft Office Access")); filechooser.addChoosableFileFilter(new ChooseFileFilter(new String[]{"accdb", "mdb"}, "Microsoft Office Access"));
int result = filechooser.showOpenDialog(DesignerContext.getDesignerFrame()); int result = filechooser.showOpenDialog(DesignerContext.getDesignerFrame());

2
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java

@ -17,7 +17,7 @@ public class PreviewLabel extends UIButton {
public PreviewLabel(Previewable previewable) { public PreviewLabel(Previewable previewable) {
super(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png")); super(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png"));
this.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Preview")); this.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
this.setCursor(new Cursor(Cursor.HAND_CURSOR)); this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.previewable = previewable; this.previewable = previewable;
this.addActionListener(new ActionListener() { this.addActionListener(new ActionListener() {

2
designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java

File diff suppressed because one or more lines are too long

8
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/AutoStoreProcedureTableModel.java

@ -122,19 +122,19 @@ public class AutoStoreProcedureTableModel extends StoreProcedureTableModel {
if(((String) value).length() > 0 && ((String) value).charAt(0) == '=') if(((String) value).length() > 0 && ((String) value).charAt(0) == '=')
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula");
else else
type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String");
}else if(value instanceof Integer) }else if(value instanceof Integer)
type = com.fr.design.i18n.Toolkit.i18nText("Integer"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Integer");
else if(value instanceof Double) else if(value instanceof Double)
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double");
else if(value instanceof Date) else if(value instanceof Date)
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date");
else if(value instanceof Boolean) else if(value instanceof Boolean)
type = com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean");
else if(value instanceof BaseFormula) else if(value instanceof BaseFormula)
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula");
else else
type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String");
return StoreProcedureParameterPane.getInfo4Value(type); return StoreProcedureParameterPane.getInfo4Value(type);
} }

2
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java

@ -44,7 +44,7 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
classNameTextField = new UITextField(36); classNameTextField = new UITextField(36);
reportletNamePane.add(classNameTextField); reportletNamePane.add(classNameTextField);
UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Select")); UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select"));
browserButton.setPreferredSize(new Dimension( browserButton.setPreferredSize(new Dimension(
browserButton.getPreferredSize().width, browserButton.getPreferredSize().width,
classNameTextField.getPreferredSize().height)); classNameTextField.getPreferredSize().height));

4
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataDefinedPane.java

@ -33,8 +33,8 @@ public class EmbeddedTableDataDefinedPane extends BasicPane{
private UIButton del; private UIButton del;
private static String[] TYPE = { private static String[] TYPE = {
com.fr.design.i18n.Toolkit.i18nText("String"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String"),
com.fr.design.i18n.Toolkit.i18nText("Integer"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Integer"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date")
}; };

2
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java

@ -73,7 +73,7 @@ public class MaxMemRowCountPanel extends UIToolbar {
switchCache.setSelectedIndex(MAX_IN_MEMORY); switchCache.setSelectedIndex(MAX_IN_MEMORY);
this.add(new UILabel(" ")); this.add(new UILabel(" "));
this.add(numberSpinner); this.add(numberSpinner);
this.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Row"))); this.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")));
this.validate(); this.validate();
this.repaint(); this.repaint();
} }

2
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java

@ -140,7 +140,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
private class RefreshAction extends UITableEditAction { private class RefreshAction extends UITableEditAction {
public RefreshAction() { public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Refresh")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
} }

20
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureParameterPane.java

@ -30,11 +30,11 @@ public class StoreProcedureParameterPane extends BasicPane {
private static NameObject[] nameAndValue = new NameObject[]{ private static NameObject[] nameAndValue = new NameObject[]{
new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cursor"), StoreProcedureConstants.CURSOR), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cursor"), StoreProcedureConstants.CURSOR),
new NameObject(com.fr.design.i18n.Toolkit.i18nText("Parameter-String"), StoreProcedureConstants.VARCHAR), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"), StoreProcedureConstants.VARCHAR),
new NameObject(com.fr.design.i18n.Toolkit.i18nText("Integer"), StoreProcedureConstants.INTEGER), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Integer"), StoreProcedureConstants.INTEGER),
new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"), StoreProcedureConstants.DECIMAL), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"), StoreProcedureConstants.DECIMAL),
new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"), StoreProcedureConstants.DATE), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"), StoreProcedureConstants.DATE),
new NameObject(com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean"), StoreProcedureConstants.BOOLEAN), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean"), StoreProcedureConstants.BOOLEAN),
new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"), StoreProcedureConstants.FORMULA), new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"), StoreProcedureConstants.FORMULA),
new NameObject("IN",StoreProcedureConstants.IN), new NameObject("IN",StoreProcedureConstants.IN),
new NameObject("OUT",StoreProcedureConstants.OUT), new NameObject("OUT",StoreProcedureConstants.OUT),
@ -71,7 +71,7 @@ public class StoreProcedureParameterPane extends BasicPane {
schemaCombo = new UIComboBox(); schemaCombo = new UIComboBox();
initUIComboBox(schemaCombo, schemaName); initUIComboBox(schemaCombo, schemaName);
JPanel namePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel namePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
namePane.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Name") + ":"), BorderLayout.WEST); namePane.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), BorderLayout.WEST);
nameField = new UITextField(10); nameField = new UITextField(10);
namePane.add(nameField, BorderLayout.CENTER); namePane.add(nameField, BorderLayout.CENTER);
namePane.add(new UILabel(" "), BorderLayout.EAST); namePane.add(new UILabel(" "), BorderLayout.EAST);
@ -80,7 +80,7 @@ public class StoreProcedureParameterPane extends BasicPane {
valuePane.add(new UILabel(" "), BorderLayout.EAST); valuePane.add(new UILabel(" "), BorderLayout.EAST);
Component[][] components = {{null}, Component[][] components = {{null},
{namePane}, {namePane},
{addPane("Model", 1, schemaCombo)}, {addPane("Fine-Design_Basic_Model", 1, schemaCombo)},
{valuePane}, {valuePane},
{null} {null}
}; };
@ -105,7 +105,7 @@ public class StoreProcedureParameterPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Parameter"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter");
} }
public void populate(StoreProcedureParameter stpParameter) { public void populate(StoreProcedureParameter stpParameter) {
@ -129,19 +129,19 @@ public class StoreProcedureParameterPane extends BasicPane {
if(((String) value).length() > 0 && ((String) value).charAt(0) == '=') if(((String) value).length() > 0 && ((String) value).charAt(0) == '=')
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula");
else else
type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String");
}else if(value instanceof Integer) }else if(value instanceof Integer)
type = com.fr.design.i18n.Toolkit.i18nText("Integer"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Integer");
else if(value instanceof Double) else if(value instanceof Double)
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Double");
else if(value instanceof Date) else if(value instanceof Date)
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date");
else if(value instanceof Boolean) else if(value instanceof Boolean)
type = com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean");
else if(value instanceof BaseFormula) else if(value instanceof BaseFormula)
type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula");
else else
type = com.fr.design.i18n.Toolkit.i18nText("Parameter-String"); type = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String");
int typeVl = getInfo4Value(type); int typeVl = getInfo4Value(type);
p.setType(typeVl); p.setType(typeVl);
String schema = (String)schemaCombo.getSelectedItem(); String schema = (String)schemaCombo.getSelectedItem();

25
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/StoreProcedureTableModel.java

@ -1,24 +1,23 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import javax.swing.BorderFactory;
import com.fr.base.StoreProcedureParameter; import com.fr.base.StoreProcedureParameter;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import javax.swing.BorderFactory;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedureParameter> { public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedureParameter> {
public StoreProcedureTableModel() { public StoreProcedureTableModel() {
super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type"), com.fr.design.i18n.Toolkit.i18nText("Model"), com.fr.design.i18n.Toolkit.i18nText("Value") }); super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") });
if (shouldResponseDoubleClickAction()) { if (shouldResponseDoubleClickAction()) {
table.addMouseListener(new MouseAdapter() { table.addMouseListener(new MouseAdapter() {
@ -36,7 +35,7 @@ public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedure
final StoreProcedureParameterPane pane = new StoreProcedureParameterPane(); final StoreProcedureParameterPane pane = new StoreProcedureParameterPane();
pane.populate(spp); pane.populate(spp);
pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Parameter"))); pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame()); BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame());
stpEditDialog.addDialogActionListener(new DialogActionAdapter() { stpEditDialog.addDialogActionListener(new DialogActionAdapter() {
@ -90,7 +89,7 @@ public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedure
StoreProcedureParameter para = new StoreProcedureParameter(); StoreProcedureParameter para = new StoreProcedureParameter();
final StoreProcedureParameterPane pane = new StoreProcedureParameterPane(); final StoreProcedureParameterPane pane = new StoreProcedureParameterPane();
pane.populate(para); pane.populate(para);
pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Parameter"))); pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame()); BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame());
stpEditDialog.addDialogActionListener(new DialogActionAdapter() { stpEditDialog.addDialogActionListener(new DialogActionAdapter() {
@ -112,7 +111,7 @@ public class StoreProcedureTableModel extends UITableModelAdapter<StoreProcedure
StoreProcedureParameter para = getSelectedValue(); StoreProcedureParameter para = getSelectedValue();
final StoreProcedureParameterPane pane = new StoreProcedureParameterPane(); final StoreProcedureParameterPane pane = new StoreProcedureParameterPane();
pane.populate(para); pane.populate(para);
pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Parameter"))); pane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame()); BasicDialog stpEditDialog = pane.showWindow(DesignerContext.getDesignerFrame());
stpEditDialog.addDialogActionListener(new DialogActionAdapter() { stpEditDialog.addDialogActionListener(new DialogActionAdapter() {

2
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java

@ -101,7 +101,7 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
return columnNameList; return columnNameList;
} }
if (!createStore(false)) { if (!createStore(false)) {
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("FR-Engine_No-tableData")); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_No_TableData"));
return new ArrayList<String>(); return new ArrayList<String>();
} }
columnNameList = Arrays.asList(procedureDataModel.getColumnName()); columnNameList = Arrays.asList(procedureDataModel.getColumnName());

41
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TableDataFactory.java

@ -3,17 +3,37 @@ package com.fr.design.data.tabledata.wrapper;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.data.impl.*; import com.fr.data.impl.ClassTableData;
import com.fr.data.impl.DBTableData;
import com.fr.data.impl.DecoratedTableData;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.data.impl.FileTableData;
import com.fr.data.impl.MultiFieldTableData;
import com.fr.data.impl.MultiTDTableData;
import com.fr.data.impl.RecursionTableData;
import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.data.datapane.TableDataNameObjectCreator; import com.fr.design.data.datapane.TableDataNameObjectCreator;
import com.fr.design.data.tabledata.tabledatapane.*; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.ClassTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.DBTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.DecoratedTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.EmbeddedTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.FileTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.ProcedureDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.file.TableDataConfig; import com.fr.file.TableDataConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.*; import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
/** /**
@ -155,12 +175,17 @@ public abstract class TableDataFactory {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static String[] getSortOfChineseNameOfServerData(TableDataConfig tableDataConfig) { public static String[] getSortOfChineseNameOfServerData(TableDataConfig tableDataConfig) {
clearAll(); clearAll();
java.util.Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator(); try {
while (nameIt.hasNext()) { java.util.Iterator<String> nameIt = tableDataConfig.getTableDatas().keySet().iterator();
String name = nameIt.next(); while (nameIt.hasNext()) {
TableData td = TableDataConfig.getInstance().getTableData(name); String name = nameIt.next();
addName(name, td); addName(name, tableDataConfig.getTableData(name));
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return ArrayUtils.EMPTY_STRING_ARRAY;
} }
return getSortedNameArray(); return getSortedNameArray();
} }

2
designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java

@ -80,7 +80,7 @@ public class InformationWarnPane extends JPanel{
}); });
arrow.setBounds(90,100,30,30); arrow.setBounds(90,100,30,30);
UILabel more = new UILabel("<html><font color='blue'FACE='MicroSoft YaHei'>"+com.fr.design.i18n.Toolkit.i18nText("More-information")+"</font></html>"); UILabel more = new UILabel("<html><font color='blue'FACE='MicroSoft YaHei'>"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_More_Information")+"</font></html>");
more.setBounds(125,102,55,25); more.setBounds(125,102,55,25);
moreText = new UITextArea(moreInfo); moreText = new UITextArea(moreInfo);

25
designer-base/src/main/java/com/fr/design/dialog/JWizardDialog.java

@ -1,5 +1,14 @@
package com.fr.design.dialog; package com.fr.design.dialog;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Dialog; import java.awt.Dialog;
@ -10,16 +19,6 @@ import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JDialog;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory;
/** /**
* Wizard dialog. * Wizard dialog.
@ -104,13 +103,13 @@ public class JWizardDialog extends BasicDialog {
workArea.setLayout(cardLayout); workArea.setLayout(cardLayout);
// Buttons // Buttons
buttonBack = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Previous")); buttonBack = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Previous"));
buttonBack.addActionListener(new ActionListener() { buttonBack.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
back(); back();
} }
}); });
buttonNext = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Next")); buttonNext = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Next"));
buttonNext.addActionListener(new ActionListener() { buttonNext.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
next(); next();
@ -365,4 +364,4 @@ public class JWizardDialog extends BasicDialog {
@Override @Override
public void checkValid() throws Exception { public void checkValid() throws Exception {
} }
} }

4
designer-base/src/main/java/com/fr/design/editor/DoubleDeckValueEditorPane.java

@ -283,7 +283,7 @@ public class DoubleDeckValueEditorPane extends BasicPane implements UIObserver,
int i; int i;
boolean containFormulaType = false; boolean containFormulaType = false;
for (i = 0; i < cards.length; i++) { for (i = 0; i < cards.length; i++) {
if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter-Formula"))) { if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Formula"))) {
containFormulaType = true; containFormulaType = true;
break; break;
} }
@ -303,7 +303,7 @@ public class DoubleDeckValueEditorPane extends BasicPane implements UIObserver,
if (designerEnvManager.isSupportStringToFormula()) { if (designerEnvManager.isSupportStringToFormula()) {
if (!designerEnvManager.isDefaultStringToFormula()) { if (!designerEnvManager.isDefaultStringToFormula()) {
int returnValue = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit_String_To_Formula") int returnValue = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit_String_To_Formula")
+ "?", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.YES_NO_OPTION); + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.YES_NO_OPTION);
if (returnValue == JOptionPane.OK_OPTION) { if (returnValue == JOptionPane.OK_OPTION) {
setCurrentEditor(j); setCurrentEditor(j);

4
designer-base/src/main/java/com/fr/design/editor/ValueEditorPane.java

@ -264,7 +264,7 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName
int i; int i;
boolean containFormulaType = false; boolean containFormulaType = false;
for (i = 0; i < cards.length; i++) { for (i = 0; i < cards.length; i++) {
if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter-Formula"))) { if (ComparatorUtils.equals(cards[i].getName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Formula"))) {
containFormulaType = true; containFormulaType = true;
break; break;
} }
@ -284,7 +284,7 @@ public class ValueEditorPane extends BasicPane implements UIObserver, GlobalName
if (designerEnvManager.isSupportStringToFormula()) { if (designerEnvManager.isSupportStringToFormula()) {
if (!designerEnvManager.isDefaultStringToFormula()) { if (!designerEnvManager.isDefaultStringToFormula()) {
int returnValue = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit_String_To_Formula") int returnValue = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit_String_To_Formula")
+ "?", com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.YES_NO_OPTION); + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.YES_NO_OPTION);
if (returnValue == JOptionPane.OK_OPTION) { if (returnValue == JOptionPane.OK_OPTION) {
setCurrentEditor(j); setCurrentEditor(j);

2
designer-base/src/main/java/com/fr/design/editor/editor/BooleanEditor.java

@ -42,7 +42,7 @@ public class BooleanEditor extends Editor<Boolean> {
booleanCheckBox = new UICheckBox("true"); booleanCheckBox = new UICheckBox("true");
this.add(booleanCheckBox, BorderLayout.CENTER); this.add(booleanCheckBox, BorderLayout.CENTER);
this.setValue(value); this.setValue(value);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Parameter-Boolean")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Boolean"));
booleanCheckBox.addItemListener(new ItemListener() { booleanCheckBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {

2
designer-base/src/main/java/com/fr/design/editor/editor/ParameterEditor.java

@ -28,7 +28,7 @@ public class ParameterEditor extends Editor<Parameter> {
this.add(parameterCombobox, BorderLayout.CENTER); this.add(parameterCombobox, BorderLayout.CENTER);
this.setValue(parameter); this.setValue(parameter);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Parameter")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"));
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/editor/editor/TextEditor.java

@ -45,7 +45,7 @@ public class TextEditor extends Editor<String> {
this.textField.addKeyListener(textKeyListener); this.textField.addKeyListener(textKeyListener);
this.setValue(value); this.setValue(value);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Parameter-String")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_String"));
} }
public UITextField getTextField() { public UITextField getTextField() {

2
designer-base/src/main/java/com/fr/design/editor/editor/XMLANameEditor.java

@ -34,7 +34,7 @@ public class XMLANameEditor extends ColumnIndexEditor{
* @param columnNames 度量值 * @param columnNames 度量值
*/ */
public XMLANameEditor(String[] columnNames) { public XMLANameEditor(String[] columnNames) {
this(columnNames, com.fr.design.i18n.Toolkit.i18nText("Measure")); this(columnNames, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Measure"));
} }
/** /**

2
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -94,7 +94,7 @@ public class PluginOperateUtils {
public void run() { public void run() {
int rv = JOptionPane.showConfirmDialog( int rv = JOptionPane.showConfirmDialog(
null, null,
com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Delete_Confirmed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Confirmed"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.OK_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE JOptionPane.INFORMATION_MESSAGE

4
designer-base/src/main/java/com/fr/design/extra/PluginUtils.java

@ -139,7 +139,7 @@ public class PluginUtils {
String startVersion = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Start_Version"); String startVersion = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Start_Version");
String developer = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Developer"); String developer = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Developer");
String desc = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Function_Description"); String desc = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Function_Description");
String updateLog = com.fr.design.i18n.Toolkit.i18nText("FR-Plugin-Update_Log"); String updateLog = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Plugin_Update_Log");
Map<String, String> map = new HashMap<String, String>(); Map<String, String> map = new HashMap<String, String>();
map.put("name", pluginName); map.put("name", pluginName);
@ -246,7 +246,7 @@ public class PluginUtils {
int leftDays = plugin.getLeftDays(); int leftDays = plugin.getLeftDays();
if (leftDays == Integer.MAX_VALUE) { if (leftDays == Integer.MAX_VALUE) {
return com.fr.design.i18n.Toolkit.i18nText("FR-Plugin-Store_Permanent"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Store_Permanent");
} }
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

8
designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java

@ -53,7 +53,6 @@ public class PluginWebBridge {
private static final String PLUGIN_INFO = "pluginInfo"; private static final String PLUGIN_INFO = "pluginInfo";
private static final int COREPOOLSIZE = 3; private static final int COREPOOLSIZE = 3;
private static final int MAXPOOLSIZE = 5; private static final int MAXPOOLSIZE = 5;
private static final String I18N_PREFIX = "FR-";
private static PluginWebBridge helper; private static PluginWebBridge helper;
@ -571,13 +570,6 @@ public class PluginWebBridge {
//todo 初始化设计器其他部分 //todo 初始化设计器其他部分
} }
/**
* 国际化
*/
public String parseI18(final String key) {
return com.fr.design.i18n.Toolkit.i18nText(I18N_PREFIX + key);
}
/** /**
* 是否是在设计器中操作 * 是否是在设计器中操作
*/ */

3
designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java

@ -1,6 +1,7 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.base.TemplateUtils; import com.fr.base.TemplateUtils;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -30,6 +31,7 @@ import java.util.Map;
*/ */
public class PluginWebPane extends JFXPanel { public class PluginWebPane extends JFXPanel {
private static final String RESOURCE_URL = "resourceURL"; private static final String RESOURCE_URL = "resourceURL";
private static final String LANGUAGE = "language";
private WebEngine webEngine; private WebEngine webEngine;
public PluginWebPane(final String installHome, final String mainJs) { public PluginWebPane(final String installHome, final String mainJs) {
@ -75,6 +77,7 @@ public class PluginWebPane extends JFXPanel {
Map<String, Object> map4Tpl = new HashMap<String, Object>(); Map<String, Object> map4Tpl = new HashMap<String, Object>();
map4Tpl.put(RESOURCE_URL, "file:///" + URLEncoder.encode(installHome, "UTF-8")); map4Tpl.put(RESOURCE_URL, "file:///" + URLEncoder.encode(installHome, "UTF-8"));
map4Tpl.put(LANGUAGE, GeneralContext.getLocale().toString());
while ((line = read.readLine()) != null) { while ((line = read.readLine()) != null) {
if (sb.length() > 0) { if (sb.length() > 0) {
sb.append('\n'); sb.append('\n');

2
designer-base/src/main/java/com/fr/design/extra/QQLoginWebPane.java

@ -177,7 +177,7 @@ public class QQLoginWebPane extends JFXPanel {
dialog.close(); dialog.close();
} }
}).build(), }).build(),
ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Cancel")).cancelButton(true).onAction(new EventHandler<ActionEvent>() { ButtonBuilder.create().text(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Cancel")).cancelButton(true).onAction(new EventHandler<ActionEvent>() {
@Override @Override
public void handle(ActionEvent actionEvent) { public void handle(ActionEvent actionEvent) {
// abort action and close the dialog. // abort action and close the dialog.

2
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -282,7 +282,7 @@ public class WebViewDlgHelper {
if (get()) { if (get()) {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等 PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE);
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);

2
designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java

@ -22,7 +22,7 @@ public class ModifyStatusCallback implements PluginTaskCallback{
public void done(PluginTaskResult result) { public void done(PluginTaskResult result) {
if (result.isSuccess()) { if (result.isSuccess()) {
jsCallback.execute("success"); jsCallback.execute("success");
String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Has_Been_Disabled") : com.fr.design.i18n.Toolkit.i18nText("FR-Plugin_Has_Been_Actived"); String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate");
JOptionPane.showMessageDialog(null, modifyMessage); JOptionPane.showMessageDialog(null, modifyMessage);
} else { } else {
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);

4
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -937,11 +937,11 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"),
variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode()); variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("ParameterD-Report_Parameter"), rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ParameterD_Report_Parameter"),
BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"), BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"),
variableResolver.resolveReportParameterVariables()).createMutableTreeNode()); variableResolver.resolveReportParameterVariables()).createMutableTreeNode());
rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"), rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters"),
BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"),
variableResolver.resolveGlobalParameterVariables()).createMutableTreeNode()); variableResolver.resolveGlobalParameterVariables()).createMutableTreeNode());

2
designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java

@ -107,7 +107,7 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present");
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java

@ -34,7 +34,7 @@ public class ColumnRowVerticalPane extends ColumnRowPane {
JPanel rowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel rowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pane.add(rowPane); pane.add(rowPane);
rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Row") + ":")); rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") + ":"));
initRowSpinner(); initRowSpinner();
rowPane.add(rowSpinner); rowPane.add(rowSpinner);

212
designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java

@ -0,0 +1,212 @@
package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import javax.swing.DefaultListModel;
import javax.swing.SwingUtilities;
import java.awt.Component;
import java.util.Arrays;
import java.util.Comparator;
/**
* 存放一些通用的事件处理方法
* Created by plough on 2018/8/13.
*/
public class CommonShortCutHandlers {
ListControlPaneProvider listControlPane;
JNameEdList nameableList;
private CommonShortCutHandlers(ListControlPaneProvider listControlPane) {
this.listControlPane = listControlPane;
this.nameableList = listControlPane.getNameableList();
}
public static CommonShortCutHandlers newInstance(ListControlPaneProvider listControlPane) {
return new CommonShortCutHandlers(listControlPane);
}
public void onAddItem(NameableCreator creator) {
if (listControlPane.hasInvalid(true)) {
return;
}
Nameable nameable = creator.createNameable(listControlPane);
listControlPane.addNameable(nameable, listControlPane.getModel().getSize());
}
public void onRemoveItem() {
try {
nameableList.getCellEditor()
.stopCellEditing();
} catch (Exception ignored) {
}
if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities
.getWindowAncestor((Component) listControlPane), nameableList)) {
listControlPane.checkButtonEnabled();
}
}
public void onCopyItem() {
// p:选中的值.
ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue();
if (selectedValue == null) {
return;
}
listControlPane.getControlUpdatePane().update();
Nameable selectedNameable = selectedValue.wrapper;
// p: 用反射机制实现
try {
Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable);
newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName()));
listControlPane.addNameable(newNameable, listControlPane.getSelectedIndex() + 1);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
public void onMoveUpItem() {
int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
// 上移
if (selectedIndex > 0) {
DefaultListModel listModel = (DefaultListModel) nameableList.getModel();
Object selecteObj1 = listModel.get(selectedIndex - 1);
listModel.set(selectedIndex - 1, listModel.get(selectedIndex));
listModel.set(selectedIndex, selecteObj1);
nameableList.setSelectedIndex(selectedIndex - 1);
nameableList.ensureIndexIsVisible(selectedIndex - 1);
}
}
public void onMoveDownItem() {
int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
if (selectedIndex < nameableList.getModel().getSize() - 1) {
DefaultListModel listModel = (DefaultListModel) nameableList
.getModel();
Object selecteObj1 = listModel.get(selectedIndex + 1);
listModel.set(selectedIndex + 1, listModel.get(selectedIndex));
listModel.set(selectedIndex, selecteObj1);
nameableList.setSelectedIndex(selectedIndex + 1);
nameableList.ensureIndexIsVisible(selectedIndex + 1);
}
}
public void onSortItem(boolean isAtoZ) {
// p:选中的值.
Object selectedValue = nameableList.getSelectedValue();
DefaultListModel listModel = (DefaultListModel) nameableList
.getModel();
Nameable[] nameableArray = new Nameable[listModel.getSize()];
if (nameableArray.length <= 0) {
return;
}
for (int i = 0; i < listModel.getSize(); i++) {
nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper;
}
// p:排序.
if (isAtoZ) {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return -ComparatorUtils.compare(o1.getName(), o2
.getName());
}
};
isAtoZ = !isAtoZ;
Arrays.sort(nameableArray, nameableComparator);
} else {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return ComparatorUtils.compare(o1.getName(), o2
.getName());
}
};
isAtoZ = !isAtoZ;
Arrays.sort(nameableArray, nameableComparator);
}
for (int i = 0; i < nameableArray.length; i++) {
listModel.set(i, new ListModelElement(nameableArray[i]));
}
// p:需要选中以前的那个值.
if (selectedValue != null) {
nameableList.setSelectedValue(selectedValue, true);
}
listControlPane.checkButtonEnabled();
// p:需要repaint.
nameableList.repaint();
}
private String createUnrepeatedCopyName(String suffix) {
DefaultListModel model = listControlPane.getModel();
String[] names = new String[model.getSize()];
for (int i = 0; i < model.size(); i++) {
names[i] = ((ListModelElement) model.get(i)).wrapper.getName();
}
String lastName = "CopyOf" + suffix;
while (ArrayUtils.contains(names, lastName)) {
lastName = "CopyOf" + lastName;
}
return lastName;
}
/**
* 生成不重复的名字
*
* @param prefix 名字前缀
* @return 名字
*/
public String createUnrepeatedName(String prefix) {
DefaultListModel model = listControlPane.getModel();
Nameable[] all = new Nameable[model.getSize()];
for (int i = 0; i < model.size(); i++) {
all[i] = ((ListModelElement) model.get(i)).wrapper;
}
// richer:生成的名字从1开始. kunsnat: 添加属性从0开始.
int count = all.length + 1;
while (true) {
String name_test = prefix + count;
boolean repeated = false;
for (int i = 0, len = model.size(); i < len; i++) {
Nameable nameable = all[i];
if (ComparatorUtils.equals(nameable.getName(), name_test)) {
repeated = true;
break;
}
}
if (!repeated) {
return name_test;
}
count++;
}
}
}

115
designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java

@ -1,6 +1,8 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.controlpane.shortcutfactory.AbstractShortCutFactory;
import com.fr.design.gui.controlpane.shortcutfactory.OldShortCutFactory;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -17,24 +19,32 @@ import java.awt.*;
* Date: 2016/5/17 * Date: 2016/5/17
* Time: 15:07 * Time: 15:07
*/ */
public abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper { abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, ShortCutListenerProvider {
protected static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30 private static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30
protected JPanel controlUpdatePane; private static final String SELECT = "SELECT";
private static final String EDIT = "EDIT";
private ShortCut4JControlPane[] shorts; JPanel controlUpdatePane;
private NameableCreator[] creators;
ShortCut4JControlPane[] shorts;
NameableCreator[] creators;
private ToolBarDef toolbarDef; private ToolBarDef toolbarDef;
private UIToolbar toolBar; UIToolbar toolBar;
// peter:这是整体的一个cardLayout Pane // peter:这是整体的一个cardLayout Pane
protected CardLayout cardLayout; protected CardLayout cardLayout;
protected JPanel cardPane; protected JPanel cardPane;
protected AbstractShortCutFactory shortCutFactory;
public JControlPane() { JControlPane() {
this.initShortCutFactory();
this.initComponentPane(); this.initComponentPane();
} }
protected void initShortCutFactory() {
this.shortCutFactory = OldShortCutFactory.newInstance(this);
}
/** /**
* 生成添加按钮的NameableCreator * 生成添加按钮的NameableCreator
* *
@ -46,10 +56,6 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe
return shorts; return shorts;
} }
public void setShorts(ShortCut4JControlPane[] shorts) {
this.shorts = shorts;
}
public void setCreators(NameableCreator[] creators) { public void setCreators(NameableCreator[] creators) {
this.creators = creators; this.creators = creators;
} }
@ -89,6 +95,18 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe
protected void initComponentPane() { protected void initComponentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.creators = this.createNameableCreators(); this.creators = this.createNameableCreators();
initCardPane();
// SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER);
mainSplitPane.setDividerLocation(getLeftPreferredSize());
this.checkButtonEnabled();
}
protected void initCardPane() {
this.controlUpdatePane = createControlUpdatePane(); this.controlUpdatePane = createControlUpdatePane();
// p: edit card layout // p: edit card layout
@ -97,20 +115,29 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe
cardPane.setLayout(this.cardLayout); cardPane.setLayout(this.cardLayout);
// p:选择的Label // p:选择的Label
UILabel selectLabel = new UILabel(); UILabel selectLabel = new UILabel();
cardPane.add(selectLabel, "SELECT"); cardPane.add(selectLabel, SELECT);
cardPane.add(controlUpdatePane, "EDIT"); cardPane.add(controlUpdatePane, EDIT);
// SplitPane }
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane);
mainSplitPane.setBorder(BorderFactory.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER); public void showEditPane() {
mainSplitPane.setDividerLocation(getLeftPreferredSize()); this.cardLayout.show(cardPane, EDIT);
this.checkButtonEnabled(); }
public void showSelectPane() {
this.cardLayout.show(cardPane, SELECT);
} }
protected abstract JPanel createControlUpdatePane(); protected abstract JPanel createControlUpdatePane();
protected void initToolBar() {
toolbarDef = new ToolBarDef();
for (ShortCut4JControlPane sj : shorts) {
toolbarDef.addShortCut(sj.getShortCut());
}
toolBar = ToolBarDef.createJToolBar();
toolbarDef.updateToolBar(toolBar);
}
protected JPanel getLeftPane() { protected JPanel getLeftPane() {
// LeftPane // LeftPane
JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -122,12 +149,8 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe
return leftPane; return leftPane;
} }
toolbarDef = new ToolBarDef(); initToolBar();
for (ShortCut4JControlPane sj : shorts) {
toolbarDef.addShortCut(sj.getShortCut());
}
toolBar = ToolBarDef.createJToolBar();
toolbarDef.updateToolBar(toolBar);
leftPane.add(toolBar, BorderLayout.NORTH); leftPane.add(toolBar, BorderLayout.NORTH);
return leftPane; return leftPane;
} }
@ -143,30 +166,10 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe
return shorts.length * SHORT_WIDTH; return shorts.length * SHORT_WIDTH;
} }
protected ShortCut4JControlPane[] createShortcuts() { protected ShortCut4JControlPane[] createShortcuts() {
return new ShortCut4JControlPane[]{ return shortCutFactory.createShortCuts();
addItemShortCut(),
removeItemShortCut(),
copyItemShortCut(),
moveUpItemShortCut(),
moveDownItemShortCut(),
sortItemShortCut()
};
} }
protected abstract ShortCut4JControlPane addItemShortCut();
protected abstract ShortCut4JControlPane removeItemShortCut();
protected abstract ShortCut4JControlPane copyItemShortCut();
protected abstract ShortCut4JControlPane moveUpItemShortCut();
protected abstract ShortCut4JControlPane moveDownItemShortCut();
protected abstract ShortCut4JControlPane sortItemShortCut();
public abstract Nameable[] update(); public abstract Nameable[] update();
@ -179,23 +182,15 @@ public abstract class JControlPane extends BasicPane implements UnrepeatedNameHe
public void checkButtonEnabled() { public void checkButtonEnabled() {
} }
protected void doBeforeRemove() {
}
protected void doAfterRemove() {
}
public NameableCreator[] creators() { public NameableCreator[] creators() {
return creators == null ? new NameableCreator[0] : creators; return creators == null ? new NameableCreator[0] : creators;
} }
protected abstract boolean hasInvalid(boolean isAdd);
/** /**
* 刷新 NameableCreator * 刷新 NameableCreator
* *
* @param creators 生成器 * @param creators 生成器
*/ */
public void refreshNameableCreator(NameableCreator[] creators) { public void refreshNameableCreator(NameableCreator[] creators) {
this.creators = creators; this.creators = creators;
shorts = this.createShortcuts(); shorts = this.createShortcuts();

112
designer-base/src/main/java/com/fr/design/gui/controlpane/JControlUpdatePane.java

@ -0,0 +1,112 @@
package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.ComparatorUtils;
import javax.swing.JPanel;
import java.awt.CardLayout;
/**
* Created by plough on 2018/8/13.
*/
class JControlUpdatePane extends JPanel {
private ListControlPaneProvider listControlPane;
private CardLayout card;
private JPanel cardPane;
private BasicBeanPane[] updatePanes;
private ListModelElement elEditing;
private JControlUpdatePane(ListControlPaneProvider listControlPane) {
this.listControlPane = listControlPane;
initUpdatePane();
}
public static JControlUpdatePane newInstance(ListControlPaneProvider listControlPane) {
return new JControlUpdatePane(listControlPane);
}
private void initUpdatePane() {
NameableCreator[] creators = listControlPane.creators();
if (creators == null) {
return;
}
card = new CardLayout();
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
cardPane.setLayout(card);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(cardPane);
int len = creators.length;
updatePanes = new BasicBeanPane[len];
}
public BasicBeanPane[] getUpdatePanes() {
return updatePanes;
}
public void populate() {
ListModelElement el = listControlPane.getSelectedValue();
if (el == null) {
return;
}
elEditing = el;
NameableCreator[] creators = listControlPane.creators();
for (int i = 0, len = updatePanes.length; i < len; i++) {
Object ob2Populate = creators[i].acceptObject2Populate(el.wrapper);
if (ob2Populate != null) {
if (updatePanes[i] == null) {
if (isMulti(creators[i].getUpdatePane()) || isTree(creators[i].getUpdatePane())) {
updatePanes[i] = listControlPane.createPaneByCreators(creators[i], el.wrapper.getName());
} else {
updatePanes[i] = listControlPane.createPaneByCreators(creators[i]);
}
cardPane.add(updatePanes[i], String.valueOf(i));
}
card.show(cardPane, String.valueOf(i));
updatePanes[i].populateBean(ob2Populate);
break;
}
}
}
public boolean isMulti(Class _class) {
return ComparatorUtils.equals(_class, GlobalMultiTDTableDataPane.class) || ComparatorUtils.equals(_class, MultiTDTableDataPane.class);
}
public boolean isTree(Class _class) {
return ComparatorUtils.equals(_class, GlobalTreeTableDataPane.class) || ComparatorUtils.equals(_class, TreeTableDataPane.class);
}
public void update() {
NameableCreator[] creators = listControlPane.creators();
for (int i = 0; i < updatePanes.length; i++) {
BasicBeanPane pane = updatePanes[i];
if (pane != null && pane.isVisible()) {
Object bean = pane.updateBean();
if (i < creators.length) {
creators[i].saveUpdatedBean(elEditing, bean);
}
}
}
}
public void checkValid() throws Exception {
if (updatePanes != null) {
for (int i = 0; i < updatePanes.length; i++) {
if (updatePanes[i] != null) {
updatePanes[i].checkValid();
}
}
}
}
}

634
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -1,22 +1,10 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane;
import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane;
import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener; import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
@ -25,24 +13,30 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*; import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.Component;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.util.Arrays;
import java.util.Comparator;
public abstract class JListControlPane extends JControlPane { public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider {
public static final String LIST_NAME = "JControl_List"; private static final String LIST_NAME = "JControl_List";
protected JNameEdList nameableList; protected JNameEdList nameableList;
protected int editingIndex; protected int editingIndex;
protected String selectedName; protected String selectedName;
private boolean isNameRepeated = false; private boolean isNameRepeated = false;
private CommonShortCutHandlers commonHandlers;
private ListControlPaneHelper helper;
public JListControlPane() { public JListControlPane() {
this.initComponentPane(); this.initComponentPane();
@ -50,7 +44,21 @@ public abstract class JListControlPane extends JControlPane {
@Override @Override
protected JPanel createControlUpdatePane() { protected JPanel createControlUpdatePane() {
return new JControlUpdatePane(); return JControlUpdatePane.newInstance(this);
}
private ListControlPaneHelper getHelper() {
if (helper == null) {
helper = ListControlPaneHelper.newInstance(this);
}
return helper;
}
private CommonShortCutHandlers getCommonHandlers() {
if (commonHandlers == null) {
commonHandlers = CommonShortCutHandlers.newInstance(this);
}
return commonHandlers;
} }
/** /**
@ -68,7 +76,6 @@ public abstract class JListControlPane extends JControlPane {
nameableList.setName(LIST_NAME); nameableList.setName(LIST_NAME);
leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER); leftPane.add(new UIScrollPane(nameableList), BorderLayout.CENTER);
nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameableList.addMouseListener(listMouseListener); nameableList.addMouseListener(listMouseListener);
nameableList.addListSelectionListener(new ListSelectionListener() { nameableList.addListSelectionListener(new ListSelectionListener() {
@ -87,7 +94,7 @@ public abstract class JListControlPane extends JControlPane {
}); });
} }
public JNameEdList createJNameList() { protected JNameEdList createJNameList() {
JNameEdList nameEdList = new JNameEdList(new DefaultListModel()) { JNameEdList nameEdList = new JNameEdList(new DefaultListModel()) {
@Override @Override
protected void doAfterLostFocus() { protected void doAfterLostFocus() {
@ -98,69 +105,13 @@ public abstract class JListControlPane extends JControlPane {
return nameEdList; return nameEdList;
} }
public void updateControlUpdatePane() { private void updateControlUpdatePane() {
((JControlUpdatePane) controlUpdatePane).update(); ((JControlUpdatePane) controlUpdatePane).update();
} }
protected void doWhenPopulate(BasicBeanPane beanPane) {
}
protected void doBeforePopulate(ListModelElement el, Object obj) {
}
@Override
protected ShortCut4JControlPane addItemShortCut() {
ShortCut addItemShortCut;
NameableCreator[] creators = creators();
if (creators.length == 1) {
addItemShortCut = new AddItemUpdateAction(creators);
} else {
addItemShortCut = new AddItemMenuDef(creators);
}
return new AbsoluteEnableShortCut(addItemShortCut);
}
@Override
protected ShortCut4JControlPane removeItemShortCut() {
return new NormalEnableShortCut(new RemoveItemAction());
}
@Override
protected ShortCut4JControlPane copyItemShortCut() {
return new NormalEnableShortCut(new CopyItemAction());
}
@Override
protected ShortCut4JControlPane moveUpItemShortCut() {
return new NormalEnableShortCut(new MoveUpItemAction());
}
@Override
protected ShortCut4JControlPane moveDownItemShortCut() {
return new NormalEnableShortCut(new MoveDownItemAction());
}
@Override
protected ShortCut4JControlPane sortItemShortCut() {
return new NormalEnableShortCut(new SortItemAction());
}
public void setNameListEditable(boolean editable) {
this.nameableList.setEditable(editable);
}
@Override @Override
public Nameable[] update() { public Nameable[] update() {
java.util.List<Nameable> res = new java.util.ArrayList<Nameable>(); return getHelper().update();
((JControlUpdatePane) this.controlUpdatePane).update();
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel();
for (int i = 0, len = listModel.getSize(); i < len; i++) {
res.add(((ListModelElement) listModel.getElementAt(i)).wrapper);
}
return res.toArray(new Nameable[res.size()]);
} }
@Override @Override
@ -186,7 +137,7 @@ public abstract class JListControlPane extends JControlPane {
* *
* @param l 名字改变时的监听 * @param l 名字改变时的监听
*/ */
public void addModNameActionListener(ModNameActionListener l) { protected void addModNameActionListener(ModNameActionListener l) {
this.nameableList.addModNameActionListener(l); this.nameableList.addModNameActionListener(l);
} }
@ -195,7 +146,7 @@ public abstract class JListControlPane extends JControlPane {
* *
* @param l 监听 * @param l 监听
*/ */
public void addEditingListener(PropertyChangeAdapter l) { protected void addEditingListener(PropertyChangeAdapter l) {
this.nameableList.addEditingListner(l); this.nameableList.addEditingListner(l);
} }
@ -236,9 +187,7 @@ public abstract class JListControlPane extends JControlPane {
* 获取选中的名字 * 获取选中的名字
*/ */
public String getSelectedName() { public String getSelectedName() {
ListModelElement el = (ListModelElement) this.nameableList.getSelectedValue(); return getHelper().getSelectedName();
return el == null ? null : el.wrapper.getName();
} }
protected boolean isNameRepeated(java.util.List[] list, String name) { protected boolean isNameRepeated(java.util.List[] list, String name) {
@ -268,15 +217,7 @@ public abstract class JListControlPane extends JControlPane {
* @param index 序号 * @param index 序号
*/ */
public void addNameable(Nameable nameable, int index) { public void addNameable(Nameable nameable, int index) {
JNameEdList nameEdList = JListControlPane.this.nameableList; getHelper().addNameable(nameable, index);
DefaultListModel model = (DefaultListModel) nameEdList.getModel();
ListModelElement el = new ListModelElement(nameable);
model.add(index, el);
nameableList.setSelectedIndex(index);
nameableList.ensureIndexIsVisible(index);
nameEdList.repaint();
} }
/** /**
@ -295,314 +236,54 @@ public abstract class JListControlPane extends JControlPane {
return false; return false;
} }
protected DefaultListModel getModel() { public DefaultListModel getModel() {
return (DefaultListModel) JListControlPane.this.nameableList.getModel(); return (DefaultListModel) JListControlPane.this.nameableList.getModel();
} }
private String createUnrepeatedCopyName(String suffix) {
DefaultListModel model = this.getModel();
String[] names = new String[model.getSize()];
for (int i = 0; i < model.size(); i++) {
names[i] = ((ListModelElement) model.get(i)).wrapper.getName();
}
String lastName = "CopyOf" + suffix;
while (ArrayUtils.contains(names, lastName)) {
lastName = "CopyOf" + lastName;
}
return lastName;
}
/** /**
* 生成不重复的名字 * 生成不重复的名字
* *
* @param prefix 名字前缀 * @param prefix 名字前缀
* @return 名字 * @return 名字
*/ */
@Override @Override
public String createUnrepeatedName(String prefix) { public String createUnrepeatedName(String prefix) {
DefaultListModel model = this.getModel(); return getCommonHandlers().createUnrepeatedName(prefix);
Nameable[] all = new Nameable[model.getSize()];
for (int i = 0; i < model.size(); i++) {
all[i] = ((ListModelElement) model.get(i)).wrapper;
}
// richer:生成的名字从1开始. kunsnat: 添加属性从0开始.
int count = all.length + 1;
while (true) {
String name_test = prefix + count;
boolean repeated = false;
for (int i = 0, len = model.size(); i < len; i++) {
Nameable nameable = all[i];
if (ComparatorUtils.equals(nameable.getName(), name_test)) {
repeated = true;
break;
}
}
if (!repeated) {
return name_test;
}
count++;
}
} }
/** @Override
* 增加项的UpdateAction public void onAddItem(NameableCreator creator) {
*/ getCommonHandlers().onAddItem(creator);
protected class AddItemUpdateAction extends UpdateAction {
final NameableCreator creator;
public AddItemUpdateAction(NameableCreator[] creators) {
this.creator = creators[0];
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add"));
this.setMnemonic('A');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
Nameable nameable = creator.createNameable(JListControlPane.this);
JListControlPane.this.addNameable(nameable, getModel().getSize());
}
} }
/* @Override
* 增加项的MenuDef public void onRemoveItem() {
*/ getCommonHandlers().onRemoveItem();
protected class AddItemMenuDef extends MenuDef {
public AddItemMenuDef(NameableCreator[] creators) {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add"));
this.setMnemonic('A');
this.setIconPath("/com/fr/design/images/control/addPopup.png");
wrapActionListener(creators);
}
private void wrapActionListener(NameableCreator[] creators) {
for (final NameableCreator creator : creators) {
if (filterNameableCreator(creator)) {
continue;
}
boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Stored_Procedure")) ||
ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Multi_Dimensional_Database"));
if (isTrue) {
this.addShortCut(new LineSeparator());
}
this.addShortCut(new UpdateAction() {
{
this.setName(creator.menuName());
Icon icon = creator.menuIcon();
if (icon != null) {
this.setSmallIcon(icon);
}
}
@Override
public void actionPerformed(ActionEvent e) {
if (hasInvalid(true)) {
return;
}
Nameable nameable = creator.createNameable(JListControlPane.this);
JListControlPane.this.addNameable(nameable, getModel().getSize());
}
});
}
}
} }
/* @Override
* 移除item public void onCopyItem() {
*/ getCommonHandlers().onCopyItem();
private class RemoveItemAction extends UpdateAction {
public RemoveItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove"));
this.setMnemonic('R');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/base/images/cell/control/remove.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
try {
JListControlPane.this.nameableList.getCellEditor()
.stopCellEditing();
} catch (Exception ignored) {
}
// bug:在选中一个NameObject并删除,会遗留下Name.
doBeforeRemove();
if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities
.getWindowAncestor(JListControlPane.this), nameableList)) {
checkButtonEnabled();
doAfterRemove();
}
}
} }
/* @Override
* CopyItem public void onMoveUpItem() {
*/ getCommonHandlers().onMoveUpItem();
private class CopyItemAction extends UpdateAction {
public CopyItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Copy"));
this.setMnemonic('C');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/m_edit/copy.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
// p:选中的值.
ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue();
if (selectedValue == null) {
return;
}
((JControlUpdatePane) controlUpdatePane).update();
Nameable selectedNameable = selectedValue.wrapper;
// p: 用反射机制实现
try {
Nameable newNameable = (Nameable) BaseUtils.cloneObject(selectedNameable);
newNameable.setName(createUnrepeatedCopyName(selectedNameable.getName()));
JListControlPane.this.addNameable(newNameable, nameableList.getSelectedIndex() + 1);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
} }
/* @Override
* 上移Item public void onMoveDownItem() {
*/ getCommonHandlers().onMoveDownItem();
private class MoveUpItemAction extends UpdateAction {
public MoveUpItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
this.setMnemonic('U');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/up.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
// 上移
if (selectedIndex > 0) {
DefaultListModel listModel = (DefaultListModel) nameableList
.getModel();
Object selecteObj1 = listModel.get(selectedIndex - 1);
listModel.set(selectedIndex - 1, listModel.get(selectedIndex));
listModel.set(selectedIndex, selecteObj1);
nameableList.setSelectedIndex(selectedIndex - 1);
nameableList.ensureIndexIsVisible(selectedIndex - 1);
}
}
} }
/* @Override
* 下移Item public void onSortItem(boolean isAtoZ) {
*/ getCommonHandlers().onSortItem(isAtoZ);
private class MoveDownItemAction extends UpdateAction {
public MoveDownItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
this.setMnemonic('D');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/down.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
if (selectedIndex < nameableList.getModel().getSize() - 1) {
DefaultListModel listModel = (DefaultListModel) nameableList
.getModel();
Object selecteObj1 = listModel.get(selectedIndex + 1);
listModel.set(selectedIndex + 1, listModel.get(selectedIndex));
listModel.set(selectedIndex, selecteObj1);
nameableList.setSelectedIndex(selectedIndex + 1);
nameableList.ensureIndexIsVisible(selectedIndex + 1);
}
}
} }
private class SortItemAction extends UpdateAction { @Override
private boolean isAtoZ = false; public boolean isItemSelected() {
return getModel().getSize() > 0 && nameableList.getSelectedIndex() != -1;
public SortItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort"));
this.setMnemonic('S');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/sortAsc.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
// p:选中的值.
Object selectedValue = nameableList.getSelectedValue();
DefaultListModel listModel = (DefaultListModel) nameableList
.getModel();
Nameable[] nameableArray = new Nameable[listModel.getSize()];
if (nameableArray.length <= 0) {
return;
}
for (int i = 0; i < listModel.getSize(); i++) {
nameableArray[i] = ((ListModelElement) listModel.getElementAt(i)).wrapper;
}
// p:排序.
if (isAtoZ) {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return -ComparatorUtils.compare(o1.getName(), o2
.getName());
}
};
isAtoZ = !isAtoZ;
Arrays.sort(nameableArray, nameableComparator);
} else {
Comparator<Nameable> nameableComparator = new Comparator<Nameable>() {
@Override
public int compare(Nameable o1, Nameable o2) {
return ComparatorUtils.compare(o1.getName(), o2
.getName());
}
};
isAtoZ = !isAtoZ;
Arrays.sort(nameableArray, nameableComparator);
}
for (int i = 0; i < nameableArray.length; i++) {
listModel.set(i, new ListModelElement(nameableArray[i]));
}
// p:需要选中以前的那个值.
if (selectedValue != null) {
nameableList.setSelectedValue(selectedValue, true);
}
checkButtonEnabled();
// p:需要repaint.
nameableList.repaint();
}
} }
/* /*
@ -649,16 +330,7 @@ public abstract class JListControlPane extends JControlPane {
*/ */
@Override @Override
public void checkButtonEnabled() { public void checkButtonEnabled() {
getHelper().checkButtonEnabled();
int selectedIndex = nameableList.getSelectedIndex();
if (selectedIndex == -1) {
this.cardLayout.show(cardPane, "SELECT");
} else {
this.cardLayout.show(cardPane, "EDIT");
}
for (ShortCut4JControlPane sj : getShorts()) {
sj.checkEnable();
}
} }
private class NameableListCellRenderer extends private class NameableListCellRenderer extends
@ -690,129 +362,13 @@ public abstract class JListControlPane extends JControlPane {
} }
} }
public class AbsoluteEnableShortCut extends ShortCut4JControlPane { @Override
public AbsoluteEnableShortCut(ShortCut shortCut) { public BasicBeanPane createPaneByCreators(NameableCreator creator) {
this.shortCut = shortCut;
}
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(true);
}
}
public class NormalEnableShortCut extends ShortCut4JControlPane {
public NormalEnableShortCut(ShortCut shortCut) {
this.shortCut = shortCut;
}
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(getModel()
.getSize() > 0
&& JListControlPane.this.nameableList.getSelectedIndex() != -1);
}
}
private class JControlUpdatePane extends JPanel {
private CardLayout card;
private JPanel cardPane;
private BasicBeanPane[] updatePanes;
private ListModelElement elEditing;
public JControlUpdatePane() {
initUpdatePane();
}
private void initUpdatePane() {
NameableCreator[] creators = creators();
if (creators == null) {
return;
}
card = new CardLayout();
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
cardPane.setLayout(card);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(cardPane);
int len = creators.length;
updatePanes = new BasicBeanPane[len];
}
public void populate() {
ListModelElement el = (ListModelElement) JListControlPane.this.nameableList.getSelectedValue();
if (el == null) {
return;
}
elEditing = el;
NameableCreator[] creators = creators();
for (int i = 0, len = updatePanes.length; i < len; i++) {
Object ob2Populate = creators[i].acceptObject2Populate(el.wrapper);
if (ob2Populate != null) {
if (updatePanes[i] == null) {
if (isMulti(creators[i].getUpdatePane()) || isTree(creators[i].getUpdatePane())) {
updatePanes[i] = createPaneByCreators(creators[i], el.wrapper.getName());
} else {
updatePanes[i] = createPaneByCreators(creators[i]);
}
cardPane.add(updatePanes[i], String.valueOf(i));
}
card.show(cardPane, String.valueOf(i));
doBeforePopulate(el, ob2Populate);
updatePanes[i].populateBean(ob2Populate);
doWhenPopulate(updatePanes[i]);
break;
}
}
}
public boolean isMulti(Class _class) {
return ComparatorUtils.equals(_class, GlobalMultiTDTableDataPane.class) || ComparatorUtils.equals(_class, MultiTDTableDataPane.class);
}
public boolean isTree(Class _class) {
return ComparatorUtils.equals(_class, GlobalTreeTableDataPane.class) || ComparatorUtils.equals(_class, TreeTableDataPane.class);
}
public void update() {
NameableCreator[] creators = creators();
for (int i = 0; i < updatePanes.length; i++) {
BasicBeanPane pane = updatePanes[i];
if (pane != null && pane.isVisible()) {
Object bean = pane.updateBean();
if (i < creators.length) {
creators[i].saveUpdatedBean(elEditing, bean);
}
}
}
}
public void checkValid() throws Exception {
if (updatePanes != null) {
for (int i = 0; i < updatePanes.length; i++) {
if (updatePanes[i] != null) {
updatePanes[i].checkValid();
}
}
}
}
}
protected BasicBeanPane createPaneByCreators(NameableCreator creator) {
return Reflect.on(creator.getUpdatePane()).create().get(); return Reflect.on(creator.getUpdatePane()).create().get();
} }
private BasicBeanPane createPaneByCreators(NameableCreator creator, String string) { @Override
public BasicBeanPane createPaneByCreators(NameableCreator creator, String string) {
return Reflect.on(creator.getUpdatePane()).create(string).get(); return Reflect.on(creator.getUpdatePane()).create(string).get();
} }
@ -826,35 +382,9 @@ public abstract class JListControlPane extends JControlPane {
((JControlUpdatePane) this.controlUpdatePane).checkValid(); ((JControlUpdatePane) this.controlUpdatePane).checkValid();
} }
private int getInValidIndex() {
BasicBeanPane[] p = ((JControlUpdatePane) controlUpdatePane).updatePanes;
if (p != null) {
for (int i = 0; i < p.length; i++) {
if (p[i] != null) {
try {
p[i].checkValid();
} catch (Exception e) {
return i;
}
}
}
}
return -1;
}
@Override @Override
protected boolean hasInvalid(boolean isAdd) { public boolean hasInvalid(boolean isAdd) {
int idx = JListControlPane.this.getInValidIndex(); return getHelper().hasInvalid(isAdd);
if (isAdd || nameableList.getSelectedIndex() != idx) {
try {
checkValid();
} catch (Exception exp) {
JOptionPane.showMessageDialog(JListControlPane.this, exp.getMessage());
nameableList.setSelectedIndex(idx);
return true;
}
}
return false;
} }
/** /**
@ -862,16 +392,28 @@ public abstract class JListControlPane extends JControlPane {
* *
* @param index 选中项的序列号 * @param index 选中项的序列号
*/ */
@Override
public void setSelectedIndex(int index) { public void setSelectedIndex(int index) {
nameableList.setSelectedIndex(index); nameableList.setSelectedIndex(index);
} }
@Override
public int getSelectedIndex() {
return nameableList.getSelectedIndex();
}
/** @Override
* 用于在list面板中过滤某些下拉选项 public JNameEdList getNameableList() {
* @return true过滤掉这个creator return nameableList;
*/ }
protected boolean filterNameableCreator(NameableCreator creator) {
return !HyperlinkFilterHelper.whetherAddHyperlink4cell(creator.menuName()); @Override
public ListModelElement getSelectedValue() {
return (ListModelElement) this.nameableList.getSelectedValue();
}
@Override
public JControlUpdatePane getControlUpdatePane() {
return (JControlUpdatePane) controlUpdatePane;
} }
} }

112
designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java

@ -0,0 +1,112 @@
package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import java.awt.Component;
/**
* 存放一些公用的方法
* Created by plough on 2018/8/13.
*/
class ListControlPaneHelper {
private ListControlPaneProvider listControlPane;
private ListControlPaneHelper(ListControlPaneProvider listControlPane) {
this.listControlPane = listControlPane;
}
public static ListControlPaneHelper newInstance(ListControlPaneProvider listControlPane) {
return new ListControlPaneHelper(listControlPane);
}
public boolean hasInvalid(boolean isAdd) {
int idx = getInValidIndex();
if (isAdd || listControlPane.getSelectedIndex() != idx) {
try {
listControlPane.checkValid();
} catch (Exception exp) {
JOptionPane.showMessageDialog((Component) listControlPane, exp.getMessage());
listControlPane.setSelectedIndex(idx);
return true;
}
}
return false;
}
private int getInValidIndex() {
BasicBeanPane[] p = listControlPane.getControlUpdatePane().getUpdatePanes();
if (p != null) {
for (int i = 0; i < p.length; i++) {
if (p[i] != null) {
try {
p[i].checkValid();
} catch (Exception e) {
return i;
}
}
}
}
return -1;
}
public Nameable[] update() {
java.util.List<Nameable> res = new java.util.ArrayList<Nameable>();
listControlPane.getControlUpdatePane().update();
DefaultListModel listModel = listControlPane.getModel();
for (int i = 0, len = listModel.getSize(); i < len; i++) {
res.add(((ListModelElement) listModel.getElementAt(i)).wrapper);
}
return res.toArray(new Nameable[res.size()]);
}
/**
* 获取选中的名字
*/
public String getSelectedName() {
ListModelElement el = listControlPane.getSelectedValue();
return el == null ? StringUtils.EMPTY : el.wrapper.getName();
}
/**
* 添加 Nameable
*
* @param nameable 添加的Nameable
* @param index 序号
*/
public void addNameable(Nameable nameable, int index) {
JNameEdList nameableList = listControlPane.getNameableList();
DefaultListModel model = listControlPane.getModel();
ListModelElement el = new ListModelElement(nameable);
model.add(index, el);
nameableList.setSelectedIndex(index);
nameableList.ensureIndexIsVisible(index);
nameableList.repaint();
}
/**
* 检查按钮可用状态 Check button enabled.
*/
public void checkButtonEnabled() {
int selectedIndex = listControlPane.getSelectedIndex();
if (selectedIndex == -1) {
listControlPane.showSelectPane();
} else {
listControlPane.showEditPane();
}
for (ShortCut4JControlPane sj : listControlPane.getShorts()) {
sj.checkEnable();
}
}
}

35
designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneProvider.java

@ -0,0 +1,35 @@
package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.stable.Nameable;
import javax.swing.DefaultListModel;
/**
* Created by plough on 2018/8/13.
*/
public interface ListControlPaneProvider extends UnrepeatedNameHelper {
NameableCreator[] creators();
BasicBeanPane createPaneByCreators(NameableCreator creator);
BasicBeanPane createPaneByCreators(NameableCreator creator, String string);
DefaultListModel getModel();
boolean hasInvalid(boolean isAdd);
void addNameable(Nameable nameable, int index);
JNameEdList getNameableList();
int getSelectedIndex();
void setSelectedIndex(int idx);
ListModelElement getSelectedValue();
void checkButtonEnabled();
JControlUpdatePane getControlUpdatePane();
// BasicBeanPane[] getUpdatePanes();
/**
* 检查是否符合规范
* @throws Exception
*/
void checkValid() throws Exception;
void showSelectPane();
void showEditPane();
ShortCut4JControlPane[] getShorts();
}

2
designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java

@ -22,7 +22,7 @@ public abstract class ObjectJControlPane extends JListControlPane {
} }
@Override @Override
protected BasicBeanPane createPaneByCreators(NameableCreator creator) { public BasicBeanPane createPaneByCreators(NameableCreator creator) {
try { try {
return Reflect.on(creator.getUpdatePane()).create(object).get(); return Reflect.on(creator.getUpdatePane()).create(object).get();
} catch (Exception e) { } catch (Exception e) {

6
designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectUIControlPane.java

@ -10,17 +10,13 @@ import com.fr.design.beans.BasicBeanPane;
public abstract class ObjectUIControlPane extends UIListControlPane { public abstract class ObjectUIControlPane extends UIListControlPane {
private Object object; private Object object;
public ObjectUIControlPane() {
this(null);
}
public ObjectUIControlPane(Object object) { public ObjectUIControlPane(Object object) {
super(); super();
this.object = object; this.object = object;
} }
@Override @Override
protected BasicBeanPane createPaneByCreators(NameableCreator creator) { public BasicBeanPane createPaneByCreators(NameableCreator creator) {
try { try {
if (object == null) { if (object == null) {
return super.createPaneByCreators(creator); return super.createPaneByCreators(creator);

15
designer-base/src/main/java/com/fr/design/gui/controlpane/ShortCutListenerProvider.java

@ -0,0 +1,15 @@
package com.fr.design.gui.controlpane;
/**
* Created by plough on 2018/8/12.
*/
public interface ShortCutListenerProvider {
void onAddItem(NameableCreator creator);
void onRemoveItem();
void onCopyItem();
void onMoveUpItem();
void onMoveDownItem();
void onSortItem(boolean isAtoZ);
boolean isItemSelected();
NameableCreator[] creators();
}

203
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -2,7 +2,7 @@ package com.fr.design.gui.controlpane;
import com.fr.base.chart.BasePlot; import com.fr.base.chart.BasePlot;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
@ -11,10 +11,8 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -25,7 +23,6 @@ import javax.swing.JPanel;
import javax.swing.JSplitPane; import javax.swing.JSplitPane;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Cursor; import java.awt.Cursor;
@ -49,85 +46,30 @@ import java.awt.event.WindowEvent;
/** /**
* Created by plough on 2017/7/21. * Created by plough on 2017/7/21.
*/ */
public abstract class UIControlPane extends BasicPane implements UnrepeatedNameHelper { abstract class UIControlPane extends JControlPane {
protected static final int SHORT_WIDTH = 30; //每加一个short Divider位置加30
protected JPanel controlUpdatePane;
private ShortCut4JControlPane[] shorts;
private NameableCreator[] creators;
private ToolBarDef toolbarDef;
private UIToolbar toolBar;
private UIToolbar topToolBar; private UIToolbar topToolBar;
protected Window popupEditDialog; protected Window popupEditDialog;
// peter:这是整体的一个cardLayout Pane
protected CardLayout cardLayout;
protected JPanel cardPane;
protected BasePlot plot; protected BasePlot plot;
private static final int TOP_TOOLBAR_HEIGHT = 20; private static final int TOP_TOOLBAR_HEIGHT = 20;
private static final int TOP_TOOLBAR_WIDTH = 156; // 可能因为用了tablelayout,要比其他地方多一个像素,看起来才正常 private static final int TOP_TOOLBAR_WIDTH = 156; // 可能因为用了tablelayout,要比其他地方多一个像素,看起来才正常
private static final int TOP_TOOLBAR_WIDTH_SHORT = 76; private static final int TOP_TOOLBAR_WIDTH_SHORT = 76;
public UIControlPane() { UIControlPane() {
this.initComponentPane(); super();
} }
public UIControlPane(BasePlot plot) { UIControlPane(BasePlot plot) {
super();
this.plot = plot; this.plot = plot;
this.initComponentPane();
} }
/** public abstract void saveSettings();
* 生成添加按钮的NameableCreator
*
* @return 按钮的NameableCreator
*/
public abstract NameableCreator[] createNameableCreators();
public ShortCut4JControlPane[] getShorts() {
return shorts;
}
public void setShorts(ShortCut4JControlPane[] shorts) {
this.shorts = shorts;
}
public void setCreators(NameableCreator[] creators) {
this.creators = creators;
}
public ToolBarDef getToolbarDef() {
return toolbarDef;
}
public void setToolbarDef(ToolBarDef toolbarDef) {
this.toolbarDef = toolbarDef;
}
public UIToolbar getToolBar() {
return toolBar;
}
public void setToolBar(UIToolbar toolBar) {
this.toolBar = toolBar;
}
public CardLayout getCardLayout() {
return cardLayout;
}
public void setCardLayout(CardLayout cardLayout) {
this.cardLayout = cardLayout;
}
public JPanel getCardPane() {
return cardPane;
}
public void setCardPane(JPanel cardPane) { @Override
this.cardPane = cardPane; protected void initShortCutFactory() {
this.shortCutFactory = ShortCutFactory.newInstance(this);
} }
public abstract void saveSettings();
// 是否使用新样式 // 是否使用新样式
protected boolean isNewStyle() { protected boolean isNewStyle() {
return true; return true;
@ -136,16 +78,9 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
protected void initComponentPane() { protected void initComponentPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.creators = this.createNameableCreators(); this.creators = this.createNameableCreators();
this.controlUpdatePane = createControlUpdatePane();
initCardPane();
// p: edit card layout
this.cardLayout = new CardLayout();
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
cardPane.setLayout(this.cardLayout);
// p:选择的Label
UILabel selectLabel = new UILabel();
cardPane.add(selectLabel, "SELECT");
cardPane.add(controlUpdatePane, "EDIT");
if (isNewStyle()) { if (isNewStyle()) {
getPopupEditDialog(cardPane); getPopupEditDialog(cardPane);
this.add(getLeftPane(), BorderLayout.CENTER); this.add(getLeftPane(), BorderLayout.CENTER);
@ -169,11 +104,22 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
this.checkButtonEnabled(); this.checkButtonEnabled();
} }
protected void getPopupEditDialog(JPanel cardPane) { private void getPopupEditDialog(JPanel cardPane) {
popupEditDialog = new PopupEditDialog(cardPane); popupEditDialog = new PopupEditDialog(cardPane);
} }
protected abstract JPanel createControlUpdatePane(); @Override
protected void initToolBar() {
super.initToolBar();
toolBar.setUI(new UIToolBarUI() {
@Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.WHITE);
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
}
protected JPanel getLeftPane() { protected JPanel getLeftPane() {
// LeftPane // LeftPane
@ -188,20 +134,8 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
return leftPane; return leftPane;
} }
toolbarDef = new ToolBarDef(); initToolBar();
for (ShortCut4JControlPane sj : shorts) {
toolbarDef.addShortCut(sj.getShortCut());
}
toolBar = ToolBarDef.createJToolBar();
toolBar.setUI(new UIToolBarUI() {
@Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.WHITE);
g2.fillRect(0, 0, c.getWidth(), c.getHeight());
}
});
toolbarDef.updateToolBar(toolBar);
// 封装一层,加边框 // 封装一层,加边框
JPanel toolBarPane = new JPanel(new BorderLayout()); JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(toolBar, BorderLayout.CENTER); toolBarPane.add(toolBar, BorderLayout.CENTER);
@ -220,7 +154,7 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
}); });
topToolBar.setBorder(null); topToolBar.setBorder(null);
topToolBar.setLayout(new BorderLayout()); topToolBar.setLayout(new BorderLayout());
ShortCut addItem = addItemShortCut().getShortCut(); ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
JPanel leftTopPane = getLeftTopPane(topToolBar); JPanel leftTopPane = getLeftTopPane(topToolBar);
@ -249,85 +183,22 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
return "add item "; return "add item ";
} }
/**
* 初始化左边面板
*/
protected void initLeftPane(JPanel leftPane) {
}
protected int getLeftPreferredSize() {
return shorts.length * SHORT_WIDTH;
}
protected ShortCut4JControlPane[] createShortcuts() { protected ShortCut4JControlPane[] createShortcuts() {
return new ShortCut4JControlPane[]{ // return AbstractShortCutFactory.getInstance(this).createNewShortCuts();
copyItemShortCut(), return shortCutFactory.createShortCuts();
moveUpItemShortCut(),
moveDownItemShortCut(),
sortItemShortCut(),
removeItemShortCut()
};
} }
protected abstract ShortCut4JControlPane addItemShortCut();
protected abstract ShortCut4JControlPane removeItemShortCut();
protected abstract ShortCut4JControlPane copyItemShortCut();
protected abstract ShortCut4JControlPane moveUpItemShortCut();
protected abstract ShortCut4JControlPane moveDownItemShortCut();
protected abstract ShortCut4JControlPane sortItemShortCut();
public abstract Nameable[] update();
public void populate(Nameable[] nameableArray) {
}
/**
* 检查按钮可用状态 Check button enabled.
*/
public void checkButtonEnabled() {
}
protected void doBeforeRemove() {
}
protected void doAfterRemove() {
}
public NameableCreator[] creators() {
return creators == null ? new NameableCreator[0] : creators;
}
protected abstract boolean hasInvalid(boolean isAdd);
/** /**
* 刷新 NameableCreator * 刷新 NameableCreator
* *
* @param creators 生成器 * @param creators 生成器
*/ */
public void refreshNameableCreator(NameableCreator[] creators) { public void refreshNameableCreator(NameableCreator[] creators) {
this.creators = creators; super.refreshNameableCreator(creators);
shorts = this.createShortcuts();
toolbarDef.clearShortCuts();
for (ShortCut4JControlPane sj : shorts) {
toolbarDef.addShortCut(sj.getShortCut());
}
toolbarDef.updateToolBar(toolBar);
toolBar.validate();
toolBar.repaint();
// 顶部按钮 // 顶部按钮
topToolBar.removeAll(); topToolBar.removeAll();
ShortCut addItem = addItemShortCut().getShortCut(); ShortCut addItem = shortCutFactory.addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
topToolBar.validate(); topToolBar.validate();
this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板 this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板
@ -337,13 +208,13 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
} }
// 点击"编辑"按钮,弹出面板 // 点击"编辑"按钮,弹出面板
protected class PopupEditDialog extends JDialog { class PopupEditDialog extends JDialog {
private JComponent editPane; private JComponent editPane;
private PopupToolPane popupToolPane; private PopupToolPane popupToolPane;
private static final int WIDTH = 570; private static final int WIDTH = 570;
private static final int HEIGHT = 490; private static final int HEIGHT = 490;
public PopupEditDialog(JComponent pane) { PopupEditDialog(JComponent pane) {
super(DesignerContext.getDesignerFrame()); super(DesignerContext.getDesignerFrame());
setUndecorated(true); setUndecorated(true);
pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10));
@ -475,11 +346,11 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
} }
}; };
public PopupToolPane(JDialog parentDialog) { PopupToolPane(JDialog parentDialog) {
this(StringUtils.EMPTY, parentDialog); this(StringUtils.EMPTY, parentDialog);
} }
public PopupToolPane(String title, JDialog parentDialog) { PopupToolPane(String title, JDialog parentDialog) {
super(); super();
this.parentDialog = parentDialog; this.parentDialog = parentDialog;
originColor = UIConstants.DIALOG_TITLEBAR_BACKGROUND; originColor = UIConstants.DIALOG_TITLEBAR_BACKGROUND;

880
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java

File diff suppressed because it is too large Load Diff

178
designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/AbstractShortCutFactory.java

@ -0,0 +1,178 @@
package com.fr.design.gui.controlpane.shortcutfactory;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.ShortCutListenerProvider;
import com.fr.design.menu.ShortCut;
import java.awt.event.ActionEvent;
/**
* 生成 ShortCut 的抽象工厂
* Created by plough on 2018/8/2.
*/
public abstract class AbstractShortCutFactory {
protected ShortCutListenerProvider listener;
AbstractShortCutFactory(ShortCutListenerProvider listener) {
setListener(listener);
}
/**
* 生成一组默认的 ShortCut
*/
abstract public ShortCut4JControlPane[] createShortCuts();
abstract public ShortCut createAddItemUpdateAction(NameableCreator[] creator);
abstract public ShortCut createAddItemMenuDef(NameableCreator[] creator);
public ShortCut4JControlPane addItemShortCut() {
ShortCut addItemShortCut;
NameableCreator[] creators = listener.creators();
if (creators.length == 1) {
addItemShortCut = createAddItemUpdateAction(creators);
} else {
addItemShortCut = createAddItemMenuDef(creators);
}
return new AbsoluteEnableShortCut(addItemShortCut);
}
public ShortCut4JControlPane removeItemShortCut() {
return new NormalEnableShortCut(new RemoveItemAction());
}
public ShortCut4JControlPane copyItemShortCut() {
return new NormalEnableShortCut(new CopyItemAction());
}
public ShortCut4JControlPane moveUpItemShortCut() {
return new NormalEnableShortCut(new MoveUpItemAction());
}
public ShortCut4JControlPane moveDownItemShortCut() {
return new NormalEnableShortCut(new MoveDownItemAction());
}
public ShortCut4JControlPane sortItemShortCut() {
return new NormalEnableShortCut(new SortItemAction());
}
public void setListener(ShortCutListenerProvider listener) {
this.listener = listener;
}
private class AbsoluteEnableShortCut extends ShortCut4JControlPane {
AbsoluteEnableShortCut(ShortCut shortCut) {
this.shortCut = shortCut;
}
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(true);
}
}
private class NormalEnableShortCut extends ShortCut4JControlPane {
NormalEnableShortCut(ShortCut shortCut) {
this.shortCut = shortCut;
}
/**
* 检查是否可用
*/
@Override
public void checkEnable() {
this.shortCut.setEnabled(listener.isItemSelected());
}
}
/*
* 移除item
*/
private class RemoveItemAction extends UpdateAction {
RemoveItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText(("Fine-Design_Basic_Action_Remove")));
this.setMnemonic('R');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/base/images/cell/control/remove.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
listener.onRemoveItem();
}
}
/*
* CopyItem
*/
private class CopyItemAction extends UpdateAction {
CopyItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Copy"));
this.setMnemonic('C');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/m_edit/copy.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
listener.onCopyItem();
}
}
/*
* 上移Item
*/
private class MoveUpItemAction extends UpdateAction {
MoveUpItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
this.setMnemonic('U');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/up.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
listener.onMoveUpItem();
}
}
/*
* 下移Item
*/
private class MoveDownItemAction extends UpdateAction {
MoveDownItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
this.setMnemonic('D');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/down.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
listener.onMoveDownItem();
}
}
private class SortItemAction extends UpdateAction {
private boolean isAtoZ = false;
SortItemAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Sort"));
this.setMnemonic('S');
this.setSmallIcon(BaseUtils
.readIcon("/com/fr/design/images/control/sortAsc.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
listener.onSortItem(isAtoZ);
}
}
}

112
designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java

@ -0,0 +1,112 @@
package com.fr.design.gui.controlpane.shortcutfactory;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.ShortCutListenerProvider;
import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import javax.swing.Icon;
import java.awt.event.ActionEvent;
/**
* Created by plough on 2018/8/13.
*/
public class OldShortCutFactory extends AbstractShortCutFactory {
private OldShortCutFactory(ShortCutListenerProvider listenerProvider) {
super(listenerProvider);
}
public static OldShortCutFactory newInstance(ShortCutListenerProvider listenerProvider) {
return new OldShortCutFactory(listenerProvider);
}
@Override
public ShortCut4JControlPane[] createShortCuts() {
return new ShortCut4JControlPane[]{
addItemShortCut(),
removeItemShortCut(),
copyItemShortCut(),
moveUpItemShortCut(),
moveDownItemShortCut(),
sortItemShortCut()
};
}
@Override
public ShortCut createAddItemUpdateAction(NameableCreator[] creators) {
return new AddItemUpdateAction(creators);
}
@Override
public ShortCut createAddItemMenuDef(NameableCreator[] creators) {
return new AddItemMenuDef(creators);
}
/**
* 增加项的UpdateAction
*/
protected class AddItemUpdateAction extends UpdateAction {
final NameableCreator creator;
public AddItemUpdateAction(NameableCreator[] creators) {
this.creator = creators[0];
this.setName(com.fr.design.i18n.Toolkit.i18nText(("Fine-Design_Basic_Action_Add")));
this.setMnemonic('A');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
}
@Override
public void actionPerformed(ActionEvent e) {
listener.onAddItem(creator);
}
}
/*
* 增加项的MenuDef
*/
private class AddItemMenuDef extends MenuDef {
AddItemMenuDef(NameableCreator[] creators) {
this.setName(com.fr.design.i18n.Toolkit.i18nText(("Fine-Design_Basic_Action_Add")));
this.setMnemonic('A');
this.setIconPath("/com/fr/design/images/control/addPopup.png");
wrapActionListener(creators);
}
private void wrapActionListener(NameableCreator[] creators) {
for (final NameableCreator creator : creators) {
if (!HyperlinkFilterHelper.whetherAddHyperlink4cell(creator.menuName())) {
continue;
}
boolean isTrue = ComparatorUtils.equals(creator.menuName(), Inter.getLocText("Datasource-Stored_Procedure")) ||
ComparatorUtils.equals(creator.menuName(), Inter.getLocText("DS-Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), Inter.getLocText("DS-Multi_Dimensional_Database"));
if (isTrue) {
this.addShortCut(new LineSeparator());
}
this.addShortCut(new UpdateAction() {
{
this.setName(creator.menuName());
Icon icon = creator.menuIcon();
if (icon != null) {
this.setSmallIcon(icon);
}
}
@Override
public void actionPerformed(ActionEvent e) {
listener.onAddItem(creator);
}
});
}
}
}
}

171
designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java

@ -0,0 +1,171 @@
package com.fr.design.gui.controlpane.shortcutfactory;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.gui.HyperlinkFilterHelper;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ShortCut4JControlPane;
import com.fr.design.gui.controlpane.ShortCutListenerProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.menu.LineSeparator;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.AbstractButton;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JComponent;
import java.awt.event.ActionEvent;
/**
* Created by plough on 2018/8/13.
*/
public class ShortCutFactory extends AbstractShortCutFactory {
protected ShortCutFactory(ShortCutListenerProvider listenerProvider) {
super(listenerProvider);
}
public static ShortCutFactory newInstance(ShortCutListenerProvider listenerProvider) {
return new ShortCutFactory(listenerProvider);
}
@Override
public ShortCut4JControlPane[] createShortCuts() {
return new ShortCut4JControlPane[]{
copyItemShortCut(),
moveUpItemShortCut(),
moveDownItemShortCut(),
sortItemShortCut(),
removeItemShortCut()
};
}
@Override
public ShortCut createAddItemUpdateAction(NameableCreator[] creators) {
return new AddItemUpdateAction(creators);
}
@Override
public ShortCut createAddItemMenuDef(NameableCreator[] creators) {
return new AddItemMenuDef(creators);
}
/**
* 增加项的UpdateAction
*/
protected class AddItemUpdateAction extends UpdateAction {
final NameableCreator creator;
public AddItemUpdateAction(NameableCreator[] creators) {
this.creator = creators[0];
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add"));
this.setMnemonic('A');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
}
/**
* Gets component on toolbar.
*
* @return the created components on toolbar.
*/
@Override
public JComponent createToolBarComponent() {
Object object = this.getValue(UIButton.class.getName());
if (!(object instanceof AbstractButton)) {
// 直接使用默认UI
UIButton button = new UIButton();
// 添加一个名字作为自动化测试用
button.setName(getName());
//设置属性.
Integer mnemonicInteger = (Integer) this.getValue(Action.MNEMONIC_KEY);
if (mnemonicInteger != null) {
button.setMnemonic((char) mnemonicInteger.intValue());
}
button.setIcon((Icon) this.getValue(Action.SMALL_ICON));
button.addActionListener(this);
button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW);
this.putValue(UIButton.class.getName(), button);
button.setText(StringUtils.EMPTY);
button.setEnabled(this.isEnabled());
//peter:产生tooltip
button.setToolTipText(ActionFactory.createButtonToolTipText(this));
object = button;
}
return (JComponent) object;
}
@Override
public void actionPerformed(ActionEvent e) {
listener.onAddItem(creator);
}
}
/*
* 增加项的MenuDef
*/
protected class AddItemMenuDef extends MenuDef {
public AddItemMenuDef(NameableCreator[] creators) {
super(true);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Add"));
this.setMnemonic('A');
this.setIconPath("/com/fr/design/images/control/addPopup.png");
wrapActionListener(creators);
}
/**
* 生成UIButton
* @return 菜单按钮
*/
public UIButton createUIButton() {
createdButton = super.createUIButton();
// 此按钮单独抽出,不应使用工具栏外观
if (!createdButton.isOpaque()) {
createdButton.setOpaque(true);
createdButton.setNormalPainted(true);
createdButton.setBorderPaintedOnlyWhenPressed(false);
}
return createdButton;
}
private void wrapActionListener(NameableCreator[] creators) {
for (final NameableCreator creator : creators) {
if (!whetherAdd(creator.menuName())) {
continue;
}
boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Datasource-Stored_Procedure")) ||
ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Relation_TableData")) || ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Multi_Dimensional_Database"));
if (isTrue) {
this.addShortCut(new LineSeparator());
}
this.addShortCut(new UpdateAction() {
{
this.setName(creator.menuName());
Icon icon = creator.menuIcon();
if (icon != null) {
this.setSmallIcon(icon);
}
}
@Override
public void actionPerformed(ActionEvent e) {
listener.onAddItem(creator);
}
});
}
}
protected boolean whetherAdd(String itemName){
return HyperlinkFilterHelper.whetherAddHyperlink4cell(itemName);
}
}
}

2
designer-base/src/main/java/com/fr/design/gui/date/CalendarNumberField.java

@ -30,7 +30,7 @@ public class CalendarNumberField extends UINumberField {
setValue(getIntValue()); setValue(getIntValue());
} }
}); });
this.setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Song_TypeFace"),0,12)); this.setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"),0,12));
} }
public void setValue(int value) { public void setValue(int value) {

6
designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java

@ -45,7 +45,7 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
public class UICalendarPanel extends JPanel { public class UICalendarPanel extends JPanel {
private static final Font FONT_SONG = new Font(com.fr.design.i18n.Toolkit.i18nText("Song_TypeFace"),0,12); private static final Font FONT_SONG = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"),0,12);
private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"),0,12); private static final Font FONT_BLACK = new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Black_Font"),0,12);
private static final int WEEKDAY_COUNT = 7; private static final int WEEKDAY_COUNT = 7;
private static final int TOTAL_DAYS_COUNT = 42; private static final int TOTAL_DAYS_COUNT = 42;
@ -161,9 +161,9 @@ public class UICalendarPanel extends JPanel {
pWeeks.setPreferredSize(new Dimension(216, 22)); pWeeks.setPreferredSize(new Dimension(216, 22));
pWeeks.setBackground(new Color(0xFFFFFF)); pWeeks.setBackground(new Color(0xFFFFFF));
pWeeks.setOpaque(true); pWeeks.setOpaque(true);
String[] strWeeks = new String[] {StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Mon"), String[] strWeeks = new String[] {StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sun"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Mon"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tue"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Wed"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Thu"),
com.fr.design.i18n.Toolkit.i18nText("Fri"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat") com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Fri"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sat")
}; };
for (int i = 1; i <= WEEKDAY_COUNT; i++) { for (int i = 1; i <= WEEKDAY_COUNT; i++) {
UILabel label = new UILabel(); UILabel label = new UILabel();

11
designer-base/src/main/java/com/fr/design/gui/date/UIDayLabel.java

@ -1,11 +1,12 @@
package com.fr.design.gui.date; package com.fr.design.gui.date;
import java.awt.*; import com.fr.design.gui.ilable.UILabel;
import java.awt.Dimension;
import java.awt.Font;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import com.fr.design.gui.ilable.UILabel;
public class UIDayLabel extends UILabel { public class UIDayLabel extends UILabel {
@ -27,13 +28,13 @@ public class UIDayLabel extends UILabel {
public UIDayLabel(Date date, boolean isSmallLabel) { public UIDayLabel(Date date, boolean isSmallLabel) {
setHorizontalAlignment(UILabel.CENTER); setHorizontalAlignment(UILabel.CENTER);
setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Song_TypeFace"), 0, 12)); setFont(new Font(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Song_TypeFace"), 0, 12));
this.date = date; this.date = date;
setPreferredSize(new Dimension(30, 18)); setPreferredSize(new Dimension(30, 18));
if (isSmallLabel) { if (isSmallLabel) {
setText(dayFormat.format(date)); setText(dayFormat.format(date));
} else { } else {
setText(com.fr.design.i18n.Toolkit.i18nText("Today")+":" + dateFormat.format(new Date())); setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Today")+":" + dateFormat.format(new Date()));
} }
} }

4
designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java

@ -56,8 +56,8 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
}); });
addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add")); addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"));
editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Modify")); editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify"));
removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Remove")); removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up")); moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down")); moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));

2
designer-base/src/main/java/com/fr/design/gui/frpane/ImgChoosePane.java

@ -34,7 +34,7 @@ public class ImgChoosePane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel previewContainner = new JPanel(); JPanel previewContainner = new JPanel();
previewContainner.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"))); previewContainner.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")));
previewPane = new ImagePreviewPane(); previewPane = new ImagePreviewPane();
previewContainner.add(previewPane); previewContainner.add(previewPane);

2
designer-base/src/main/java/com/fr/design/gui/frpane/ImgChooseWrapper.java

@ -148,7 +148,7 @@ public class ImgChooseWrapper {
imageSizeLabel.setText(StringUtils.EMPTY); imageSizeLabel.setText(StringUtils.EMPTY);
} else { } else {
imageSizeLabel.setText(selectImage.getWidth(null) + "x" imageSizeLabel.setText(selectImage.getWidth(null) + "x"
+ selectImage.getHeight(null) + com.fr.design.i18n.Toolkit.i18nText("px")); + selectImage.getHeight(null) + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Px"));
} }
} }
} }

2
designer-base/src/main/java/com/fr/design/gui/frpane/LoadingBasicPaneTest.java

@ -31,7 +31,7 @@ public class LoadingBasicPaneTest {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Test") ; return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Test") ;
} }
}; };
BasicDialog dlg = lb.showWindow(null); BasicDialog dlg = lb.showWindow(null);

8
designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java

@ -29,7 +29,7 @@ public class ObjectProperiesPane extends BasicBeanPane<ListMap> {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel buttonPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel buttonPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + " " +com.fr.design.i18n.Toolkit.i18nText("Property")); this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + " " +com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"));
buttonPane.add(this.addButton, BorderLayout.WEST); buttonPane.add(this.addButton, BorderLayout.WEST);
this.add(buttonPane, BorderLayout.NORTH); this.add(buttonPane, BorderLayout.NORTH);
@ -124,16 +124,16 @@ public class ObjectProperiesPane extends BasicBeanPane<ListMap> {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
UIButton cancel = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); UIButton cancel = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png"));
cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Remove")); cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
cancel.addActionListener(cancleListener); cancel.addActionListener(cancleListener);
cancel.setMargin(new Insets(0, 0, 0, 0)); cancel.setMargin(new Insets(0, 0, 0, 0));
this.add(cancel); this.add(cancel);
this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Name")+":")); this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")+":"));
this.nameField = new UITextField(6); this.nameField = new UITextField(6);
this.add(this.nameField); this.add(this.nameField);
this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Value")+ ":")); this.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value")+ ":"));
this.valueEditorPane = ValueEditorPaneFactory.createExtendedValueEditorPane(); this.valueEditorPane = ValueEditorPaneFactory.createExtendedValueEditorPane();
this.add(this.valueEditorPane); this.add(this.valueEditorPane);
} }

2
designer-base/src/main/java/com/fr/design/gui/frpane/ReportletParameterViewPane.java

@ -95,7 +95,7 @@ public class ReportletParameterViewPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Parameters"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters");
} }
public void populate(ParameterProvider[] parameters) { public void populate(ParameterProvider[] parameters) {

27
designer-base/src/main/java/com/fr/design/gui/frpane/TemplateParameterPane.java

@ -1,20 +1,19 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.BorderFactory;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.ValueEditorPane; import javax.swing.BorderFactory;
import com.fr.design.editor.ValueEditorPaneFactory; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/** /**
@ -30,7 +29,7 @@ public class TemplateParameterPane extends BasicPane {
} }
public void initComponents() { public void initComponents() {
this.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Parameter"))); this.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -39,8 +38,8 @@ public class TemplateParameterPane extends BasicPane {
JPanel defaultPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); JPanel defaultPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
northPane.add(defaultPane, BorderLayout.CENTER); northPane.add(defaultPane, BorderLayout.CENTER);
UILabel nameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Name") + ":"); UILabel nameLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":");
UILabel valueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Value") + ":"); UILabel valueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") + ":");
nameTextField = new UITextField(12); nameTextField = new UITextField(12);
valuePane = ValueEditorPaneFactory.createBasicValueEditorPane(); valuePane = ValueEditorPaneFactory.createBasicValueEditorPane();
@ -55,7 +54,7 @@ public class TemplateParameterPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Parameter"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter");
} }
public void populate(Parameter parameter) { public void populate(Parameter parameter) {

6
designer-base/src/main/java/com/fr/design/gui/frpane/UIAdvancedTextPane.java

@ -142,7 +142,7 @@ public class UIAdvancedTextPane extends UITextPane {
private class CutAction extends UpdateAction { private class CutAction extends UpdateAction {
public CutAction() { public CutAction() {
setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Cut")); setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"));
setMnemonic('T'); setMnemonic('T');
setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png")); setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
@ -161,7 +161,7 @@ public class UIAdvancedTextPane extends UITextPane {
private class CopyAction extends UpdateAction { private class CopyAction extends UpdateAction {
public CopyAction() { public CopyAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Copy")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy"));
this.setMnemonic('C'); this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));
@ -180,7 +180,7 @@ public class UIAdvancedTextPane extends UITextPane {
private class PasteAction extends UpdateAction { private class PasteAction extends UpdateAction {
public PasteAction() { public PasteAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("M_Edit-Paste")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste"));
this.setMnemonic('P'); this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER));

2
designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java

@ -377,7 +377,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
JPanel content = (JPanel) jf.getContentPane(); JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout()); content.setLayout(new BorderLayout());
List<UIMenuNameableCreator> data = new ArrayList<UIMenuNameableCreator>(); List<UIMenuNameableCreator> data = new ArrayList<UIMenuNameableCreator>();
UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Hyperlink_Reportlet"), UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet"),
new ReportletHyperlink(), ReportletHyperlinkPane.class); new ReportletHyperlink(), ReportletHyperlinkPane.class);
UIMenuNameableCreator email = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), UIMenuNameableCreator email = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"),

2
designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPane.java

@ -113,7 +113,7 @@ public class UITabbedPane extends JTabbedPane{
* @param i tab索引 * @param i tab索引
*/ */
public void doRemoveTab(int i){ public void doRemoveTab(int i){
int re = JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(UITabbedPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete")+ "?", com.fr.design.i18n.Toolkit.i18nText("Remove") int re = JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(UITabbedPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete")+ "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove")
, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); , JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if (re == JOptionPane.OK_OPTION) { if (re == JOptionPane.OK_OPTION) {
super.removeTabAt(i); super.removeTabAt(i);

4
designer-base/src/main/java/com/fr/design/gui/icombobox/DictionaryConstants.java

@ -22,8 +22,8 @@ public class DictionaryConstants {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Length"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Length"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Float"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Float"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"),
com.fr.design.i18n.Toolkit.i18nText("Phone"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Phone"),
com.fr.design.i18n.Toolkit.i18nText("MobilePhone"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_MobilePhone"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_IDCard"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_IDCard"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_PostCode"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_PostCode"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")}; com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom")};

61
designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java

@ -22,7 +22,6 @@ import java.util.ArrayList;
import java.util.Vector; import java.util.Vector;
public class JNameEdList extends UIList implements CellEditorListener { public class JNameEdList extends UIList implements CellEditorListener {
private static final int TEST_LIST_LENTH = 20;
private static final int ICON_WIDTH = 20; private static final int ICON_WIDTH = 20;
private boolean editable = true; private boolean editable = true;
@ -232,7 +231,7 @@ public class JNameEdList extends UIList implements CellEditorListener {
} }
Rectangle rect = this.getCellBounds(index, index); Rectangle rect = this.getCellBounds(index, index);
// alex:所有的JNameEdList都有Icon,空出前面20 * 20的位置就是放的Icon // alex:所有的JNameEdList都有Icon,空出前面20 * 20的位置就是放的Icon
rect.setRect(createRect(rect, ICON_WIDTH)); rect.setRect(createRect(rect, getIconWidth()));
editorComp.setBounds(rect); editorComp.setBounds(rect);
add(editorComp); add(editorComp);
@ -247,6 +246,10 @@ public class JNameEdList extends UIList implements CellEditorListener {
return true; return true;
} }
public int getIconWidth() {
return ICON_WIDTH;
}
public Rectangle createRect(Rectangle rect, int iconWidth) { public Rectangle createRect(Rectangle rect, int iconWidth) {
return new Rectangle(rect.x + iconWidth, rect.y, rect.width - iconWidth, rect.height); return new Rectangle(rect.x + iconWidth, rect.y, rect.width - iconWidth, rect.height);
} }
@ -301,9 +304,14 @@ public class JNameEdList extends UIList implements CellEditorListener {
String name = StringUtils.isBlank(value.toString()) ? oldName : value.toString(); String name = StringUtils.isBlank(value.toString()) ? oldName : value.toString();
setNameAt(name, editingIndex); setNameAt(name, editingIndex);
removeComp(); removeComp();
doAfterStopEditing();
} }
} }
protected void doAfterStopEditing() {
// default: do nothing
}
public String[] getAllNames() { public String[] getAllNames() {
int length = this.getModel().getSize(); int length = this.getModel().getSize();
String[] names = new String[length]; String[] names = new String[length];
@ -335,53 +343,4 @@ public class JNameEdList extends UIList implements CellEditorListener {
editorComp = null; editorComp = null;
repaint(cellRect); repaint(cellRect);
} }
/**
* 主函数
*
* @param args 参数
*/
public static void main(String... args) {
JFrame f = new JFrame();
JPanel c = (JPanel) f.getContentPane();
c.setLayout(new BorderLayout());
ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH];
for (int i = 0; i < TEST_LIST_LENTH; i++) {
data[i] = new ListModelElement(new NameObject(i + 1 + "", i));
}
final JNameEdList list = new JNameEdList(data);
list.setEditable(true);
list.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent evt) {
list.stopEditing();
if (evt.getClickCount() >= 2
&& SwingUtilities.isLeftMouseButton(evt)) {
list.editItemAt(list.getSelectedIndex());
}
}
})
;
list.setCellEditor(new DefaultListCellEditor(new UITextField()));
list.setCellRenderer(new NameableListCellRenderer());
c.add(list, BorderLayout.CENTER);
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.setSize(400, 600);
f.setVisible(true);
}
private static class NameableListCellRenderer extends DefaultListCellRenderer {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Nameable) {
Nameable wrappee = (Nameable) value;
this.setText(wrappee.getName());
}
return this;
}
}
} }

386
designer-base/src/main/java/com/fr/design/gui/ilist/UINameEdList.java

@ -1,163 +1,21 @@
package com.fr.design.gui.ilist; package com.fr.design.gui.ilist;
import com.fr.base.Utils;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*; import javax.swing.ListModel;
import javax.swing.event.CellEditorListener; import java.awt.Point;
import javax.swing.event.ChangeEvent;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.Vector;
/** /**
* Created by plough on 2017/7/23. * Created by plough on 2017/7/23.
*/ */
public class UINameEdList extends UIList implements CellEditorListener { public class UINameEdList extends JNameEdList {
private static final int TEST_LIST_LENTH = 20;
private static final int BUTTON_WIDTH = 25; private static final int BUTTON_WIDTH = 25;
private boolean editable = true;
// kunsnat: 是否强制ListName是数字 (int型)
private boolean isNameShouldNumber = false;
transient protected ListCellEditor cellEditor; protected UINameEdList(ListModel dataModel) {
transient protected Component editorComp;
transient protected int editingIndex;
private PropertyChangeAdapter editingListner;
private java.util.List<ModNameActionListener> ll = new ArrayList<ModNameActionListener>();
public UINameEdList(ListModel dataModel) {
super(dataModel); super(dataModel);
} }
public UINameEdList(final Object[] listData) {
super(listData);
}
public UINameEdList(final Vector<?> listData) {
super(listData);
}
public UINameEdList() {
super();
}
/*
* Sets是否可编辑
*/
public void setEditable(boolean editable) {
this.editable = editable;
}
/**
* 是否可编辑
*
* @return 是则返回true
*/
public boolean isEditable() {
return this.editable;
}
public void setNameShouldNumber(boolean isNameShouldNumber) {
this.isNameShouldNumber = isNameShouldNumber;
}
/**
* 是否强制ListName是数字 (int型)
*
* @return 是则返回true
*/
public boolean isNameShouldNumber() {
return isNameShouldNumber;
}
/**
* 添加名字改变时的listener
*
* @param l 监听器
*/
public void addModNameActionListener(ModNameActionListener l) {
ll.add(l);
}
/**
* 编辑时的监听器
*
* @param l 监听器
*/
public void addEditingListner(PropertyChangeAdapter l) {
this.editingListner = l;
}
/**
* 移除某名字改变时的listener
*
* @param l 监听器
*/
public void removeModNameActionListener(ModNameActionListener l) {
ll.remove(l);
}
public ListCellEditor getCellEditor() {
if (cellEditor == null) {
UITextField editField = new UITextField();
if (editingListner != null) {
editField.addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
editingListner.propertyChange();
}
@Override
public void focusGained(FocusEvent e) {
// TODO Auto-generated method stub
}
});
}
cellEditor = new DefaultListCellEditor(editField) {
public boolean stopCellEditing() {
boolean isTrue = super.stopCellEditing();
stopEditing();
return isTrue;
}
};
cellEditor.addCellEditorListener(this);
}
return cellEditor;
}
protected void doAfterLostFocus() {
}
public void setCellEditor(ListCellEditor editor) {
this.cellEditor = editor;
}
/*
* 取得index节点的名字
*/
public String getNameAt(int index) {
Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper;
if (nameable != null) {
return nameable.getName();
}
return null;
}
public Object getType(int index) { public Object getType(int index) {
Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper; Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper;
if (nameable != null && nameable instanceof NameObject) { if (nameable != null && nameable instanceof NameObject) {
@ -166,177 +24,8 @@ public class UINameEdList extends UIList implements CellEditorListener {
return null; return null;
} }
/* public int getIconWidth() {
* 设置index节点的名字 return BUTTON_WIDTH;
*/
// b:edit改变name的时候怎么办?
public void setNameAt(String name, int index) {
Nameable nameable = ((ListModelElement) getModel().getElementAt(index)).wrapper;
if (nameable != null) {
String oldName = nameable.getName();
if (isNameShouldNumber()) {
// kunsnat: 限制只能是数字(int型)
Number number = Utils.string2Number(name);
if (number == null) {
nameable.setName(oldName);
} else {
int newName = number.intValue();
nameable.setName(String.valueOf(newName));
}
} else {
nameable.setName(name);
}
for (int i = 0, len = ll.size(); i < len; i++) {
ll.get(i).nameModed(index, oldName, name);
}
}
}
/*
* 编辑第index个item
*/
private String oldName;
/**
* 编辑第index项
*
* @param index 序号
* @return 成功返回true
*/
public boolean editItemAt(int index) {
// 如果不可编辑,返回
if (!this.editable) {
return false;
}
if (cellEditor != null && !cellEditor.stopCellEditing()) {
return false;
}
if (index < 0 || index >= this.getModel().getSize()) {
return false;
}
ListCellEditor editor = getCellEditor();
Object value = editor.getCellEditorValue();
if (!StringUtils.isBlank(value.toString())) {
oldName = value.toString();
}
editorComp = prepareEditor(editor, index);
if (editorComp == null) {
return false;
}
Rectangle rect = this.getCellBounds(index, index);
// alex:所有的UINameEdList都有Icon,空出前面20 * 20的位置就是放的Icon
rect.setRect(createRect(rect, BUTTON_WIDTH));
editorComp.setBounds(rect);
add(editorComp);
editorComp.validate();
editorComp.requestFocus();
if (editorComp instanceof UITextField) {
((UITextField) editorComp).selectAll();
}
setEditingIndex(index);
return true;
}
public Rectangle createRect(Rectangle rect, int iconWidth) {
return new Rectangle(rect.x + iconWidth, rect.y, rect.width - iconWidth, rect.height);
}
public String getEditingName() {
return (String) getCellEditor().getCellEditorValue();
}
/*
* 根据ListCellEditor取得编辑器的Component
*/
private Component prepareEditor(ListCellEditor cellEditor, int index) {
String name = getNameAt(index);
boolean isSelected = this.isSelectedIndex(index);
Component comp = cellEditor.getListCellEditorComponent(this, name, isSelected, index);
return comp;
}
/*
* 记录正在编辑的index
*/
private void setEditingIndex(int idx) {
editingIndex = idx;
}
/**
* 编辑取消
*
* @param e 事件
*/
public void editingCanceled(ChangeEvent e) {
removeComp();
}
/**
* 编辑结束
*
* @param e 事件
*/
public void editingStopped(ChangeEvent e) {
doAfterLostFocus();
stopEditing();
}
/**
* 停止编辑事件
*/
public void stopEditing() {
ListCellEditor editor = getCellEditor();
if (editor != null && editorComp != null) {
Object value = editor.getCellEditorValue();
String name = StringUtils.isBlank(value.toString()) ? oldName : value.toString();
setNameAt(name, editingIndex);
removeComp();
doAfterStopEditing();
}
}
protected void doAfterStopEditing() {
// default: do nothing
}
public String[] getAllNames() {
int length = this.getModel().getSize();
String[] names = new String[length];
for (int i = 0; i < length; i++) {
names[i] = getNameAt(i);
}
return names;
}
public Object[] getAllTypes() {
int length = this.getModel().getSize();
Object[] types = new Object[length];
for (int i = 0; i < length; i++) {
types[i] = getType(i);
}
return types;
}
/*
* 移除编辑器的Component
*/
private void removeComp() {
if (editorComp != null) {
remove(editorComp);
}
Rectangle cellRect = this.getCellBounds(editingIndex, editingIndex);
setEditingIndex(-1);
editorComp = null;
repaint(cellRect);
} }
@Override @Override
@ -349,67 +38,4 @@ public class UINameEdList extends UIList implements CellEditorListener {
return index; return index;
} }
} }
/**
* 主函数
*
* @param args 参数
*/
public static void main(String... args) {
JFrame f = new JFrame();
JPanel c = (JPanel) f.getContentPane();
c.setLayout(new BorderLayout());
ListModelElement[] data = new ListModelElement[TEST_LIST_LENTH];
for (int i = 0; i < TEST_LIST_LENTH; i++) {
data[i] = new ListModelElement(new NameObject(i + 1 + "", i));
}
final UINameEdList list = new UINameEdList(data);
list.setEditable(true);
list.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent evt) {
list.stopEditing();
if (evt.getClickCount() >= 2
&& SwingUtilities.isLeftMouseButton(evt)) {
list.editItemAt(list.getSelectedIndex());
}
}
@Override
public void mouseClicked(MouseEvent e) {
JList list = (JList) e.getSource();
if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown()
&& !isMenuShortcutKeyDown(e)) {
list.clearSelection();
}
}
private boolean isMenuShortcutKeyDown(InputEvent event) {
return (event.getModifiers() & Toolkit.getDefaultToolkit()
.getMenuShortcutKeyMask()) != 0;
}
})
;
list.setCellEditor(new DefaultListCellEditor(new UITextField()));
list.setCellRenderer(new NameableListCellRenderer());
c.add(list, BorderLayout.CENTER);
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
f.setSize(400, 600);
f.setVisible(true);
}
private static class NameableListCellRenderer extends DefaultListCellRenderer {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Nameable) {
Nameable wrappee = (Nameable) value;
this.setText(wrappee.getName());
}
return this;
}
}
} }

2
designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTable.java

@ -211,7 +211,7 @@ public class UIMenuTable extends JTable {
JPanel content = (JPanel)jf.getContentPane(); JPanel content = (JPanel)jf.getContentPane();
content.setLayout(new BorderLayout()); content.setLayout(new BorderLayout());
List<UIMenuNameableCreator> data = new ArrayList<UIMenuNameableCreator>(); List<UIMenuNameableCreator> data = new ArrayList<UIMenuNameableCreator>();
UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Reportlet"), UIMenuNameableCreator reportlet = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reportlet"),
new ReportletHyperlink(), ReportletHyperlinkPane.class); new ReportletHyperlink(), ReportletHyperlinkPane.class);
UIMenuNameableCreator email = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), UIMenuNameableCreator email = new UIMenuNameableCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"),

2
designer-base/src/main/java/com/fr/design/gui/imenutable/UIMenuTableUI.java

@ -75,7 +75,7 @@ public class UIMenuTableUI extends UITableUI{
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if (e.getX() >= table.getWidth() - 20) { if (e.getX() >= table.getWidth() - 20) {
int val = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", int val = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?",
com.fr.design.i18n.Toolkit.i18nText("Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (val == JOptionPane.OK_OPTION) { if (val == JOptionPane.OK_OPTION) {
uiTable.removeLine(table.rowAtPoint(e.getPoint())); uiTable.removeLine(table.rowAtPoint(e.getPoint()));
uiTable.fireTargetChanged(); uiTable.fireTargetChanged();

2
designer-base/src/main/java/com/fr/design/gui/iscrollbar/UISBChooser.java

@ -106,7 +106,7 @@ public class UISBChooser extends JDialog {
JButton b = new JButton("Cancel"); JButton b = new JButton("Cancel");
b.addActionListener(new CancelAction()); b.addActionListener(new CancelAction());
p3.add(b); p3.add(b);
b = new JButton("Fine-Design_Report_OK"); b = new JButton("OK");
getRootPane().setDefaultButton(b); getRootPane().setDefaultButton(b);
b.addActionListener(new OKAction()); b.addActionListener(new OKAction());
p3.add(b); p3.add(b);

2
designer-base/src/main/java/com/fr/design/gui/itable/UITableUI.java

@ -133,7 +133,7 @@ public class UITableUI extends BasicTableUI {
} }
if (!table.isEditing()) { if (!table.isEditing()) {
int val = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", int val = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?",
com.fr.design.i18n.Toolkit.i18nText("Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (val == JOptionPane.OK_OPTION) { if (val == JOptionPane.OK_OPTION) {
((UITable) table).removeLine(table.rowAtPoint(e.getPoint())); ((UITable) table).removeLine(table.rowAtPoint(e.getPoint()));
((UITable) table).fireTargetChanged(); ((UITable) table).fireTargetChanged();

6
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java

@ -35,7 +35,7 @@ public class ParameterTableModel extends UITableModelAdapter<ParameterProvider>
} }
public ParameterTableModel(int paraUseType) { public ParameterTableModel(int paraUseType) {
super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") });
this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class }); this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class });
this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType)); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType));
this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor());
@ -43,7 +43,7 @@ public class ParameterTableModel extends UITableModelAdapter<ParameterProvider>
} }
public ParameterTableModel(int paraUseType, Component component) { public ParameterTableModel(int paraUseType, Component component) {
super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") });
this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class }); this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class });
this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType)); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(paraUseType));
this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor());
@ -52,7 +52,7 @@ public class ParameterTableModel extends UITableModelAdapter<ParameterProvider>
} }
public ParameterTableModel(ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane, Component component) { public ParameterTableModel(ValueEditorPane valueEditorPane, ValueEditorPane valueRenderPane, Component component) {
super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") });
this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class }); this.setColumnClass(new Class[] { ParameterEditor.class, ParameterValueEditor.class });
this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(valueEditorPane)); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor(valueEditorPane));
this.setDefaultEditor(ParameterEditor.class, new ParameterEditor()); this.setDefaultEditor(ParameterEditor.class, new ParameterEditor());

2
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableModelAdapter.java

@ -252,7 +252,7 @@ public abstract class UITableModelAdapter<T extends Object> extends AbstractTabl
component = DesignerContext.getDesignerFrame(); component = DesignerContext.getDesignerFrame();
} }
int val = JOptionPane.showConfirmDialog(component, int val = JOptionPane.showConfirmDialog(component,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", com.fr.design.i18n.Toolkit.i18nText("Remove"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + "?", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (val != JOptionPane.OK_OPTION) { if (val != JOptionPane.OK_OPTION) {
return; return;

4
designer-base/src/main/java/com/fr/design/gui/itextfield/UISearchTextField.java

@ -27,7 +27,7 @@ public class UISearchTextField extends UITextField {
private UILabel iconLabel = new UILabel(UIConstants.BLACK_SEARCH_ICON); private UILabel iconLabel = new UILabel(UIConstants.BLACK_SEARCH_ICON);
private UILabel clearLabel = new UILabel(UIConstants.CLEAR_ICON); private UILabel clearLabel = new UILabel(UIConstants.CLEAR_ICON);
private UILabel infoLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Search")); private UILabel infoLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Search"));
private Dimension iconSize; private Dimension iconSize;
private Dimension infoSize; private Dimension infoSize;
@ -62,7 +62,7 @@ public class UISearchTextField extends UITextField {
private void initTextField() { private void initTextField() {
iconLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); iconLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
iconLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Search")); iconLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Search"));
clearLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear")); clearLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear"));
clearLabel.setOpaque(false); clearLabel.setOpaque(false);
iconSize = iconLabel.getPreferredSize(); iconSize = iconLabel.getPreferredSize();

2
designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java

@ -96,7 +96,7 @@ public class ReportletPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Reportlet"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reportlet");
} }
/* /*

26
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/ErrorStrip.java

@ -9,6 +9,17 @@
*/ */
package com.fr.design.gui.syntax.ui.rsyntaxtextarea; package com.fr.design.gui.syntax.ui.rsyntaxtextarea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.Parser;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.ParserNotice;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.TaskTagParser.TaskNotice;
import com.fr.design.gui.syntax.ui.rtextarea.RTextArea;
import javax.swing.JComponent;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.BadLocationException;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Cursor; import java.awt.Cursor;
@ -24,17 +35,6 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.swing.JComponent;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.BadLocationException;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.Parser;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.ParserNotice;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.parser.TaskTagParser.TaskNotice;
import com.fr.design.gui.syntax.ui.rtextarea.RTextArea;
@ -287,7 +287,7 @@ public class ErrorStrip extends JComponent {
String text = null; String text = null;
int line = yToLine(e.getY()); int line = yToLine(e.getY());
if (line>-1) { if (line>-1) {
text = com.fr.design.i18n.Toolkit.i18nText("Line"); text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Line");
text = MessageFormat.format(text, Integer.valueOf(line+1)); text = MessageFormat.format(text, Integer.valueOf(line+1));
} }
return text; return text;
@ -673,7 +673,7 @@ public class ErrorStrip extends JComponent {
try { try {
String word = textArea.getText(range.getStartOffset(), String word = textArea.getText(range.getStartOffset(),
getLength()); getLength());
text = com.fr.design.i18n.Toolkit.i18nText("OccurrenceOf"); text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_OccurrenceOf");
text = MessageFormat.format(text, word); text = MessageFormat.format(text, word);
} catch (BadLocationException ble) { } catch (BadLocationException ble) {
UIManager.getLookAndFeel().provideErrorFeedback(textArea); UIManager.getLookAndFeel().provideErrorFeedback(textArea);

4
designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java

@ -86,13 +86,13 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
Component[][] components; Component[][] components;
if (!this.needRenamePane) { if (!this.needRenamePane) {
components = new Component[][]{ components = new Component[][]{
{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("FR-Hyperlink_Reportlet") + ":"), reportletNamePane}, {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane},
}; };
} else { } else {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
components = new Component[][]{ components = new Component[][]{
{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField}, {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField},
{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("FR-Hyperlink_Reportlet") + ":"), reportletNamePane}, {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane},
}; };
} }
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);

2
designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java

@ -53,7 +53,7 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane<ReportletHyper
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Hyperlink_Reportlet"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet");
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/javascript/FormSubmitJavaScriptPane.java

@ -54,7 +54,7 @@ public class FormSubmitJavaScriptPane extends FurtherBasicBeanPane<FormSubmitJav
} }
}); });
pViewPane = new ReportletParameterViewPane(); pViewPane = new ReportletParameterViewPane();
pViewPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Parameter"))); pViewPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
northPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_Submit"))); northPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_Submit")));
addCallbackButton = javaScriptActionPane.createCallButton(); addCallbackButton = javaScriptActionPane.createCallButton();

6
designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java

@ -72,7 +72,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
} }
}); });
OneListTableModel<String> model = new OneListTableModel<String>(com.fr.design.i18n.Toolkit.i18nText("ReportServerP-Import_JavaScript"), this) { OneListTableModel<String> model = new OneListTableModel<String>(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"), this) {
public UITableEditAction[] createAction() { 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()};
@ -84,7 +84,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
} }
}; };
importedJsPane = new UITableEditorPane<String>(model); importedJsPane = new UITableEditorPane<String>(model);
importedJsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("ReportServerP-Import_JavaScript"))); importedJsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript")));
importedJsPane.setPreferredSize(new Dimension(265, 150)); importedJsPane.setPreferredSize(new Dimension(265, 150));
jsPane = new JSContentPane(defaultArgs); jsPane = new JSContentPane(defaultArgs);
jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"))); jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript")));
@ -196,7 +196,7 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
JPanel topPane = GUICoreUtils.createBorderLayoutPane( JPanel topPane = GUICoreUtils.createBorderLayoutPane(
GUICoreUtils.createNamedPane(itemNameTextField, com.fr.design.i18n.Toolkit.i18nText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH, GUICoreUtils.createNamedPane(itemNameTextField, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"), BorderLayout.NORTH,
importedJsPane, BorderLayout.CENTER, importedJsPane, BorderLayout.CENTER,
parameterPane, BorderLayout.EAST parameterPane, BorderLayout.EAST
); );

4
designer-base/src/main/java/com/fr/design/javascript/ProcessParameterTableModel.java

@ -30,7 +30,7 @@ public class ProcessParameterTableModel extends UITableModelAdapter<ParameterPro
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public ProcessParameterTableModel() { public ProcessParameterTableModel() {
super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Parameter"), com.fr.design.i18n.Toolkit.i18nText("Value") }); super(new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Value") });
this.setColumnClass(new Class[] { JLabel.class, ParameterValueEditor.class }); this.setColumnClass(new Class[] { JLabel.class, ParameterValueEditor.class });
this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor()); this.setDefaultEditor(ParameterValueEditor.class, new ParameterValueEditor());
this.setDefaultRenderer(ParameterValueEditor.class, new ParameterValueRenderer()); this.setDefaultRenderer(ParameterValueEditor.class, new ParameterValueRenderer());
@ -102,7 +102,7 @@ public class ProcessParameterTableModel extends UITableModelAdapter<ParameterPro
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Parameter"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter");
} }
private String getEditFilePath() { private String getEditFilePath() {

11
designer-base/src/main/java/com/fr/design/layout/TableLayoutTest.java

@ -1,13 +1,12 @@
package com.fr.design.layout; package com.fr.design.layout;
import java.awt.Container; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import javax.swing.JFrame; import javax.swing.JFrame;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Container;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UITextField;
public class TableLayoutTest extends JFrame public class TableLayoutTest extends JFrame
{ {
@ -57,7 +56,7 @@ public class TableLayoutTest extends JFrame
UITextField textfieldState = new UITextField(2); UITextField textfieldState = new UITextField(2);
UITextField textfieldZip = new UITextField(5); UITextField textfieldZip = new UITextField(5);
UIButton buttonOk = new UIButton("Fine-Design_Report_OK"); UIButton buttonOk = new UIButton("OK");
UIButton buttonCancel = new UIButton("Cancel"); UIButton buttonCancel = new UIButton("Cancel");
JPanel panelButton = new JPanel(); JPanel panelButton = new JPanel();
panelButton.add(buttonOk); panelButton.add(buttonOk);

13
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -944,19 +944,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* @param tplFile 文件 * @param tplFile 文件
*/ */
public void openTemplate(FILE tplFile) { public void openTemplate(FILE tplFile) {
// 测试连接,如果连接失败,则提示
// try {
// if (FRContext.getCommonOperator() != null
// && !FRContext.getCommonOperator().testServerConnectionWithOutShowMessagePane()) {
// JOptionPane.showMessageDialog(
// DesignerContext.getDesignerFrame(),
// com.fr.design.i18n.Toolkit.i18nText(new String[]{"FR-Chart-Server_disconnected", "FR-Server-Design_template_unopened"}, new String[]{
// ",", "!"}), com.fr.design.i18n.Toolkit.i18nText("FR-Server-All_Error"), JOptionPane.ERROR_MESSAGE);
// return;
// }
// } catch (Exception e) {
// FineLoggerFactory.getLogger().error(e.getMessage());
// }
// p:判断一下,如何文件为空或者文件不存在,直接返回. // p:判断一下,如何文件为空或者文件不存在,直接返回.
if (tplFile == null || !tplFile.exists()) { if (tplFile == null || !tplFile.exists()) {

4
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -868,7 +868,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (isLowerThanHBB(xmlDesignerVersion)) { if (isLowerThanHBB(xmlDesignerVersion)) {
String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip"); String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip");
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips")).show(); new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
return true; return true;
} }
return false; return false;
@ -884,7 +884,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (isHigherThanCurrent(xmlDesignerVersion)) { if (isHigherThanCurrent(xmlDesignerVersion)) {
String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", StringUtils.parseVersion(xmlDesignerVersion)); String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", StringUtils.parseVersion(xmlDesignerVersion));
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info"); String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Tooltips")).show(); new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
return true; return true;
} }
return false; return false;

2
designer-base/src/main/java/com/fr/design/mainframe/NoSupportAuthorityEdit.java

@ -40,7 +40,7 @@ public class NoSupportAuthorityEdit extends AuthorityEditPane {
private JPanel createTextPane() { private JPanel createTextPane() {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("not_support_authority_edit")); UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Not_Support_Authority_Edit"));
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
uiLabel.setVerticalAlignment(SwingConstants.CENTER); uiLabel.setVerticalAlignment(SwingConstants.CENTER);
panel.add(uiLabel, BorderLayout.CENTER); panel.add(uiLabel, BorderLayout.CENTER);

2
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBarUI.java

@ -100,7 +100,7 @@ public class LogHandlerBarUI extends ComponentUI implements MouseListener, Focus
g.drawString(button.getText(), textLeadingGap, y); g.drawString(button.getText(), textLeadingGap, y);
} }
g.drawString(com.fr.design.i18n.Toolkit.i18nText("NNormal") + '(' + button.getInfo() + ')', button.getWidth() - 310, y); g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_NNormal") + '(' + button.getInfo() + ')', button.getWidth() - 310, y);
g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + '(' + button.getError() + ')', button.getWidth() - 250, y); g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + '(' + button.getError() + ')', button.getWidth() - 250, y);
g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + '(' + button.getServer() + ')', button.getWidth() - 190, y); g.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + '(' + button.getServer() + ')', button.getWidth() - 190, y);
} }

2
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java

@ -56,7 +56,7 @@ public class LogMessageBar extends JPanel {
if (message == null) { if (message == null) {
return; return;
} }
messageLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Log") + " | " + message); messageLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log") + " | " + message);
repaint(); repaint();
} }

2
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/TemplateStylePane.java

@ -54,7 +54,7 @@ public class TemplateStylePane extends BasicPane {
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
westPane.setPreferredSize(new Dimension(100, 500)); westPane.setPreferredSize(new Dimension(100, 500));
centerPane.setPreferredSize(new Dimension(300, 500)); centerPane.setPreferredSize(new Dimension(300, 500));
centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Preview"), null)); centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"), null));
centerPane.add(previewPane); centerPane.add(previewPane);
styleList.addMouseListener(new MouseAdapter() { styleList.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {

2
designer-base/src/main/java/com/fr/design/mainframe/widget/wrappers/BackgroundWrapper.java

@ -35,7 +35,7 @@ public class BackgroundWrapper implements Encoder, Decoder {
} else if (v instanceof GradientBackground) { } else if (v instanceof GradientBackground) {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Gradient_Color"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Gradient_Color");
} else { } else {
return com.fr.design.i18n.Toolkit.i18nText("None"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_None");
} }
} }

28
designer-base/src/main/java/com/fr/design/menu/KeySetUtils.java

@ -184,7 +184,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Export-Excel-Page"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Export_Excel_Page");
} }
@Override @Override
@ -202,7 +202,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Export-Excel-Simple"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Export_Excel_Simple");
} }
@Override @Override
@ -220,7 +220,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Export-Excel-PageToSheet"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Export_Excel_PageToSheet");
} }
@Override @Override
@ -327,7 +327,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("M_File-ExportT-Template(embedded_data)"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_File_ExportT_Template(embedded_data)");
} }
@Override @Override
@ -450,7 +450,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("ReportD-Excel_Export"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export");
} }
@Override @Override
@ -569,7 +569,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("Report-Write_Attributes"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Report_Write_Attributes");
} }
@Override @Override
@ -603,7 +603,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_ReportColumns-Columns"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns");
} }
@Override @Override
@ -639,7 +639,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Frozen"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen");
} }
@Override @Override
@ -776,7 +776,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Chart-Style_Present"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Present");
} }
@Override @Override
@ -793,7 +793,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("M_Format-Data_Map"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Format_Data_Map");
} }
@Override @Override
@ -810,7 +810,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present");
} }
@Override @Override
@ -827,7 +827,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("M_Insert-Barcode"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Insert_Barcode");
} }
@Override @Override
@ -862,7 +862,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("Present-No_Present"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_No_Present");
} }
@Override @Override
@ -947,7 +947,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("M_Insert-Cell"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Insert_Cell");
} }
@Override @Override

4
designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java

@ -54,7 +54,7 @@ public class ParameterArrayPane extends JListControlPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Schedule-Template_Parameter"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Schedule_Template_Parameter");
} }
/** /**
@ -64,7 +64,7 @@ public class ParameterArrayPane extends JListControlPane {
*/ */
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{ return new NameableCreator[]{
new NameableSelfCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Engine_Parameter_Name"), Parameter.class, ParameterPane.class) { new NameableSelfCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Name"), Parameter.class, ParameterPane.class) {
public Parameter createNameable(UnrepeatedNameHelper helper) { public Parameter createNameable(UnrepeatedNameHelper helper) {
// 返回参数设置面板. // 返回参数设置面板.
return new Parameter(helper.createUnrepeatedName("p")); return new Parameter(helper.createUnrepeatedName("p"));

4
designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java

@ -66,7 +66,7 @@ public class ParameterInputPane extends BasicPane {
//Content Pane. //Content Pane.
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(new JScrollPane(contentPane), BorderLayout.CENTER); this.add(new JScrollPane(contentPane), BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Parameters") + ":")); contentPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters") + ":"));
FlowTableLayoutHelper flowTableLayoutHelper = new FlowTableLayoutHelper(); FlowTableLayoutHelper flowTableLayoutHelper = new FlowTableLayoutHelper();
@ -133,7 +133,7 @@ public class ParameterInputPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Parameters"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters");
} }
/** /**

5
designer-base/src/main/java/com/fr/design/parameter/ParameterManagerPane.java

@ -3,12 +3,9 @@ package com.fr.design.parameter;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterConfig; import com.fr.base.ParameterConfig;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -24,7 +21,7 @@ public class ParameterManagerPane extends BasicPane {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("M_Server-Global_Parameters"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters");
} }
public void populate(Parameter[] parameters) { public void populate(Parameter[] parameters) {

19
designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java

@ -1,19 +1,18 @@
package com.fr.design.parameter; package com.fr.design.parameter;
import java.awt.BorderLayout;
import java.awt.Component;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
public class ParameterPane extends BasicBeanPane<Parameter> { public class ParameterPane extends BasicBeanPane<Parameter> {
@ -46,7 +45,7 @@ public class ParameterPane extends BasicBeanPane<Parameter> {
// richer:要排列显示的控件 // richer:要排列显示的控件
Component[][] components = {{null}, Component[][] components = {{null},
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Name") + ":"),textFieldPanel }, { null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"),textFieldPanel },
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":"),valueEditor } { null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":"),valueEditor }
}; };
double p =TableLayout.PREFERRED; double p =TableLayout.PREFERRED;
@ -65,7 +64,7 @@ public class ParameterPane extends BasicBeanPane<Parameter> {
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Parameter"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter");
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/present/FormulaPresentPane.java

@ -23,7 +23,7 @@ public class FormulaPresentPane extends FurtherBasicBeanPane<FormulaPresent> {
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Present-Formula_Present"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Present_Formula_Present");
} }
@Override @Override

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save