• R/O
  • SSH
  • HTTPS

dbviewer: コミット


コミットメタ情報

リビジョン258 (tree)
日時2012-07-16 13:24:03
作者makopoppo

ログメッセージ

UI text standardization (part 2 - connection profile wizard, part of tree view)

変更サマリ

差分

--- DBViewer/branches/2.0.0/src/zigen/plugin/db/ui/actions/Messages.java (revision 257)
+++ DBViewer/branches/2.0.0/src/zigen/plugin/db/ui/actions/Messages.java (revision 258)
@@ -5,6 +5,7 @@
55 */
66 package zigen.plugin.db.ui.actions;
77
8+import java.text.MessageFormat;
89 import java.util.MissingResourceException;
910 import java.util.ResourceBundle;
1011
@@ -23,4 +24,13 @@
2324 return '!' + key + '!';
2425 }
2526 }
27+
28+ public static String getFormattedString(String key, Object[] args) {
29+ try {
30+ String str = RESOURCE_BUNDLE.getString(key);
31+ return MessageFormat.format(str, args);
32+ } catch (MissingResourceException e) {
33+ return '!' + key + '!';
34+ }
35+ }
2636 }
--- DBViewer/branches/2.0.0/src/zigen/plugin/db/ui/actions/RegistBookmarkFolderAction.java (revision 257)
+++ DBViewer/branches/2.0.0/src/zigen/plugin/db/ui/actions/RegistBookmarkFolderAction.java (revision 258)
@@ -20,11 +20,9 @@
2020
2121 public class FolderNameValidator implements IInputValidator {
2222
23- final String name = Messages.getString("RegistBookmarkFolderAction.0"); //$NON-NLS-1$
24-
2523 public String isValid(String str) {
26- if (str == null || str.trim().equals(Messages.getString("RegistBookmarkFolderAction.1"))) { //$NON-NLS-1$
27- return name + Messages.getString("RegistBookmarkFolderAction.2"); //$NON-NLS-1$
24+ if (str == null || str.trim().length() == 0) {
25+ return Messages.getString("RegistBookmarkFolderAction.0"); //$NON-NLS-1$
2826 }
2927 return null;
3028 }
--- DBViewer/branches/2.0.0/src/zigen/plugin/db/ui/actions/CopyDBAction.java (revision 257)
+++ DBViewer/branches/2.0.0/src/zigen/plugin/db/ui/actions/CopyDBAction.java (revision 258)
@@ -26,14 +26,12 @@
2626
2727 public class DBNameValidator implements IInputValidator {
2828
29- final String name = Messages.getString("CopyDBAction.0"); //$NON-NLS-1$
30-
3129 public String isValid(String str) {
32- if (str == null || str.trim().equals("")) { //$NON-NLS-1$
33- return name + Messages.getString("CopyDBAction.2"); //$NON-NLS-1$
30+ if (str == null || str.trim().equals("")) { //$NON-NLS-1$
31+ return Messages.getString("CopyDBAction.0"); //$NON-NLS-1$
3432 }
3533 if (DBConfigManager.hasSection(str)) {
36- return Messages.getString("CopyDBAction.3") + name + Messages.getString("CopyDBAction.4"); //$NON-NLS-1$ //$NON-NLS-2$
34+ return Messages.getString("CopyDBAction.3"); //$NON-NLS-1$
3735 }
3836 return null;
3937 }
@@ -58,7 +56,7 @@
5856 IDBConfig copyConfig = (IDBConfig) config.clone();
5957
6058 Shell shell = DbPlugin.getDefault().getShell();
61- String name = config.getDbName() + Messages.getString("CopyDBAction.7"); //$NON-NLS-1$
59+ String name = Messages.getFormattedString("CopyDBAction.7", new Object[]{config.getDbName()}); //$NON-NLS-1$
6260
6361 InputDialog dialog = new InputDialog(shell, Messages.getString("CopyDBAction.8"), Messages.getString("CopyDBAction.9"), name, new DBNameValidator()); //$NON-NLS-1$ //$NON-NLS-2$
6462
旧リポジトリブラウザで表示