/** * Create a new control */ public StyledTextArea() { this.getStyleClass().add("styled-text-area"); //$NON-NLS-1$ this.contentProperty = new ContentProperty(this, "content", new DefaultContent()); //$NON-NLS-1$ setFocusTraversable(true); }
@Override protected void invalidated() { if (this.oldContent != null) { StyledTextContent content = this.oldContent.get(); if (content != null) { content.removeTextChangeListener(StyledTextArea.this.textChangeListener); } } StyledTextContent newContent = get(); this.oldContent = new WeakReference<StyledTextContent>(newContent); newContent.addTextChangeListener(StyledTextArea.this.textChangeListener); } }
public ContentProperty(Object bean, String name, @NonNull StyledTextContent initialValue) { super(bean, name, initialValue); invalidated(); }
@Override protected void invalidated() { if (this.oldContent != null) { StyledTextContent content = this.oldContent.get(); if (content != null) { content.removeTextChangeListener(StyledTextArea.this.textChangeListener); } } StyledTextContent newContent = get(); this.oldContent = new WeakReference<StyledTextContent>(newContent); newContent.addTextChangeListener(StyledTextArea.this.textChangeListener); } }
public ContentProperty(Object bean, String name, @NonNull StyledTextContent initialValue) { super(bean, name, initialValue); invalidated(); }
/** * Create a new control */ public StyledTextArea() { this.getStyleClass().add("styled-text-area"); //$NON-NLS-1$ this.contentProperty = new ContentProperty(this, "content", new DefaultContent()); //$NON-NLS-1$ setFocusTraversable(true); //FIXME This rules out the CSS-Setting! // we cannot change remove it because the dynamic zoom depends on it -.- DoubleBinding lineHeight = org.eclipse.fx.ui.controls.Util.createTextHeightBinding("Pj", fontProperty(), this.fontZoomFactor); //$NON-NLS-1$ fixedLineHeightProperty().bind(lineHeight.multiply(1.3)); }