Skip to content

Commit e4780db

Browse files
committed
CSSTUDIO-2954 Move informative tooltips to messages.properties.
1 parent 88928c8 commit e4780db

File tree

5 files changed

+41
-13
lines changed

5 files changed

+41
-13
lines changed

app/display/model/src/main/java/org/csstudio/display/builder/model/Messages.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ public class Messages
5252
FontStyle_Regular,
5353
GroupWidget_Description,
5454
GroupWidget_Name,
55+
InformativeTooltipActions,
56+
InformativeTooltipAlarmBorder,
57+
InformativeTooltipHeight,
58+
InformativeTooltipName,
59+
InformativeTooltipPVName,
60+
InformativeTooltipRules,
61+
InformativeTooltipScripts,
62+
InformativeTooltipTooltip,
63+
InformativeTooltipVisible,
64+
InformativeTooltipWidgetClass,
65+
InformativeTooltipWidth,
66+
InformativeTooltipX,
67+
InformativeTooltipY,
5568
Interpolation_Automatic,
5669
Interpolation_Interpolate,
5770
Interpolation_None,

app/display/model/src/main/java/org/csstudio/display/builder/model/Widget.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,23 +211,23 @@ public Widget(final String type, final int default_width, final int default_heig
211211
// -- Mandatory properties --
212212
prelim_properties.add(this.type = propType.createProperty(this, type));
213213
prelim_properties.add(name = propName.createProperty(this, ""));
214-
name.setInformativeTooltip("The name of the widget.");
214+
name.setInformativeTooltip(Messages.InformativeTooltipName);
215215
prelim_properties.add(widget_class = propWidgetClass.createProperty(this, WidgetClassSupport.DEFAULT));
216-
widget_class.setInformativeTooltip("The style class of the widget.");
216+
widget_class.setInformativeTooltip(Messages.InformativeTooltipWidgetClass);
217217
prelim_properties.add(x = propX.createProperty(this, 0));
218-
x.setInformativeTooltip("The x-coordinate of the widget counted in pixels from the left side of the screen.");
218+
x.setInformativeTooltip(Messages.InformativeTooltipX);
219219
prelim_properties.add(y = propY.createProperty(this, 0));
220-
y.setInformativeTooltip("The y-coordinate of the widget counted in pixels from the top of the screen.");
220+
y.setInformativeTooltip(Messages.InformativeTooltipY);
221221
prelim_properties.add(width = propWidth.createProperty(this, default_width));
222-
width.setInformativeTooltip("The width of the widget in pixels.");
222+
width.setInformativeTooltip(Messages.InformativeTooltipWidth);
223223
prelim_properties.add(height = propHeight.createProperty(this, default_height));
224-
height.setInformativeTooltip("The height of the widget in pixels.");
224+
height.setInformativeTooltip(Messages.InformativeTooltipHeight);
225225
prelim_properties.add(actions = propActions.createProperty(this, ActionInfos.EMPTY));
226-
actions.setInformativeTooltip("Actions to execute when the widget is clicked on.");
226+
actions.setInformativeTooltip(Messages.InformativeTooltipActions);
227227
prelim_properties.add(rules = propRules.createProperty(this, Collections.emptyList()));
228-
rules.setInformativeTooltip("Rules associated with the widget.");
228+
rules.setInformativeTooltip(Messages.InformativeTooltipRules);
229229
prelim_properties.add(scripts = propScripts.createProperty(this, Collections.emptyList()));
230-
scripts.setInformativeTooltip("Scripts associated with the widget.");
230+
scripts.setInformativeTooltip(Messages.InformativeTooltipScripts);
231231

232232
// -- Widget-specific properties --
233233
defineProperties(prelim_properties);

app/display/model/src/main/java/org/csstudio/display/builder/model/widgets/PVWidget.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,12 @@ protected void defineProperties (final List<WidgetProperty<?>> properties )
8282
{
8383
super.defineProperties(properties);
8484
properties.add(pv_name = propPVName.createProperty(this, ""));
85-
pv_name.setInformativeTooltip("The name of the PV to display in the widget.");
85+
pv_name.setInformativeTooltip(Messages.InformativeTooltipPVName);
8686
pv_name.addPropertyListener((property, oldValue, newValue) -> pv_value.setValue(null));
8787
properties.add(pv_value = runtimePropPVValue.createProperty(this, null));
8888
properties.add(alarm_border = propBorderAlarmSensitive.createProperty(this, true));
89-
alarm_border.setInformativeTooltip("Should an alarm border be shown around the widget when the displayed PV signals an alarm?");
89+
alarm_border.setInformativeTooltip(Messages.InformativeTooltipAlarmBorder);
90+
var s = Messages.InformativeTooltipHeight;
9091
}
9192

9293
@Override

app/display/model/src/main/java/org/csstudio/display/builder/model/widgets/VisibleWidget.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import java.util.List;
1515

16+
import org.csstudio.display.builder.model.Messages;
1617
import org.csstudio.display.builder.model.Widget;
1718
import org.csstudio.display.builder.model.WidgetProperty;
1819

@@ -57,9 +58,9 @@ protected void defineProperties(final List<WidgetProperty<?>> properties)
5758
{
5859
super.defineProperties(properties);
5960
properties.add(visible = propVisible.createProperty(this, true));
60-
visible.setInformativeTooltip("Should the widget be visible?");
61+
visible.setInformativeTooltip(Messages.InformativeTooltipVisible);
6162
properties.add(tooltip = propTooltip.createProperty(this, getInitialTooltip()));
62-
tooltip.setInformativeTooltip("Text to display in the tooltip of the widget when hovering with the mouse over the widget.");
63+
tooltip.setInformativeTooltip(Messages.InformativeTooltipTooltip);
6364
// Start 'connected', assuming there are no PVs
6465
properties.add(connected = runtimePropConnected.createProperty(this, true));
6566
}

app/display/model/src/main/resources/org/csstudio/display/builder/model/messages.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ FontStyle_Italic=Italic
3434
FontStyle_Regular=Regular
3535
GroupWidget_Description=Group of widgets
3636
GroupWidget_Name=Group
37+
InformativeTooltipActions=Actions to execute when the widget is clicked on.
38+
InformativeTooltopAlarmBorder=Should an alarm border be shown around the widget when the displayed PV signals an alarm?
39+
InformativeTooltipHeight=The height of the widget in pixels.
40+
InformativeTooltipName=The name of the widget.
41+
InformativTooltipPVName=The name of the PV to connect to and to display in the widget.
42+
InformativeTooltipRules=Rules associated with the widget.
43+
InformativeTooltipScripts=Scripts associated with the widget.
44+
InformativeTooltipTooltip=Text to display in the tooltip of the widget when hovering with the mouse over the widget.
45+
InformativeTooltipVisible=Should the widget be visible?
46+
InformativeTooltipWidgetClass=The style class of the widget.
47+
InformativeTooltipWidth=The width of the widget in pixels.
48+
InformativeTooltipX=The x-coordinate of the widget counted in pixels from the left side of the screen.
49+
InformativeTooltipY=The y-coordinate of the widget counted in pixels from the top of the screen.
3750
Interpolation_Automatic=Automatic
3851
Interpolation_Interpolate=Interpolate
3952
Interpolation_None=None

0 commit comments

Comments
 (0)