de.jaret.util.ui.table.util.action
Class ConfigureColumnsAction

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.jface.action.AbstractAction
          extended by org.eclipse.jface.action.Action
              extended by de.jaret.util.ui.table.util.action.ConfigureColumnsAction
All Implemented Interfaces:
org.eclipse.jface.action.IAction

public class ConfigureColumnsAction
extends org.eclipse.jface.action.Action

Action for configuring column display. Showing a dialog to reorder and change the visibility of rows. The action can be parametrized to disallow manipulating the positions and visibility of fixed columns. The table will be manipoulated instantly. Values will be saved to allow cancelling the configuration.

Version:
$Id: ConfigureColumnsAction.java 355 2007-04-09 13:54:05Z olk $
Author:
Peter Kliem

Nested Class Summary
 class ConfigureColumnsAction.ColTableContentProvider
          Content provider for the table viewer.
 class ConfigureColumnsAction.ColTableLabelProvider
          Labelprovider for the table viewer.
 
Field Summary
protected  boolean _allowFixedColumns
          if true fixed columns can be shifted or changed in visibility.
protected  org.eclipse.jface.viewers.CheckboxTableViewer _chkBoxViewer
          checkbox table viewer used to display the columns.
protected  java.util.List<IColumn> _saveOrder
          saved order for doing a proper cancel operation.
protected  java.util.Map<IColumn,java.lang.Boolean> _saveVisibility
          saved visibility for the columns for proper cancel action.
protected  JaretTable _table
          table the action is operating on.
protected  ITableViewState _tvs
          the table viewstate.
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
ConfigureColumnsAction(JaretTable table)
          Construct the action (allowFixedColumns defaults to true).
ConfigureColumnsAction(JaretTable table, boolean allowFixedColumns)
          Construct the action.
 
Method Summary
 java.lang.String getText()
          
 void run()
          
 void setTable(JaretTable table)
          Set the table to operate on.
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

_table

protected JaretTable _table
table the action is operating on.


_tvs

protected ITableViewState _tvs
the table viewstate.


_chkBoxViewer

protected org.eclipse.jface.viewers.CheckboxTableViewer _chkBoxViewer
checkbox table viewer used to display the columns.


_saveOrder

protected java.util.List<IColumn> _saveOrder
saved order for doing a proper cancel operation.


_saveVisibility

protected java.util.Map<IColumn,java.lang.Boolean> _saveVisibility
saved visibility for the columns for proper cancel action.


_allowFixedColumns

protected boolean _allowFixedColumns
if true fixed columns can be shifted or changed in visibility.

Constructor Detail

ConfigureColumnsAction

public ConfigureColumnsAction(JaretTable table,
                              boolean allowFixedColumns)
Construct the action.

Parameters:
table - table to operate on
allowFixedColumns - if true fixed columns can be changed in visibility and position (moving them out of the fixed position)

ConfigureColumnsAction

public ConfigureColumnsAction(JaretTable table)
Construct the action (allowFixedColumns defaults to true).

Parameters:
table - table to operate on
Method Detail

setTable

public void setTable(JaretTable table)
Set the table to operate on.

Parameters:
table - table

run

public void run()

Specified by:
run in interface org.eclipse.jface.action.IAction
Overrides:
run in class org.eclipse.jface.action.Action

getText

public java.lang.String getText()

Specified by:
getText in interface org.eclipse.jface.action.IAction
Overrides:
getText in class org.eclipse.jface.action.Action


Copyright © 2012. All Rights Reserved.