org.eclipse.epf.richtext
Interface IRichText

All Known Subinterfaces:
IMethodRichText, IMethodRichTextEditor, IRichTextEditor
All Known Implementing Classes:
MethodRichText, MethodRichTextEditor, RichText, RichTextEditor

public interface IRichText

The interface for a rich text control.

A rich text control is an editable user interface object that displays rich text and images.

Since:
1.0
Author:
Kelvin Low

Field Summary
static java.lang.String PROPERTY_NAME
           
 
Method Summary
 void addDisposeListener(org.eclipse.swt.events.DisposeListener listener)
          Adds the listener to the collection of listeners who will be notifed when this control 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 control.
 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 control.
 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 control.
 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 control is modified.
 void dispose()
          Disposes the operating system resources allocated by this control.
 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.
 java.lang.String getBasePath()
          Returns the base path used for resolving text and image links.
 org.eclipse.swt.widgets.Control getControl()
          Returns this rich text 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 control.
 boolean getModified()
          Checks whether the content has been modified.
 java.util.Iterator getModifyListeners()
          Returns the modify listeners attached to this control.
 java.lang.String getSelectedText()
          Returns the currently selected text.
 java.lang.String getText()
          Returns the rich text content.
 boolean hasFocus()
          Checks whether this control has focus.
 boolean isDisposed()
          Checks whether this control has been disposed.
 void removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)
          Removes a listener from the collection of listeners who will be notified when this control 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 control.
 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 control.
 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 econtrol.
 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 control 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 control.
 void setLayoutData(java.lang.Object layoutData)
          Sets the layout data.
 void setModified(boolean modified)
          Sets the modified state.
 void setText(java.lang.String text)
          Sets the rich text content.
 

Field Detail

PROPERTY_NAME

public static final java.lang.String PROPERTY_NAME
See Also:
Constant Field Values
Method Detail

getControl

public org.eclipse.swt.widgets.Control getControl()
Returns this rich text control.

Returns:
this rich text control

setLayoutData

public void setLayoutData(java.lang.Object layoutData)
Sets the layout data.

Parameters:
layoutData - the layout data to set

getLayoutData

public java.lang.Object getLayoutData()
Returns the layout data.

Returns:
this control's layout data

setFocus

public void setFocus()
Sets focus to this control.


hasFocus

public boolean hasFocus()
Checks whether this control has focus.

Returns:
true if this control has the user-interface focus

getBasePath

public java.lang.String getBasePath()
Returns the base path used for resolving text and image links.

Returns:
the base path used for resolving links in this control

getEditable

public boolean getEditable()
Returns the editable state.

Returns:
true if the content is ediatble

setEditable

public void setEditable(boolean editable)
Sets the editable state.

Parameters:
editable - the editable state

getModified

public boolean getModified()
Checks whether the content has been modified.

Returns:
true if the content has been modified

setModified

public void setModified(boolean modified)
Sets the modified state.

Parameters:
modified - the modified state

getText

public java.lang.String getText()
Returns the rich text content.

Returns:
the rich text content formatted in a markup language

setText

public void setText(java.lang.String text)
Sets the rich text content.

Parameters:
text - the rich text content formatted in a markup language

restoreText

public void restoreText()
Restores the rich text content back to the initial value.


getSelectedText

public java.lang.String getSelectedText()
Returns the currently selected text.

Returns:
the selected text or "" if there is no selection

getData

public java.lang.Object getData(java.lang.String key)
Returns an application specific property value.

Parameters:
key - the name of the property
Returns:
the value of the property or null if it has not been set

setData

public void setData(java.lang.String key,
                    java.lang.Object value)
Sets an application specific property name and value.

Parameters:
key - the name of the property
value - the property value

executeCommand

public int executeCommand(java.lang.String command)
Executes the given rich text command. The supported command strings are defined in RichTextCommand.

Parameters:
command - a rich text command string
Returns:
a status code returned by the executed command

executeCommand

public int executeCommand(java.lang.String command,
                          java.lang.String param)
Executes the given rich text command with a single parameter. The supported command strings are defined in RichTextCommand.

Parameters:
command - a rich text command string
param - a parameter for the command or null
Returns:
a status code returned by the executed command

executeCommand

public int executeCommand(java.lang.String command,
                          java.lang.String[] params)
Executes the given rich text command with an array of parameters. The supported command strings are defined in RichTextCommand.

Parameters:
command - a rich text command string
params - an array of parameters for the command or null
Returns:
a status code returned by the executed command

getModifyListeners

public java.util.Iterator getModifyListeners()
Returns the modify listeners attached to this control.

Returns:
an iterator for retrieving the modify listeners

addKeyListener

public 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 control.

Parameters:
listener - the listener which should be notified

removeKeyListener

public 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 control.

Parameters:
listener - the listener which should no longer be notified

addModifyListener

public 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 control is modified.

Parameters:
listener - the listener which should be notified

removeModifyListener

public 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 control is modified.

Parameters:
listener - the listener which should no longer be notified

addDisposeListener

public void addDisposeListener(org.eclipse.swt.events.DisposeListener listener)
Adds the listener to the collection of listeners who will be notifed when this control is disposed.

Parameters:
listener - the listener which should be notified

removeDisposeListener

public void removeDisposeListener(org.eclipse.swt.events.DisposeListener listener)
Removes a listener from the collection of listeners who will be notified when this control is disposed.

Parameters:
listener - the listener which should no longer be notified

addHelpListener

public 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 control.

Parameters:
listener - the listener which should be notified

removeHelpListener

public 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 control.

Parameters:
listener - the listener which should no longer be notified

addListener

public 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 control.

Parameters:
eventType - the type of event to listen for
listener - the listener which should be notified when the event occurs

removeListener

public 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 econtrol.

Parameters:
eventType - the type of event to listen to
listener - the listener which should no longer be notified when the event occurs

getListeners

public java.util.Iterator getListeners()
Returns the event listeners attached to this control.

Returns:
an iterator for retrieving the event listeners attached to this control

dispose

public void dispose()
Disposes the operating system resources allocated by this control.


isDisposed

public boolean isDisposed()
Checks whether this control has been disposed.

Returns:
true if this control is disposed successfully