You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to create a new SimpleControl subclass called SimpleHtmlEditorControl for my project and I cannot access the private field instance variable in SimpleControl in my subclass because it is private. This is the code that I wrote:
public class SimpleHtmlEditorControl extends SimpleControl<StringField> {
private StackPane stackPane;
private Label fieldLabel;
private Label readOnlyLabel;
private HTMLEditor htmlEditor;
@Override
public void initializeParts() {
super.initializeParts();
stackPane = new StackPane();
fieldLabel = new Label();
readOnlyLabel = new Label();
htmlEditor = new HTMLEditor();
}
@Override
public void layoutParts() {
super.layoutParts();
readOnlyLabel.getStyleClass().add("read-only-label");
readOnlyLabel.setPrefHeight(26);
stackPane.getChildren().addAll(htmlEditor, readOnlyLabel);
stackPane.setAlignment(Pos.CENTER_LEFT);
// Cannot access private instance variable 'field' here.
int columns = 12;
if (columns < 3) {
add(fieldLabel, 0, 0, columns, 1);
add(stackPane, 0, 1, columns, 1);
} else {
add(fieldLabel, 0, 0, 2, 1);
add(stackPane, 2, 0, columns - 2, 1);
}
}
@Override
public void setupBindings() {
super.setupBindings();
}
@Override
public void setupValueChangedListeners() {
super.setupValueChangedListeners();
}
}
If I hardcode the column count, as you can see below my inline code comment above, the HTMLEditor is displayed fine. Otherwise, if I try to to call getSpan() on the field to get the field's actual column span I get a compile time error. Can you please make that field protected so subclasses can use it?
The text was updated successfully, but these errors were encountered:
I'm attempting to create a new SimpleControl subclass called SimpleHtmlEditorControl for my project and I cannot access the private field instance variable in SimpleControl in my subclass because it is private. This is the code that I wrote:
If I hardcode the column count, as you can see below my inline code comment above, the HTMLEditor is displayed fine. Otherwise, if I try to to call getSpan() on the field to get the field's actual column span I get a compile time error. Can you please make that field protected so subclasses can use it?
The text was updated successfully, but these errors were encountered: