|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.eclipse.epf.richtext.RichTextEditor
The default rich text editor implementation.
The default rich text editor uses XHTML as the underlying markup language for
the rich text content. It is implemented using a ViewForm control
with a tool bar at the top, a tab folder that contains a RichText
control for entering the rich text content, and a tab foler that contains a
StyleText control for viewing and modifying the XHTML
representation of the rich text content.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.epf.richtext.IRichText |
|---|
PROPERTY_NAME |
| Constructor Summary | |
|---|---|
RichTextEditor(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a new instance. |
|
RichTextEditor(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String basePath)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addDisposeListener(org.eclipse.swt.events.DisposeListener listener)
Adds the listener to the collection of listeners who will be notifed when this editor is disposed. |
void |
addHelpListener(org.eclipse.swt.events.HelpListener listener)
Adds a listener to the collection of listeners who will be notified when help events are generated for this editor. |
void |
addHTML(java.lang.String text)
Inserts text at the selection (overwriting the selection). |
void |
addKeyListener(org.eclipse.swt.events.KeyListener listener)
Adds a listener to the collection of listeners who will be notified when keys are pressed and released within this editor. |
void |
addListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
Adds the listener to the collection of listeners who will be notifed when an event of the given type occurs within this editor. |
void |
addModifyListener(org.eclipse.swt.events.ModifyListener listener)
Adds a listener to the collection of listeners who will be notified when the content of this editor is modified. |
void |
dispose()
Disposes the operating system resources allocated by this editor. |
int |
executeCommand(java.lang.String command)
Executes the given rich text command. |
int |
executeCommand(java.lang.String command,
java.lang.String param)
Executes the given rich text command with a single parameter. |
int |
executeCommand(java.lang.String command,
java.lang.String[] params)
Executes the given rich text command with an array of parameters. |
void |
fillToolBar(IRichTextToolBar toolBar)
Fills the tool bar with action items. |
java.lang.String |
getBasePath()
Returns the base path used for resolving text and image links. |
org.eclipse.swt.widgets.Control |
getControl()
Returns the form control. |
java.lang.Object |
getData(java.lang.String key)
Returns an application specific property value. |
boolean |
getEditable()
Returns the editable state. |
java.lang.Object |
getLayoutData()
Returns the layout data. |
java.util.Iterator |
getListeners()
Returns the event listeners attached to this editor. |
boolean |
getModified()
Checks whether the content has been modified. |
java.util.Iterator |
getModifyListeners()
Returns the modify listeners attached to this editor. |
IRichText |
getRichTextControl()
Returns the rich text control embedded within this editor. |
java.lang.String |
getSelectedText()
Returns the currently selected text. |
org.eclipse.swt.custom.StyledText |
getSourceEdit()
Returns the HTML source edit control. |
java.lang.String |
getText()
Returns the rich text content. |
boolean |
hasFocus()
Checks whether this editor has focus. |
boolean |
isDisposed()
Checks whether this control has been disposed. |
boolean |
isHTMLTabSelected()
Checks whether the HTML tab is selected. |
void |
removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)
Removes a listener from the collection of listeners who will be notified when this editor is disposed. |
void |
removeHelpListener(org.eclipse.swt.events.HelpListener listener)
Removes a listener from the collection of listeners who will be notified when help events are generated for this editor. |
void |
removeKeyListener(org.eclipse.swt.events.KeyListener listener)
Removes a listener from the collection of listeners who will be notified when keys are pressed and released within this editor. |
void |
removeListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
Removes the listener from the collection of listeners who will be notifed when an event of the given type occurs within this editor. |
void |
removeModifyListener(org.eclipse.swt.events.ModifyListener listener)
Removes a listener from the collection of listeners who will be notified when the content of this editor is modified. |
void |
restoreText()
Restores the rich text content back to the initial value. |
void |
setData(java.lang.String key,
java.lang.Object value)
Sets an application specific property name and value. |
void |
setEditable(boolean editable)
Sets the editable state. |
void |
setFocus()
Sets focus to this editor. |
void |
setLayoutData(java.lang.Object layoutData)
Sets the layout data. |
void |
setModified(boolean modified)
Sets the modified state. |
void |
setSelection(int index)
Selects the Rich Text or HTML tab. |
void |
setText(java.lang.String text)
Sets the rich text content. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RichTextEditor(org.eclipse.swt.widgets.Composite parent,
int style)
parent - the parent compositestyle - the editor style
public RichTextEditor(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String basePath)
parent - the parent compositestyle - the editor stylebasePath - the base path used for resolving links| Method Detail |
public org.eclipse.swt.widgets.Control getControl()
getControl in interface IRichTextpublic IRichText getRichTextControl()
public void setLayoutData(java.lang.Object layoutData)
setLayoutData in interface IRichTextlayoutData - the layout data to setpublic java.lang.Object getLayoutData()
getLayoutData in interface IRichTextpublic void setFocus()
setFocus in interface IRichTextpublic boolean hasFocus()
hasFocus in interface IRichTexttrue if this editor has the user-interface focuspublic void setSelection(int index)
setSelection in interface IRichTextEditorindex - 0 for the Rich Text tab, 1 for
the HTML tab.public java.lang.String getBasePath()
getBasePath in interface IRichTextpublic boolean getEditable()
getEditable in interface IRichTexttrue if the content can be editedpublic void setEditable(boolean editable)
setEditable in interface IRichTexteditable - the editable statepublic boolean getModified()
getModified in interface IRichTexttrue if the content has been modifiedpublic void setModified(boolean modified)
setModified in interface IRichTextmodified - the modified statepublic java.lang.String getText()
getText in interface IRichTextpublic void setText(java.lang.String text)
setText in interface IRichTexttext - the rich text content in XHTML formatpublic void restoreText()
restoreText in interface IRichTextpublic java.lang.String getSelectedText()
getSelectedText in interface IRichText"" if there is no selectionpublic java.lang.Object getData(java.lang.String key)
getData in interface IRichTextkey - the name of the property
null if it has not
been set
public void setData(java.lang.String key,
java.lang.Object value)
setData in interface IRichTextkey - the name of the propertyvalue - the new value for the propertypublic int executeCommand(java.lang.String command)
RichTextCommand.
- Specified by:
executeCommand in interface IRichText
- Parameters:
command - a rich text command string
- Returns:
- a status code returned by the executed command
public int executeCommand(java.lang.String command,
java.lang.String param)
RichTextCommand.
- Specified by:
executeCommand in interface IRichText
- Parameters:
command - a rich text command stringparam - a parameter for the command or null
- Returns:
- a status code returned by the executed command
public int executeCommand(java.lang.String command,
java.lang.String[] params)
RichTextCommand.
- Specified by:
executeCommand in interface IRichText
- Parameters:
command - a rich text command stringparams - an array of parameters for the command or null
- Returns:
- a status code returned by the executed command
public void dispose()
dispose in interface IRichTextpublic boolean isDisposed()
isDisposed in interface IRichTexttrue if this control is disposed successfullypublic java.util.Iterator getModifyListeners()
getModifyListeners in interface IRichTextpublic void addKeyListener(org.eclipse.swt.events.KeyListener listener)
addKeyListener in interface IRichTextlistener - the listener which should be notifiedpublic void removeKeyListener(org.eclipse.swt.events.KeyListener listener)
removeKeyListener in interface IRichTextlistener - the listener which should no longer be notifiedpublic void addModifyListener(org.eclipse.swt.events.ModifyListener listener)
addModifyListener in interface IRichTextlistener - the listener which should be notifiedpublic void removeModifyListener(org.eclipse.swt.events.ModifyListener listener)
removeModifyListener in interface IRichTextlistener - the listener which should no longer be notifiedpublic void addDisposeListener(org.eclipse.swt.events.DisposeListener listener)
addDisposeListener in interface IRichTextlistener - the listener which should be notifiedpublic void removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)
removeDisposeListener in interface IRichTextlistener - the listener which should no longer be notifiedpublic void addHelpListener(org.eclipse.swt.events.HelpListener listener)
addHelpListener in interface IRichTextlistener - the listener which should be notifiedpublic void removeHelpListener(org.eclipse.swt.events.HelpListener listener)
removeHelpListener in interface IRichTextlistener - the listener which should no longer be notified
public void addListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
addListener in interface IRichTexteventType - the type of event to listen forlistener - the listener which should be notified when the event occurs
public void removeListener(int eventType,
org.eclipse.swt.widgets.Listener listener)
removeListener in interface IRichTexteventType - the type of event to listen forlistener - the listener which should no longer be notified when the event
occurspublic java.util.Iterator getListeners()
getListeners in interface IRichTextpublic void fillToolBar(IRichTextToolBar toolBar)
fillToolBar in interface IRichTextEditortoolBar - a tool bar contain rich text actionspublic org.eclipse.swt.custom.StyledText getSourceEdit()
StyleText object.public void addHTML(java.lang.String text)
public boolean isHTMLTabSelected()
true if the HTML tab is selected.
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||