# Class EditorReference

java.lang.Object
org.eclipse.ui.internal.WorkbenchPartReference
org.eclipse.ui.internal.EditorReference

All Implemented Interfaces:
  `IEditorReference, ISizeProvider, IWorkbenchPartReference`

public class EditorReference extends WorkbenchPartReference implements IEditorReference

## Field Summary

### Fields inherited from class WorkbenchPartReference

`INTERNAL_PROPERTY_ACTIVE_CHILD_CHANGED, INTERNAL_PROPERTY_CLOSED, INTERNAL_PROPERTY_MAXIMIZED, INTERNAL_PROPERTY_OPENED, INTERNAL_PROPERTY_PINNED, INTERNAL_PROPERTY_VISIBLE, INTERNAL_PROPERTY_ZOOMED, legacyPart, propertyCache, STATE_CREATED, STATE_CREATION_IN_PROGRESS, STATE_DISPOSED, STATE_LAZY`

### Fields inherited from interface ISizeProvider

`INFINITE`

## Constructor Summary

Constructors
Constructor
Description
`EditorReference(IEclipseContext windowContext, IWorkbenchPage page, MPart part, IEditorInput input, org.eclipse.ui.internal.registry.EditorDescriptor descriptor, IMemento editorState)`

## Method Summary

Modifier and Type
Method
Description
`IWorkbenchPart`
`createErrorPart(IStatus status)`
`static IEditorInput`
`createInput(IMemento editorMem)`
`IWorkbenchPart`
`createPart()`
`static void`
`disposeEditorActionBars(EditorActionBars actionBars)`
`org.eclipse.ui.internal.registry.EditorDescriptor`
`getDescriptor()`
`IEditorPart`
`getEditor(boolean restore)`
Returns the editor referenced by this object.
`IEditorInput`
`getEditorInput()`
Returns the editor input for the editor referenced by this object.
`String`
`getFactoryId()`
Returns the factory id of the factory used to restore this editor.
`String`
`getId()`
`String`
`getName()`
Returns the editor input's name.
`PartSite`
`getSite()`
`String`
`getTitle()`
`void`
`initialize(IWorkbenchPart part)`

### Methods inherited from class WorkbenchPartReference

`addPartPropertyListener, addPropertyListener, checkReference, computePreferredSize, computeTitle, createPartProperties, doDisposeNestedParts, fireInternalPropertyChange, firePartPropertyChange, firePropertyChange, getContentDescription, getModel, getPage, getPane, getPart, getPartName, getPartProperty, getRawTitle, getSizeFlags, getTitleImage, getTitleToolTip, invalidate, isDirty, isDisposed, isPinned, partPropertyChanged, partPropertyChanged, releaseReferences, removePartPropertyListener, removePropertyListener, setPage, setPinned, subscribe, unsubscribe`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface IEditorReference

`isPinned`

### Methods inherited from interface IWorkbenchPartReference

`addPartPropertyListener, addPropertyListener, getContentDescription, getPage, getPart, getPartName, getPartProperty, getTitleImage, getTitleToolTip, isDirty, removePartPropertyListener, removePropertyListener`

## Constructor Details

### EditorReference

public EditorReference(IEclipseContext windowContext, IWorkbenchPage page, MPart part, IEditorInput input, org.eclipse.ui.internal.registry.EditorDescriptor descriptor, IMemento editorState)

## Method Details

### getDescriptor

public org.eclipse.ui.internal.registry.EditorDescriptor getDescriptor()

### getId

public String getId()

Specified by:
  `getId` in interface `IWorkbenchPartReference`
Overrides:
  `getId` in class `WorkbenchPartReference`
Returns:
  the ID of the part
See Also:
  - `IWorkbenchPartSite.getId()`

### getFactoryId

public String getFactoryId()
Description copied from interface: `IEditorReference`
Returns the factory id of the factory used to restore this editor. Returns null if the editor is not persistable.

Specified by:
  `getFactoryId` in interface `IEditorReference`
Returns:
  the factory ID

### getName

public String getName()
Description copied from interface: `IEditorReference`
Returns the editor input's name. May return null if the name is not available or if the editor failed to be restored.

Specified by:
  `getName` in interface `IEditorReference`
Returns:
  the name

### getTitle

public String getTitle()

Specified by:
  `getTitle` in interface `IWorkbenchPartReference`
Overrides:
  `getTitle` in class `WorkbenchPartReference`
Returns:
  the title of the part
See Also:
  - `IWorkbenchPart.getTitle()`

### createInput

public static IEditorInput createInput(IMemento editorMem) throws PartInitException

Throws:
  `PartInitException`

### getEditor

public IEditorPart getEditor(boolean restore)
Description copied from interface: `IEditorReference`
Returns the editor referenced by this object. Returns `null` if the editor was not instantiated or it failed to be restored. Tries to restore the editor if `restore` is true.

Specified by:
  `getEditor` in interface `IEditorReference`
Parameters:
  `restore` - true to try to restore, false otherwise.
Returns:
  the `IEditorPart`

### getEditorInput

public IEditorInput getEditorInput() throws PartInitException
Description copied from interface: `IEditorReference`
Returns the editor input for the editor referenced by this object.

Unlike most of the other methods on this type, this method can trigger plug-in activation.

Specified by:
  `getEditorInput` in interface `IEditorReference`
Returns:
  the editor input for the editor referenced by this object
Throws:
  `PartInitException` - if there was an error restoring the editor input

### createPart

public IWorkbenchPart createPart() throws PartInitException

Specified by:
  `createPart` in class `WorkbenchPartReference`
Throws:
  `PartInitException`

### createErrorPart

public IWorkbenchPart createErrorPart(IStatus status)

Specified by:
  `createErrorPart` in class `WorkbenchPartReference`

### initialize

public void initialize(IWorkbenchPart part) throws PartInitException

Specified by:
  `initialize` in class `WorkbenchPartReference`
Throws:
  `PartInitException`

### getSite

public PartSite getSite()

Specified by:
  `getSite` in class `WorkbenchPartReference`

### disposeEditorActionBars

public static void disposeEditorActionBars(EditorActionBars actionBars)