abstract class AbstractToggleFeatureBehavior extends AbstractFeatureBehavior implements com.google.gwt.event.dom.client.ClickHandler, AttributeWriteValue<Boolean>
FeatureBehavior for a feature that has
a Boolean state that is toggled if toolbar widget is clicked.| Modifier and Type | Field and Description |
|---|---|
private com.google.gwt.user.client.ui.CheckBox |
fontSettingsWidget |
private SimpleToggleButton |
toolbarWidget |
| Constructor and Description |
|---|
AbstractToggleFeatureBehavior(RichTextToolbar richTextToolbar)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyFontSettings()
Updates the
RichTextArea according to the value from the widget for
the font-settings. |
com.google.gwt.user.client.ui.CheckBox |
getFontSettingsWidget() |
SimpleToggleButton |
getToolbarWidget() |
protected boolean |
hasFontSettingsWidget() |
boolean |
isEnabled() |
void |
onClick(com.google.gwt.event.dom.client.ClickEvent event) |
void |
setEnabled(boolean enabled) |
void |
setFontSettingsPreviewElement(com.google.gwt.dom.client.Element element)
Updates the
RichTextArea according to the value from the widget for
the font-settings. |
void |
setValue(Boolean value)
This method sets the
value. |
protected abstract void |
toggle()
Toggles the
feature. |
void |
updateFontSettings()
Updates the value of the widget for the font-settings according to the state of the
RichTextArea. |
protected abstract void |
updateFontSettings(boolean checked,
com.google.gwt.dom.client.Style style) |
void |
updateFontSettings(com.google.gwt.dom.client.Style style) |
void |
updateToolbar()
Updates the status of the
FeatureBehavior in the toolbar widget after
a change. |
createFontSettingsLabel, createId, getFontSettingsLabel, getFormatter, getIconMarkup, getLocalizedLabel, getRichTextToolbar, isVisible, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetValuegetFeatureprivate final SimpleToggleButton toolbarWidget
getToolbarWidget()private com.google.gwt.user.client.ui.CheckBox fontSettingsWidget
getFontSettingsWidget()public AbstractToggleFeatureBehavior(RichTextToolbar richTextToolbar)
richTextToolbar - is the RichTextToolbar owning this FeatureBehavior.public void updateToolbar()
FeatureBehavior in the toolbar widget after
a change. E.g. toggle buttons are updated to reflect the current state.updateToolbar in interface FeatureBehaviorupdateToolbar in class AbstractFeatureBehaviorpublic void updateFontSettings()
RichTextArea.updateFontSettings in interface FeatureBehaviorupdateFontSettings in class AbstractFeatureBehaviorpublic boolean isEnabled()
isEnabled in interface AttributeReadEnabledpublic void setEnabled(boolean enabled)
setEnabled in interface AttributeWriteEnabledpublic com.google.gwt.user.client.ui.CheckBox getFontSettingsWidget()
getFontSettingsWidget in interface FeatureBehaviorgetFontSettingsWidget in class AbstractFeatureBehaviorWidget for the feature in the
RichTextToolbar.FontSettingsPopup.public void setFontSettingsPreviewElement(com.google.gwt.dom.client.Element element)
RichTextArea according to the value from the widget for
the font-settings.setFontSettingsPreviewElement in interface FeatureBehaviorsetFontSettingsPreviewElement in class AbstractFeatureBehaviorelement - is the Element where to apply font settings whenever the value changed.public void updateFontSettings(com.google.gwt.dom.client.Style style)
style - the Style to update.protected abstract void updateFontSettings(boolean checked,
com.google.gwt.dom.client.Style style)
checked - - the value of the checkbox.style - the Style to update.protected boolean hasFontSettingsWidget()
hasFontSettingsWidget in class AbstractFeatureBehaviortrue if the font settings widget is available and
has already been created, false otherwise.public SimpleToggleButton getToolbarWidget()
getToolbarWidget in interface FeatureBehaviorpublic void setValue(Boolean value)
value.setValue in interface AttributeWriteValue<Boolean>value - is the new value. May be null unless otherwise stated.public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick in interface com.google.gwt.event.dom.client.ClickHandlerpublic void applyFontSettings()
RichTextArea according to the value from the widget for
the font-settings.applyFontSettings in interface FeatureBehaviorapplyFontSettings in class AbstractFeatureBehaviorprotected abstract void toggle()
feature.Copyright © 2001–2016 mmm-Team. All rights reserved.