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, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValue
getFeature
private 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 FeatureBehavior
updateToolbar
in class AbstractFeatureBehavior
public void updateFontSettings()
RichTextArea
.updateFontSettings
in interface FeatureBehavior
updateFontSettings
in class AbstractFeatureBehavior
public boolean isEnabled()
isEnabled
in interface AttributeReadEnabled
public void setEnabled(boolean enabled)
setEnabled
in interface AttributeWriteEnabled
public com.google.gwt.user.client.ui.CheckBox getFontSettingsWidget()
getFontSettingsWidget
in interface FeatureBehavior
getFontSettingsWidget
in class AbstractFeatureBehavior
Widget
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 FeatureBehavior
setFontSettingsPreviewElement
in class AbstractFeatureBehavior
element
- 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 AbstractFeatureBehavior
true
if the font settings widget
is available and
has already been created, false
otherwise.public SimpleToggleButton getToolbarWidget()
getToolbarWidget
in interface FeatureBehavior
public 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.ClickHandler
public void applyFontSettings()
RichTextArea
according to the value from the widget for
the font-settings.applyFontSettings
in interface FeatureBehavior
applyFontSettings
in class AbstractFeatureBehavior
protected abstract void toggle()
feature
.Copyright © 2001–2016 mmm-Team. All rights reserved.