org.eclipse.wst.sse.ui
Class StructuredTextEditor

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.EditorPart
              extended by org.eclipse.ui.texteditor.AbstractTextEditor
                  extended by org.eclipse.ui.texteditor.StatusTextEditor
                      extended by org.eclipse.ui.texteditor.AbstractDecoratedTextEditor
                          extended by org.eclipse.ui.editors.text.TextEditor
                              extended by org.eclipse.wst.sse.ui.StructuredTextEditor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IEditorPart, org.eclipse.ui.INavigationLocationProvider, org.eclipse.ui.IPersistable, org.eclipse.ui.IPersistableEditor, org.eclipse.ui.IReusableEditor, org.eclipse.ui.ISaveablePart, org.eclipse.ui.ISaveablesSource, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation, org.eclipse.ui.texteditor.ITextEditor, org.eclipse.ui.texteditor.ITextEditorExtension, org.eclipse.ui.texteditor.ITextEditorExtension2, org.eclipse.ui.texteditor.ITextEditorExtension3, org.eclipse.ui.texteditor.ITextEditorExtension4

public class StructuredTextEditor
extends org.eclipse.ui.editors.text.TextEditor

A Text Editor for editing structured models and structured documents.

This class is not meant to be subclassed.
New content types may associate source viewer, content outline, and property sheet configurations to extend the existing functionality.

Since:
1.0
See Also:
StructuredTextViewerConfiguration, ContentOutlineConfiguration, PropertySheetConfiguration

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.ui.texteditor.ITextEditorExtension3
org.eclipse.ui.texteditor.ITextEditorExtension3.InsertMode
 
Field Summary
static java.lang.String GROUP_NAME_ADDITIONS
          Not API.
 
Fields inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
DEFAULT_EDITOR_CONTEXT_MENU_ID, DEFAULT_RULER_CONTEXT_MENU_ID, PREFERENCE_COLOR_BACKGROUND, PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, PREFERENCE_COLOR_FIND_SCOPE, PREFERENCE_COLOR_FOREGROUND, PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, PREFERENCE_COLOR_SELECTION_BACKGROUND, PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT, PREFERENCE_COLOR_SELECTION_FOREGROUND, PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT, PREFERENCE_FONT, PREFERENCE_HYPERLINK_KEY_MODIFIER, PREFERENCE_HYPERLINK_KEY_MODIFIER_MASK, PREFERENCE_HYPERLINKS_ENABLED, PREFERENCE_NAVIGATION_SMART_HOME_END, PREFERENCE_RULER_CONTRIBUTIONS, PREFERENCE_SHOW_WHITESPACE_CHARACTERS, PREFERENCE_TEXT_DRAG_AND_DROP_ENABLED, PREFERENCE_USE_CUSTOM_CARETS, PREFERENCE_WIDE_CARET
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Fields inherited from interface org.eclipse.ui.texteditor.ITextEditorExtension3
INSERT, SMART_INSERT
 
Constructor Summary
StructuredTextEditor()
          Creates a new Structured Text Editor.
 
Method Summary
 void close(boolean save)
           
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           Use StructuredTextViewerConfiguration if a viewerconfiguration has not already been set.
 void dispose()
           
 void doRevertToSaved()
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
           
 void editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager menu)
          Sets up this editor's context menu before it is made visible.
 java.lang.Object getAdapter(java.lang.Class required)
           
 org.eclipse.ui.IEditorPart getEditorPart()
          Returns this editor part.
 org.eclipse.wst.sse.core.internal.provisional.IStructuredModel getModel()
          Deprecated. - This method allowed for uncontrolled access to the model instance and will be removed in the future. It is recommended that the current document provider be asked for the current document and the IModelManager then asked for the corresponding model with getExistingModelFor*(IDocument).
 int getOrientation()
           
 org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()
           
 org.eclipse.wst.sse.ui.internal.StructuredTextViewer getTextViewer()
          Returns the editor's source viewer.
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
           
 void initializeDocumentProvider(org.eclipse.ui.texteditor.IDocumentProvider documentProvider)
          Set the document provider for this editor.
 void rememberSelection()
           Not API.
 void restoreSelection()
           Not API.
 void safelySanityCheckState(org.eclipse.ui.IEditorInput input)
           Overridden to expose part activation handling for multi-page editors.
 void setEditorPart(org.eclipse.ui.IEditorPart editorPart)
          Set editor part associated with this editor.
 void showBusy(boolean busy)
           
 void update()
          Update should be called whenever the model is set or changed (as in swapped) Not API.
 
Methods inherited from class org.eclipse.ui.editors.text.TextEditor
isSaveAsAllowed
 
Methods inherited from class org.eclipse.ui.texteditor.AbstractDecoratedTextEditor
getDocumentProvider, gotoAnnotation, gotoMarker, isChangeInformationShowing, isEditable, showChangeInformation, showRevisionInformation, validateEditorInputState
 
Methods inherited from class org.eclipse.ui.texteditor.StatusTextEditor
updatePartControl
 
Methods inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
addRulerContextMenuListener, createEmptyNavigationLocation, createNavigationLocation, doSaveAs, getAction, getActiveSaveables, getHighlightRange, getInsertMode, getSaveables, isDirty, isEditorInputModifiable, isEditorInputReadOnly, markAsContentDependentAction, markAsPropertyDependentAction, markAsSelectionDependentAction, markAsStateDependentAction, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreState, saveState, selectAndReveal, setAction, setActionActivationCode, setFocus, setHighlightRange, setInput, setInsertMode, setStatusField, showHighlightRangeOnly, showsHighlightRangeOnly
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, getContentDescription, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IEditorPart
getEditorInput, getEditorSite
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.ui.ISaveablePart
isSaveOnCloseNeeded
 
Methods inherited from interface org.eclipse.ui.IEditorPart
getEditorInput, getEditorSite
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.ui.ISaveablePart
isSaveOnCloseNeeded
 

Field Detail

GROUP_NAME_ADDITIONS

public static final java.lang.String GROUP_NAME_ADDITIONS
Not API. May be removed in the future.

See Also:
Constant Field Values
Constructor Detail

StructuredTextEditor

public StructuredTextEditor()
Creates a new Structured Text Editor.

Method Detail

close

public void close(boolean save)
Specified by:
close in interface org.eclipse.ui.texteditor.ITextEditor
Overrides:
close in class org.eclipse.ui.texteditor.AbstractTextEditor

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)

Use StructuredTextViewerConfiguration if a viewerconfiguration has not already been set. Also initialize StructuredTextViewer.

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Overrides:
createPartControl in class org.eclipse.ui.texteditor.AbstractDecoratedTextEditor
See Also:
AbstractDecoratedTextEditor.createPartControl(org.eclipse.swt.widgets.Composite)

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.editors.text.TextEditor

doRevertToSaved

public void doRevertToSaved()
Specified by:
doRevertToSaved in interface org.eclipse.ui.texteditor.ITextEditor
Overrides:
doRevertToSaved in class org.eclipse.ui.texteditor.StatusTextEditor

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
Specified by:
doSave in interface org.eclipse.ui.ISaveablePart
Overrides:
doSave in class org.eclipse.ui.texteditor.AbstractTextEditor

editorContextMenuAboutToShow

public void editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager menu)
Sets up this editor's context menu before it is made visible.

Not API. May be reduced to protected method in the future.

Overrides:
editorContextMenuAboutToShow in class org.eclipse.ui.editors.text.TextEditor
Parameters:
menu - the menu

getAdapter

public java.lang.Object getAdapter(java.lang.Class required)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.editors.text.TextEditor

getEditorPart

public org.eclipse.ui.IEditorPart getEditorPart()
Returns this editor part.

Not API. May be removed in the future.

Returns:
this editor part

getModel

public org.eclipse.wst.sse.core.internal.provisional.IStructuredModel getModel()
Deprecated. - This method allowed for uncontrolled access to the model instance and will be removed in the future. It is recommended that the current document provider be asked for the current document and the IModelManager then asked for the corresponding model with getExistingModelFor*(IDocument).

Returns this editor's StructuredModel.

Not API. Will be removed in the future.

Returns:
returns this editor's IStructuredModel

getOrientation

public int getOrientation()
Specified by:
getOrientation in interface org.eclipse.ui.part.IWorkbenchPartOrientation
Overrides:
getOrientation in class org.eclipse.ui.part.WorkbenchPart

getSelectionProvider

public org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()
Specified by:
getSelectionProvider in interface org.eclipse.ui.texteditor.ITextEditor
Overrides:
getSelectionProvider in class org.eclipse.ui.texteditor.AbstractTextEditor

getTextViewer

public org.eclipse.wst.sse.ui.internal.StructuredTextViewer getTextViewer()
Returns the editor's source viewer. This method was created to expose the protected final getSourceViewer() method.

Not API. May be removed in the future.

Returns:
the editor's source viewer

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput input)
          throws org.eclipse.ui.PartInitException
Specified by:
init in interface org.eclipse.ui.IEditorPart
Overrides:
init in class org.eclipse.ui.texteditor.AbstractTextEditor
Throws:
org.eclipse.ui.PartInitException

initializeDocumentProvider

public void initializeDocumentProvider(org.eclipse.ui.texteditor.IDocumentProvider documentProvider)
Set the document provider for this editor.

Not API. May be removed in the future.

Parameters:
documentProvider - documentProvider to initialize

rememberSelection

public void rememberSelection()

Not API. May be reduced to protected method in the future.

Overrides:
rememberSelection in class org.eclipse.ui.texteditor.AbstractTextEditor

restoreSelection

public void restoreSelection()

Not API. May be reduced to protected method in the future.

Overrides:
restoreSelection in class org.eclipse.ui.texteditor.AbstractTextEditor

safelySanityCheckState

public void safelySanityCheckState(org.eclipse.ui.IEditorInput input)

Overridden to expose part activation handling for multi-page editors.

Not API. May be reduced to protected method in the future.

Overrides:
safelySanityCheckState in class org.eclipse.ui.texteditor.AbstractTextEditor
See Also:
AbstractTextEditor.safelySanityCheckState(org.eclipse.ui.IEditorInput)

setEditorPart

public void setEditorPart(org.eclipse.ui.IEditorPart editorPart)
Set editor part associated with this editor.

Not API. May be removed in the future.

Parameters:
editorPart - editor part associated with this editor

showBusy

public void showBusy(boolean busy)
Overrides:
showBusy in class org.eclipse.ui.part.WorkbenchPart

update

public void update()
Update should be called whenever the model is set or changed (as in swapped)

Not API. May be removed in the future.