|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.viewers.Viewer | +--com.ibm.lpex.alef.LpexTextViewer
A line-oriented, LPEX-based partial implementation of
org.eclipse.jface.text.ITextViewer
.
Like TextViewer, once this viewer and its text widget have been created,
the viewer can only indirectly be disposed by disposing its primary SWT
control (the LpexWindow). Clients should not subclass this class, as it
is likely that subclasses will be broken by future releases.
One major difference from TextViewer, this viewer's stream-oriented IDocument is not kept up-to-date with the text changes in the underlying LPEX text widget. Always use LpexView to query the text of the edited document.
Several TextViewer classes, methods, and fields are not available in LpexTextViewer. Most programming of the underlying LPEX widget should be done directly via its LpexView and LpexWindow.
TextViewer classes, methods, and fields which are not available, not implemented, or whose function differs significantly in LpexTextViewer are listed below, along with explanations and any LPEX alternatives. While the list is rather long, it should be noted that several (such as those geared towards specific Eclipse solutions, like the shift-string operations, or those specific to the underlying StyledText) are indicated for completness, even if their visibility is package or private.
null
: use getLpexWindow() and
getLpexView() instead
IUndoManager
ITextDoubleClickStrategy
. Token/word selection and bracket
matching can be customized via new LpexActions
IAutoIndentStrategy
is not supported
ITextViewer
,
getLpexView()
,
getLpexWindow()
Field Summary | |
protected int |
fLastTopPixel
The last visible vertical position of the top line. |
protected boolean |
fReplaceTextPresentation
Indicates whether the viewer's text presentation should be replaced are modified. |
protected java.util.Map |
fTextHovers
The text viewer's text hovers. |
protected java.util.List |
fTextInputListeners
All registered text input listeners. |
protected java.util.List |
fViewportListeners
All registered viewport listeners. |
protected static int |
INTERNAL
Id for originator of view port changes. |
protected static int |
KEY
Id for originator of view port changes. |
protected static int |
MOUSE
Id for originator of view port changes. |
protected static int |
MOUSE_END
Id for originator of view port changes. |
protected static int |
RESIZE
Id for originator of view port changes. |
protected static int |
SCROLLER
Id for originator of view port changes. |
static boolean |
TRACE_ERRORS
|
Fields inherited from class org.eclipse.jface.viewers.Viewer |
WIDGET_DATA_KEY |
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 | |
protected |
LpexTextViewer()
Internal-use constructor. |
|
LpexTextViewer(org.eclipse.swt.widgets.Composite parent,
int styles)
Create an LpexTextViewer with the given SWT style bits. |
Method Summary | |
void |
activatePlugins()
Activate the installed TextViewer 'plugins' (hover, etc.). |
void |
addTextInputListener(org.eclipse.jface.text.ITextInputListener listener)
Add a text input listener to the ITextViewer . |
void |
addTextListener(org.eclipse.jface.text.ITextListener listener)
The implementation of this method does nothing. |
void |
addViewportListener(org.eclipse.jface.text.IViewportListener listener)
|
boolean |
canDoOperation(int operation)
Check whether the action specified by the operation id can be performed. |
void |
changeTextPresentation(org.eclipse.jface.text.TextPresentation presentation,
boolean controlRedraw)
This method does nothing. |
protected void |
createControl(org.eclipse.swt.widgets.Composite parent,
int styles)
Creates the viewer's SWT control. |
protected org.eclipse.jface.text.IDocumentAdapter |
createDocumentAdapter()
Factory method to create the document adapter to be used by this viewer. |
void |
doOperation(int operation)
Performs the action specified by the operation id. |
protected void |
fireInputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument oldInput,
org.eclipse.jface.text.IDocument newInput)
Informs all registered text input listeners about the forthcoming input change. |
protected void |
fireInputDocumentChanged(org.eclipse.jface.text.IDocument oldInput,
org.eclipse.jface.text.IDocument newInput)
Informs all registered text input listeners about the sucessful input change. |
int |
getBottomIndex()
Return the ZERO-based index of the visible document-section line with the highest line number. |
int |
getBottomIndexEndOffset()
Return the character position which is at the lower-right corner of the widget's viewport, i.e., the visible character with the highest character position. |
org.eclipse.swt.widgets.Control |
getControl()
Return the primary SWT Control (LpexWindow) associated with this viewer. |
org.eclipse.jface.text.IDocument |
getDocument()
Return this text viewer's stream-oriented IDocument. |
java.lang.String |
getEOL()
Return the line delimiter used by the document currently handled by this text viewer. |
org.eclipse.jface.text.IFindReplaceTarget |
getFindReplaceTarget()
This method returns null . |
java.lang.Object |
getInput()
Return the input (IDocument) of this viewer. |
LpexView |
getLpexView()
Retrieve the underlying LPEX text widget view on the document. |
LpexWindow |
getLpexWindow()
Retrieve the underlying LPEX text widget window (an SWT Composite). |
org.eclipse.swt.graphics.Point |
getSelectedRange()
Return the range of the current selection in coordinates of this viewer's document. |
org.eclipse.jface.viewers.ISelection |
getSelection()
Return the current selection. |
org.eclipse.jface.viewers.ISelectionProvider |
getSelectionProvider()
|
org.eclipse.jface.text.ITextOperationTarget |
getTextOperationTarget()
Return the text-operations target of this viewer. |
org.eclipse.swt.custom.StyledText |
getTextWidget()
This method returns null . |
int |
getTopIndex()
Return the ZERO-based index of the visible document-section line with the smallest line number. |
int |
getTopIndexStartOffset()
Return the character position which is at the upper-left corner of the widget's viewport. |
int |
getTopInset()
Return the top, in pixels, of the text-widget screen. |
org.eclipse.jface.text.IDocument |
getVisibleDocument()
Returns the viewer's visible document. |
protected int |
getVisibleLinesInViewport()
Return the number of rows displayable in the viewport. |
org.eclipse.jface.text.IRegion |
getVisibleRegion()
This method always returns a 0,0 region. |
protected int |
getVisibleRegionOffset()
This method always returns 0. |
protected void |
handleDispose()
Frees all resources allocated by this viewer. |
protected void |
initializeLpexView(LpexView lpexView)
Hook to initialize a newly instantiated LpexView. |
protected org.eclipse.jface.text.IRegion |
internalGetVisibleRegion()
This method always return null . |
boolean |
isEditable()
Query whether the shown text can be manipulated. |
protected boolean |
isPrintable()
Query whether the shown text can be printed. |
boolean |
overlapsWithVisibleRegion(int start,
int length)
This method always returns true . |
void |
refresh()
Refresh this viewer completely with information freshly obtained from this viewer's model (its IDocument). |
void |
removeTextInputListener(org.eclipse.jface.text.ITextInputListener listener)
Remove the text input listener from the ITextViewer . |
void |
removeTextListener(org.eclipse.jface.text.ITextListener listener)
The implementation of this method does nothing. |
void |
removeViewportListener(org.eclipse.jface.text.IViewportListener listener)
|
void |
resetPlugins()
Resets the installed plug-ins. |
void |
resetVisibleRegion()
This method does nothing. |
void |
revealRange(int start,
int end)
Ensure that the given character range is visible. |
protected java.lang.Object |
selectContentTypePlugin(int offset,
java.util.Map plugins)
Selects from the given map the one which is registered under the content type of the partition in which the given offset is located. |
protected void |
selectionChanged(int offset,
int len)
Sends out a selection-changed event to all registered listeners. |
void |
setAutoIndentStrategy(org.eclipse.jface.text.IAutoIndentStrategy strategy,
java.lang.String contentType)
This method does nothing. |
void |
setDefaultPrefix(java.lang.String defaultPrefix,
java.lang.String contentType)
This method does nothing in LpexTextViewer. |
void |
setDocument(org.eclipse.jface.text.IDocument document)
Set the given IDocument as the text viewer's model, and update the presentation accordingly. |
void |
setDocument(org.eclipse.jface.text.IDocument document,
int visibleRegionOffset,
int visibleRegionLength)
The implementation of this method calls setDocument(document). |
void |
setEditable(boolean editable)
Set the editable mode. |
protected void |
setEditorInput(org.eclipse.ui.IEditorInput editorInput)
Indicate which is the editor-input resource for this text viewer. |
void |
setEventConsumer(org.eclipse.jface.text.IEventConsumer consumer)
This method does nothing. |
void |
setIndentPrefixes(java.lang.String[] indentPrefixes,
java.lang.String contentType)
This method does nothing. |
void |
setInput(java.lang.Object input)
Set or clear the input (IDocument) for this viewer. |
void |
setSelectedRange(int offset,
int length)
Sets the selection to the specified range. |
void |
setSelection(org.eclipse.jface.viewers.ISelection selection,
boolean reveal)
|
void |
setTextColor(org.eclipse.swt.graphics.Color color)
This method does nothing. |
void |
setTextColor(org.eclipse.swt.graphics.Color color,
int start,
int length,
boolean controlRedraw)
This method does nothing. |
void |
setTextDoubleClickStrategy(org.eclipse.jface.text.ITextDoubleClickStrategy strategy,
java.lang.String contentType)
This method does nothing in LpexTextViewer. |
void |
setTextHover(org.eclipse.jface.text.ITextHover hover,
java.lang.String contentType)
Defined by ITextViewer, as part of its plugins support. |
void |
setTopIndex(int index)
Scrolls the edit window so that ZERO-based index is the
smallest document-section line number of all visible lines. |
void |
setUndoManager(org.eclipse.jface.text.IUndoManager undoManager)
This method does nothing in LpexTextViewer. |
void |
setVisibleRegion(int start,
int len)
This method does nothing. |
protected void |
updateProfile()
Hook for post-updateProfile command processing. |
protected void |
updateViewportListeners(int origin)
Checks whether the viewport changed and if so informs all registered listeners about the change. |
Methods inherited from class org.eclipse.jface.viewers.Viewer |
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, 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 |
Field Detail |
public static boolean TRACE_ERRORS
protected static final int SCROLLER
protected static final int MOUSE
protected static final int MOUSE_END
protected static final int KEY
protected static final int RESIZE
protected static final int INTERNAL
protected java.util.Map fTextHovers
protected java.util.List fViewportListeners
protected int fLastTopPixel
protected java.util.List fTextInputListeners
protected boolean fReplaceTextPresentation
Constructor Detail |
protected LpexTextViewer()
public LpexTextViewer(org.eclipse.swt.widgets.Composite parent, int styles)
parent
- the parent of the viewer's controlstyles
- the SWT style bits for the viewer's controlcreateControl(org.eclipse.swt.widgets.Composite, int)
Method Detail |
protected org.eclipse.jface.text.IDocumentAdapter createDocumentAdapter()
IDocumentAdapter adapts an IDocument to the StyledTextContent interface. The document adapter is used by TextViewer to translate IDocument changes into its styled text content changes and vice versa. Clients may implement this interface and override this method if they want to intercept the communication between the viewer's text widget and the viewer's document.
protected void createControl(org.eclipse.swt.widgets.Composite parent, int styles)
Here are the steps carried out by this method:
The user must add their own LPEX actions and commands by extending updateProfile(), which is called when we are notified of the completion of the updateProfile command.
parent
- the parent of the viewer's controlstyles
- the SWT style bits for the viewer's controlinitializeLpexView(com.ibm.lpex.core.LpexView)
,
updateProfile()
public org.eclipse.swt.widgets.Control getControl()
getControl
in class org.eclipse.jface.viewers.Viewer
Viewer.getControl()
public void activatePlugins()
Defined by ITextViewer, as part of its plugins support.
activatePlugins
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.activatePlugins()
public void resetPlugins()
resetPlugins
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.resetPlugins()
protected void handleDispose()
public org.eclipse.swt.custom.StyledText getTextWidget()
null
. In TextViewer, this method returns
the StyledText control, its underlying text widget.
Note: Do not use this method in LpexTextViewer. LpexTextViewer uses an LPEX text widget, which consists of an LpexWindow (an SWT Composite) and an LpexView, rather than a StyledText widget.
getTextWidget
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getTextWidget()
,
getLpexWindow()
,
getLpexView()
public void setAutoIndentStrategy(org.eclipse.jface.text.IAutoIndentStrategy strategy, java.lang.String contentType)
In TextViewer, this method registers an IAutoIndentStrategy for the given content type. LPEX language parsers handle their own autoindent.
Defined by ITextViewer, as part of its plugins support.
setAutoIndentStrategy
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setAutoIndentStrategy(org.eclipse.jface.text.IAutoIndentStrategy, java.lang.String)
public void setEventConsumer(org.eclipse.jface.text.IEventConsumer consumer)
In TextViewer, implementers can register and receive VerifyEvents before the text viewer touches them. If the IEventConsumer marks an event as processed, the text viewer will ignore it. For example, keys consumed by a content-assist popup should not be again processed by us (this is not quite AWT's e.consume(), but that's the way Eclipse operates).
setEventConsumer
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setEventConsumer(org.eclipse.jface.text.IEventConsumer)
public void setIndentPrefixes(java.lang.String[] indentPrefixes, java.lang.String contentType)
In TextViewer, this method sets the strings that are used as prefixes when lines of the given content type are shifted using the shift operations. Defined by ITextViewer, as part of its plugins support.
setIndentPrefixes
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setIndentPrefixes(java.lang.String[], java.lang.String)
public int getTopInset()
getTopInset
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getTopInset()
public boolean isEditable()
isEditable
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.isEditable()
protected boolean isPrintable()
public void setEditable(boolean editable)
setEditable
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setEditable(boolean)
,
isEditable()
public void setDefaultPrefix(java.lang.String defaultPrefix, java.lang.String contentType)
Defined by ITextViewer, as part of its plugins support.
setDefaultPrefix
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setDefaultPrefix(java.lang.String, java.lang.String)
public void setUndoManager(org.eclipse.jface.text.IUndoManager undoManager)
IUndoManager
.
Defined by ITextViewer, as part of its plugins support.
setUndoManager
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setUndoManager(org.eclipse.jface.text.IUndoManager)
public void setTextHover(org.eclipse.jface.text.ITextHover hover, java.lang.String contentType)
setTextHover
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setTextHover(org.eclipse.jface.text.ITextHover, java.lang.String)
public org.eclipse.swt.graphics.Point getSelectedRange()
In LPEX, this stream-oriented method is inefficient, and should be avoided.
getSelectedRange
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getSelectedRange()
public void setSelectedRange(int offset, int length)
In LPEX, this stream-oriented method is inefficient, and should be avoided. To set selections, use the block command. To reposition the cursor, use the locate command and the position parameter.
setSelectedRange
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setSelectedRange(int, int)
public void setSelection(org.eclipse.jface.viewers.ISelection selection, boolean reveal)
setSelection
in class org.eclipse.jface.viewers.Viewer
Viewer.setSelection(ISelection)
public org.eclipse.jface.viewers.ISelection getSelection()
In LPEX, this stream-oriented method is inefficient, and should be avoided.
getSelection
in class org.eclipse.jface.viewers.Viewer
Viewer.getSelection()
public org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()
getSelectionProvider
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getSelectionProvider()
protected void selectionChanged(int offset, int len)
offset
- the offset of the newly selected rangelen
- the length of the newly selected rangepublic void addTextListener(org.eclipse.jface.text.ITextListener listener)
In TextViewer, this method adds a text listener to the text widget. A listener is registered only once, subsequent calls are without effect.
addTextListener
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.addTextListener(org.eclipse.jface.text.ITextListener)
public void removeTextListener(org.eclipse.jface.text.ITextListener listener)
In TextViewer, this method removes the text listener from the text widget. If the listener is not registered with the widget, the call is without effect.
removeTextListener
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.removeTextListener(org.eclipse.jface.text.ITextListener)
public void addTextInputListener(org.eclipse.jface.text.ITextInputListener listener)
ITextViewer
. A listener is
registered only once, subsequent calls are without effect.
Text input listeners registered with a text viewer are informed when the document serving as the text viewer's model is replaced.
addTextInputListener
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.addTextInputListener(org.eclipse.jface.text.ITextInputListener)
public void removeTextInputListener(org.eclipse.jface.text.ITextInputListener listener)
ITextViewer
. If the
listener is not registered with the viewer, the call is without effect.removeTextInputListener
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.removeTextInputListener(org.eclipse.jface.text.ITextInputListener)
protected void fireInputDocumentAboutToBeChanged(org.eclipse.jface.text.IDocument oldInput, org.eclipse.jface.text.IDocument newInput)
oldInput
- the old input documentnewInput
- the new input documentprotected void fireInputDocumentChanged(org.eclipse.jface.text.IDocument oldInput, org.eclipse.jface.text.IDocument newInput)
oldInput
- the old input documentnewInput
- the new input documentpublic java.lang.Object getInput()
getInput
in class org.eclipse.jface.viewers.Viewer
Viewer.getInput()
public org.eclipse.jface.text.IDocument getDocument()
Defined by ITextViewer, as part of its model-manipulation support.
getDocument
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getDocument()
public void setInput(java.lang.Object input)
setInput
in class org.eclipse.jface.viewers.Viewer
Viewer.setInput(java.lang.Object)
public void setDocument(org.eclipse.jface.text.IDocument document)
Defined by ITextViewer, as part of its model-manipulation support.
setDocument
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setDocument(IDocument)
public void setDocument(org.eclipse.jface.text.IDocument document, int visibleRegionOffset, int visibleRegionLength)
In TextViewer, this is a convenience method for
setDocument(document); setVisibleRegion(offset, length)It is defined by ITextViewer as part of its visible-region support.
setDocument
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setDocument(IDocument,int,int)
,
setDocument(IDocument)
public void addViewportListener(org.eclipse.jface.text.IViewportListener listener)
addViewportListener
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.addViewportListener(org.eclipse.jface.text.IViewportListener)
public void removeViewportListener(org.eclipse.jface.text.IViewportListener listener)
removeViewportListener
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.removeViewportListener(org.eclipse.jface.text.IViewportListener)
protected void updateViewportListeners(int origin)
origin
- describes under which circumstances this method has been called.IViewportListener
public int getTopIndex()
getTopIndex
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getTopIndex()
public int getTopIndexStartOffset()
getTopIndexStartOffset
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getTopIndexStartOffset()
public void setTopIndex(int index)
index
is the
smallest document-section line number of all visible lines.
Preferred method: in LPEX you may consider various options, depending on the intended usage. For example, to set the cursor in the edit window on a certain line in the document:
LpexView lpexView = getLpexView(); lpexView.doCommand("locate emphasis line " + (index + 1 + lpexView.linesBeforeStart())); lpexView.triggerAction(lpexView.actionId("textWindow"));To position the line that contains the cursor on a certain screen row:
LpexView lpexView = getLpexView(); lpexView.doCommand("set cursorRow " + row); lpexView.doDefaultCommand("screenShow");
You must consider certain characteristics of the LPEX edit window, such as:
setTopIndex
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setTopIndex(int)
protected int getVisibleLinesInViewport()
Preferred method: use getLpexView().queryInt("rows").
public int getBottomIndex()
getBottomIndex
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getBottomIndex()
public int getBottomIndexEndOffset()
getBottomIndexEndOffset
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getBottomIndexEndOffset()
public void revealRange(int start, int end)
revealRange
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.revealRange(int, int)
public void refresh()
refresh
in class org.eclipse.jface.viewers.Viewer
Viewer.refresh()
,
setDocument(IDocument)
public org.eclipse.jface.text.IDocument getVisibleDocument()
protected int getVisibleRegionOffset()
In TextViewer, this method returns the offset of the visible region.
public org.eclipse.jface.text.IRegion getVisibleRegion()
In TextViewer, this method returns the current visible region of this viewer's document. Defined by ITextViewer as part of its visible-region support.
getVisibleRegion
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getVisibleRegion()
public void setVisibleRegion(int start, int len)
In TextViewer, this method sets the region of this viewer's document which will be visible in the presentation. It does this by defining a child document for this region, and setting it as the visible document for the text widget (i.e., reloading the text widgets with the contents of this child document). It is defined by ITextViewer as part of its visible-region support.
setVisibleRegion
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setVisibleRegion(int, int)
public void resetVisibleRegion()
In TextViewer, this method resets the region of this viewer's document which is visible in the presentation, so that the whole document is presented again. It is defined by ITextViewer, as part of its visible-region support.
resetVisibleRegion
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.resetVisibleRegion()
public boolean overlapsWithVisibleRegion(int start, int length)
true
.
In LpexTextViewer, 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 TextViewer, this method returns whether a given range overlaps with the visible region of this viewer's document. It is defined by ITextViewer, as part of its visible-region support.
overlapsWithVisibleRegion
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.overlapsWithVisibleRegion(int, int)
public void setTextDoubleClickStrategy(org.eclipse.jface.text.ITextDoubleClickStrategy strategy, java.lang.String contentType)
ITextDoubleClickStrategy
. Token/word selection and bracket
matching can be customized via new LpexActions.
Defined by ITextViewer, as part of its plugins support.
setTextDoubleClickStrategy
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setTextDoubleClickStrategy(org.eclipse.jface.text.ITextDoubleClickStrategy, java.lang.String)
protected java.lang.Object selectContentTypePlugin(int offset, java.util.Map plugins)
offset
- the offset for which to find the pluginplugins
- the map from which to choosepublic boolean canDoOperation(int operation)
Note that most LPEX actions (as defined in e.g., LpexAbstractTextEditor) call the editor directly for querying availability.
canDoOperation
in interface org.eclipse.jface.text.ITextOperationTarget
operation
- LPEX-defined operation id (including the equivalents of
ITextOperationTarget.UNDO, .REDO, etc.)ITextOperationTarget.canDoOperation(int)
public void doOperation(int operation)
canDoOperation()
returns true
.
Note that most LPEX actions (as defined in e.g., LpexAbstractTextEditor) call the editor directly.
doOperation
in interface org.eclipse.jface.text.ITextOperationTarget
operation
- LPEX-defined operation id (including the equivalents of
ITextOperationTarget.UNDO, .REDO, etc.)ITextOperationTarget.doOperation(int)
public void setTextColor(org.eclipse.swt.graphics.Color color)
Defined by ITextViewer, as part of its presentation-manipulation support.
setTextColor
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setTextColor(Color)
public void setTextColor(org.eclipse.swt.graphics.Color color, int start, int length, boolean controlRedraw)
Defined by ITextViewer, as part of its presentation-manipulation support.
setTextColor
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.setTextColor(Color,int,int,boolean)
protected org.eclipse.jface.text.IRegion internalGetVisibleRegion()
null
.
In LpexTextViewer, 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 TextViewer, this method returns the visible region if it is not equal
to the whole document, or null
if it is.
public void changeTextPresentation(org.eclipse.jface.text.TextPresentation presentation, boolean controlRedraw)
In TextViewer, this method applies in the text widget the color information of the specified text presentation.
Defined by ITextViewer, as part of its presentation-manipulation support.
changeTextPresentation
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.changeTextPresentation(org.eclipse.jface.text.TextPresentation, boolean)
public org.eclipse.jface.text.IFindReplaceTarget getFindReplaceTarget()
null
.
LPEX implements its own findAndReplace action.
Defined by ITextViewer, as part of its target-handling support.
getFindReplaceTarget
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getFindReplaceTarget()
public org.eclipse.jface.text.ITextOperationTarget getTextOperationTarget()
Defined by ITextViewer, as part of its target-handling support.
getTextOperationTarget
in interface org.eclipse.jface.text.ITextViewer
ITextViewer.getTextOperationTarget()
protected void initializeLpexView(LpexView lpexView)
Extend this method to set any file/view-specific parameters for this LpexView. Here you may set any "File Open" preferences page settings for your solution's plugin, such as sequenceNumbers, sourceEncoding, save.textLimit, and save.trim. The updateProfile command will be called later.
createControl(org.eclipse.swt.widgets.Composite, int)
protected void updateProfile()
Called when a new LpexTextViewer is created (an LPEX document is opened), and whenever the updateProfile command is issued afterwards.
protected void setEditorInput(org.eclipse.ui.IEditorInput editorInput)
This method should be called prior to the setDocument() for this text viewer, and whenever the input changes for this text viewer.
public LpexWindow getLpexWindow()
public LpexView getLpexView()
public java.lang.String getEOL()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |