breakCommand,
lastHistory,
nextHistory,
+ showAllHistories,
sendRollback,
sendCommit,
connect,
}
/**
+ * Prepares submitting.
+ * Clears selection, moves cursor to end, and focuses this.
+ */
+ void prepareSubmitting() {
+ final int ep = getEndPosition();
+ setSelectionStart(ep);
+ moveCaretPosition(ep);
+ requestFocus();
+ }
+
+ /**
* Clears text.
*/
void clear() {
group.command=Command
group.command.mnemonic=C
-group.command.items=executeCommand,breakCommand,,lastHistory,nextHistory,sendRollback,sendCommit,,connect,disconnect,,postProcessMode,inputEcryptionKey,editConnectors
+group.command.items=executeCommand,breakCommand,,lastHistory,nextHistory,showAllHistories,sendRollback,sendCommit,,connect,disconnect,,postProcessMode,inputEcryptionKey,editConnectors
item.executeCommand=Execute
item.executeCommand.mnemonic=X
item.executeCommand.shortcut=ctrl M
item.nextHistory=History Next
item.nextHistory.mnemonic=N
item.nextHistory.shortcut=ctrl DOWN
+item.showAllHistories=Show All Histories
+item.showAllHistories.mnemonic=A
item.sendRollback=Rollback
item.sendRollback.mnemonic=R
item.sendCommit=Commit
item.breakCommand=中断
item.lastHistory=前のコマンド履歴
item.nextHistory=次のコマンド履歴
+item.showAllHistories=コマンド履歴を全表示
item.sendRollback=ロールバック
item.sendCommit=コミット
item.connect=接続
retrieveHistory(-1);
} else if (ev.isAnyOf(nextHistory)) {
retrieveHistory(+1);
+ } else if (ev.isAnyOf(showAllHistories)) {
+ if (historyList.isEmpty()) {
+ op.showInformationMessageDialog(res.get("w.no-histories"), null);
+ } else {
+ final String msg = res.get("i.choose-history", historyList.size());
+ final String lastCommand = historyList.get(historyList.size() - 1);
+ Object value = op.showInputDialog(msg, null, historyList.toArray(), lastCommand);
+ if (value != null) {
+ textArea.replace((String)value);
+ textArea.prepareSubmitting();
+ }
+ }
} else if (ev.isAnyOf(sendRollback)) {
if (confirmCommitable()
&& showConfirmDialog(op, res.get("i.confirm-rollback"), null, OK_CANCEL_OPTION) == OK_OPTION) {
historyIndex = historyList.size() - 1;
}
textArea.replace(historyList.get(historyIndex));
- final int endPosition = textArea.getEndPosition();
- textArea.setSelectionStart(endPosition);
- textArea.moveCaretPosition(endPosition);
- textArea.requestFocus();
+ textArea.prepareSubmitting();
}
/**
currentDirectory = dir;
}
+ Object showInputDialog(String message, String title, Object[] values, Object initial) {
+ return showInputDialog(this, message, title, values, initial);
+ }
+
+ static Object showInputDialog(Component parent, String message, String title, Object[] values, Object initial) {
+ JOptionPane p = new JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION);
+ p.setWantsInput(true);
+ p.setSelectionValues(values);
+ p.setInitialSelectionValue(initial);
+ p.setComponentOrientation(parent.getComponentOrientation());
+ JDialog d = p.createDialog(parent, title);
+ Dimension size = d.getSize();
+ if (size.width > parent.getWidth() || size.height > parent.getHeight()) {
+ if (size.width > parent.getWidth()) {
+ size.width = (int)(parent.getWidth() * 0.95);
+ }
+ if (size.height > parent.getHeight()) {
+ size.height = (int)(parent.getHeight() * 0.95);
+ }
+ d.setPreferredSize(size);
+ d.setSize(size);
+ d.setLocationRelativeTo(parent);
+ }
+ p.selectInitialValue();
+ d.setVisible(true);
+ d.dispose();
+ Object value = p.getInputValue();
+ return (value == UNINITIALIZED_VALUE) ? null : value;
+ }
+
void showInformationMessageDialog(String message, String title) {
showInformationMessageDialog(this, message, title);
}
i.cancelled=The command was canceled.\n(The process in the server-side may be still working.)
i.choose-connection=Choose Connector
+i.choose-history=Choose a command history of {0} histories
i.confirm-close=Do you want to close this window?
i.confirm-commit=Do you want to commit?
i.confirm-overwrite=The file [{0}] already exists. Overwrite it?
w.connector-readonly=This connector is read-only.
w.import-target-not-available=The destination to import is not available.
w.no-connector=No Connector.
+w.no-histories=No command histories.
w.not-connect=Not connected.
e.cannot-open-help-automatically=Can't open help({0}) automatically on this platform.
e.enables-select-just-1-table=You can choose only one of tables.
i.cancelled=コマンドがキャンセルされました。\n(サーバ側の処理はキャンセルされていません。)
i.choose-connection=接続を選択
+i.choose-history=コマンド履歴{0}件からコマンドを選択
i.confirm-close=ウィンドウを閉じてよろしいですか?
i.confirm-commit=コミットします。よろしいですか?
i.confirm-overwrite=ファイル {0} は存在します。\n上書きしますか?
w.connector-readonly=コネクタは読取専用です。
w.import-target-not-available=インポート先が無効です。
w.no-connector=接続設定がありません。
+w.no-histories=コマンド履歴がありません。
w.not-connect=接続されていません。
e.cannot-open-help-automatically=このプラットフォームでは自動でヘルプ({0})を開けません。\r
e.enables-select-just-1-table=テーブルは1つだけ選択できます。