Show input label in input dialog title

This commit is contained in:
hneemann 2017-07-09 12:48:50 +02:00
parent 5d27b3db1d
commit 9571fd0fd3
4 changed files with 8 additions and 5 deletions

View File

@ -72,7 +72,7 @@ public class InputShape implements Shape {
value.setValue(1 - value.getValue());
});
} else {
SingleValueDialog.editValue(pos, value, modelSync);
SingleValueDialog.editValue(pos, label, value, modelSync);
}
return true;
}

View File

@ -57,8 +57,8 @@ public final class SingleValueDialog extends JDialog {
private long editValue;
private boolean ok = false;
private SingleValueDialog(Point pos, ObservableValue value) {
super((Frame) null, Lang.get("attr_dialogTitle"), true);
private SingleValueDialog(Point pos, String label, ObservableValue value) {
super((Frame) null, Lang.get("win_valueInputTitle_N", label), true);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
editValue = value.getValue();
@ -211,11 +211,12 @@ public final class SingleValueDialog extends JDialog {
* Edits a single value
*
* @param pos the position to pop up the dialog
* @param label the name of the value
* @param value the value to edit
* @param modelSync used to access the running model
*/
public static void editValue(Point pos, ObservableValue value, Sync modelSync) {
SingleValueDialog svd = new SingleValueDialog(pos, value);
public static void editValue(Point pos, String label, ObservableValue value, Sync modelSync) {
SingleValueDialog svd = new SingleValueDialog(pos, label, value);
if (svd.showDialog()) {
if (svd.getSelectedFormat().equals(InMode.HIGHZ)) {
modelSync.access(() -> value.set(0, true));

View File

@ -982,6 +982,7 @@ Die Icons stammen aus dem Tango Desktop Project.</string>
<string name="win_table">Tabelle</string>
<string name="win_table_exportDialog">Export</string>
<string name="win_itempicker_title">Auswahl</string>
<string name="win_valueInputTitle_N">Eingabe {0}</string>
<string name="btn_help">Hilfe</string>
<string name="msg_expressionHelpTitle">Ausdrücke</string>
<string name="msg_expressionHelp">Zur Definition eines Ausdruckes können alle üblichen

View File

@ -969,6 +969,7 @@ The icons are taken from the Tango Desktop Project.</string>
<string name="win_itempicker_title">Select</string>
<string name="win_testdata_N">Testdata {0}</string>
<string name="win_data">Data</string>
<string name="win_valueInputTitle_N">Input {0}</string>
<string name="btn_help">Help</string>