chemaxon.alchemist.configbuilder
Class ConfigBuilderPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by chemaxon.alchemist.configbuilder.ConfigBuilderPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ConfigBuilderPanel
extends javax.swing.JPanel

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String PROPERTY_KEY_CONFIGURATION_VALID
          property key for configuration validity
static java.lang.String PROPERTY_KEY_ELEMENT_LIST
          property key for element added or removed
static java.lang.String PROPERTY_KEY_ELEMENT_ORDER
          property key for element order changed
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration)
          Constructs a config builder panel with default options.
ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration, javax.swing.Action openFileAction, javax.swing.Action saveFileAction)
          Constructs a config builder panel with default options.
ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration, AlchemistProfile profile)
          Constructs a config builder panel with specified configuration and profile
ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration, AlchemistProfile profile, javax.swing.Action openFileAction, javax.swing.Action saveFileAction)
          Constructs a config builder panel with specified configuration and profile with file load and save support.
ConfigBuilderPanel(java.lang.String configPath)
          Constructs a config builder panel with default options.
ConfigBuilderPanel(java.lang.String configPath, javax.swing.Action openFileAction, javax.swing.Action saveFileAction)
          Constructs a config builder panel with default options.
ConfigBuilderPanel(java.lang.String configPath, AlchemistProfile profile)
          Constructs a config builder panel with default options.
ConfigBuilderPanel(java.lang.String configPath, AlchemistProfile profile, javax.swing.Action openFileAction, javax.swing.Action saveFileAction)
          Constructs a config builder panel with default options.
 
Method Summary
protected  void addElement(ConfigElement element)
          Adds the clone of the element to the right list
 void addElementPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener for element property changes
 void addElementPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener for a specific element property change
 void clear()
          elementves all elements from the right list
 ConfigElement[] getConfiguration()
          Returns the current configuration elements
 javax.swing.Action getOpenFileAction()
          Returns the Action associated with open file event, or null if no Action
 AlchemistProfile getProfile()
          Returns the current profile
Note, that profile may be out of sync as various editors may use the same profile to store custom properties.
 javax.swing.Action getSaveFileAction()
          Returns the Action associated with save file event, or null if no Action
 boolean isFileSupportEnabled()
          Returns true if file loading support is enabled
 boolean isIgnoreMissingLicense()
          Returns false when panel is set to mark elements without valid license
 boolean isValidConfiguration()
          Returns true if configuration is valid
 void readConfiguration(AbstractConfigurationReader reader)
          Reads a configuration provided by reader
 void readConfiguration(AbstractConfigurationReader reader, java.lang.String[] groupFilter)
          Reads a configuration provided by reader and filter.
 void refreshLicenses()
          Re-validates the license information of elements
protected  void removeElement(ConfigElement element)
          Removes element from the right list
 void removeElementPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from element listener list
 void removeElementPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Removes a specific PropertyChangeListener from element listener list
 void setFileSupportEnabled(boolean fileSupportEnabled)
          Sets file support enabled or disabled
 void setIgnoreMissingLicense(boolean ignoreMissingLicense)
          Sets that actions without valid license are marked
 void setOpenFileAction(javax.swing.Action openFileAction)
          Sets the Action to be invoked at open file event
 void setProfile(AlchemistProfile profile)
          Sets the profile to be used.
 void setSaveFileAction(javax.swing.Action saveFileAction)
          Sets the Action to be invoked at save file event
 void updateProfile()
          Updates the current profile by forcing all editors sharing this profile to save changes
 void writeConfiguration(AbstractConfigurationWriter writer)
          Writes the current configuration with provider writer
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_KEY_ELEMENT_LIST

public static final java.lang.String PROPERTY_KEY_ELEMENT_LIST
property key for element added or removed

See Also:
Constant Field Values

PROPERTY_KEY_ELEMENT_ORDER

public static final java.lang.String PROPERTY_KEY_ELEMENT_ORDER
property key for element order changed

See Also:
Constant Field Values

PROPERTY_KEY_CONFIGURATION_VALID

public static final java.lang.String PROPERTY_KEY_CONFIGURATION_VALID
property key for configuration validity

See Also:
Constant Field Values
Constructor Detail

ConfigBuilderPanel

public ConfigBuilderPanel(java.lang.String configPath)
                   throws org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException,
                          java.io.FileNotFoundException
Constructs a config builder panel with default options.

Parameters:
configPath - is the path to configuration XML of available elements
Throws:
java.io.FileNotFoundException
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException

ConfigBuilderPanel

public ConfigBuilderPanel(java.lang.String configPath,
                          javax.swing.Action openFileAction,
                          javax.swing.Action saveFileAction)
                   throws org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException
Constructs a config builder panel with default options.

Parameters:
configPath - is the path to configuration XML of available elements
openFileAction - will be invoked on load file, if not null
saveFileAction - will be invoked on save file, in not null
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

ConfigBuilderPanel

public ConfigBuilderPanel(java.lang.String configPath,
                          AlchemistProfile profile)
                   throws org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException,
                          java.io.FileNotFoundException
Constructs a config builder panel with default options.

Parameters:
configPath - is the path to configuration XML of available elements
profile - is the profile used
Throws:
java.io.FileNotFoundException
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException

ConfigBuilderPanel

public ConfigBuilderPanel(java.lang.String configPath,
                          AlchemistProfile profile,
                          javax.swing.Action openFileAction,
                          javax.swing.Action saveFileAction)
                   throws org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException
Constructs a config builder panel with default options.

Parameters:
configPath - is the path to configuration XML of available elements
profile - is the profile used
openFileAction - will be invoked on load file, if not null
saveFileAction - will be invoked on save file, in not null
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

ConfigBuilderPanel

public ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration)
Constructs a config builder panel with default options.

Parameters:
configuration - is the XML-based configuration of available elements

ConfigBuilderPanel

public ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration,
                          javax.swing.Action openFileAction,
                          javax.swing.Action saveFileAction)
Constructs a config builder panel with default options.

Parameters:
configuration - is the XML-based configuration of available elements
openFileAction - will be invoked on load file, if not null
saveFileAction - will be invoked on save file, in not null

ConfigBuilderPanel

public ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration,
                          AlchemistProfile profile)
Constructs a config builder panel with specified configuration and profile

Parameters:
configuration - is the configuration used for element list
profile - is the profile storing custom user options

ConfigBuilderPanel

public ConfigBuilderPanel(chemaxon.alchemist.configbuilder.configuration.marshalling.Configuration configuration,
                          AlchemistProfile profile,
                          javax.swing.Action openFileAction,
                          javax.swing.Action saveFileAction)
Constructs a config builder panel with specified configuration and profile with file load and save support.

Parameters:
configuration - is the configuration used for element list
profile - is the profile storing custom user options
openFileAction - will be invoked on load file, if not null
saveFileAction - will be invoked on save file, in not null
Method Detail

refreshLicenses

public void refreshLicenses()
Re-validates the license information of elements


setProfile

public void setProfile(AlchemistProfile profile)
Sets the profile to be used. This method should be called before readConfiguration.

Parameters:
profile - is the profile to be used
See Also:
readConfiguration(AbstractConfigurationReader), readConfiguration(AbstractConfigurationReader, String[]), getProfile(), updateProfile()

updateProfile

public void updateProfile()
Updates the current profile by forcing all editors sharing this profile to save changes


getProfile

public AlchemistProfile getProfile()
Returns the current profile
Note, that profile may be out of sync as various editors may use the same profile to store custom properties. Call updateProfile() to perform a profile update

Returns:
the current profile
See Also:
setProfile(AlchemistProfile profile), updateProfile()

addElement

protected void addElement(ConfigElement element)
Adds the clone of the element to the right list

Parameters:
element - is the element to be cloned

removeElement

protected void removeElement(ConfigElement element)
Removes element from the right list

Parameters:
t - is the element to be removed

clear

public void clear()
elementves all elements from the right list


readConfiguration

public void readConfiguration(AbstractConfigurationReader reader)
Reads a configuration provided by reader

Parameters:
reader - is the configuration reader

readConfiguration

public void readConfiguration(AbstractConfigurationReader reader,
                              java.lang.String[] groupFilter)
Reads a configuration provided by reader and filter. To read ungrouped items as well, add an empty string ("") into the filter.
Note: if group filtering is not supported by reader, all items will be read.

Parameters:
reader - is the configuration reader
groupFilter - is an array of group names

writeConfiguration

public void writeConfiguration(AbstractConfigurationWriter writer)
                        throws java.io.IOException
Writes the current configuration with provider writer

Parameters:
writer - is the configuration writer
Throws:
java.io.IOException

getConfiguration

public ConfigElement[] getConfiguration()
Returns the current configuration elements

Returns:
the current configuration elements

isValidConfiguration

public boolean isValidConfiguration()
Returns true if configuration is valid

Returns:
true if configuration is valid

isIgnoreMissingLicense

public boolean isIgnoreMissingLicense()
Returns false when panel is set to mark elements without valid license

Returns:
false when panel is set to mark elements without valid license

setIgnoreMissingLicense

public void setIgnoreMissingLicense(boolean ignoreMissingLicense)
Sets that actions without valid license are marked

Parameters:
ignoreMissingLicense - when set to false, unlicensed actions will be marked

addElementPropertyChangeListener

public void addElementPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener for element property changes

Parameters:
listener - is the PropertyChangeListener to be added

addElementPropertyChangeListener

public void addElementPropertyChangeListener(java.lang.String propertyName,
                                             java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener for a specific element property change

Parameters:
propertyName - is the name of the property listen on
listener - is the PropertyChangeListener to be added

removeElementPropertyChangeListener

public void removeElementPropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from element listener list

Parameters:
listener - is the PropertyChangeListener to be removed

removeElementPropertyChangeListener

public void removeElementPropertyChangeListener(java.lang.String propertyName,
                                                java.beans.PropertyChangeListener listener)
Removes a specific PropertyChangeListener from element listener list

Parameters:
propertyName - is the name of the property that was listened on
listener - is the PropertyChangeListener to be removed

isFileSupportEnabled

public boolean isFileSupportEnabled()
Returns true if file loading support is enabled

Returns:
true if file loading support is enabled

setFileSupportEnabled

public void setFileSupportEnabled(boolean fileSupportEnabled)
Sets file support enabled or disabled

Parameters:
fileSupportEnabled -

getOpenFileAction

public javax.swing.Action getOpenFileAction()
Returns the Action associated with open file event, or null if no Action

Returns:
the Action associated with open file event, or null if no Action

setOpenFileAction

public void setOpenFileAction(javax.swing.Action openFileAction)
Sets the Action to be invoked at open file event

Parameters:
openFileAction - is the Action to be invoked at open file

getSaveFileAction

public javax.swing.Action getSaveFileAction()
Returns the Action associated with save file event, or null if no Action

Returns:
the Action associated with save file event, or null if no Action

setSaveFileAction

public void setSaveFileAction(javax.swing.Action saveFileAction)
Sets the Action to be invoked at save file event

Parameters:
saveFileAction - is the Action to be invoked at save file