TPTP 4.5.0 Platform Project
Internal API Specification

org.eclipse.hyades.ui.internal.editor
Class HyadesEditorPart

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.part.MultiPageEditorPart
                  extended by org.eclipse.ui.forms.editor.FormEditor
                      extended by org.eclipse.hyades.ui.internal.editor.PageContainerEditorPart
                          extended by org.eclipse.hyades.ui.internal.editor.HyadesEditorPart
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.hyades.ui.editor.IHyadesEditorPart, org.eclipse.hyades.ui.editor.IHyadesEditorPartExtended, org.eclipse.hyades.ui.util.IDisposable, org.eclipse.hyades.ui.util.IRefreshable, org.eclipse.jface.dialogs.IPageChangeProvider, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public abstract class HyadesEditorPart
extends PageContainerEditorPart
implements org.eclipse.hyades.ui.util.IRefreshable, org.eclipse.ui.ISelectionListener

Abstract implementation of the IHyadesEditorPart. This class has all the code to support the Hyades editor extension mechanism.

Subclasses are supposed to customize the HyadesEditorPart to a particular type of object or resource file.

See Also:
IHyadesEditorPart

Field Summary
 
Fields inherited from class org.eclipse.ui.forms.editor.FormEditor
pages
 
Fields inherited from class org.eclipse.ui.part.MultiPageEditorPart
PAGE_CONTAINER_SITE
 
Fields inherited from interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
PROP_DIRTY, PROP_INPUT, PROP_OBJECT, PROP_TITLE
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
HyadesEditorPart()
          Constructor for HyadesEditorPart
 
Method Summary
 int addPage(org.eclipse.swt.widgets.Control control)
           
 int addPage(org.eclipse.ui.IEditorPart editor, org.eclipse.ui.IEditorInput input)
           
protected  void addPages()
           
 void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
           
protected  void adjustContainer()
          Adjusts the container by adjusting the height of the tab depending on the number of available pages - the goal is to hide all tab if there is only one page.
protected  boolean cloneExtensionDefinitions()
          Returns true if this editor should clone the extension definitions that are used in its context.
 void dispose()
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
protected  void enableEditActions()
           
protected  void enableFileSynchronization()
           
protected  void fileSelection(org.eclipse.jface.viewers.ISelection selection)
           
 java.lang.Object getAdapter(java.lang.Class adapterClass)
           
 org.eclipse.hyades.ui.extension.IAssociationDescriptor getEditorDescriptor()
           
 org.eclipse.hyades.ui.editor.IEditorExtension getEditorExtension()
          Returns the editor extension that is used by this editor.
 java.lang.Object getEditorObject()
           
 org.eclipse.ui.IEditorPart getEditorPart()
           
 org.eclipse.jface.viewers.ISelection getSelection()
           
protected  java.lang.String getStatusLineMessage(org.eclipse.jface.viewers.IStructuredSelection structuredSelection)
          Returns the message to show in the status line.
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
           
protected abstract  org.eclipse.hyades.ui.extension.IAssociationDescriptor identifyEditorDescriptor(org.eclipse.ui.IEditorInput input)
          Identifies the editor descriptor that should be used with the editor input.
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
           
 boolean isDirty()
           
 boolean isReadOnly()
           
 boolean isSaveAsAllowed()
           
protected  void notifyPageChange(int newPageIndex)
          Notifies the editor extension that a new page was activated.
protected  void pageChange(int newPageIndex)
           
 void refreshContent(java.lang.Object data)
           
 void removePage(int pageIndex)
           
 void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
           
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
           
 void setActivePage(int pageIndex)
           
 void setEditorObject(java.lang.Object editorObject)
           
 void setInput(org.eclipse.ui.IEditorInput input)
           
 void setSelection(org.eclipse.jface.viewers.ISelection selection)
           
protected  void updateStatusLine(org.eclipse.jface.viewers.IStructuredSelection structuredSelection)
          Updates the message shown in the status line.
 
Methods inherited from class org.eclipse.hyades.ui.internal.editor.PageContainerEditorPart
firePropertyChange, getActivePage, getContainer, getContainerComposite, getControl, getEditor, getPageCount, getPageImage, getPageText, setControl, setEditorTitle, setPageImage, setPageText, setTitle, setTitleImage, setTitleToolTip
 
Methods inherited from class org.eclipse.ui.forms.editor.FormEditor
addPage, addPage, addPage, addPage, addPageChangedListener, close, commitPages, configurePage, createPageContainer, createPages, createToolkit, editorDirtyStateChanged, findPage, getActiveEditor, getActivePageInstance, getCurrentPage, getSelectedPage, getToolkit, removePageChangedListener, selectReveal, setActivePage, setActivePage, updateActionBarContributor
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
activateSite, createPartControl, createSite, deactivateSite, findEditors, getPageSite, handlePropertyChange, initializePageSwitching, setActiveEditor, setFocus
 
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInputWithNotify, 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, 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.hyades.ui.editor.IHyadesEditorPart
addPropertyListener, getFileExtension, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
 

Constructor Detail

HyadesEditorPart

public HyadesEditorPart()
Constructor for HyadesEditorPart

Method Detail

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.hyades.ui.util.IDisposable
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.forms.editor.FormEditor
See Also:
IWorkbenchPart.dispose()

getEditorDescriptor

public final org.eclipse.hyades.ui.extension.IAssociationDescriptor getEditorDescriptor()
Specified by:
getEditorDescriptor in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
See Also:
org.eclipse.hyades.ui.editor.IHyadesEditorPart#getEditorExtensionDefinition()

getEditorExtension

public final org.eclipse.hyades.ui.editor.IEditorExtension getEditorExtension()
Returns the editor extension that is used by this editor. This method is not supposed to be overwritten.

Returns:
IEditorExtension

setEditorObject

public void setEditorObject(java.lang.Object editorObject)
Specified by:
setEditorObject in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
See Also:
IHyadesEditorPart.setEditorObject(Object)

getEditorObject

public java.lang.Object getEditorObject()
Specified by:
getEditorObject in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
See Also:
IHyadesEditorPart.getEditorObject()

addPage

public int addPage(org.eclipse.swt.widgets.Control control)
Specified by:
addPage in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
Overrides:
addPage in class org.eclipse.ui.forms.editor.FormEditor
See Also:
MultiPageEditorPart.addPage(org.eclipse.swt.widgets.Control)

addPage

public int addPage(org.eclipse.ui.IEditorPart editor,
                   org.eclipse.ui.IEditorInput input)
            throws org.eclipse.ui.PartInitException
Specified by:
addPage in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
Overrides:
addPage in class org.eclipse.ui.forms.editor.FormEditor
Throws:
org.eclipse.ui.PartInitException
See Also:
MultiPageEditorPart.addPage(org.eclipse.ui.IEditorPart, org.eclipse.ui.IEditorInput)

pageChange

protected void pageChange(int newPageIndex)
Overrides:
pageChange in class org.eclipse.ui.forms.editor.FormEditor
See Also:
MultiPageEditorPart.pageChange(int)

setActivePage

public void setActivePage(int pageIndex)
Specified by:
setActivePage in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
Overrides:
setActivePage in class PageContainerEditorPart
See Also:
MultiPageEditorPart.setActivePage(int)

notifyPageChange

protected void notifyPageChange(int newPageIndex)
Notifies the editor extension that a new page was activated.

Parameters:
newPageIndex -

removePage

public void removePage(int pageIndex)
Specified by:
removePage in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
Overrides:
removePage in class org.eclipse.ui.forms.editor.FormEditor
See Also:
MultiPageEditorPart.removePage(int)

adjustContainer

protected void adjustContainer()
Adjusts the container by adjusting the height of the tab depending on the number of available pages - the goal is to hide all tab if there is only one page.


addPages

protected final void addPages()
Specified by:
addPages in class org.eclipse.ui.forms.editor.FormEditor
See Also:
MultiPageEditorPart.createPages()

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
doSave in interface org.eclipse.ui.ISaveablePart
Specified by:
doSave in class org.eclipse.ui.part.EditorPart
See Also:
ISaveablePart.doSave(org.eclipse.core.runtime.IProgressMonitor)

doSaveAs

public void doSaveAs()
Specified by:
doSaveAs in interface org.eclipse.ui.ISaveablePart
Specified by:
doSaveAs in class org.eclipse.ui.part.EditorPart
See Also:
ISaveablePart.doSaveAs()

gotoMarker

public void gotoMarker(org.eclipse.core.resources.IMarker marker)
See Also:
org.eclipse.ui.IEditorPart#gotoMarker(org.eclipse.core.resources.IMarker)

isSaveAsAllowed

public boolean isSaveAsAllowed()
Specified by:
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart
Specified by:
isSaveAsAllowed in class org.eclipse.ui.part.EditorPart
See Also:
ISaveablePart.isSaveAsAllowed()

isDirty

public boolean isDirty()
Specified by:
isDirty in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
Specified by:
isDirty in interface org.eclipse.ui.ISaveablePart
Overrides:
isDirty in class org.eclipse.ui.forms.editor.FormEditor
See Also:
ISaveablePart.isDirty()

refreshContent

public void refreshContent(java.lang.Object data)
Specified by:
refreshContent in interface org.eclipse.hyades.ui.util.IRefreshable
See Also:
IRefreshable.refreshContent(java.lang.Object)

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.forms.editor.FormEditor
Throws:
org.eclipse.ui.PartInitException
See Also:
IEditorPart.init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)

enableEditActions

protected void enableEditActions()

enableFileSynchronization

protected void enableFileSynchronization()

cloneExtensionDefinitions

protected boolean cloneExtensionDefinitions()
Returns true if this editor should clone the extension definitions that are used in its context. By cloning those objects the editor shields itself against changes that might occur while it is opened - requiring it to be restarted to apply the changes.

Note: The editor extension is always instantiated so it is not necessary to clone it.

Subclasses may overwrite this method.

Returns:
boolean

identifyEditorDescriptor

protected abstract org.eclipse.hyades.ui.extension.IAssociationDescriptor identifyEditorDescriptor(org.eclipse.ui.IEditorInput input)
                                                                                            throws org.eclipse.ui.PartInitException
Identifies the editor descriptor that should be used with the editor input.

Implementors of this method may store the identified extension as a preference for the next time this editor is opened.

Important: This method is supposed to return a valid IAssociationDescriptor - ie. not null and related to an editor.

Parameters:
input -
Returns:
IAssociationDescriptor
Throws:
org.eclipse.ui.PartInitException - if the editor input is not valid.

addSelectionChangedListener

public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
Specified by:
addSelectionChangedListener in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
Specified by:
addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)

getSelection

public org.eclipse.jface.viewers.ISelection getSelection()
Specified by:
getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.getSelection()

removeSelectionChangedListener

public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
Specified by:
removeSelectionChangedListener in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
Specified by:
removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)

setSelection

public void setSelection(org.eclipse.jface.viewers.ISelection selection)
Specified by:
setSelection in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)

fileSelection

protected void fileSelection(org.eclipse.jface.viewers.ISelection selection)

updateStatusLine

protected void updateStatusLine(org.eclipse.jface.viewers.IStructuredSelection structuredSelection)
Updates the message shown in the status line.

Parameters:
selection - the current selection

getStatusLineMessage

protected java.lang.String getStatusLineMessage(org.eclipse.jface.viewers.IStructuredSelection structuredSelection)
Returns the message to show in the status line. If this method returns null the status line won't present any message.

If a subclass requires a more sophisticated use of the status line, it should manipulate the status line direct. The status line can be obtained by getEditorSite().getActionBars().getStatusLineManager().

Parameters:
selection - the current selection
Returns:
the status line message

getEditorPart

public org.eclipse.ui.IEditorPart getEditorPart()
Specified by:
getEditorPart in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
See Also:
IHyadesEditorPart.getEditorPart()

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapterClass)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.part.MultiPageEditorPart
See Also:
IAdaptable.getAdapter(java.lang.Class)

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface org.eclipse.hyades.ui.editor.IHyadesEditorPart
See Also:
IHyadesEditorPart.isReadOnly()

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener
See Also:
ISelectionListener.selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)

setInput

public void setInput(org.eclipse.ui.IEditorInput input)
Overrides:
setInput in class org.eclipse.ui.part.EditorPart

TPTP 4.5.0 Platform Project
Internal API Specification