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 privateAbstractEditor()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.StringcomputeEncoding()voiddispose()clean reference to wrapped "real" editor objectvoiddoSave(org.eclipse.core.runtime.IProgressMonitor moni)booleanequals(java.lang.Object obj)private <T> @Nullable TgetAdapterFromPart(java.lang.Class<T> clazz)@Nullable java.lang.StringgetContentType()@Nullable org.eclipse.jface.text.IDocumentgetDocument()@Nullable org.eclipse.ui.texteditor.IDocumentProvidergetDocumentProvider()@Nullable java.io.FilegetFile()@Nullable org.eclipse.core.resources.IFilegetIFile()@Nullable org.eclipse.ui.IEditorInputgetInput()@Nullable org.eclipse.ui.IWorkbenchPartgetPart()@Nullable java.lang.StringgetSelectedText()@Nullable org.eclipse.jface.text.ITextSelectiongetSelection()@Nullable org.eclipse.jface.viewers.ISelectionProvidergetSelectionProvider()@Nullable java.lang.StringgetText()@NonNull java.lang.StringgetTitle()private @Nullable java.net.URIgetURI()inthashCode()booleanisDirty()booleanisDisposed()booleanisEditorInputModifiable()booleanisMultiPage()AbstractEditorrecreate()voidselectAndReveal(int lineNumber)@Nullable org.eclipse.jface.text.DocumentRewriteSessionstartSequentialRewriteMode(boolean normalized)Starts the sequential rewrite mode of the viewer's document.voidstopSequentialRewriteMode(org.eclipse.jface.text.DocumentRewriteSession session)Sets the sequential rewrite mode of the viewer's document.booleanvalidateEditorInputState()
-
-
-
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:
isEditorInputModifiablein interfaceorg.eclipse.ui.texteditor.ITextEditorExtension2
-
validateEditorInputState
public boolean validateEditorInputState()
- Specified by:
validateEditorInputStatein 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-trueif 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getPart
public @Nullable org.eclipse.ui.IWorkbenchPart getPart()
-
getText
public @Nullable java.lang.String getText()
-
-