|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.inet.editor.BaseEditorToolBar
public class BaseEditorToolBar
This is the toolbar of the base editor. It support custom button groups which can be enabled, disabled or hidden. The groups will be loaded on demand, as required by the current document
Field Summary | |
---|---|
static java.lang.Integer |
GROUP_DEFAULT
Group for all components, which are directly added to the toolbar. |
static java.lang.Integer |
GROUP_FORMATSWITCH
The Constant GROUP_FORMATSWITCH. |
static java.lang.Integer |
GROUP_HTMLFORMAT
The Constant GROUP_HTMLFORMAT. |
static java.lang.Integer |
GROUP_SPELLCHECKER
The Constant GROUP_SPELLCHECKER. |
static java.lang.Integer |
GROUP_UNDOREDO
The Constant GROUP_UNDOREDO. |
Constructor Summary | |
---|---|
BaseEditorToolBar(BaseEditor editor,
boolean hasToolbar,
boolean isEditable,
boolean isHtml)
Creates the datamodel for the toolbar of the BaseEditor. |
Method Summary | |
---|---|
void |
addComponent(java.awt.Component comp,
java.lang.Integer group,
java.awt.event.ActionListener listener)
Adds a component to the model. |
void |
componentAdded(java.awt.event.ContainerEvent e)
|
void |
componentRemoved(java.awt.event.ContainerEvent e)
|
void |
createComponentGroup(java.lang.Integer groupKey,
boolean requiresLeftSep,
boolean requiresRightSep,
boolean visible)
Creates a new component group for the toolbar. |
void |
disableGroups(java.lang.Integer... groups)
Disables / hides the given component groups on the toolbar. |
void |
enableGroups(java.lang.Integer... groups)
Enables / displays the given component groups on the toolbar. |
javax.swing.JButton |
getAddimage()
Gets the addimage. |
javax.swing.Action |
getAddImageAction()
Gets the adds the image action. |
javax.swing.JToggleButton |
getAutoSpell()
Gets the auto spell. |
javax.swing.JButton |
getBlockLeft()
Gets the block left. |
javax.swing.JButton |
getBlockRight()
Gets the block right. |
javax.swing.JToggleButton |
getBold()
Gets the bold. |
javax.swing.JButton |
getBulletList()
Gets the bullet list. |
int |
getButtonoffset()
Gets the buttonoffset. |
javax.swing.JToggleButton |
getCenter()
Gets the center. |
ColorList |
getColorList()
Gets the color list. |
javax.swing.JPopupMenu |
getColorMenu()
Gets the color menu. |
javax.swing.JButton |
getFontColor()
Gets the font color. |
javax.swing.JComboBox |
getFontNameComboBox()
Gets the font name combo box. |
javax.swing.JComboBox |
getFontSizeComboBox()
Gets the font size combo box. |
javax.swing.JButton |
getHr()
Gets the hr. |
javax.swing.JButton |
getHtmlFormat()
Gets the html format. |
javax.swing.JButton |
getHyperlink()
Gets the hyperlink. |
javax.swing.JToggleButton |
getItalic()
Gets the italic. |
javax.swing.JToggleButton |
getJustify()
Gets the justify. |
javax.swing.JToggleButton |
getLeft()
Gets the left. |
javax.swing.JButton |
getNumberList()
Gets the number list. |
javax.swing.JButton |
getRedoButton()
Gets the redo button. |
javax.swing.JToggleButton |
getRight()
Gets the right. |
javax.swing.JButton |
getSpellchecker()
Gets the spellchecker. |
javax.swing.JToolBar |
getToolbar()
returns the internal toolbar object, or null if it's not present. |
javax.swing.JToggleButton |
getUnderline()
Gets the underline. |
javax.swing.JButton |
getUndoButton()
Gets the undo button. |
void |
notifyFormat(boolean isHtml)
Inform this object of a content type change, will modify the format switch. |
void |
setAddImageEnabled(boolean enabled)
Sets the adds the image enabled. |
void |
setAutoSpellSelected(boolean enabled)
Sets the auto spell selected. |
void |
setBoldSelected(boolean b)
Sets the bold selected. |
void |
setCenterSelected(boolean b)
Sets the center selected. |
void |
setEditable(boolean editable)
Proxy for the Swing setEditable() function on the toolbar and it's components. |
void |
setEnabled(boolean enabled)
Enables or disables all toolbar components. |
void |
setItalicSelected(boolean b)
Sets the italic selected. |
void |
setJustifySelected(boolean b)
Sets the justify selected. |
void |
setLeftSelected(boolean b)
Sets the left selected. |
void |
setRedoButtonEnabled(boolean canRedo)
Sets the redo button enabled. |
void |
setRightSelected(boolean b)
Sets the right selected. |
void |
setSelectedFontName(java.lang.String fontName)
Sets the selected font name. |
void |
setSelectedFontSize(java.lang.Object fontSize)
Sets the selected font size. |
void |
setSelectionColor(java.awt.Color value)
Sets the selection color. |
void |
setToolbarVisible(boolean visible)
Proxy for toolbar.setVisible(), will work without a toolbar as well |
void |
setUnderlineSelected(boolean b)
Sets the underline selected. |
void |
setUndoButtonEnabled(boolean canUndo)
Sets the undo button enabled. |
void |
updateToolbar()
This method has to be called, to display the changed made in the model. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Integer GROUP_DEFAULT
public static final java.lang.Integer GROUP_SPELLCHECKER
public static final java.lang.Integer GROUP_HTMLFORMAT
public static final java.lang.Integer GROUP_UNDOREDO
public static final java.lang.Integer GROUP_FORMATSWITCH
Constructor Detail |
---|
public BaseEditorToolBar(BaseEditor editor, boolean hasToolbar, boolean isEditable, boolean isHtml)
editor
- the editor, which will use this toolbarhasToolbar
- true, if the editor has an toolbar on startupisEditable
- true, if the editor is editable by defaultisHtml
- true, if the first text of the editor will be HTMLMethod Detail |
---|
public void addComponent(java.awt.Component comp, java.lang.Integer group, java.awt.event.ActionListener listener)
comp
- The component to addgroup
- the group where to add the componentlistener
- the actionlistener for this component(duplicate-safe!)public void createComponentGroup(java.lang.Integer groupKey, boolean requiresLeftSep, boolean requiresRightSep, boolean visible)
groupKey
- the key of the group which will be createdrequiresLeftSep
- set to true, if the group requires a separator to the leftrequiresRightSep
- set to true, if the group requires a separator to the rightvisible
- should this group be visible immediatly?public void notifyFormat(boolean isHtml)
isHtml
- true, if htmlpublic void setToolbarVisible(boolean visible)
visible
- true, to set visiblepublic void enableGroups(java.lang.Integer... groups)
groups
- the groups to displaypublic void disableGroups(java.lang.Integer... groups)
groups
- the groups to displaypublic void setEditable(boolean editable)
editable
- true to enable, false to disablepublic void updateToolbar()
public void componentAdded(java.awt.event.ContainerEvent e)
componentAdded
in interface java.awt.event.ContainerListener
public void componentRemoved(java.awt.event.ContainerEvent e)
componentRemoved
in interface java.awt.event.ContainerListener
public void setEnabled(boolean enabled)
enabled
- true, if enabled, false otherwisepublic javax.swing.JToolBar getToolbar()
public void setSelectionColor(java.awt.Color value)
value
- the new selection colorpublic void setBoldSelected(boolean b)
b
- the new bold selectedpublic void setItalicSelected(boolean b)
b
- the new italic selectedpublic void setUnderlineSelected(boolean b)
b
- the new underline selectedpublic void setSelectedFontName(java.lang.String fontName)
fontName
- the new selected font namepublic void setSelectedFontSize(java.lang.Object fontSize)
fontSize
- the new selected font sizepublic void setLeftSelected(boolean b)
b
- the new left selectedpublic void setCenterSelected(boolean b)
b
- the new center selectedpublic void setRightSelected(boolean b)
b
- the new right selectedpublic void setJustifySelected(boolean b)
b
- the new justify selectedpublic javax.swing.JComboBox getFontNameComboBox()
public javax.swing.JComboBox getFontSizeComboBox()
public javax.swing.JButton getFontColor()
public javax.swing.JPopupMenu getColorMenu()
public ColorList getColorList()
public javax.swing.JToggleButton getBold()
public javax.swing.JToggleButton getItalic()
public javax.swing.JToggleButton getUnderline()
public javax.swing.JToggleButton getLeft()
public javax.swing.JToggleButton getCenter()
public javax.swing.JToggleButton getRight()
public javax.swing.JToggleButton getJustify()
public javax.swing.JButton getBulletList()
public javax.swing.JButton getNumberList()
public javax.swing.JButton getBlockLeft()
public javax.swing.JButton getBlockRight()
public javax.swing.JButton getHr()
public javax.swing.JButton getHyperlink()
public javax.swing.JButton getUndoButton()
public javax.swing.JButton getRedoButton()
public javax.swing.JButton getHtmlFormat()
public javax.swing.JButton getAddimage()
public javax.swing.JButton getSpellchecker()
public javax.swing.JToggleButton getAutoSpell()
public int getButtonoffset()
public void setUndoButtonEnabled(boolean canUndo)
canUndo
- the new undo button enabledpublic void setRedoButtonEnabled(boolean canRedo)
canRedo
- the new redo button enabledpublic javax.swing.Action getAddImageAction()
public void setAddImageEnabled(boolean enabled)
enabled
- the new adds the image enabledpublic void setAutoSpellSelected(boolean enabled)
enabled
- the new auto spell selected
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |