Skip to content

Commit d0dd5a4

Browse files
committed
Add 'enabled' check and remove static declaration of ID variable
1 parent a0d96c6 commit d0dd5a4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/TextEntryRepresentation.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class TextEntryRepresentation extends RegionBaseRepresentation<TextInputC
5252
*/
5353
private boolean active = false;
5454
private volatile boolean enabled = true;
55-
private static final String NODE_ID = UUID.randomUUID().toString();;
55+
private final String node_id = UUID.randomUUID().toString();;
5656

5757

5858
private final DirtyFlag dirty_size = new DirtyFlag();
@@ -104,7 +104,7 @@ public TextInputControl createJFXNode() throws Exception
104104
text = new TextField();
105105
text.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE);
106106
text.getStyleClass().add("text_entry");
107-
text.setId(NODE_ID);
107+
text.setId(node_id);
108108

109109
if (! toolkit.isEditMode())
110110
{
@@ -430,10 +430,11 @@ else if(jfx_node instanceof TextArea){
430430
PseudoClass alignmentClass = PseudoClass.getPseudoClass(alignment);
431431
jfx_node.pseudoClassStateChanged(alignmentClass, true);
432432

433-
if (jfx_node.getScene() != null) {
433+
if (jfx_node.getScene() != null && !enabled) {
434434
// Need to get the TextArea 'content' node to set the cursor
435435
// for the whole widget otherwise it will only show on the borders.
436-
jfx_node.getScene().lookup("#"+NODE_ID+" .content").setCursor(Cursors.NO_WRITE);
436+
jfx_node.getScene().lookup("#"+node_id+" .content").setCursor(Cursors.NO_WRITE);
437+
jfx_node.layout();
437438
}
438439
}
439440
}

0 commit comments

Comments
 (0)