public class RichTextToolbar extends Toolbar
Widget
that represents the toolbar for a
RichTextArea
. The toolbar allows to format the selected text or insert images, hyperlinks, etc.Modifier and Type | Class and Description |
---|---|
(package private) class |
RichTextToolbar.FontSettingsPopup
The
PopupWindow for the font settings. |
private class |
RichTextToolbar.UpdateHandler
This class is the handler to update the toolbar buttons, etc.
|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
Modifier and Type | Field and Description |
---|---|
private Map<RichTextFeature,FeatureBehavior> |
behaviorMap |
private NlsBundleClientUiRoot |
bundle
The
NlsBundleClientUiRoot for NLS. |
private static com.google.gwt.user.client.ui.RichTextArea.FontSize[] |
FONT_SIZES
The available font sizes.
|
private RichTextToolbar.FontSettingsPopup |
fontSettingsPopup |
private com.google.gwt.user.client.ui.RichTextArea.Formatter |
formatter
The
RichTextArea.Formatter for the RichTextArea . |
private com.google.gwt.user.client.ui.RichTextArea |
richTextArea
The associated
RichTextArea to modify via this toolbar. |
Constructor and Description |
---|
RichTextToolbar(com.google.gwt.user.client.ui.RichTextArea richTextArea)
Creates a new toolbar that drives the given rich text area.
|
Modifier and Type | Method and Description |
---|---|
private void |
addBehavior(FeatureBehavior behavior) |
protected void |
addFeatureBehaviors()
Adds all available FeatureBehavior s at construction time. |
private void |
createButtonGroup(RichTextFeature... features)
Creates a new
ButtonGroup with buttons for the given RichTextFeature s. |
private FeatureBehavior |
getBehavior(RichTextFeature feature) |
private RichTextToolbar.FontSettingsPopup |
getFontSettingsPopup() |
(package private) com.google.gwt.user.client.ui.RichTextArea.Formatter |
getFormatter() |
protected void |
invokeFeature(RichTextFeature feature) |
(package private) void |
openFontSettingsPopup()
Opens a popup with the font related
feature settings . |
void |
setEnabled(boolean enabled) |
void |
setFeatureAvailable(RichTextFeature feature,
boolean available)
Sets the given
RichTextFeature to the given availability. |
private void |
updateFontSettings()
Updates the status of the
RichTextToolbar.FontSettingsPopup . |
private void |
updateToolbar()
Updates the status of the toolbar (with all the toggle buttons).
|
add, addBlurHandler, addFocusHandler, endGroup, onFocus, onKeyUp, startGroup
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
add, adopt, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getWidgetIndex
getWidget, getWidgetCount, getWidgetIndex, remove
forEach, spliterator
private static final com.google.gwt.user.client.ui.RichTextArea.FontSize[] FONT_SIZES
private final com.google.gwt.user.client.ui.RichTextArea richTextArea
RichTextArea
to modify via this toolbar.private final com.google.gwt.user.client.ui.RichTextArea.Formatter formatter
RichTextArea.Formatter
for the RichTextArea
.private final Map<RichTextFeature,FeatureBehavior> behaviorMap
getBehavior(RichTextFeature)
private final NlsBundleClientUiRoot bundle
NlsBundleClientUiRoot
for NLS.private RichTextToolbar.FontSettingsPopup fontSettingsPopup
getFontSettingsPopup()
public RichTextToolbar(com.google.gwt.user.client.ui.RichTextArea richTextArea)
richTextArea
- the rich text area to be controlledprotected void addFeatureBehaviors()
Adds
all available FeatureBehavior
s at construction time.private void addBehavior(FeatureBehavior behavior)
behavior
- the FeatureBehavior
to register in the internal Map
.private FeatureBehavior getBehavior(RichTextFeature feature)
feature
- is the RichTextFeature
.FeatureBehavior
for the given RichTextFeature
. Invoking
getFeature()
on the result has to return the given
RichTextFeature
.com.google.gwt.user.client.ui.RichTextArea.Formatter getFormatter()
RichTextArea.Formatter
instance of the RichTextArea
.private RichTextToolbar.FontSettingsPopup getFontSettingsPopup()
RichTextToolbar.FontSettingsPopup
. Lazily created on the first call.void openFontSettingsPopup()
feature settings
.private void createButtonGroup(RichTextFeature... features)
ButtonGroup
with buttons for the given RichTextFeature
s.features
- are the RichTextFeature
s to create buttons for.protected void invokeFeature(RichTextFeature feature)
feature
- is the RichTextFeature
to invoke (e.g. if according button has been clicked).public void setFeatureAvailable(RichTextFeature feature, boolean available)
RichTextFeature
to the given availability.feature
- is the RichTextFeature
.available
- - true
if the given feature
should be available (button
visible), false
otherwise.private void updateToolbar()
private void updateFontSettings()
RichTextToolbar.FontSettingsPopup
.public void setEnabled(boolean enabled)
enabled
- - true
to enable, false
to disable.Copyright © 2001–2016 mmm-Team. All rights reserved.