de.frag.umlplugin.settings
Class SettingsPlugin

java.lang.Object
  extended by de.frag.umlplugin.settings.SettingsPlugin
All Implemented Interfaces:
com.intellij.openapi.components.ApplicationComponent, com.intellij.openapi.components.BaseComponent, com.intellij.openapi.components.PersistentStateComponent<org.jdom.Element>, com.intellij.openapi.options.Configurable, com.intellij.openapi.options.UnnamedConfigurable

public class SettingsPlugin
extends java.lang.Object
implements com.intellij.openapi.components.ApplicationComponent, com.intellij.openapi.options.Configurable, com.intellij.openapi.components.PersistentStateComponent<org.jdom.Element>

Settings plugin application component. This class is responsible for handling plugin settings.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.intellij.openapi.options.Configurable
com.intellij.openapi.options.Configurable.Assistant
 
Field Summary
static java.lang.String DISPLAY_NAME
           
 
Fields inherited from interface com.intellij.openapi.options.Configurable
APPLICATION_CONFIGURABLES, PROJECT_CONFIGURABLES
 
Constructor Summary
SettingsPlugin()
          Creates a new settings plugin.
 
Method Summary
 void apply()
          Apply the settings changes from settings form to all dependent objects.
 javax.swing.JComponent createComponent()
          Returns the user interface component for editing the configuration.
 void disposeComponent()
           
 void disposeUIResources()
          Disposes the Swing components used for displaying the configuration.
 java.lang.String getComponentName()
           
 java.lang.String getDisplayName()
          Returns the user-visible name of the settings component.
 java.lang.String getHelpTopic()
          Returns the topic in the help file which is shown when help for the configurable is requested.
 javax.swing.Icon getIcon()
          Returns the icon representing the settings component.
 Settings getSettings()
          Gets settings.
 org.jdom.Element getState()
          Writes settings from settings object to persistent storage object.
 void initComponent()
           
 boolean isModified()
          Checks if the settings in the user interface component were modified by the user and need to be saved.
 void loadState(org.jdom.Element settingsElement)
          Loads settings from given persistent storage JDOM element.
 void reset()
          Load settings from other components to configurable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLAY_NAME

public static final java.lang.String DISPLAY_NAME
See Also:
Constant Field Values
Constructor Detail

SettingsPlugin

public SettingsPlugin()
Creates a new settings plugin.

Method Detail

getSettings

@NotNull
public Settings getSettings()
Gets settings.

Returns:
settings

initComponent

public void initComponent()
Specified by:
initComponent in interface com.intellij.openapi.components.BaseComponent

disposeComponent

public void disposeComponent()
Specified by:
disposeComponent in interface com.intellij.openapi.components.BaseComponent

getComponentName

@NotNull
public java.lang.String getComponentName()
Specified by:
getComponentName in interface com.intellij.openapi.components.BaseComponent

getDisplayName

@NotNull
public java.lang.String getDisplayName()
Returns the user-visible name of the settings component.

Specified by:
getDisplayName in interface com.intellij.openapi.options.Configurable
Returns:
the visible name of the component.

getIcon

@NotNull
public javax.swing.Icon getIcon()
Returns the icon representing the settings component. Components shown in the IDEA settings dialog have 32x32 icons.

Specified by:
getIcon in interface com.intellij.openapi.options.Configurable
Returns:
the icon for the component.

getHelpTopic

@Nullable
public java.lang.String getHelpTopic()
Returns the topic in the help file which is shown when help for the configurable is requested.

Specified by:
getHelpTopic in interface com.intellij.openapi.options.Configurable
Returns:
the help topic, or null if no help is available.

createComponent

@NotNull
public javax.swing.JComponent createComponent()
Returns the user interface component for editing the configuration.

Specified by:
createComponent in interface com.intellij.openapi.options.UnnamedConfigurable
Returns:
the component instance.

isModified

public boolean isModified()
Checks if the settings in the user interface component were modified by the user and need to be saved.

Specified by:
isModified in interface com.intellij.openapi.options.UnnamedConfigurable
Returns:
true if the settings were modified, false otherwise.

apply

public void apply()
           throws com.intellij.openapi.options.ConfigurationException
Apply the settings changes from settings form to all dependent objects.

Specified by:
apply in interface com.intellij.openapi.options.UnnamedConfigurable
Throws:
com.intellij.openapi.options.ConfigurationException

reset

public void reset()
Load settings from other components to configurable.

Specified by:
reset in interface com.intellij.openapi.options.UnnamedConfigurable

disposeUIResources

public void disposeUIResources()
Disposes the Swing components used for displaying the configuration.

Specified by:
disposeUIResources in interface com.intellij.openapi.options.UnnamedConfigurable

getState

@NotNull
public org.jdom.Element getState()
Writes settings from settings object to persistent storage object.

Specified by:
getState in interface com.intellij.openapi.components.PersistentStateComponent<org.jdom.Element>
Returns:
created JDOM element to be used for persistent storage

loadState

public void loadState(@NotNull
                      org.jdom.Element settingsElement)
Loads settings from given persistent storage JDOM element.

Specified by:
loadState in interface com.intellij.openapi.components.PersistentStateComponent<org.jdom.Element>
Parameters:
settingsElement - settings element to read from