Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.editors.text
Class TextEditor


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
All Implemented Interfaces:
IAdaptable, IExecutableExtension, IEditorPart, INavigationLocationProvider, IPersistable, IPersistableEditor, IReusableEditor, ISaveablePart, ISaveablesSource, IWorkbenchPart, IWorkbenchPart2, IWorkbenchPart3, IWorkbenchPartOrientation, ITextEditor, ITextEditorExtension, ITextEditorExtension2, ITextEditorExtension3, ITextEditorExtension4, ITextEditorExtension5

public class TextEditor
extends AbstractDecoratedTextEditor

The standard text editor for file resources (IFile).

This editor has id "org.eclipse.ui.DefaultTextEditor". The editor's context menu has id #TextEditorContext. The editor's ruler context menu has id #TextRulerContext.

The workbench will automatically instantiate this class when the default editor is needed for a workbench window.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ui.texteditor. AbstractTextEditor
AbstractTextEditor.AbstractSelectionChangedListener, AbstractTextEditor.ColumnSupport, AbstractTextEditor.IdMapEntry, AbstractTextEditor.LineEndAction, AbstractTextEditor.LineStartAction, AbstractTextEditor.SelectionProvider, AbstractTextEditor.TextEditorSavable
 
Nested classes/interfaces inherited from interface org.eclipse.ui.texteditor. ITextEditorExtension3
ITextEditorExtension3.InsertMode
 
Field Summary
protected   DefaultEncodingSupport fEncodingSupport
          The encoding support for the editor.
 
Fields inherited from class org.eclipse.ui.texteditor. AbstractDecoratedTextEditor
DEFAULT_OVERVIEW_RULER_CONTEXT_MENU_ID, fAnnotationAccess, fIsUpdatingMarkerViews, fLineNumberRulerColumn, fOverviewRuler, fSourceViewerDecorationSupport
 
Fields inherited from class org.eclipse.ui.texteditor. AbstractTextEditor
ACTION_MAP, COMMON_EDITOR_CONTEXT_MENU_ID, COMMON_RULER_CONTEXT_MENU_ID, DEFAULT_EDITOR_CONTEXT_MENU_ID, DEFAULT_RULER_CONTEXT_MENU_ID, fErrorLabel, 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_HOVER_ENRICH_MODE, 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, TAG_SELECTION_LENGTH, TAG_SELECTION_OFFSET, VERTICAL_RULER_WIDTH
 
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
TextEditor ()
          Creates a new text editor.
 
Method Summary
protected  void createActions ()
          Creates this editor's standard actions and connects them with the global workbench actions.
 void dispose ()
          The AbstractTextEditor implementation of this IWorkbenchPart method may be extended by subclasses.
protected  void doSetInput ( IEditorInput input)
          Called directly from setInput and from within a workspace runnable from init, this method does the actual setting of the editor input.
protected  void editorContextMenuAboutToShow ( IMenuManager menu)
          Sets up this editor's context menu before it is made visible.
  Object getAdapter ( Class adapter)
          Returns an object which is an instance of the given class associated with this object.
protected   String getStatusBanner ( IStatus status)
          Returns a banner for the given status.
protected   String getStatusHeader ( IStatus status)
          Returns a header for the given status
protected   String getStatusMessage ( IStatus status)
          Returns a message for the given status.
protected  void handlePreferenceStoreChanged ( PropertyChangeEvent event)
          Handles a property change event describing a change of the editor's preference store and updates the preference related editor properties.
protected  void initializeEditor ()
          Initializes this editor.
protected  void installEncodingSupport ()
          Installs the encoding support on the given text editor.
 boolean isSaveAsAllowed ()
          The AbstractTextEditor implementation of this IEditorPart method returns false.
protected  void updatePropertyDependentActions ()
          Updates all property dependent actions.
 
Methods inherited from class org.eclipse.ui.texteditor. AbstractDecoratedTextEditor
collectContextMenuPreferencePages, collectOverviewRulerMenuPreferencePages, collectRulerMenuPreferencePages, configureSourceViewerDecorationSupport, createAnnotationAccess, createAnnotationRulerColumn, createChangeHover, createChangeRulerColumn, createColumnSupport, createCompositeRuler, createContextMenuListener, createLineNumberRulerColumn, createOverviewRuler, createOverviewRulerContextMenu, createPartControl, createSourceViewer, createStatusControl, createVerticalRuler, disposeDocumentProvider, getAnnotationAccess, getAnnotationPreferenceLookup, getAnnotationPreferences, getDocumentProvider, getOverviewRuler, getOverviewRulerContextMenuId, getSharedColors, getSourceViewerDecorationSupport, getUndoRedoOperationApprover, gotoAnnotation, gotoMarker, hideOverviewRuler, initializeKeyBindingScopes, initializeLineNumberRulerColumn, isChangeInformationShowing, isEditable, isErrorStatus, isLineNumberRulerVisible, isNavigationTarget, isOverviewRulerVisible, isOverwriteModeEnabled, isPrefQuickDiffAlwaysOn, isTabsToSpacesConversionEnabled, overviewRulerContextMenuAboutToShow, performSaveAs, rulerContextMenuAboutToShow, setDocumentProvider, setOverviewRulerContextMenuId, showChangeInformation, showOverviewRuler, showRevisionInformation, updateMarkerViews, validateEditorInputState
 
Methods inherited from class org.eclipse.ui.texteditor. StatusTextEditor
doRevertToSaved, handleEditorInputChanged, handleElementContentReplaced, sanityCheckState, updatePartControl, updateStatusField
 
Methods inherited from class org.eclipse.ui.texteditor. AbstractTextEditor
addAction, addAction, addGroup, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, canHandleMove, close, configureInsertMode, containsSavedState, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createUndoRedoActions, doGetSelection, doRestoreState, doSave, doSaveAs, doSetSelection, editorSaved, enableOverwriteMode, enableSanityChecking, enableStateValidation, findAnnotation, firePropertyChange, getAction, getActiveSaveables, getContextMenuListener, getCoverage, getCursorListener, getCursorPosition, getEditorContextMenuId, getFontPropertyPreferenceKey, getHelpContextId, getHighlightRange, getInsertMode, getLegalInsertModes, getPreferenceStore, getProgressMonitor, getRangeIndicator, getRulerContextMenuId, getRulerMouseListener, getSaveables, getSelectionChangedListener, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getStatusLineManager, getVerticalRuler, handleCursorPositionChanged, handleExceptionOnSave, handleInsertModeChanged, init, initializeDragAndDrop, initializeViewerColors, installTabsToSpacesConverter, installTextDragAndDrop, internalInit, isBlockSelectionModeEnabled, isBlockSelectionModeSupported, isDirty, isEditorInputIncludedInContextMenu, isEditorInputModifiable, isEditorInputReadOnly, isInInsertMode, isVisible, markAsContentDependentAction, markAsPropertyDependentAction, markAsSelectionDependentAction, markAsStateDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, openSaveErrorDialog, performRevert, performSave, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, restoreState, safelySanityCheckState, saveState, selectAndReveal, selectAndReveal, setAction, setActionActivationCode, setBlockSelectionMode, setCompatibilityMode, setDocumentProvider, setEditorContextMenuId, setFocus, setHelpContextId, setHighlightRange, setInput, setInputWithNotify, setInsertMode, setKeyBindingScopes, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, setStatusLineErrorMessage, setStatusLineMessage, showHighlightRangeOnly, showsHighlightRangeOnly, uninstallTabsToSpacesConverter, uninstallTextDragAndDrop, updateContentDependentActions, updateContributedRulerColumns, updateIndentPrefixes, updateSelectionDependentActions, updateState, updateStateDependentActions, updateStatusFields, validateState, widgetOffset2ModelOffset
 
Methods inherited from class org.eclipse.ui.part. EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part. WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common. EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang. Object
clone, equals, finalize, 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
 

Field Detail

fEncodingSupport

protected 
DefaultEncodingSupport fEncodingSupport
The encoding support for the editor.

Since:
2.0
Constructor Detail

TextEditor

public TextEditor()
Creates a new text editor.

Method Detail

initializeEditor

protected void initializeEditor()
Initializes this editor. Subclasses may re-implement. If sub-classes do not change the contract, this method should not be extended, i.e. do not call super.initializeEditor() in order to avoid the temporary creation of objects that are immediately overwritten by subclasses. This method configures the editor but does not define a SourceViewerConfiguration. When only interested in providing a custom source viewer configuration, subclasses may extend this method.

Overrides:
initializeEditor in class AbstractDecoratedTextEditor

dispose

public void dispose()
Description copied from class: AbstractTextEditor
The AbstractTextEditor implementation of this IWorkbenchPart method may be extended by subclasses. Subclasses must call super.dispose().

Note that many methods may return null after the editor is disposed.

Specified by:
dispose in interface IWorkbenchPart
Overrides:
dispose in class AbstractDecoratedTextEditor

installEncodingSupport

protected void installEncodingSupport()
Installs the encoding support on the given text editor.

Subclasses may override to install their own encoding support or to disable the default encoding support.

Since:
2.1

isSaveAsAllowed

public boolean isSaveAsAllowed()
Description copied from class: AbstractTextEditor
The AbstractTextEditor implementation of this IEditorPart method returns false. Subclasses may override.

Specified by:
isSaveAsAllowed in interface ISaveablePart
Overrides:
isSaveAsAllowed in class AbstractTextEditor
Returns:
false

createActions

protected void createActions()
Description copied from class: AbstractTextEditor
Creates this editor's standard actions and connects them with the global workbench actions.

Subclasses may extend.

Overrides:
createActions in class AbstractDecoratedTextEditor

getStatusHeader

protected 
String getStatusHeader(
IStatus status)
Description copied from class: StatusTextEditor
Returns a header for the given status

Overrides:
getStatusHeader in class StatusTextEditor
Parameters:
status - the status whose message is returned
Returns:
a header for the given status

getStatusBanner

protected 
String getStatusBanner(
IStatus status)
Description copied from class: StatusTextEditor
Returns a banner for the given status.

Overrides:
getStatusBanner in class StatusTextEditor
Parameters:
status - the status whose message is returned
Returns:
a banner for the given status

getStatusMessage

protected 
String getStatusMessage(
IStatus status)
Description copied from class: StatusTextEditor
Returns a message for the given status.

Overrides:
getStatusMessage in class StatusTextEditor
Parameters:
status - the status whose message is returned
Returns:
a message for the given status

doSetInput

protected void doSetInput(
IEditorInput input)
                   throws 
CoreException
Description copied from class: AbstractTextEditor
Called directly from setInput and from within a workspace runnable from init, this method does the actual setting of the editor input. Closes the editor if input is null. Disconnects from any previous editor input and its document provider and connects to the new one.

Subclasses may extend.

Overrides:
doSetInput in class AbstractDecoratedTextEditor
Parameters:
input - the input to be set
Throws:
CoreException - if input cannot be connected to the document provider

getAdapter

public 
Object getAdapter(
Class adapter)
Description copied from class: WorkbenchPart
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found. Subclasses may override this method (however, if they do so, they should invoke the method on their superclass to ensure that the Platform's adapter manager is consulted).

Specified by:
getAdapter in interface IAdaptable
Overrides:
getAdapter in class AbstractDecoratedTextEditor
Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class

updatePropertyDependentActions

protected void updatePropertyDependentActions()
Description copied from class: AbstractTextEditor
Updates all property dependent actions.

Overrides:
updatePropertyDependentActions in class AbstractTextEditor

handlePreferenceStoreChanged

protected void handlePreferenceStoreChanged(
PropertyChangeEvent event)
Description copied from class: AbstractTextEditor
Handles a property change event describing a change of the editor's preference store and updates the preference related editor properties.

Subclasses may extend.

Overrides:
handlePreferenceStoreChanged in class AbstractDecoratedTextEditor
Parameters:
event - the property change event

editorContextMenuAboutToShow

protected void editorContextMenuAboutToShow(
IMenuManager menu)
Description copied from class: AbstractTextEditor
Sets up this editor's context menu before it is made visible.

Subclasses may extend to add other actions.

Overrides:
editorContextMenuAboutToShow in class AbstractDecoratedTextEditor
Parameters:
menu - the menu

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire