Skip to content

Commit a0c68f1

Browse files
committed
CSSTUDIO-2072 Add the configuration option 'org.csstudio.trends.databrowser3/assign_pvs_from_clipboard_to_the_same_axis_by_default'.
1 parent 0ed4488 commit a0c68f1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

app/databrowser/src/main/java/org/csstudio/trends/databrowser3/preferences/Preferences.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ public static class TimePreset
101101
/** Setting */
102102
@Preference public static boolean config_dialog_supported;
103103

104+
@Preference
105+
public static boolean assign_pvs_from_clipboard_to_the_same_axis_by_default;
106+
107+
104108
@Preference
105109
public static String value_axis_label_policy;
106110

app/databrowser/src/main/java/org/csstudio/trends/databrowser3/ui/AddPVDialog.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ private Node createContent(final Model model, final int count)
169169
useTheSameAxisForAllPVs = true;
170170
radioButton_useTheSame.setSelected(true);
171171
row += 1;
172+
173+
if (Preferences.assign_pvs_from_clipboard_to_the_same_axis_by_default) {
174+
radioButton_useTheSame.setSelected(true);
175+
radioButton_useTheSame.getOnAction().handle(null);
176+
}
177+
else {
178+
radioButton_useDifferent.setSelected(true);
179+
radioButton_useDifferent.getOnAction().handle(null);
180+
}
172181
}
173182

174183
for (int i=0; i<count; ++i)
@@ -232,7 +241,7 @@ private Node createContent(final Model model, final int count)
232241
}
233242
ScrollPane scrollPane = new ScrollPane(gridPane);
234243
scrollPane.setFitToWidth(true);
235-
axes.forEach(axis -> axis.setDisable(true)); // By default, the "yes" radio button is selected, and individual axes for each PV are disabled.
244+
axes.forEach(axis -> axis.setDisable(useTheSameAxisForAllPVs)); // When the "use the same axis for all PVs" radio button is selected, then individual axes for each PV are disabled. Otherwise, they are enabled.
236245
return scrollPane;
237246
}
238247

0 commit comments

Comments
 (0)