com.ibm.lpex.core
Class LpexView

java.lang.Object
  |
  +--com.ibm.lpex.core.LpexView

public class LpexView
extends java.lang.Object

The class LpexView can be used to manage an LPEX document view. It essentially provides all the editor programming support. Creating an instance of this class creates a document view.

See Also:
LpexWindow

Constructor Summary
LpexView()
          This constructor can be used to create an untitled document.
LpexView(boolean updateProfile)
          This constructor can be used to create an untitled document, indicating whether the updateProfile command should be called.
LpexView(LpexView lpexView)
          This constructor can be used to create a new document view from the specified document view.
LpexView(LpexView lpexView, boolean updateProfile)
          This constructor can be used to create a new document view from the specified document view, indicating whether the updateProfile command should be called.
LpexView(java.lang.String fileName)
          This constructor can be used to create a document from the specified file name.
LpexView(java.lang.String fileName, boolean updateProfile)
          This constructor can be used to create a document from the specified file name, indicating whether the updateProfile command should be called.
 
Method Summary
 LpexAction action(java.lang.String actionString)
          Retrieve the specified action.
 boolean actionAvailable(int actionId)
          Check whether the specified action is available.
 int actionId(java.lang.String actionString)
          Retrieve the id of the specified action.
 java.lang.String actionKey(int actionId)
          Get the primary key associated with the specified action.
 java.lang.String actionKeyText(int actionId)
          Get a translated text version of the primary key for the specified action.
 void addLpexCursorListener(LpexCursorListener cursorListener)
          Add a cursor listener to this editor view.
 void addLpexDocumentSectionListener(LpexDocumentSectionListener sectionListener)
          Add a document-section listener to the editor document of this view.
 void addLpexMarkListener(int markId, LpexMarkListener markListener)
          Add a mark listener to the specified mark.
 void addLpexViewListener(LpexViewListener viewListener)
          Add a view listener to this editor view.
 int charOffset(LpexDocumentLocation documentLocation, int eolLength)
          Get a document (or document section) location's Unicode-character offset in its underlying file (section).
 long classMask(java.lang.String names)
          Get the bit-mask allocated for the registered element class(es) named.
 LpexCommand command(java.lang.String commandString)
          Retrieve the specified command.
 org.eclipse.swt.widgets.Widget commandLineFocusWidget()
          Return the command line widget with the input focus, if any.
 int currentElement()
          Get the ordinal number of the current (cursor) element in the document (or section of the document that is currently loaded in the editor).
 int currentPosition()
          Convenience method to retrieve the current (cursor) position within the current (cursor) element.
 boolean defaultActionAvailable(int actionId)
          Check whether the specified default editor action is available.
 java.lang.String defaultHelp()
          Retrieve the default help URL for this view.
 LpexAction defineAction(java.lang.String actionString, LpexAction lpexAction)
          Define a user action.
 LpexCommand defineCommand(java.lang.String commandString, LpexCommand lpexCommand)
          Define a user command.
 java.lang.String deletedMarkName(int markId)
          Return the name of the deleted mark with the id specified.
 void dispose()
          This method disposes the view.
 void doAction(int actionId)
          Perform the specified action.
 boolean doCommand(LpexDocumentLocation documentLocation, java.lang.String commandString)
          Perform the specified command at the specified document (or document section) location.
 boolean doCommand(java.lang.String commandString)
          Perform the specified command.
 LpexDocumentLocation documentLocation()
          Get the view's current (cursor) location in the document (or section of the document that is currently loaded in the editor).
 LpexDocumentLocation documentLocation(int charOffset, int eolLength)
          Get the location in the document (or section of the document that is currently loaded in the editor) which corresponds to the given Unicode-character offset in its underlying file (section).
 void doDefaultAction(int actionId)
          Perform the default editor action for the specified action id.
 boolean doDefaultCommand(LpexDocumentLocation documentLocation, java.lang.String commandString)
          Perform the default editor command for the specified command string.
 boolean doDefaultCommand(java.lang.String commandString)
          Perform the default editor command for the specified command string.
static boolean doGlobalCommand(java.lang.String commandString)
          Perform the specified command.
 long elementClasses(int element)
          Retrieve the bit-mask of the element classes set in an element of the document (or document section that is currently loaded in the editor).
 int elementOfLine(int line)
          Retrieve the element for the specified line.
 int elementOfRow(int row)
          Return the element in the document (or that section of the document that is currently loaded in the editor) which is displayed on the given screen row.
 void elementParsed(int element)
          Remove the specified element from the parse-pending list.
 int elements()
          Retrieve the number of elements in the document (or section of the document that is currently loaded in the editor).
 java.lang.String elementStyle(int element)
          Get the style string for an element in the document (or document section currently loaded in the editor).
 java.lang.String elementText(int element)
          Get the text of an element in the document (or document section currently loaded in the editor).
 org.eclipse.swt.widgets.Shell frame()
          Retrieve the Shell that is used when dialogs are displayed.
 org.eclipse.swt.graphics.Font getFont()
          Retrieve the font in the view.
static java.lang.String globalQuery(java.lang.String parameter)
          Query a global editor parameter.
 void jump(int element, int position)
          Move the cursor to the specified position in the document (or section of the document that is currently loaded in the editor).
 void jump(LpexDocumentLocation documentLocation)
          Move the cursor to the specified position in the document (or section of the document that is currently loaded in the editor).
 boolean keyAssigned(java.lang.String keyString)
          Check whether the specified key is associated with an action.
 int lineOfElement(int element)
          Retrieve the line for the specified element.
 int linesAfterEnd()
          Return the number of lines in the document following the currently-loaded document section.
 int linesBeforeStart()
          Return the number of lines in the document prior to the currently-loaded document section.
 boolean load(java.io.Reader reader)
          Load the entire text of the document (or document section) from the specified Reader.
 LpexNls nls()
          Retrieve the NLS object associated with this LpexView.
 boolean otherShow(int element)
          Determine if the specified element in the document (or document section that is currently loaded in the editor) is a show line for another document view.
 int parsePending(int element)
          Query the parse-pending state of the specified element.
 LpexParser parser()
          Get the current document parser for this view.
 java.lang.String query(java.lang.String parameter)
          Query an editor parameter.
 java.lang.String query(java.lang.String parameter, LpexDocumentLocation documentLocation)
          Query an editor parameter.
 int queryInt(java.lang.String parameter)
          Convenience method to query an editor integer parameter.
 int queryInt(java.lang.String parameter, LpexDocumentLocation documentLocation)
          Convenience method to query an editor integer parameter.
 boolean queryOn(java.lang.String parameter)
          Convenience method to query an editor on/off parameter.
 boolean queryOn(java.lang.String parameter, LpexDocumentLocation documentLocation)
          Convenience method to query an editor on/off parameter.
 long registerClass(java.lang.String name)
          Register the specified element class.
 void removeLpexCursorListener(LpexCursorListener cursorListener)
          Remove a cursor listener from this editor view.
 void removeLpexDocumentSectionListener(LpexDocumentSectionListener sectionListener)
          Remove a document-section listener from the editor document of this view.
 void removeLpexMarkListener(int markId, LpexMarkListener markListener)
          Remove a mark listener from the specified mark.
 void removeLpexMarkListener(LpexMarkListener markListener)
          Remove a mark listener from all the marks in this document view for which it is registered.
 void removeLpexViewListener(LpexViewListener viewListener)
          Remove a view listener from this editor view.
 boolean save(java.io.Writer writer)
          Save the entire text of the document (or document section currently loaded in the ditor) to the specified Writer.
 void setClassLoader(java.lang.ClassLoader classLoader)
          Set an alternate class loader to be used by this view.
 void setDefaultHelp(java.lang.String URL)
          Set the default URL to load for this view when language-sensitive help is not available.
 void setElementClasses(int element, long classes)
          Set the element classes bit-mask in an element of the document (or document section that is currently loaded in the editor).
 void setElementStyle(int element, java.lang.String style)
          Set the style string for an element in the document (or section of the document that is currently loaded in the editor).
 void setElementText(int element, java.lang.String text)
          Set the text for an element in the document (or document section that is currently loaded in the editor).
 void setFont(org.eclipse.swt.graphics.Font swtFont)
          Set a new font in the view.
 void setFrame(org.eclipse.swt.widgets.Shell frame)
          Set the Shell that should be used when dialogs are displayed.
 void setLinesOutsideDocumentSection(int linesBeforeStart, int linesAfterEnd)
          Set the number of lines in the complete document outside the boundaries of the currently-loaded document section.
 void setSaveLineSeparator(java.lang.String eol)
          Set the line separator for the save, saveAs, and saveToWriter actions.
 void setSaveWriter(java.io.Writer writer)
          Set the Writer object for the saveToWriter action.
 void setText(java.lang.String text)
          Set the entire text of the document (or document section).
 void setWindow(LpexWindow lpexWindow)
          Use this method to associate an LPEX window with this document view.
 boolean show(int element)
          Get the show setting for an element in the document (or document section that is currently loaded in the editor).
 java.lang.String text()
          Retrieve the entire text of the document (or document section currently loaded in the editor).
 void triggerAction(int actionId)
          Perform the specified action.
 LpexWindow window()
          Retrieve the LPEX window currently associated with this view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LpexView

public LpexView(java.lang.String fileName,
                boolean updateProfile)
This constructor can be used to create a document from the specified file name, indicating whether the updateProfile command should be called. If you specify true for updateProfile, then the updateProfile command will be called with the default settings. If you specify false, then updateProfile will not be called; you can then change the updateProfile settings and issue the updateProfile command later.

LpexView

public LpexView(java.lang.String fileName)
This constructor can be used to create a document from the specified file name.

LpexView

public LpexView()
This constructor can be used to create an untitled document.

LpexView

public LpexView(boolean updateProfile)
This constructor can be used to create an untitled document, indicating whether the updateProfile command should be called.

If you specify true for updateProfile, then the updateProfile command will be called with the default settings. If you specify false, then updateProfile will not be called; you can then change the updateProfile settings and issue the updateProfile command later.


LpexView

public LpexView(LpexView lpexView)
This constructor can be used to create a new document view from the specified document view.

LpexView

public LpexView(LpexView lpexView,
                boolean updateProfile)
This constructor can be used to create a new document view from the specified document view, indicating whether the updateProfile command should be called.

If you specify true for updateProfile, then the updateProfile command will be called with the default settings. If you specify false, then updateProfile will not be called; you can then change the updateProfile settings and issue the updateProfile command later.

Method Detail

dispose

public void dispose()
This method disposes the view.

setWindow

public void setWindow(LpexWindow lpexWindow)
Use this method to associate an LPEX window with this document view.

window

public LpexWindow window()
Retrieve the LPEX window currently associated with this view.

nls

public LpexNls nls()
Retrieve the NLS object associated with this LpexView. The National Language Support functions in LPEX are accessible via this object.
See Also:
LpexNls

setText

public void setText(java.lang.String text)
Set the entire text of the document (or document section).
See Also:
text()

text

public java.lang.String text()
Retrieve the entire text of the document (or document section currently loaded in the editor).
See Also:
setText(java.lang.String), save(Writer)

load

public boolean load(java.io.Reader reader)
Load the entire text of the document (or document section) from the specified Reader.
Returns:
true if the text was loaded successfully

save

public boolean save(java.io.Writer writer)
Save the entire text of the document (or document section currently loaded in the ditor) to the specified Writer.
Returns:
true if the text was saved successfully
See Also:
text()

setSaveWriter

public void setSaveWriter(java.io.Writer writer)
Set the Writer object for the saveToWriter action. The saveToWriter action will run the save command to the specified Writer, instead of the document's file. The save command makes use of certain settings, such as save.textLimit, to determine what text is actually saved.

Example of using saveToWriter with an OutputStreamWriter:

   ByteArrayOutputStream bytes = new ByteArrayOutputStream();
   OutputStreamWriter writer = new OutputStreamWriter(bytes);
   lpexView.setSaveWriter(writer);
   lpexView.triggerAction(lpexView.actionId("saveToWriter"));
   lpexView.setSaveWriter(null); 

Example of using saveToWriter to save to a String:

   StringWriter writer = new StringWriter();
   lpexView.setSaveWriter(writer);
   lpexView.doAction(lpexView.actionId("saveToWriter"));
   lpexView.setSaveWriter(null);
   String savedDocument = writer.toString(); 


setSaveLineSeparator

public void setSaveLineSeparator(java.lang.String eol)
Set the line separator for the save, saveAs, and saveToWriter actions. Example:
   lpexView.setSaveLineSeparator("\r\n"); // use Windows-style CR LF 
If not set, the platform's default line separator is used.

defineCommand

public LpexCommand defineCommand(java.lang.String commandString,
                                 LpexCommand lpexCommand)
Define a user command.
See Also:
LpexCommand

command

public LpexCommand command(java.lang.String commandString)
Retrieve the specified command.

doDefaultCommand

public boolean doDefaultCommand(java.lang.String commandString)
Perform the default editor command for the specified command string. Example:
   lpexView.doDefaultCommand("insertText xyz"); 
Returns:
true if the command string is valid, or false if the command string is not valid

doDefaultCommand

public boolean doDefaultCommand(LpexDocumentLocation documentLocation,
                                java.lang.String commandString)
Perform the default editor command for the specified command string. If the command requires a document location, then the specified document (or document section) location will be used. If the command changes the view's document location, then the specified document location will be updated; the view's actual current (cursor) document location will not be affected, to the extent that its underlying text is not affected.
Parameters:
documentLocation - a document location (element, position) in the document section currently loaded in the editor
Returns:
true if the command string is valid, or false if the command string is not valid

doCommand

public boolean doCommand(java.lang.String commandString)
Perform the specified command.
Returns:
true if the command string is valid, or false if the command string is not valid

doGlobalCommand

public static boolean doGlobalCommand(java.lang.String commandString)
Perform the specified command. The command should be a globally-scoped command, i.e., one that does not require a document view. Example:
   LpexView.doGlobalCommand("updateProfile all"); 
Returns:
true if the command string is valid, or false if the command string is not valid

doCommand

public boolean doCommand(LpexDocumentLocation documentLocation,
                         java.lang.String commandString)
Perform the specified command at the specified document (or document section) location. If the command requires a document location, then the specified document (or document section) location will be used. If the command changes the view's document location, then the given document location will be updated; the view's actual current (cursor) document location will not be affected, to the extent that its underlying text is not affected.
Parameters:
documentLocation - a document location (element, position) in the document section currently loaded in the editor
Returns:
true if the command string is valid, or false if the command string is not valid

defineAction

public LpexAction defineAction(java.lang.String actionString,
                               LpexAction lpexAction)
Define a user action.
Returns:
previous LpexAction defined for this actionString, if any
See Also:
LpexAction

actionId

public int actionId(java.lang.String actionString)
Retrieve the id of the specified action.

action

public LpexAction action(java.lang.String actionString)
Retrieve the specified action.

doDefaultAction

public void doDefaultAction(int actionId)
Perform the default editor action for the specified action id.

defaultActionAvailable

public boolean defaultActionAvailable(int actionId)
Check whether the specified default editor action is available.

doAction

public void doAction(int actionId)
Perform the specified action. Use this method instead of triggerAction() if you are implementing your own command or action. No screen refresh will be done after the action has completed.

Note that the LPEX built-in action ids defined in LpexConstants (e.g., LpexConstants.ACTION_BLOCK_COPY) may change between releases. In order to isolate your code from dependency on a certain LPEX release, you should first query, and eventually cache, the id of a built-in action before using it, for example:

   int blockCopyId = lpexView.actionId("blockCopy");
   lpexView.triggerAction(blockCopyId); 

See Also:
triggerAction(int), actionId(java.lang.String)

actionAvailable

public boolean actionAvailable(int actionId)
Check whether the specified action is available.

actionKey

public java.lang.String actionKey(int actionId)
Get the primary key associated with the specified action.
Returns:
primary key definition, e.g., "a-pageDown.t"
See Also:
actionKeyText(int)

actionKeyText

public java.lang.String actionKeyText(int actionId)
Get a translated text version of the primary key for the specified action.
Returns:
primary key, e.g., "Alt+Page down"
See Also:
actionKey(int)

keyAssigned

public boolean keyAssigned(java.lang.String keyString)
Check whether the specified key is associated with an action. A key associated with action nullAction is considered unassigned. This method allows to associate actions to keys without overriding previous assignments. For example,
   keyAssigned("c-o.t"); 
will return true if an action was defined and associated with Ctrl+O in the text area.

triggerAction

public void triggerAction(int actionId)
Perform the specified action. Use this method instead of doAction() if you are processing anything other than your own action or command (e.g., a listener notification, a menu or toolbar action, etc.). This method ensures that the screen will be refreshed.

Note that the LPEX built-in action ids defined in LpexConstants (e.g., LpexConstants.ACTION_BLOCK_COPY) may change between releases. In order to isolate your code from dependency on a certain LPEX release, you should first query, and eventually cache, the id of a built-in action before using it, for example:

   int blockCopyId = lpexView.actionId("blockCopy");
   lpexView.triggerAction(blockCopyId); 

See Also:
doAction(int), actionId(java.lang.String)

elements

public int elements()
Retrieve the number of elements in the document (or section of the document that is currently loaded in the editor).

Note: the elements editor parameter always returns the number of elements in the complete document.


jump

public void jump(int element,
                 int position)
Move the cursor to the specified position in the document (or section of the document that is currently loaded in the editor).

Note: the locate editor command always applies to elements or lines in the complete document.

Parameters:
element - an element in the document section currently loaded in the editor
See Also:
jump(LpexDocumentLocation)

jump

public void jump(LpexDocumentLocation documentLocation)
Move the cursor to the specified position in the document (or section of the document that is currently loaded in the editor).

Note: the locate editor command always applies to elements or lines in the complete document.

Parameters:
documentLocation - a document location (element, position) in the document section currently loaded in the editor
See Also:
jump(int,int)

parser

public LpexParser parser()
Get the current document parser for this view.

parsePending

public int parsePending(int element)
Query the parse-pending state of the specified element.
Returns:
one or more of these flags: LpexConstants.PARSE_PENDING_CHANGE_MASK, LpexConstants.PARSE_PENDING_NEXT_DELETED_MASK, LpexConstants.PARSE_PENDING_PREV_DELETED_MASK, LpexConstants.PARSE_PENDING_NEXT_SHOW_DELETED_MASK, LpexConstants.PARSE_PENDING_PREV_SHOW_DELETED_MASK

elementParsed

public void elementParsed(int element)
Remove the specified element from the parse-pending list. This view's document parser will not be called for this element until after a subsequent change.

elementText

public java.lang.String elementText(int element)
Get the text of an element in the document (or document section currently loaded in the editor). If there is no such element, null is returned. If the element has no text, an empty String is returned.

Note: the text editor parameter applies to the current element.

Parameters:
element - an element in the document section currently loaded in the editor

setElementText

public void setElementText(int element,
                           java.lang.String text)
Set the text for an element in the document (or document section that is currently loaded in the editor).

Note: the text editor parameter applies to the current element.

Parameters:
element - an element in the document section currently loaded in the editor
text - the text to set

show

public boolean show(int element)
Get the show setting for an element in the document (or document section that is currently loaded in the editor).

Note: the show editor parameter applies to the current element.

Parameters:
element - an element in the document section currently loaded in the editor

otherShow

public boolean otherShow(int element)
Determine if the specified element in the document (or document section that is currently loaded in the editor) is a show line for another document view.
Parameters:
element - an element in the document section currently loaded in the editor

elementStyle

public java.lang.String elementStyle(int element)
Get the style string for an element in the document (or document section currently loaded in the editor). If there is no such element, null is returned. If the element has no style string set, an empty String is returned.

Note: the style editor parameter applies to the current element.

Parameters:
element - an element in the section of the document that is currently loaded in the editor

setElementStyle

public void setElementStyle(int element,
                            java.lang.String style)
Set the style string for an element in the document (or section of the document that is currently loaded in the editor).

Note: the style editor parameter applies to the current element.

Parameters:
element - an element in the document section currently loaded in the editor
style - the style string to set

elementClasses

public long elementClasses(int element)
Retrieve the bit-mask of the element classes set in an element of the document (or document section that is currently loaded in the editor).

Note: the elementClasses editor parameter applies to the current element.

Parameters:
element - an element in the document section currently loaded in the editor

setElementClasses

public void setElementClasses(int element,
                              long classes)
Set the element classes bit-mask in an element of the document (or document section that is currently loaded in the editor).

Note: the elementClasses editor parameter applies to the current element.

Parameters:
element - an element in the document section currently loaded in the editor
classes - bit-mask of the element class(es) to set

registerClass

public long registerClass(java.lang.String name)
Register the specified element class.
Returns:
the allocated bit-mask of this element class

classMask

public long classMask(java.lang.String names)
Get the bit-mask allocated for the registered element class(es) named.

currentElement

public int currentElement()
Get the ordinal number of the current (cursor) element in the document (or section of the document that is currently loaded in the editor). If there is no current element (no elements are visible in the document), this method returns 0.

Note: the element editor parameter returns the ordinal number of the (current) element in the complete document.

See Also:
lineOfElement(int), currentPosition(), documentLocation()

currentPosition

public int currentPosition()
Convenience method to retrieve the current (cursor) position within the current (cursor) element. An equivalent command to query the position parameter is:
   lpexView.queryInt("position"); 
See Also:
currentElement(), documentLocation()

documentLocation

public LpexDocumentLocation documentLocation()
Get the view's current (cursor) location in the document (or section of the document that is currently loaded in the editor). If no elements are currently visible, the returned LpexDocumentLocation.element will be 0.

Note: the element editor parameter returns the ordinal number of the (current) element in the complete document.

See Also:
currentElement(), currentPosition()

documentLocation

public LpexDocumentLocation documentLocation(int charOffset,
                                             int eolLength)
Get the location in the document (or section of the document that is currently loaded in the editor) which corresponds to the given Unicode-character offset in its underlying file (section). If the specified offset is beyond the end of the document (section), the location returned will be the end of the document (section).
Parameters:
charOffset - ZERO-based character offset from the start of the file
eolLength - length of file's line delimiter, e.g., 2 for CRLF ("\r\n")
See Also:
charOffset(com.ibm.lpex.core.LpexDocumentLocation, int)

charOffset

public int charOffset(LpexDocumentLocation documentLocation,
                      int eolLength)
Get a document (or document section) location's Unicode-character offset in its underlying file (section). If the specified location is beyond the end of the document (section), the offset returned will be for the end of the document (section).
Parameters:
documentLocation - a location (element, position) in the document section currently loaded in the editor
eolLength - length of file's line delimiter, e.g., 2 for CRLF ("\r\n")
Returns:
ZERO-based character offset from the start of the file
See Also:
documentLocation(int,int)

query

public java.lang.String query(java.lang.String parameter)
Query an editor parameter.

queryInt

public int queryInt(java.lang.String parameter)
Convenience method to query an editor integer parameter. Shortcut for
   String value = query(parameter);
   return (value != null)? Integer.parseInt(value) : -1; 
Note that if the underlying query returns null, this method returns -1.
See Also:
query(String)

queryOn

public boolean queryOn(java.lang.String parameter)
Convenience method to query an editor on/off parameter. Shortcut for
   String value = query(parameter);
   return value != null && value.equals("on"); 
Returns:
true for a valid LPEX parameter whose value is "on"
See Also:
query(String)

query

public java.lang.String query(java.lang.String parameter,
                              LpexDocumentLocation documentLocation)
Query an editor parameter. If the parameter requires a document location, then the specified document (or document section) location will be used rather than the view's actual current document (or document section) location.
Parameters:
documentLocation - a document location (element, position) in the document section currently loaded in the editor

queryInt

public int queryInt(java.lang.String parameter,
                    LpexDocumentLocation documentLocation)
Convenience method to query an editor integer parameter. Shortcut for
   String value = query(parameter, documentLocation);
   return (value != null)? Integer.parseInt(value) : -1; 
Note that if the underlying query returns null, this method returns -1.
Parameters:
documentLocation - a document location (element, position) in the document section currently loaded in the editor
See Also:
query(String,LpexDocumentLocation)

queryOn

public boolean queryOn(java.lang.String parameter,
                       LpexDocumentLocation documentLocation)
Convenience method to query an editor on/off parameter. Shortcut for
   String value = query(parameter, documentLocation);
   return value != null && value.equals("on"); 
Parameters:
documentLocation - a document location (element, position) in the document section currently loaded in the editor
Returns:
true for a valid LPEX parameter whose value is "on"
See Also:
query(String,LpexDocumentLocation)

elementOfRow

public int elementOfRow(int row)
Return the element in the document (or that section of the document that is currently loaded in the editor) which is displayed on the given screen row. Screen rows are 1 .. n, where n if specified by the rows parameter.
Returns:
0 if the row doesn't display a visible element

elementOfLine

public int elementOfLine(int line)
Retrieve the element for the specified line. Both the specified line and the returned element are defined inside the document section that is currently loaded in the editor.

Note: the element editor parameter returns the ordinal number of the (current) element in the complete document.

Returns:
0 if the line doesn't exist in the document (or currently loaded section of it)
See Also:
lineOfElement(int)

lineOfElement

public int lineOfElement(int element)
Retrieve the line for the specified element. Both the specified element and the returned line are defined inside the document section that is currently loaded in the editor. If the element is a show element, the first document line above it is returned. If the element does not exist, or if there is no document line corresponding to the given element (e.g., one or more show elements at the top of the document), this method returns 0.

Note: the line editor parameter returns the ordinal number of the (current) line in the complete document.

See Also:
currentElement(), elementOfLine(int)

deletedMarkName

public java.lang.String deletedMarkName(int markId)
Return the name of the deleted mark with the id specified. Can be used during the processing of LpexMarkListener markDeleted() notifications.

commandLineFocusWidget

public org.eclipse.swt.widgets.Widget commandLineFocusWidget()
Return the command line widget with the input focus, if any. This information is not available from the FocusEvent notifications of a FocusListener on the command line, as these events' widget field is set to the command-line Composite.

globalQuery

public static java.lang.String globalQuery(java.lang.String parameter)
Query a global editor parameter. The parameter should be a globally-scoped parameter, i.e., one that does not require a document view. Example:
   LpexView.globalQuery("version"); 

setLinesOutsideDocumentSection

public void setLinesOutsideDocumentSection(int linesBeforeStart,
                                           int linesAfterEnd)
Set the number of lines in the complete document outside the boundaries of the currently-loaded document section.
See Also:
LpexDocumentSectionListener

linesBeforeStart

public int linesBeforeStart()
Return the number of lines in the document prior to the currently-loaded document section. Normally, the complete document is loaded in the editor, and this method will return 0.
See Also:
LpexDocumentSectionListener

linesAfterEnd

public int linesAfterEnd()
Return the number of lines in the document following the currently-loaded document section. Normally, the complete document is loaded in the editor, and this method will return 0.
See Also:
LpexDocumentSectionListener

addLpexViewListener

public void addLpexViewListener(LpexViewListener viewListener)
Add a view listener to this editor view. A listener is only registered once, subsequent calls to add the same listener have no effect.
See Also:
LpexViewListener, removeLpexViewListener(com.ibm.lpex.core.LpexViewListener)

removeLpexViewListener

public void removeLpexViewListener(LpexViewListener viewListener)
Remove a view listener from this editor view. Removes the specified listener if it is registered with this view.

addLpexCursorListener

public void addLpexCursorListener(LpexCursorListener cursorListener)
Add a cursor listener to this editor view. A listener is only registered once, subsequent calls to add the same listener have no effect.
See Also:
LpexCursorListener, removeLpexCursorListener(com.ibm.lpex.core.LpexCursorListener)

removeLpexCursorListener

public void removeLpexCursorListener(LpexCursorListener cursorListener)
Remove a cursor listener from this editor view. Removes the specified listener if it is registered with this view.

addLpexMarkListener

public void addLpexMarkListener(int markId,
                                LpexMarkListener markListener)
Add a mark listener to the specified mark.
See Also:
LpexMarkListener, removeLpexMarkListener(int,LpexMarkListener), removeLpexMarkListener(LpexMarkListener)

removeLpexMarkListener

public void removeLpexMarkListener(int markId,
                                   LpexMarkListener markListener)
Remove a mark listener from the specified mark.

removeLpexMarkListener

public void removeLpexMarkListener(LpexMarkListener markListener)
Remove a mark listener from all the marks in this document view for which it is registered.

addLpexDocumentSectionListener

public void addLpexDocumentSectionListener(LpexDocumentSectionListener sectionListener)
Add a document-section listener to the editor document of this view. A listener is only registered once, subsequent calls to add the same listener have no effect.
See Also:
LpexDocumentSectionListener, removeLpexDocumentSectionListener(com.ibm.lpex.core.LpexDocumentSectionListener)

removeLpexDocumentSectionListener

public void removeLpexDocumentSectionListener(LpexDocumentSectionListener sectionListener)
Remove a document-section listener from the editor document of this view. Removes the specified listener if it is registered with this view's document.

setFrame

public void setFrame(org.eclipse.swt.widgets.Shell frame)
Set the Shell that should be used when dialogs are displayed.

frame

public org.eclipse.swt.widgets.Shell frame()
Retrieve the Shell that is used when dialogs are displayed. This is the Shell of the LpexWindow associated with this view or, if none, the Shell previously set with setFrame().

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Set an alternate class loader to be used by this view. This method is needed e.g., on the Eclipse platform, where the LPEX plugin cannot load a class outside its own runtime library, and consequently cannot process commands such as set updateProfile.parserClass for a parser shipped by another plugin. This class loader is only used when a class cannot be loaded by the current LPEX loader.

setFont

public void setFont(org.eclipse.swt.graphics.Font swtFont)
Set a new font in the view. The font passed in is an SWT Font.

getFont

public org.eclipse.swt.graphics.Font getFont()
Retrieve the font in the view. The font returned is an SWT Font.

setDefaultHelp

public void setDefaultHelp(java.lang.String URL)
Set the default URL to load for this view when language-sensitive help is not available.

defaultHelp

public java.lang.String defaultHelp()
Retrieve the default help URL for this view. The default help URL is loaded when language-sensitive help is not available.