Interface DocumentNoteType
-
public interface DocumentNoteType
This represents a "Note Type" in the program. Users can add custom note types and modify existing ones. Essentially consists of a name, description etc and a list ofDocumentNoteField
s which specify the type of information that this note type represents. ATTENTION: Plugin writers should not implement this interface.
UseDocumentNoteUtilities
to access theDocumentNoteType
s. For an example of notes in use see documentation forDocumentNoteUtilities
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentNote
createDocumentNote()
Get an instance ofDocumentNote
with this as its note type.java.lang.String
getCode()
java.lang.String
getDescription()
DocumentNoteField
getField(java.lang.String fieldCode)
java.util.List<DocumentNoteField>
getFields()
long
getModifiedDate()
Get the date that this note type was last modified (eg.java.lang.String
getName()
boolean
isDefaultVisibleInTable()
Are the fields of this note type visible in the document table by default.boolean
isStoredInConnectedNonLocalDatbase()
If a note type is stored in a non-local database then the user should be notified when editing it because they may effect other users.boolean
isVisible()
void
removeField(java.lang.String fieldCode)
Remove a field.void
setDefaultVisibleInTable(boolean visible)
Set whether the fields of this note type are visible in the document table by defaultvoid
setDescription(java.lang.String description)
void
setField(DocumentNoteField field)
Add or modify a field.void
setName(java.lang.String name)
void
setVisible(boolean isVisible)
Setting this to false will mean the user can not edit the note type at all and can not add new instances of the note type through the standard "Notes" user interface.
-
-
-
Method Detail
-
getCode
java.lang.String getCode()
- Returns:
- the unique code
-
getName
java.lang.String getName()
- Returns:
- the user visible name
-
getDescription
java.lang.String getDescription()
- Returns:
- a description of this note type
-
isVisible
boolean isVisible()
- Returns:
- true if this note type is visible in the user interface, false otherwise
- See Also:
setVisible(boolean)
-
setVisible
void setVisible(boolean isVisible)
Setting this to false will mean the user can not edit the note type at all and can not add new instances of the note type through the standard "Notes" user interface. This is equivalent to deleting the note type through the user interface.- Parameters:
isVisible
- false to have this note type not visible in the user interface. true otherwise
-
isDefaultVisibleInTable
boolean isDefaultVisibleInTable()
Are the fields of this note type visible in the document table by default.- Returns:
- true if the fields of this note type are visible in the document table by default, false otherwise
-
setDefaultVisibleInTable
void setDefaultVisibleInTable(boolean visible)
Set whether the fields of this note type are visible in the document table by default- Parameters:
visible
- true if the fields of this note type should be visible in the document table by default, false otherwise
-
getFields
java.util.List<DocumentNoteField> getFields()
- Returns:
- list of all the fields
-
getField
DocumentNoteField getField(java.lang.String fieldCode)
- Parameters:
fieldCode
- of field to get- Returns:
- field with code
code
or null if no field with this code. - See Also:
DocumentNoteField.getCode()
-
setName
void setName(java.lang.String name)
- Parameters:
name
- to set- See Also:
getName()
-
setDescription
void setDescription(java.lang.String description)
- Parameters:
description
- to set- See Also:
getDescription()
-
setField
void setField(DocumentNoteField field)
Add or modify a field. UseDocumentNoteField.createTextNoteField(String, String, String, java.util.List, boolean)
and the similar factory methods to get instances ofDocumentNoteField
s for adding. This method should not be performed by a user interface ifDocumentNoteField.isUserModificationAllowed()
is false for the field with codefieldCode
- Parameters:
field
- to add (if a field with the same code does not already exist) or modify (if a field does exist with the same code).
-
removeField
void removeField(java.lang.String fieldCode)
Remove a field.
This method should not be performed by a user interface ifDocumentNoteField.isUserModificationAllowed()
is false for the field with codefieldCode
- Parameters:
fieldCode
- of field to remove
-
createDocumentNote
DocumentNote createDocumentNote()
Get an instance ofDocumentNote
with this as its note type. All values will be empty. Use this to create a note for adding to anAnnotatedPluginDocument
.- Returns:
- a new DocumentNote of this type
- See Also:
AnnotatedPluginDocument.getDocumentNotes(boolean)
-
getModifiedDate
long getModifiedDate()
Get the date that this note type was last modified (eg. fields added/removed/modified on the note type - this does not include when an instance of the note is changed on a document). Used to resolve conflicts when a note type has been edited in two places (the most recently modified one is kept).- Returns:
- the date (as defined by
System.currentTimeMillis()
) that this note type was last modified. Will be 0 for note types that were last modified in Geneious 4.7 or earlier.
-
isStoredInConnectedNonLocalDatbase
boolean isStoredInConnectedNonLocalDatbase()
If a note type is stored in a non-local database then the user should be notified when editing it because they may effect other users.- Returns:
- true if this note type is stored in a currently connected, non-local database (eg. a Shared Database), false if the note type is stored locally only.
-
-