Package de.loskutov.anyedit.ui.editor
Class AbstractEditor
- java.lang.Object
-
- de.loskutov.anyedit.ui.editor.AbstractEditor
-
- All Implemented Interfaces:
org.eclipse.ui.texteditor.ITextEditorExtension2
public class AbstractEditor extends java.lang.Object implements org.eclipse.ui.texteditor.ITextEditorExtension2
-
-
Constructor Summary
Constructors Modifier Constructor Description private
AbstractEditor()
AbstractEditor(@Nullable org.eclipse.ui.IWorkbenchPart editorPart)
Proxy for different editor types
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull java.lang.String
computeEncoding()
void
dispose()
clean reference to wrapped "real" editor objectvoid
doSave(org.eclipse.core.runtime.IProgressMonitor moni)
boolean
equals(java.lang.Object obj)
private <T> @Nullable T
getAdapterFromPart(java.lang.Class<T> clazz)
@Nullable java.lang.String
getContentType()
@Nullable org.eclipse.jface.text.IDocument
getDocument()
@Nullable org.eclipse.ui.texteditor.IDocumentProvider
getDocumentProvider()
@Nullable java.io.File
getFile()
@Nullable org.eclipse.core.resources.IFile
getIFile()
@Nullable org.eclipse.ui.IEditorInput
getInput()
@Nullable org.eclipse.ui.IWorkbenchPart
getPart()
@Nullable java.lang.String
getSelectedText()
@Nullable org.eclipse.jface.text.ITextSelection
getSelection()
@Nullable org.eclipse.jface.viewers.ISelectionProvider
getSelectionProvider()
@Nullable java.lang.String
getText()
@NonNull java.lang.String
getTitle()
private @Nullable java.net.URI
getURI()
int
hashCode()
boolean
isDirty()
boolean
isDisposed()
boolean
isEditorInputModifiable()
boolean
isMultiPage()
AbstractEditor
recreate()
void
selectAndReveal(int lineNumber)
@Nullable org.eclipse.jface.text.DocumentRewriteSession
startSequentialRewriteMode(boolean normalized)
Starts the sequential rewrite mode of the viewer's document.void
stopSequentialRewriteMode(org.eclipse.jface.text.DocumentRewriteSession session)
Sets the sequential rewrite mode of the viewer's document.boolean
validateEditorInputState()
-
-
-
Method Detail
-
recreate
public AbstractEditor recreate()
-
isMultiPage
public boolean isMultiPage()
-
getDocumentProvider
public @Nullable org.eclipse.ui.texteditor.IDocumentProvider getDocumentProvider()
- Returns:
- may return null
-
getInput
public @Nullable org.eclipse.ui.IEditorInput getInput()
- Returns:
- may return null
-
getIFile
public @Nullable org.eclipse.core.resources.IFile getIFile()
- Returns:
- may return null
-
getFile
public @Nullable java.io.File getFile()
-
getContentType
public @Nullable java.lang.String getContentType()
- See Also:
ITypedElement.getType()
-
getTitle
public @NonNull java.lang.String getTitle()
-
getURI
private @Nullable java.net.URI getURI()
- Returns:
- may return null
-
computeEncoding
public @NonNull java.lang.String computeEncoding()
-
getSelectionProvider
public @Nullable org.eclipse.jface.viewers.ISelectionProvider getSelectionProvider()
-
getDocument
public @Nullable org.eclipse.jface.text.IDocument getDocument()
-
getSelection
public @Nullable org.eclipse.jface.text.ITextSelection getSelection()
-
getSelectedText
public @Nullable java.lang.String getSelectedText()
-
selectAndReveal
public void selectAndReveal(int lineNumber)
-
isDirty
public boolean isDirty()
-
getAdapterFromPart
private <T> @Nullable T getAdapterFromPart(java.lang.Class<T> clazz)
-
doSave
public void doSave(org.eclipse.core.runtime.IProgressMonitor moni)
-
isEditorInputModifiable
public boolean isEditorInputModifiable()
- Specified by:
isEditorInputModifiable
in interfaceorg.eclipse.ui.texteditor.ITextEditorExtension2
-
validateEditorInputState
public boolean validateEditorInputState()
- Specified by:
validateEditorInputState
in interfaceorg.eclipse.ui.texteditor.ITextEditorExtension2
-
stopSequentialRewriteMode
public void stopSequentialRewriteMode(org.eclipse.jface.text.DocumentRewriteSession session)
Sets the sequential rewrite mode of the viewer's document.
-
startSequentialRewriteMode
public @Nullable org.eclipse.jface.text.DocumentRewriteSession startSequentialRewriteMode(boolean normalized)
Starts the sequential rewrite mode of the viewer's document.- Parameters:
normalized
-true
if the rewrite is performed from the start to the end of the document
-
dispose
public void dispose()
clean reference to wrapped "real" editor object
-
isDisposed
public boolean isDisposed()
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getPart
public @Nullable org.eclipse.ui.IWorkbenchPart getPart()
-
getText
public @Nullable java.lang.String getText()
-
-