com.bbn.swede.editor
Class OWLEditor

java.lang.Object
  extended byMultiPageEditorPart
      extended bycom.bbn.swede.editor.OWLEditor

public class OWLEditor
extends MultiPageEditorPart

Multi-page editor for OWL documents. The source tab is present by default and provides access to the OWL text editor. Additional tabs are added automatically for each extension of the com.bbn.swede.editor.visualizationPage extension point.

Author:
jlerner
See Also:
Serialized Form

Field Summary
protected  OWLEditorContentOutlinePage _outline
          The content outline page for this instance of the editor.
protected static IConfigurationElement[] _visualEditors
          Array containing all extenders of com.bbn.swede.editors.visualEditor.
protected static IConfigurationElement[] _visualizationPages
          Array containing all extenders of com.bbn.swede.editors.visualizationPage.
 
Constructor Summary
OWLEditor()
           
 
Method Summary
protected  void createPages()
          Creates the pages for the multiple page editor.
 void doSave(IProgressMonitor monitor)
           
 void doSaveAs()
           
 void enableSourcePage()
          Switches the multi-page editor to the "Source" tab.
 Object getAdapter(Class adapter)
           
 OWLEditorInput getOwlEditorInput()
          Returns the OWLEditorInput being used by this editor.
 OWLSourceEditor getSourceEditor()
          Provides direct access to the OWL text editor that appears as the first tab in the multi-page editor.
 void gotoMarker(IMarker marker)
           
 void goToResource(Resource res)
          Select and scroll to a specific com.hp.hpl.jena.rdf.model.Resource in the editor.
 void goToURI(String sUri)
          Select and scroll to a specific URI in the editor.
 void init(IEditorSite site, IEditorInput input)
           
(package private)  boolean isActivePage(IEditorPart part)
          Indicates whether a given sub-editor is the currently active page.
 boolean isSaveAsAllowed()
           
protected static void locateVisualEditors()
          Finds all extenders of com.bbn.swede.editor.visualEditor and stores stores them in _visualEditors.
protected static void locateVisualizations()
          Finds all extenders of com.bbn.swede.editor.visualizationPage and stores stores them in _visualizationPages.
protected  void pageChange(int newPageIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_visualizationPages

protected static IConfigurationElement[] _visualizationPages
Array containing all extenders of com.bbn.swede.editors.visualizationPage.


_visualEditors

protected static IConfigurationElement[] _visualEditors
Array containing all extenders of com.bbn.swede.editors.visualEditor.


_outline

protected OWLEditorContentOutlinePage _outline
The content outline page for this instance of the editor.

Constructor Detail

OWLEditor

public OWLEditor()
Method Detail

locateVisualizations

protected static void locateVisualizations()
Finds all extenders of com.bbn.swede.editor.visualizationPage and stores stores them in _visualizationPages.


locateVisualEditors

protected static void locateVisualEditors()
Finds all extenders of com.bbn.swede.editor.visualEditor and stores stores them in _visualEditors.


createPages

protected void createPages()
Creates the pages for the multiple page editor. The first page will be "Source", followed by a page for each entry in _visualizationPages.


doSave

public void doSave(IProgressMonitor monitor)

doSaveAs

public void doSaveAs()

gotoMarker

public void gotoMarker(IMarker marker)

isSaveAsAllowed

public boolean isSaveAsAllowed()

init

public void init(IEditorSite site,
                 IEditorInput input)
          throws PartInitException
Throws:
PartInitException

goToResource

public void goToResource(Resource res)
Select and scroll to a specific com.hp.hpl.jena.rdf.model.Resource in the editor. The text selected for res is determined by searching the editor's associated com.bbn.swede.core.dom.OAST for a node that corresponds to the resource.

Parameters:
res - The resource to select and display

goToURI

public void goToURI(String sUri)
Select and scroll to a specific URI in the editor. The text selected for sUri is determined by searching the editor's associated com.bbn.swede.core.dom.OAST for a node whose corresponding com.hp.hpl.jena.rdf.model.Resource has the specified URI.

Parameters:
sUri - The URI to select and display

getOwlEditorInput

public OWLEditorInput getOwlEditorInput()
Returns the OWLEditorInput being used by this editor. This is a convenience method, fully equivalent to (OWLEditorInput)getEditorInput().

Returns:
The OWLEditorInput associated with this editor

getSourceEditor

public OWLSourceEditor getSourceEditor()
Provides direct access to the OWL text editor that appears as the first tab in the multi-page editor.

Returns:
The OWLSourceEditor associated with the "Source" tab

getAdapter

public Object getAdapter(Class adapter)

enableSourcePage

public void enableSourcePage()
Switches the multi-page editor to the "Source" tab.


pageChange

protected void pageChange(int newPageIndex)

isActivePage

boolean isActivePage(IEditorPart part)
Indicates whether a given sub-editor is the currently active page.

Parameters:
part - The sub-editor
Returns:
true if part is the active page, false if not.


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.