com.bbn.swede.editor
Class OWLSourceEditor

java.lang.Object
  extended byTextEditor
      extended bycom.bbn.swede.editor.OWLSourceEditor

public class OWLSourceEditor
extends TextEditor

The text editor that appears as "Source" tab in OWLEditor.

Author:
jlerner
See Also:
Serialized Form

Nested Class Summary
protected  class OWLSourceEditor.OWLDocumentProvider
          Creates documents that use OWLDocumentPartitioner as their document partitioner.
 
Constructor Summary
OWLSourceEditor(OAST tree)
          Creates a new OWLSourceEditor associated with an OAST.
 
Method Summary
 void addSelectionChangedListener(ISelectionChangedListener listener)
           
 void close(boolean save)
           
protected  void createActions()
           
 void createPartControl(Composite parent)
           
 void dispose()
           
 void doSave(IProgressMonitor monitor)
           
 void doSaveAs()
           
 void editorSyncCheck(OWLEditorInput input)
          This function is an accessor that runs a sanity check on the file system.
 OWLEditorContentOutlinePage getContentOutline(OWLEditor editor)
          Retrives the content outline page representing this editor's OAST, creating it first if necessary.
 ISelection getSelection()
           
 void insertNode(OASTNode parent, OASTNode node, boolean bBefore)
          Deprecated. As of SWeDE 2.0.0, use the OAST API instead.
 void removeSelectionChangedListener(ISelectionChangedListener listener)
           
 void selectNode(OASTNode node)
          Selects the full text of a node and scrolls the editor to display it.
 void selectQName(OASTNode node)
          Selects the text of a node's QName and scrolls the editor to display it.
 void setFocus()
           
 void setSelection(ISelection selection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OWLSourceEditor

public OWLSourceEditor(OAST tree)
Creates a new OWLSourceEditor associated with an OAST. The OAST will be updated automatically as the document is changed and, if there are unsaved changes when the editor is closed, reverted to reflect the state of the file on disk.

Parameters:
tree - The OAST to connect to the editor
Method Detail

close

public void close(boolean save)

getContentOutline

public OWLEditorContentOutlinePage getContentOutline(OWLEditor editor)
Retrives the content outline page representing this editor's OAST, creating it first if necessary.

Parameters:
editor - The enclosing multi-page OWL editor
Returns:
A content outline page representing the editor's document's OAST

selectNode

public void selectNode(OASTNode node)
Selects the full text of a node and scrolls the editor to display it. If node is not attached to the OAST of the document being edited, nothing happens.

Parameters:
node - The OASTNode to select and display

selectQName

public void selectQName(OASTNode node)
Selects the text of a node's QName and scrolls the editor to display it. If node has no QName or node is not attached to the OAST of the document being edited, nothing happens.

Parameters:
node - The node to select

createActions

protected void createActions()

insertNode

public void insertNode(OASTNode parent,
                       OASTNode node,
                       boolean bBefore)
                throws BadLocationException
Deprecated. As of SWeDE 2.0.0, use the OAST API instead.

Insert a manually constructed node into the document's syntax tree.

Parameters:
parent - Parent node for the new node
node - The new node. It will be placed relative to either the existing attributes or existing nested tags of the parent node, depending on whether or not it is an instance of AttributeNode
bBefore - true to insert the new node before the parent's existing children, false to insert after them.
Throws:
BadLocationException - if text for parent cannot be retrieved for a partial reparse.

doSave

public void doSave(IProgressMonitor monitor)

doSaveAs

public void doSaveAs()

dispose

public void dispose()

addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)

removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)

setSelection

public void setSelection(ISelection selection)

editorSyncCheck

public void editorSyncCheck(OWLEditorInput input)
This function is an accessor that runs a sanity check on the file system.

Parameters:
input - The editor input to check.

getSelection

public ISelection getSelection()

createPartControl

public void createPartControl(Composite parent)

setFocus

public void setFocus()


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