Overview

 
Package  Use  Tree  Serialized  Deprecated  Index  Help 
SWT LPEX
v3.0.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

com.ibm.lpex.alef
Class LpexSourceViewer

java.lang.Object
  extended byorg.eclipse.jface.viewers.Viewer
      extended bycom.ibm.lpex.alef.LpexTextViewer
          extended bycom.ibm.lpex.alef.LpexSourceViewer

All Implemented Interfaces:
org.eclipse.jface.viewers.IInputProvider, org.eclipse.jface.viewers.IInputSelectionProvider, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.jface.text.source.ISourceViewer, org.eclipse.jface.text.ITextOperationTarget, org.eclipse.jface.text.ITextOperationTargetExtension, org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IWidgetTokenOwner, org.eclipse.jface.text.IWidgetTokenOwnerExtension


public class LpexSourceViewer
extends LpexTextViewer
implements org.eclipse.jface.text.source.ISourceViewer

A line-oriented, LPEX-based partial implementation of org.eclipse.jface.text.source.ISourceViewer. A source viewer uses an IVerticalRuler as its annotation presentation area. The vertical ruler is a small strip shown left of the viewer's text widget.

Clients are supposed to instantiate a source viewer and subsequently communicate with it exclusively using the ISourceViewer interface.

Clients should not subclass this class, as it is quite likely that subclasses will be broken by future releases.

Several SourceViewer classes, methods, and fields are not available in LpexSourceViewer. Most programming of the underlying LPEX widget should be done directly via its LpexView and LpexWindow.

Always use LpexView to set the text of the edited document. For example:

 
 IEditorPart editor = IWorkbenchPage.getActiveEditor();
 // (a) Using LPEX
 if (editor instanceof LpexTextEditor)
  {
   LpexTextEditor lpexEditor = (LpexTextEditor)editor;
   LpexView lpexView = lpexEditor.getLpexView();
   if (lpexView != null)
    {
     lpexView.doDefaultCommand("insertText " + text); // insert text at cursor 
     LpexView.doGlobalCommand("screenShow");          // refresh display
    }
  }
 // (b) Using an Eclipse editor
 else
  {
   // . . . get DocumentProvider, get IDocument, do replace()
  } 

See Also:
LpexTextViewer


Nested Class Summary
protected  class LpexSourceViewer.RulerLayout
          Layout of this source viewer.
 
Nested classes inherited from class com.ibm.lpex.alef.LpexTextViewer
LpexTextViewer.TextHoverKey
 
Field Summary
protected static String _SELECTION_POSITION_CATEGORY
          Partial name of the position category to manage remembered selections.
protected  org.eclipse.jface.text.source.IAnnotationHover fAnnotationHover
          The viewer's annotation hover.
protected  IContentAssistant fContentAssistant
          The viewer's content assistant.
protected  boolean fContentAssistantInstalled
          Flag indicating whether the viewer's content assistant is installed (enabled).
protected  org.eclipse.jface.text.formatter.IContentFormatter fContentFormatter
          The viewer's content formatter.
protected  org.eclipse.jface.text.information.IInformationPresenter fInformationPresenter
          The viewer's information presenter.
protected  org.eclipse.jface.text.source.IAnnotationHover fOverviewRulerAnnotationHover
          The viewer's overview ruler annotation hover.
protected  org.eclipse.jface.text.presentation.IPresentationReconciler fPresentationReconciler
          The viewer's presentation reconciler.
protected  org.eclipse.jface.text.reconciler.IReconciler fReconciler
          The viewer's model reconciler.
protected  String fSelectionCategory
          Position category used by the selection updater.
protected  Stack fSelections
          Stack of saved selections in the underlying document.
protected  org.eclipse.jface.text.IPositionUpdater fSelectionUpdater
          Position updater for saved selections.
protected static int GAP_SIZE
          The size of the gap between the vertical ruler and the text widget.
protected static Object MODEL_ANNOTATION_MODEL
          Key of the model annotation model inside the visual annotation model.
 
Fields inherited from class com.ibm.lpex.alef.LpexTextViewer
fHoverControlCreator, fInformationMapping, fLastTopPixel, fPartitioning, fReplaceTextPresentation, fTextHovers, fTextInputListeners, fViewportListeners, INTERNAL, KEY, MOUSE, MOUSE_END, RESIZE, SCROLLER, TRACE_ERRORS
 
Fields inherited from class org.eclipse.jface.viewers.Viewer
WIDGET_DATA_KEY
 
Fields inherited from interface org.eclipse.jface.text.source.ISourceViewer
CONTENTASSIST_CONTEXT_INFORMATION, CONTENTASSIST_PROPOSALS, FORMAT, INFORMATION
 
Fields inherited from interface org.eclipse.jface.text.ITextOperationTarget
COPY, CUT, DELETE, PASTE, PREFIX, PRINT, REDO, SELECT_ALL, SHIFT_LEFT, SHIFT_RIGHT, STRIP_PREFIX, UNDO
 
Constructor Summary
LpexSourceViewer(org.eclipse.swt.widgets.Composite parent, org.eclipse.ui.texteditor.ITextEditor textEditor, org.eclipse.jface.text.source.IVerticalRuler ruler, int styles)
          Constructs a new LPEX source viewer.
 
Method Summary
 void activatePlugins()
          Extends LpexTextViewer's to install the annotation hover.
 boolean canDoOperation(int operation)
          Check whether the action specified by the operation id can be performed.
protected  void clearRememberedSelection()
           
 void configure(org.eclipse.jface.text.source.SourceViewerConfiguration configuration)
          Configure the source viewer as described in the configuration.
protected  void createControl(org.eclipse.swt.widgets.Composite parent, int styles)
          Create this source viewer's controls.
protected  org.eclipse.swt.widgets.Layout createLayout()
          Creates the layout used for this viewer.
protected  void createViewPreferenceNodes(LpexSourceViewer lpexSourceViewer)
          Hook to allow the solution plug-in create custom preference node(s) for view-scoped preference page(s) for this source viewer.
protected  org.eclipse.jface.preference.IPreferencePage createViewPreferencePage(LpexView lpexView, int nodeType)
          Factory method to create the preference page for a view-scoped preference node used by this source viewer.
protected  org.eclipse.jface.text.source.IAnnotationModel createVisualAnnotationModel(org.eclipse.jface.text.source.IAnnotationModel annotationModel)
          Creates the visual annotation model on top of the given annotation model.
 void doOperation(int operation)
          Performs the action specified by the operation id.
 void enableOperation(int operation, boolean enable)
           
protected  void ensureAnnotationHoverManagerInstalled()
          Ensure the annotation hover manager is installed.
 org.eclipse.jface.text.source.IAnnotationModel getAnnotationModel()
          Return this viewer's annotation model.
 org.eclipse.swt.widgets.Control getControl()
          Return the primary SWT Control (an LpexMultiWindow) associated with this viewer.
 org.eclipse.swt.widgets.Composite getPromptWindow()
          Optionally create and return the prompt window.
 org.eclipse.jface.text.IRegion getRangeIndication()
           
protected  org.eclipse.jface.text.source.IVerticalRuler getVerticalRuler()
          Returns the vertical ruler of this viewer.
 org.eclipse.jface.text.source.IAnnotationModel getVisualAnnotationModel()
          Returns the visual annotation model of this viewer.
protected  void handleDispose()
          Free all resources allocated by this viewer.
protected  void handleHelpRequest(org.eclipse.swt.events.HelpEvent e)
          Handle a help request from our registered help listener.
protected  org.eclipse.swt.graphics.Point rememberSelection()
          Remembers and returns the current selection.
 void removeRangeIndication()
          Remove the viewer's range indication.
protected  void restoreSelection()
          Restores a previously saved selection in the document.
 void setAnnotationHover(org.eclipse.jface.text.source.IAnnotationHover annotationHover)
           
 void setDocument(org.eclipse.jface.text.IDocument document)
          Set the viewer's IDocument.
 void setDocument(org.eclipse.jface.text.IDocument document, org.eclipse.jface.text.source.IAnnotationModel annotationModel)
          Sets the given document as this viewer's text model and the given annotation model as the model for this viewer's visual annotations.
 void setDocument(org.eclipse.jface.text.IDocument document, org.eclipse.jface.text.source.IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength)
          Sets the given document as this viewer's text model and the given annotation model as the model for this viewer's visual annotations.
 void setDocument(org.eclipse.jface.text.IDocument document, int visibleRegionOffset, int visibleRegionLength)
          This method just sets the viewer's IDocument.
protected  void setLanguageHelp(LpexLanguageHelp lsh)
          Set the provider for this source viewer's LPEX document parser language-sensitive help (LSH).
 void setOverviewRulerAnnotationHover(org.eclipse.jface.text.source.IAnnotationHover annotationHover)
          Sets the overview ruler's annotation hover of this source viewer.
 void setRangeIndication(int start, int len, boolean moveCursor)
          Sets the viewers's range indication to the specified range.
 void setRangeIndicator(org.eclipse.jface.text.source.Annotation rangeIndicator)
          Set the annotation used as range indicator for the viewer's vertical ruler.
 void showAnnotations(boolean show)
          Control the visibility of annotations and, in the case of separate presentation areas of text and annotations, the visibility of the annotation's presentation area.
 void unconfigure()
          Unconfigures this source viewer.
protected  void updateProfile(LpexView lpexView)
          Hook for post-updateProfile command processing.
 
Methods inherited from class com.ibm.lpex.alef.LpexTextViewer
_getVisibleRegionOffset, _internalGetVisibleRegion, addTextInputListener, addTextListener, addViewportListener, changeTextPresentation, createDocumentAdapter, createSlaveDocument, createSlaveDocumentManager, fireInputDocumentAboutToBeChanged, fireInputDocumentChanged, freeSlaveDocument, getAverageCharWidth, getAverageCharWidth, getBottomIndex, getBottomIndexEndOffset, getClosestWidgetLineForModelLine, getCurrentOffset, getCurrentTextHover, getDocument, getDocumentPartitioning, getEOL, getFindReplaceTarget, getFirstLpexView, getFirstLpexWindow, getHoverEventLocation, getInput, getLpexView, getLpexWindow, getModelCoverage, getSelectedRange, getSelection, getSelectionProvider, getSlaveDocumentManager, getTextHover, getTextHover, getTextHoveringController, getTextOperationTarget, getTextWidget, getTopIndex, getTopIndexStartOffset, getTopInset, getVisibleDocument, getVisibleLinesInViewport, getVisibleRegion, handleVisibleDocumentAboutToBeChanged, handleVisibleDocumentChanged, initializeDocumentInformationMapping, initializeLpexView, invalidateTextPresentation, invalidateTextPresentation, isEditable, modelLine2WidgetLine, modelOffset2WidgetOffset, modelRange2WidgetRange, modelRange2WidgetRange, modelSelection2WidgetSelection, moveFocusToWidgetToken, overlapsWithVisibleRegion, prependAutoEditStrategy, refresh, releaseWidgetToken, removeAutoEditStrategy, removeTextHovers, removeTextInputListener, removeTextListener, removeViewportListener, requestWidgetToken, requestWidgetToken, resetPlugins, resetVisibleRegion, revealRange, selectContentTypePlugin, selectionChanged, setAutoIndentStrategy, setDefaultPrefixes, setDocumentPartitioning, setEditable, setEditorInput, setEventConsumer, setHoverControlCreator, setIndentPrefixes, setInput, setSelectedRange, setSelection, setTextColor, setTextColor, setTextDoubleClickStrategy, setTextHover, setTextHover, setTopIndex, setUndoManager, setVisibleDocument, setVisibleRegion, splitView, updateProfile, updateSlaveDocument, updateViewportListeners, updateVisibleDocument, validateSelectionRange, widgetLine2ModelLine, widgetLineOfWidgetOffset, widgetlLine2ModelLine, widgetOffset2ModelOffset, widgetRange2ModelRange, widgetSelection2ModelSelection
 
Methods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, inputChanged, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.text.ITextViewer
addTextInputListener, addTextListener, addViewportListener, changeTextPresentation, getBottomIndex, getBottomIndexEndOffset, getDocument, getFindReplaceTarget, getSelectedRange, getSelectionProvider, getTextOperationTarget, getTextWidget, getTopIndex, getTopIndexStartOffset, getTopInset, getVisibleRegion, invalidateTextPresentation, isEditable, overlapsWithVisibleRegion, removeTextInputListener, removeTextListener, removeViewportListener, resetPlugins, resetVisibleRegion, revealRange, setAutoIndentStrategy, setDefaultPrefixes, setEditable, setEventConsumer, setIndentPrefixes, setSelectedRange, setTextColor, setTextColor, setTextDoubleClickStrategy, setTextHover, setTopIndex, setUndoManager, setVisibleRegion
 

 

Field Detail

 

 

GAP_SIZE

protected static final int GAP_SIZE

The size of the gap between the vertical ruler and the text widget.

See Also:
Constant Field Values


 

 

_SELECTION_POSITION_CATEGORY

protected static final String _SELECTION_POSITION_CATEGORY

Partial name of the position category to manage remembered selections.

See Also:
Constant Field Values


 

 

MODEL_ANNOTATION_MODEL

protected static final Object MODEL_ANNOTATION_MODEL

Key of the model annotation model inside the visual annotation model.


 

 

fContentAssistant

protected IContentAssistant fContentAssistant

The viewer's content assistant.


 

 

fContentAssistantInstalled

protected boolean fContentAssistantInstalled

Flag indicating whether the viewer's content assistant is installed (enabled).


 

 

fContentFormatter

protected org.eclipse.jface.text.formatter.IContentFormatter fContentFormatter

The viewer's content formatter.


 

 

fReconciler

protected org.eclipse.jface.text.reconciler.IReconciler fReconciler

The viewer's model reconciler.


 

 

fPresentationReconciler

protected org.eclipse.jface.text.presentation.IPresentationReconciler fPresentationReconciler

The viewer's presentation reconciler.


 

 

fAnnotationHover

protected org.eclipse.jface.text.source.IAnnotationHover fAnnotationHover

The viewer's annotation hover.


 

 

fSelections

protected final Stack fSelections

Stack of saved selections in the underlying document.


 

 

fSelectionUpdater

protected org.eclipse.jface.text.IPositionUpdater fSelectionUpdater

Position updater for saved selections.


 

 

fSelectionCategory

protected String fSelectionCategory

Position category used by the selection updater.


 

 

fOverviewRulerAnnotationHover

protected org.eclipse.jface.text.source.IAnnotationHover fOverviewRulerAnnotationHover

The viewer's overview ruler annotation hover.


 

 

fInformationPresenter

protected org.eclipse.jface.text.information.IInformationPresenter fInformationPresenter

The viewer's information presenter. An information presenter shows information available at the text viewer's current document position. An IInformationPresenter is a ITextViewer add-on. An information presenter has a list of IInformationProvider objects, each of which is registered for a particular document-content type. The presenter uses the strategy objects in order to retrieve the information to present.

Constructor Detail

 

 

LpexSourceViewer

public LpexSourceViewer(org.eclipse.swt.widgets.Composite parent,
                        org.eclipse.ui.texteditor.ITextEditor textEditor,
                        org.eclipse.jface.text.source.IVerticalRuler ruler,
                        int styles)

Constructs a new LPEX source viewer. The vertical ruler is initially visible. The viewer has not yet been initialized with a source viewer configuration.

Parameters:
parent - the parent of the viewer's control
textEditor - the LpexAbstractTextEditor instantiating this source viewer
ruler - the vertical ruler used by this source viewer
styles - the SWT style bits
Method Detail

 

 

createControl

protected void createControl(org.eclipse.swt.widgets.Composite parent,
                             int styles)

Create this source viewer's controls. This method extends LpexTextViewer's method in order to create a new parent Canvas for a potential prompt window and the optional vertical ruler.

Overrides:
createControl in class LpexTextViewer

Parameters:
parent - the parent of the viewer's control
styles - the SWT style bits for the viewer's control
See Also:
LpexTextViewer.createControl(org.eclipse.swt.widgets.Composite, int), getPromptWindow()


 

 

createLayout

protected org.eclipse.swt.widgets.Layout createLayout()

Creates the layout used for this viewer. Subclasses may override this method.

Returns:
the layout used for this viewer


 

 

getControl

public org.eclipse.swt.widgets.Control getControl()

Description copied from class: LpexTextViewer
Return the primary SWT Control (an LpexMultiWindow) associated with this viewer.

Overrides:
getControl in class LpexTextViewer

See Also:
LpexTextViewer.getControl()


 

 

getPromptWindow

public org.eclipse.swt.widgets.Composite getPromptWindow()

Optionally create and return the prompt window. The prompt window is a borderless Composite, initially invisible, located under the LPEX text widget window. It is created for the benefit and under the full control of the user. It can be used, for example, to house an RPG source-prompt dialog.

Returns:
the existing / a new prompt-window Composite, or null if the prompt window could not be created


 

 

setAnnotationHover

public void setAnnotationHover(org.eclipse.jface.text.source.IAnnotationHover annotationHover)

Specified by:
setAnnotationHover in interface org.eclipse.jface.text.source.ISourceViewer

See Also:
ISourceViewer.setAnnotationHover(org.eclipse.jface.text.source.IAnnotationHover)


 

 

setOverviewRulerAnnotationHover

public void setOverviewRulerAnnotationHover(org.eclipse.jface.text.source.IAnnotationHover annotationHover)

Sets the overview ruler's annotation hover of this source viewer. The annotation hover provides the information to be displayed in a hover pop-up window if requested over the overview rulers area. The annotation hover is assumed to be line oriented.

Parameters:
annotationHover - the hover to be used; null is a valid argument


 

 

configure

public void configure(org.eclipse.jface.text.source.SourceViewerConfiguration configuration)

Configure the source viewer as described in the configuration.

You should use an LpexSourceViewerConfiguration-based class to configure an LpexSourceViewer.

LpexSourceViewer does not use/implement certain (Lpex)SourceViewerConfiguration features.

  • configuration.getAutoIndentStrategy()
    -- an LPEX language parser handles its own autoindent strategy
  • configuration.getContentAssist()
    -- using configuration.getLpexContentAssist() instead (defined in LpexSourceViewerConfiguration)
  • configuration.getDoubleClickStrategy()
    -- LPEX has its own double-click actions. Token/word selection and bracket matching can be customized via new LpexActions
  • configuration.getTabWidth()
    -- LPEX tab positions for the nextTabStop and prevTabStop actions are configured through the tabs parameter
  • configuration.getUndoManager()
    -- LPEX uses its own built-in undo manager (with unlimited undo/redo capabilitites).

Specified by:
configure in interface org.eclipse.jface.text.source.ISourceViewer

Parameters:
configuration - an LpexSourceViewerConfiguration
See Also:
LpexSourceViewerConfiguration, ISourceViewer.configure(org.eclipse.jface.text.source.SourceViewerConfiguration), LpexCommonParser


 

 

ensureAnnotationHoverManagerInstalled

protected void ensureAnnotationHoverManagerInstalled()

Ensure the annotation hover manager is installed. After this method has been executed, the caller knows that any annotation hover (shows a pop-up window when the mouse pointer hovers over the vertical ruler) which was registered by the SourceViewerConfiguration has been installed.


 

 

activatePlugins

public void activatePlugins()

Extends LpexTextViewer's to install the annotation hover.

Specified by:
activatePlugins in interface org.eclipse.jface.text.ITextViewer
Overrides:
activatePlugins in class LpexTextViewer

See Also:
ITextViewer.activatePlugins()


 

 

setDocument

public void setDocument(org.eclipse.jface.text.IDocument document)

Set the viewer's IDocument.

Specified by:
setDocument in interface org.eclipse.jface.text.ITextViewer
Overrides:
setDocument in class LpexTextViewer

See Also:
ITextViewer.setDocument(IDocument)


 

 

setDocument

public void setDocument(org.eclipse.jface.text.IDocument document,
                        int visibleRegionOffset,
                        int visibleRegionLength)

This method just sets the viewer's IDocument.

In LpexSourceViewer, the visible document is always the viewer's (entire) input document. To display only certain region(s) of the document in the viewer, set marks for these regions, and set their included or excluded attribute. See the mark, markIncluded, and markExcluded parameters.

In SourceViewer, this method sets the viewer's document and the visible region.

Specified by:
setDocument in interface org.eclipse.jface.text.ITextViewer
Overrides:
setDocument in class LpexTextViewer

See Also:
ITextViewer.setDocument(IDocument,int,int), LpexTextViewer.setDocument(IDocument)


 

 

setDocument

public void setDocument(org.eclipse.jface.text.IDocument document,
                        org.eclipse.jface.text.source.IAnnotationModel annotationModel)

Sets the given document as this viewer's text model and the given annotation model as the model for this viewer's visual annotations. The presentation is accordingly updated. An appropriate TextEvent is issued. This text event does not carry a related document event.

Specified by:
setDocument in interface org.eclipse.jface.text.source.ISourceViewer

Parameters:
document - the viewer's new input document
annotationModel - the model for the viewer's visual annotations (the document provider's annotation model)
See Also:
ISourceViewer.setDocument(IDocument, IAnnotationModel)


 

 

createVisualAnnotationModel

protected org.eclipse.jface.text.source.IAnnotationModel createVisualAnnotationModel(org.eclipse.jface.text.source.IAnnotationModel annotationModel)

Creates the visual annotation model on top of the given annotation model.

Parameters:
annotationModel - the wrapped annotation model
Returns:
the visual annotation model on top of the given annotation model


 

 

setDocument

public void setDocument(org.eclipse.jface.text.IDocument document,
                        org.eclipse.jface.text.source.IAnnotationModel annotationModel,
                        int modelRangeOffset,
                        int modelRangeLength)

Sets the given document as this viewer's text model and the given annotation model as the model for this viewer's visual annotations. In LpexSourceViewer, the visible document is always the viewer's (entire) input document. To display only certain region(s) of the document in the viewer, set marks for these regions, and set their included or excluded attribute. See the mark, markIncluded, and markExcluded parameters.

In SourceViewer, the presentation is also updated, whereby only the specified region is made visible. In SourceViewer, this is a convenience method for

   setDocument(document, annotationModel);
   setVisibleRegion(offset, length) 

Specified by:
setDocument in interface org.eclipse.jface.text.source.ISourceViewer

Parameters:
document - the new input document
annotationModel - the model of the viewer's visual annotations (our IDocument provider's annotation model)
See Also:
ISourceViewer.setDocument(IDocument,IAnnotationModel,int,int)


 

 

getAnnotationModel

public org.eclipse.jface.text.source.IAnnotationModel getAnnotationModel()

Return this viewer's annotation model.

Specified by:
getAnnotationModel in interface org.eclipse.jface.text.source.ISourceViewer

See Also:
ISourceViewer.getAnnotationModel()


 

 

getVisualAnnotationModel

public org.eclipse.jface.text.source.IAnnotationModel getVisualAnnotationModel()

Returns the visual annotation model of this viewer.

See Also:
ISourceViewerExtension2.getVisualAnnotationModel()


 

 

unconfigure

public void unconfigure()

Unconfigures this source viewer. The source viewer can be configured again after a call to this method. Unlike ISourceViewer.configure(SourceViewerConfiguration), this method can be called more than once without interleaving calls to ISourceViewer.configure(SourceViewerConfiguration).

See Also:
ISourceViewerExtension2.unconfigure()


 

 

handleDispose

protected void handleDispose()

Free all resources allocated by this viewer. Extends LpexTextViewer's.

Overrides:
handleDispose in class LpexTextViewer

See Also:
LpexTextViewer.handleDispose()


 

 

canDoOperation

public boolean canDoOperation(int operation)

Description copied from class: LpexTextViewer
Check whether the action specified by the operation id can be performed.

Note that most LPEX actions (as defined in e.g., LpexAbstractTextEditor) call the editor directly for querying availability.

Specified by:
canDoOperation in interface org.eclipse.jface.text.ITextOperationTarget
Overrides:
canDoOperation in class LpexTextViewer

Parameters:
operation - LPEX-defined operation id (including the equivalents of ITextOperationTarget.UNDO, .REDO, etc.)
See Also:
ITextOperationTarget.canDoOperation(int)


 

 

rememberSelection

protected org.eclipse.swt.graphics.Point rememberSelection()

Remembers and returns the current selection. The saved selection can be restored by calling restoreSelection().

Returns:
the current selection
See Also:
ITextViewer.getSelectedRange()


 

 

restoreSelection

protected void restoreSelection()

Restores a previously saved selection in the document. If no selection was previously saved, nothing happens.


 

 

clearRememberedSelection

protected void clearRememberedSelection()


 

 

doOperation

public void doOperation(int operation)

Description copied from class: LpexTextViewer
Performs the action specified by the operation id. This method may be called when canDoOperation() returns true.

Note that most LPEX actions (as defined in e.g., LpexAbstractTextEditor) call the editor directly.

Specified by:
doOperation in interface org.eclipse.jface.text.ITextOperationTarget
Overrides:
doOperation in class LpexTextViewer

Parameters:
operation - LPEX-defined operation id (including the equivalents of ITextOperationTarget.UNDO, .REDO, etc.)
See Also:
ITextOperationTarget.doOperation(int)


 

 

enableOperation

public void enableOperation(int operation,
                            boolean enable)

Specified by:
enableOperation in interface org.eclipse.jface.text.ITextOperationTargetExtension
Overrides:
enableOperation in class LpexTextViewer


 

 

setRangeIndicator

public void setRangeIndicator(org.eclipse.jface.text.source.Annotation rangeIndicator)

Set the annotation used as range indicator for the viewer's vertical ruler.

Specified by:
setRangeIndicator in interface org.eclipse.jface.text.source.ISourceViewer

See Also:
ISourceViewer.setRangeIndicator(org.eclipse.jface.text.source.Annotation)


 

 

setRangeIndication

public void setRangeIndication(int start,
                               int len,
                               boolean moveCursor)

Sets the viewers's range indication to the specified range.

Specified by:
setRangeIndication in interface org.eclipse.jface.text.source.ISourceViewer

Parameters:
start - the offset of the range
len - the length of the range
moveCursor - indicates whether the cursor should be moved to the given offset
See Also:
ISourceViewer.setRangeIndication(int,int,boolean)


 

 

getRangeIndication

public org.eclipse.jface.text.IRegion getRangeIndication()

Specified by:
getRangeIndication in interface org.eclipse.jface.text.source.ISourceViewer

See Also:
ISourceViewer.getRangeIndication()


 

 

removeRangeIndication

public void removeRangeIndication()

Remove the viewer's range indication.

Specified by:
removeRangeIndication in interface org.eclipse.jface.text.source.ISourceViewer

See Also:
ISourceViewer.removeRangeIndication()


 

 

showAnnotations

public void showAnnotations(boolean show)

Control the visibility of annotations and, in the case of separate presentation areas of text and annotations, the visibility of the annotation's presentation area.

Specified by:
showAnnotations in interface org.eclipse.jface.text.source.ISourceViewer

See Also:
ISourceViewer.showAnnotations(boolean)


 

 

getVerticalRuler

protected final org.eclipse.jface.text.source.IVerticalRuler getVerticalRuler()

Returns the vertical ruler of this viewer.

Returns:
the vertical ruler of this viewer


 

 

updateProfile

protected void updateProfile(LpexView lpexView)

Hook for post-updateProfile command processing. Extend this method to define your own LPEX actions (and assign them to keys), and your own LPEX commands. Ensure you also call super.updateProfile(). An editor using this source viewer provides its own updateProfile() user hook.

Called when a new document view is created (a new document is opened in this viewer, and is, at this point, already loaded in the editor), and whenever the updateProfile command is issued afterwards.

Overrides:
updateProfile in class LpexTextViewer

Parameters:
lpexView - the primary or secondary document view whose profile has been updated


 

 

setLanguageHelp

protected void setLanguageHelp(LpexLanguageHelp lsh)

Set the provider for this source viewer's LPEX document parser language-sensitive help (LSH).


 

 

handleHelpRequest

protected void handleHelpRequest(org.eclipse.swt.events.HelpEvent e)

Handle a help request from our registered help listener.


 

 

createViewPreferenceNodes

protected void createViewPreferenceNodes(LpexSourceViewer lpexSourceViewer)

Hook to allow the solution plug-in create custom preference node(s) for view-scoped preference page(s) for this source viewer. If the source viewer is used by an LpexAbstractTextEditor-based editor, the implementation of this method gives that class a (first) chance at creating custom preference nodes. To allow this, extenders of this method must ensure they call super.createViewPreferenceNodes().

A custom preference node is a subclass of LpexViewPreferenceNode. Custom nodes are added after the LPEX view-scoped preference nodes, in the order in which they are created.

See Also:
LpexAbstractTextEditor.createViewPreferenceNodes(com.ibm.lpex.alef.LpexSourceViewer), LpexViewPreferenceNode


 

 

createViewPreferencePage

protected org.eclipse.jface.preference.IPreferencePage createViewPreferencePage(LpexView lpexView,
                                                                                int nodeType)

Factory method to create the preference page for a view-scoped preference node used by this source viewer. If the source viewer is used by an LpexAbstractTextEditor-based editor, that class will be given a first chance to create a custom preference page for the given LPEX built-in or custom preference node.

If you extend this method, ensure you call super.createViewPreferencePage() for the node types you don't support or customize.

Parameters:
nodeType - preference node type, one of
LpexViewPreferenceNode.VIEW_BASE_PREFERENCE_NODE, LpexViewPreferenceNode.VIEW_PARSER_PREFERENCE_NODE, LpexViewPreferenceNode.VIEW_SEQUENCE_NUMBERS_PREFERENCE_NODE, LpexViewPreferenceNode.VIEW_SOURCE_ENCODING_PREFERENCE_NODE
See Also:
LpexAbstractTextEditor.createViewPreferencePage(com.ibm.lpex.core.LpexView, int)


 

Overview

 
Package  Use  Tree  Serialized  Deprecated  Index  Help 
SWT LPEX
v3.0.0
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD