org.topbraidcomposer.editors
Class ResourceEditor

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.topbraidcomposer.editors.ResourceEditor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.jface.dialogs.IPageChangeProvider, org.eclipse.ui.ide.IGotoMarker, org.eclipse.ui.IEditorPart, org.eclipse.ui.INavigationLocationProvider, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IShowEditorInput, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation, IChangeEngineListener, IGraphRegistryListener, IResourceSelectionListener, IRefreshableWorkbenchPart

public class ResourceEditor
extends org.eclipse.ui.forms.editor.FormEditor
implements org.eclipse.ui.ide.IGotoMarker, org.eclipse.ui.INavigationLocationProvider, IRefreshableWorkbenchPart, org.eclipse.ui.IShowEditorInput, IChangeEngineListener, IGraphRegistryListener, IResourceSelectionListener

A FormEditor representing an OntModel, separating display into various tabs.

Author:
Holger Knublauch

Field Summary
static java.lang.String ID
           
 
Fields inherited from class org.eclipse.ui.forms.editor.FormEditor
pages
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
ResourceEditor()
           
 
Method Summary
protected  void addPages()
           
 void changeOperationPerformed(ChangeOperation operation, boolean undone)
          Broadcasts the change event into all pages.
 org.eclipse.ui.INavigationLocation createEmptyNavigationLocation()
           
 org.eclipse.ui.INavigationLocation createNavigationLocation()
           
 void dispose()
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
static void ensureOpen(org.eclipse.ui.IWorkbenchPage page, java.net.URI baseURI, boolean withImports)
           
static void ensureOpen(java.net.URI baseURI, boolean withImports)
           
static ResourceEditor get(org.eclipse.swt.widgets.Control child)
           
static ResourceEditor get(org.eclipse.ui.IWorkbenchPage page, java.io.File file)
           
static ResourceEditor get(org.eclipse.ui.IWorkbenchPage page, org.eclipse.core.resources.IFile file)
           
static ResourceEditor get(org.eclipse.ui.IWorkbenchPage page, org.eclipse.core.resources.IFile file, boolean restoreEditor)
           
 com.hp.hpl.jena.ontology.OntModel getModel()
           
 IResourceEditorPage getPage(java.lang.String id)
           
 java.util.Collection<ResourceEditor> getSiblingEditors()
          Gets all ResourceEditors that edit the same model.
 com.hp.hpl.jena.rdf.model.Resource getSubject()
           
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
           
 void graphChangePerformed()
          Notifies the receiver that a global change to the current model has been performed.
 void graphDirty(com.hp.hpl.jena.graph.Graph graph)
          Called when a Graph has been set to dirty.
 void graphDirtyStateChanged(java.net.URI changedBaseURI)
           
 void graphRegistered(java.net.URI uri)
           
 void graphSourceChanged(java.net.URI uri, java.lang.Object oldSource)
           
 void graphUnregistered(java.net.URI uri, com.hp.hpl.jena.graph.Graph graph, java.lang.Object source)
           
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
           
 boolean isDirty()
           
 boolean isSaveAsAllowed()
           
 void refreshWorkbenchPart(boolean structural)
          Refreshs the part from the currently selected model and settings.
 void removePage(int index)
           
 void resourceSelected(com.hp.hpl.jena.rdf.model.Resource resource)
          Called when the resource selection has changed.
 void setInput(org.eclipse.ui.IEditorInput input)
           
 void setPrimaryEditor()
           
 void setResource(com.hp.hpl.jena.rdf.model.Resource resource)
           
 void showEditorInput(org.eclipse.ui.IEditorInput editorInput)
           
static void updateAllPages(org.eclipse.ui.IWorkbenchPage page)
           
 
Methods inherited from class org.eclipse.ui.forms.editor.FormEditor
addPage, addPage, addPage, addPage, addPage, addPage, addPageChangedListener, close, commitPages, configurePage, createPageContainer, createPages, createToolkit, editorDirtyStateChanged, findPage, getActiveEditor, getActivePageInstance, getCurrentPage, getSelectedPage, getToolkit, pageChange, removePageChangedListener, selectReveal, setActivePage, setActivePage, setActivePage, updateActionBarContributor
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
createPartControl, createSite, findEditors, getActivePage, getAdapter, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageText, handlePropertyChange, setActiveEditor, setControl, setFocus, setPageImage, setPageText
 
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, firePropertyChange, 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.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values
Constructor Detail

ResourceEditor

public ResourceEditor()
Method Detail

addPages

protected void addPages()
Specified by:
addPages in class org.eclipse.ui.forms.editor.FormEditor

changeOperationPerformed

public void changeOperationPerformed(ChangeOperation operation,
                                     boolean undone)
Broadcasts the change event into all pages.

Specified by:
changeOperationPerformed in interface IChangeEngineListener
Parameters:
operation - the ModelOperation that was performed
undone - true if the operation has been undone

createEmptyNavigationLocation

public org.eclipse.ui.INavigationLocation createEmptyNavigationLocation()
Specified by:
createEmptyNavigationLocation in interface org.eclipse.ui.INavigationLocationProvider

createNavigationLocation

public org.eclipse.ui.INavigationLocation createNavigationLocation()
Specified by:
createNavigationLocation in interface org.eclipse.ui.INavigationLocationProvider

dispose

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

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

doSaveAs

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

ensureOpen

public static void ensureOpen(java.net.URI baseURI,
                              boolean withImports)

ensureOpen

public static void ensureOpen(org.eclipse.ui.IWorkbenchPage page,
                              java.net.URI baseURI,
                              boolean withImports)

get

public static ResourceEditor get(org.eclipse.ui.IWorkbenchPage page,
                                 java.io.File file)

get

public static ResourceEditor get(org.eclipse.ui.IWorkbenchPage page,
                                 org.eclipse.core.resources.IFile file)

get

public static ResourceEditor get(org.eclipse.ui.IWorkbenchPage page,
                                 org.eclipse.core.resources.IFile file,
                                 boolean restoreEditor)

get

public static ResourceEditor get(org.eclipse.swt.widgets.Control child)

getModel

public com.hp.hpl.jena.ontology.OntModel getModel()

getPage

public IResourceEditorPage getPage(java.lang.String id)

getSiblingEditors

public java.util.Collection<ResourceEditor> getSiblingEditors()
Gets all ResourceEditors that edit the same model. This can happen if the user uses "New Editor" to create a clone.

Returns:
a Collection of ResourceEditors

getSubject

public com.hp.hpl.jena.rdf.model.Resource getSubject()

gotoMarker

public void gotoMarker(org.eclipse.core.resources.IMarker marker)
Specified by:
gotoMarker in interface org.eclipse.ui.ide.IGotoMarker

graphChangePerformed

public void graphChangePerformed()
Description copied from interface: IChangeEngineListener
Notifies the receiver that a global change to the current model has been performed. This is typically called when new sub-Graphs have been added or removed, allowing the receiver to do a complete refresh.

Specified by:
graphChangePerformed in interface IChangeEngineListener

graphDirty

public void graphDirty(com.hp.hpl.jena.graph.Graph graph)
Description copied from interface: IChangeEngineListener
Called when a Graph has been set to dirty.

Specified by:
graphDirty in interface IChangeEngineListener
Parameters:
graph - the Graph that has changed

graphDirtyStateChanged

public void graphDirtyStateChanged(java.net.URI changedBaseURI)
Specified by:
graphDirtyStateChanged in interface IGraphRegistryListener

graphRegistered

public void graphRegistered(java.net.URI uri)
Specified by:
graphRegistered in interface IGraphRegistryListener

graphSourceChanged

public void graphSourceChanged(java.net.URI uri,
                               java.lang.Object oldSource)
Specified by:
graphSourceChanged in interface IGraphRegistryListener

graphUnregistered

public void graphUnregistered(java.net.URI uri,
                              com.hp.hpl.jena.graph.Graph graph,
                              java.lang.Object source)
Specified by:
graphUnregistered in interface IGraphRegistryListener

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

isDirty

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

isSaveAsAllowed

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

refreshWorkbenchPart

public void refreshWorkbenchPart(boolean structural)
Description copied from interface: IRefreshableWorkbenchPart
Refreshs the part from the currently selected model and settings. This should for example rebuild the whole tree, table or whatever else to ensure that the current state of the model is displayed.

Specified by:
refreshWorkbenchPart in interface IRefreshableWorkbenchPart
Parameters:
structural - true to completely rebuild everything, in response to structural changes - false may only refresh icons and labels.

removePage

public void removePage(int index)
Overrides:
removePage in class org.eclipse.ui.forms.editor.FormEditor

resourceSelected

public void resourceSelected(com.hp.hpl.jena.rdf.model.Resource resource)
Description copied from interface: IResourceSelectionListener
Called when the resource selection has changed. This method is called as a side effect by the ResourceSelection class.

Specified by:
resourceSelected in interface IResourceSelectionListener
Parameters:
resource - the new selection

setInput

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

setResource

public void setResource(com.hp.hpl.jena.rdf.model.Resource resource)

setPrimaryEditor

public void setPrimaryEditor()

showEditorInput

public void showEditorInput(org.eclipse.ui.IEditorInput editorInput)
Specified by:
showEditorInput in interface org.eclipse.ui.IShowEditorInput

updateAllPages

public static void updateAllPages(org.eclipse.ui.IWorkbenchPage page)