org.eclipse.nebula.widgets.nattable.persistence.command
Class DisplayPersistenceDialogCommandHandler

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler<DisplayPersistenceDialogCommand>
      extended by org.eclipse.nebula.widgets.nattable.persistence.command.DisplayPersistenceDialogCommandHandler
All Implemented Interfaces:
ILayerCommandHandler<DisplayPersistenceDialogCommand>

public class DisplayPersistenceDialogCommandHandler
extends AbstractLayerCommandHandler<DisplayPersistenceDialogCommand>

Command handler implementation for handling DisplayPersistenceDialogCommands. It is used to open the corresponding dialog for save/load operations regarding the NatTable state. Will also serve as some kind of storage for the Properties instance holding the states.

Author:
Dirk Fauth

Constructor Summary
DisplayPersistenceDialogCommandHandler()
          Create a new DisplayPersistenceDialogCommandHandler.
DisplayPersistenceDialogCommandHandler(NatTable natTable)
          Create a new DisplayPersistenceDialogCommandHandler.
DisplayPersistenceDialogCommandHandler(Properties properties)
          Create a new DisplayPersistenceDialogCommandHandler using the specified Properties instance.
DisplayPersistenceDialogCommandHandler(Properties properties, NatTable natTable)
          Create a new DisplayPersistenceDialogCommandHandler using the specified Properties instance.
 
Method Summary
 void addStateChangeListener(IStateChangedListener listener)
          Add the given IStateChangedListener to the local list of listeners.
protected  boolean doCommand(DisplayPersistenceDialogCommand command)
           
 Class<DisplayPersistenceDialogCommand> getCommandClass()
           
 Properties getProperties()
           
 void removeStateChangeListener(IStateChangedListener listener)
          Removes the given IStateChangedListener from the local list of listeners.
 void setProperties(Properties properties)
           
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler
doCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayPersistenceDialogCommandHandler

public DisplayPersistenceDialogCommandHandler()
Create a new DisplayPersistenceDialogCommandHandler. Using this constructor the Properties instance used for save and load operations will be created. It can be accessed via getProperties() for further usage.


DisplayPersistenceDialogCommandHandler

public DisplayPersistenceDialogCommandHandler(NatTable natTable)
Create a new DisplayPersistenceDialogCommandHandler. Using this constructor the Properties instance used for save and load operations will be created. It can be accessed via getProperties() for further usage. The current state of the given NatTable instance will be used to store a default configuration.

Parameters:
natTable - The NatTable instance for which this handler is registered. If it is not null, the current state of that NatTable will be stored as default configuration. This default configuration can't be modified anymore in the opened dialog.

DisplayPersistenceDialogCommandHandler

public DisplayPersistenceDialogCommandHandler(Properties properties)
Create a new DisplayPersistenceDialogCommandHandler using the specified Properties instance.

Parameters:
properties - The Properties instance that should be used for saving and loading.

DisplayPersistenceDialogCommandHandler

public DisplayPersistenceDialogCommandHandler(Properties properties,
                                              NatTable natTable)
Create a new DisplayPersistenceDialogCommandHandler using the specified Properties instance. The current state of the given NatTable instance will be used to store a default configuration.

Parameters:
properties - The Properties instance that should be used for saving and loading.
natTable - The NatTable instance for which this handler is registered. If it is not null, the current state of that NatTable will be stored as default configuration. This default configuration can't be modified anymore in the opened dialog.
Method Detail

doCommand

protected boolean doCommand(DisplayPersistenceDialogCommand command)
Specified by:
doCommand in class AbstractLayerCommandHandler<DisplayPersistenceDialogCommand>

getProperties

public Properties getProperties()
Returns:
The Properties instance that is used for saving and loading.

setProperties

public void setProperties(Properties properties)
Parameters:
properties - The Properties instance that should be used for saving and loading.

addStateChangeListener

public void addStateChangeListener(IStateChangedListener listener)
Add the given IStateChangedListener to the local list of listeners. The IStateChangedListener will be registered on every PersistenceDialog that is opened via this command handler.

Parameters:
listener - The listener to add.

removeStateChangeListener

public void removeStateChangeListener(IStateChangedListener listener)
Removes the given IStateChangedListener from the local list of listeners.

Parameters:
listener - The listener to remove.

getCommandClass

public Class<DisplayPersistenceDialogCommand> getCommandClass()


Copyright © 2014. All rights reserved.