VdexReload 1.1.3 API

uk.ac.reload.editor.vocabulary
Class Vocabulary

java.lang.Object
  extended byuk.ac.reload.moonunit.dom.ReloadDocument
      extended byuk.ac.reload.moonunit.dom.ReloadSchemaDocument
          extended byuk.ac.reload.editor.vocabulary.Vocabulary
All Implemented Interfaces:
AbstractVocabulary

public class Vocabulary
extends ReloadSchemaDocument
implements AbstractVocabulary

The Vocabulary Class


Nested Class Summary
 
Nested classes inherited from class uk.ac.reload.moonunit.dom.ReloadSchemaDocument
ReloadSchemaDocument.UndoableAddAction, ReloadSchemaDocument.UndoableCopyAction, ReloadSchemaDocument.UndoableCutAction, ReloadSchemaDocument.UndoableDeleteAction, ReloadSchemaDocument.UndoableMoveAction, ReloadSchemaDocument.UndoablePasteAction
 
Field Summary
protected  boolean _isStandalone
          Whether we are a standalone file or attached
 
Fields inherited from class uk.ac.reload.moonunit.dom.ReloadSchemaDocument
_controller, _undoHandler
 
Fields inherited from class uk.ac.reload.moonunit.dom.ReloadDocument
_dirty, _doc, _file
 
Constructor Summary
Vocabulary(boolean isStandalone)
          Constructor
Vocabulary(java.io.File file, org.jdom.Document doc, VocabularySchemaController schemaController)
          Constructor for a Standalone vocabulary File that exists
 
Method Summary
 void addRootDeclarations(org.jdom.Element root)
          Add namespace and other attribute decalarations to the root element
 boolean canCopyElement(org.jdom.Element element)
          Whether we can copy and element or not
 boolean canCutElement(org.jdom.Element element, ReloadSchemaElement schemaElement)
          Whether we can cut an element or not
 boolean canPasteFromClipboard(org.jdom.Element element)
          Whether we can paste an element or not
 java.lang.String[] getComments()
          Get the comments to add to the XML document
 org.jdom.Namespace getSchemaNamespace()
          Get the appropriate Namespace
 org.jdom.Namespace getSchemaNamespaceEmbedded()
          Get the embedded Namespace
 org.jdom.Namespace getSchemaNamespaceStandalone()
          Get the standalone Namespace
 java.lang.String getTargetRootElementName()
          Get the Root Element name
 boolean isStandalone()
          Return whether we are a standalone file
 void newDocument(VocabularySchemaController controller)
          Setup the JDOM Document with Namespaces and root element
 void removeElementsAndAttributesBySchema(java.lang.Object obj)
          Remove elements/attributes from the JDOM document which are not in the ReloadSchema
 void updateDocument(VocabularySchemaController controller)
          Update the JDOM Document with the new Schema Namespaces and root element
 
Methods inherited from class uk.ac.reload.moonunit.dom.ReloadSchemaDocument
addAttribute, addComments, addElement, addElementAtIndex, addElementBySchema, addElementBySchemaUndoable, addElementUndoable, addElementUnique, addReloadDocumentListener, canAddElement, canDeleteElement, canMoveElementDown, canMoveElementUp, changedElement, copyElementUndoable, cutElementUndoable, deleteElementUndoable, destroy, fireDocumentSaved, fireElementAdded, fireElementChanged, fireElementRemoved, getElement, getElement, getElements, getElements, getIndexOfElement, getInsertPositionOfAttribute, getInsertPositionOfElement, getReloadSchemaController, getTargetNamespace, getUndoHandler, isAllowedChild, moveElementDown, moveElementUndoable, moveElementUp, pasteElementUndoable, removeElement, removeReloadDocumentListener, saveDocument, setReloadSchemaController, setUndoHandler
 
Methods inherited from class uk.ac.reload.moonunit.dom.ReloadDocument
getDocument, getFile, getRootElement, isDirty, isDocumentNamespace, isMemberOfSameDocument, loadDocument, saveAsDocument, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_isStandalone

protected boolean _isStandalone
Whether we are a standalone file or attached

Constructor Detail

Vocabulary

public Vocabulary(boolean isStandalone)
Constructor

Parameters:
isStandalone - whether we are standalone file or attached

Vocabulary

public Vocabulary(java.io.File file,
                  org.jdom.Document doc,
                  VocabularySchemaController schemaController)
Constructor for a Standalone vocabulary File that exists

Parameters:
file - the XML file doc the JDOM document of the XML file schemaController the ReloadSchemaController corresponding to the schema of the XML file
Method Detail

newDocument

public void newDocument(VocabularySchemaController controller)
Setup the JDOM Document with Namespaces and root element

Parameters:
controller - the VocabularySchemaController used for obtaining the ReloadSchema

getTargetRootElementName

public java.lang.String getTargetRootElementName()
Get the Root Element name

Specified by:
getTargetRootElementName in class ReloadSchemaDocument
Returns:
the Root element name

getComments

public java.lang.String[] getComments()
Get the comments to add to the XML document

Specified by:
getComments in class ReloadSchemaDocument
Returns:
the Comments to add to the XML Document

updateDocument

public void updateDocument(VocabularySchemaController controller)
Update the JDOM Document with the new Schema Namespaces and root element

Parameters:
controller - the VocabularySchemaController used for obtaining the ReloadSchema

removeElementsAndAttributesBySchema

public void removeElementsAndAttributesBySchema(java.lang.Object obj)
Remove elements/attributes from the JDOM document which are not in the ReloadSchema

Parameters:
obj - either a JDOM Element or Attribute

addRootDeclarations

public void addRootDeclarations(org.jdom.Element root)
Add namespace and other attribute decalarations to the root element

Parameters:
root - the root element

isStandalone

public boolean isStandalone()
Return whether we are a standalone file

Returns:
true if we are standalone, false otherwise

getSchemaNamespace

public org.jdom.Namespace getSchemaNamespace()
Get the appropriate Namespace

Overrides:
getSchemaNamespace in class ReloadSchemaDocument
Returns:
the appropriate schema namespace

getSchemaNamespaceStandalone

public org.jdom.Namespace getSchemaNamespaceStandalone()
Get the standalone Namespace

Returns:
the standalone schema namespace

getSchemaNamespaceEmbedded

public org.jdom.Namespace getSchemaNamespaceEmbedded()
Get the embedded Namespace

Returns:
the embedded schema namespace

canCopyElement

public boolean canCopyElement(org.jdom.Element element)
Whether we can copy and element or not

Overrides:
canCopyElement in class ReloadSchemaDocument
Parameters:
element - the element concerned
Returns:
true if we can copy the given element, false otherwise

canCutElement

public boolean canCutElement(org.jdom.Element element,
                             ReloadSchemaElement schemaElement)
Whether we can cut an element or not

Overrides:
canCutElement in class ReloadSchemaDocument
Parameters:
element - the element concerned
schemaElement - the ReloadSchemaElement
Returns:
true if we can cut the given element, false otherwise

canPasteFromClipboard

public boolean canPasteFromClipboard(org.jdom.Element element)
Whether we can paste an element or not

Overrides:
canPasteFromClipboard in class ReloadSchemaDocument
Parameters:
element - the element concerned
Returns:
true if we can paste the given element, false otherwise

VdexReload 1.1.3 API