bibliothek.gui.dock.themes
Class ThemePropertyFactory<T extends DockTheme>

java.lang.Object
  extended by bibliothek.gui.dock.themes.ThemePropertyFactory<T>
Type Parameters:
T - the type of theme created by this factory
All Implemented Interfaces:
ThemeFactory

public class ThemePropertyFactory<T extends DockTheme>
extends Object
implements ThemeFactory

A factory using the ThemeProperties of a DockTheme to create instances of that DockTheme.

Author:
Benjamin Sigg

Constructor Summary
ThemePropertyFactory(Class<T> theme)
          Creates a new factory.
ThemePropertyFactory(Class<T> theme, DockUI ui)
          Creates a new factory.
ThemePropertyFactory(Class<T> theme, ResourceBundle bundle)
          Creates a new factory.
ThemePropertyFactory(Class<T> theme, ResourceBundle bundle, DockUI ui)
          Creates a new factory.
 
Method Summary
 T create()
          Creates a new theme.
 String[] getAuthors()
          Gets a list of strings, containing the names of the authors.
 ResourceBundle getBundle()
          Gets the bundle used to retrieve text for this factory.
 String getDescription()
          Gets a human readable description of the theme.
 String getName()
          Gets the name of the theme.
protected  String getString(String key)
           
 DockUI getUi()
          Gets the DockUI used with this factory.
 URI[] getWebpages()
          Gets a set of links to any webpage the authors might want to show the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThemePropertyFactory

public ThemePropertyFactory(Class<T> theme)
Creates a new factory.

Parameters:
theme - the class of a theme, must have the ThemeProperties annotation.

ThemePropertyFactory

public ThemePropertyFactory(Class<T> theme,
                            ResourceBundle bundle)
Creates a new factory.

Parameters:
theme - the class of a theme, must have the ThemeProperties annotation.
bundle - the bundle to retrieve text, might be null if the bundle of the DockUI should be used.

ThemePropertyFactory

public ThemePropertyFactory(Class<T> theme,
                            DockUI ui)
Creates a new factory.

Parameters:
theme - the class of a theme, must have the ThemeProperties annotation.
ui - the DockUI to retrieve more information, might be null

ThemePropertyFactory

public ThemePropertyFactory(Class<T> theme,
                            ResourceBundle bundle,
                            DockUI ui)
Creates a new factory.

Parameters:
theme - the class of a theme, must have the ThemeProperties annotation.
bundle - the bundle to retrieve text, might be null if the bundle of the DockUI should be used.
ui - the DockUI to retrieve more information, might be null
Method Detail

getBundle

public ResourceBundle getBundle()
Gets the bundle used to retrieve text for this factory.

Returns:
the bundle or null if the bundle of the DockUI is used.

getUi

public DockUI getUi()
Gets the DockUI used with this factory.

Returns:
the ui or null if the default-DockUI is used

create

public T create()
Description copied from interface: ThemeFactory
Creates a new theme.

Specified by:
create in interface ThemeFactory
Returns:
the new theme

getAuthors

public String[] getAuthors()
Description copied from interface: ThemeFactory
Gets a list of strings, containing the names of the authors.

Specified by:
getAuthors in interface ThemeFactory
Returns:
the authors, might be null

getString

protected String getString(String key)

getDescription

public String getDescription()
Description copied from interface: ThemeFactory
Gets a human readable description of the theme.

Specified by:
getDescription in interface ThemeFactory
Returns:
the description, might be null

getName

public String getName()
Description copied from interface: ThemeFactory
Gets the name of the theme.

Specified by:
getName in interface ThemeFactory
Returns:
the name, might be null

getWebpages

public URI[] getWebpages()
Description copied from interface: ThemeFactory
Gets a set of links to any webpage the authors might want to show the user.

Specified by:
getWebpages in interface ThemeFactory
Returns:
the pages, might be null