org.xnap.commons.gui.completion
Class CompletionModeFactory

java.lang.Object
  extended by org.xnap.commons.gui.completion.CompletionModeFactory

public class CompletionModeFactory
extends Object

Factory class that manages all installed completion modes and creates them.

Author:
Felix Berger

Nested Class Summary
static class CompletionModeFactory.CompletionModeInfo
          Info class that associates a CompletionMode with a name that can be shown to the user.
 
Constructor Summary
CompletionModeFactory()
           
 
Method Summary
static CompletionMode createCompletionMode(CompletionModeFactory.CompletionModeInfo info)
          Creates a completion mode using the class name information from info.
static CompletionMode createCompletionMode(String className)
          Creates a completion mode object with the given class name.
static CompletionModeFactory.CompletionModeInfo getCompletionModeInfoByClassName(String className)
          Returns the completion mode info object for the className.
static CompletionModeFactory.CompletionModeInfo[] getInstalledCompletionModes()
          Returns all installed completion mode info objects.
static void installCompletionMode(CompletionModeFactory.CompletionModeInfo info)
          Installs a completion mode info object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompletionModeFactory

public CompletionModeFactory()
Method Detail

getInstalledCompletionModes

public static CompletionModeFactory.CompletionModeInfo[] getInstalledCompletionModes()
Returns all installed completion mode info objects.

Returns:
an array that contains the objects; if no completion modes have been installed an empty array is returned, never returns null

getCompletionModeInfoByClassName

public static CompletionModeFactory.CompletionModeInfo getCompletionModeInfoByClassName(String className)
Returns the completion mode info object for the className.

Returns:
null if no object for that class name was found

installCompletionMode

public static void installCompletionMode(CompletionModeFactory.CompletionModeInfo info)
Installs a completion mode info object.

It is then returned in getInstalledCompletionModes(). Completion modes can not be uninstalled, since they may already be actively used in Completion objects and provided as possible options in CompletionModeMenus.

Parameters:
info -

createCompletionMode

public static CompletionMode createCompletionMode(CompletionModeFactory.CompletionModeInfo info)
                                           throws ClassNotFoundException,
                                                  NoSuchMethodException,
                                                  NoSuchMethodException,
                                                  InvocationTargetException,
                                                  InstantiationException,
                                                  IllegalAccessException,
                                                  InvocationTargetException
Creates a completion mode using the class name information from info.

Parameters:
info -
Throws:
ClassNotFoundException
NoSuchMethodException
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
InvocationTargetException

createCompletionMode

public static CompletionMode createCompletionMode(String className)
                                           throws ClassNotFoundException,
                                                  NoSuchMethodException,
                                                  NoSuchMethodException,
                                                  InvocationTargetException,
                                                  InstantiationException,
                                                  IllegalAccessException,
                                                  InvocationTargetException
Creates a completion mode object with the given class name.

Parameters:
className -
Throws:
IllegalArgumentException - if the created object is not an instance of type CompletionMode.
ClassNotFoundException
NoSuchMethodException
NoSuchMethodException
InvocationTargetException
InstantiationException
IllegalAccessException
InvocationTargetException


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.