ch.uzh.ifi.attempto.acewiki.core
Class EditorController

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.core.EditorController

public class EditorController
extends java.lang.Object

This class controls the behavior and content of the predictive editor.

Author:
Tobias Kuhn

Constructor Summary
EditorController()
           
 
Method Summary
 void addExtensibleCategory(java.lang.String category, java.lang.String menuGroup, java.lang.String type, int wordNumber)
          Adds a grammatical category that is extensible.
 void addMenuGroup(java.lang.String menuGroup, int colorShift)
          Adds a menu group.
 void addPlainCategory(java.lang.String category, java.lang.String menuGroup)
          Adds a grammatical category that is not extensible.
 java.lang.String[] getAutocompleteTokens()
          Returns the tokens used for autocompletion of sentences.
 int getColorShift(java.lang.String menuBlockName)
          Returns the color shift for the given menu group.
 java.util.List<java.lang.String> getExtensibleCategories()
          Returns a list of all extensible categories.
 java.lang.String getMenuGroup(java.lang.String category)
          Returns the menu group for the given category.
 java.util.List<java.lang.String> getMenuGroups()
          Returns all menu groups in the order they appear in the editor.
 int getWordNumber(java.lang.String category)
          Returns the word number for the given extensible category, or null if the category is not extensible.
 java.lang.String getWordType(java.lang.String category)
          Returns the word type for the given extensible category, or null if the category is not extensible.
 void setAutocompleteTokens(java.lang.String... autocompleteTokens)
          Sets the tokens that normally form the end of a sentence and that should be used to automatically complete sentences.
 void setDefaultMenuGroup(java.lang.String defaultMenuGroup)
          Sets the menu group for all words that have no menu group assigned otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EditorController

public EditorController()
Method Detail

addMenuGroup

public void addMenuGroup(java.lang.String menuGroup,
                         int colorShift)
Adds a menu group. The order of the method-calls define the order in which the menu groups will appear in the editor. Color shifts can be set to give the menu groups different colors.

Parameters:
menuGroup - The name of the menu group to be added.
colorShift - The color shift.

setDefaultMenuGroup

public void setDefaultMenuGroup(java.lang.String defaultMenuGroup)
Sets the menu group for all words that have no menu group assigned otherwise.

Parameters:
defaultMenuGroup - The name of the default menu group.

getMenuGroups

public java.util.List<java.lang.String> getMenuGroups()
Returns all menu groups in the order they appear in the editor.

Returns:
All menu groups.

getExtensibleCategories

public java.util.List<java.lang.String> getExtensibleCategories()
Returns a list of all extensible categories.

Returns:
All extensible categories.

getColorShift

public int getColorShift(java.lang.String menuBlockName)
Returns the color shift for the given menu group.

Parameters:
menuBlockName - The name of the menu group.
Returns:
The color shift.

addExtensibleCategory

public void addExtensibleCategory(java.lang.String category,
                                  java.lang.String menuGroup,
                                  java.lang.String type,
                                  int wordNumber)
Adds a grammatical category that is extensible. Extensible means that users can define new words in this category.

Parameters:
category - The extensible category name.
menuGroup - The menu group for the category.
type - The type of the respective ontology elements.
wordNumber - The word number.

addPlainCategory

public void addPlainCategory(java.lang.String category,
                             java.lang.String menuGroup)
Adds a grammatical category that is not extensible.

Parameters:
category - The category name.
menuGroup - The menu group for the category.

getMenuGroup

public java.lang.String getMenuGroup(java.lang.String category)
Returns the menu group for the given category.

Parameters:
category - The category name.
Returns:
The name of the menu group.

getWordType

public java.lang.String getWordType(java.lang.String category)
Returns the word type for the given extensible category, or null if the category is not extensible.

Parameters:
category - The category name.
Returns:
The word type.

getWordNumber

public int getWordNumber(java.lang.String category)
Returns the word number for the given extensible category, or null if the category is not extensible.

Parameters:
category - The category name.
Returns:
The word number.

setAutocompleteTokens

public void setAutocompleteTokens(java.lang.String... autocompleteTokens)
Sets the tokens that normally form the end of a sentence and that should be used to automatically complete sentences. These tokens are usually punctuation symbols like a dot or a question mark.

Parameters:
autocompleteTokens -

getAutocompleteTokens

public java.lang.String[] getAutocompleteTokens()
Returns the tokens used for autocompletion of sentences.

Returns:
The autocompletion tokens.


Copyright 2008-2012, AceWiki developers