org.tentackle.appworx
Class AppDbObjectNaviPanel

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 org.tentackle.ui.FormPanel
                      extended by org.tentackle.appworx.AppDbObjectNaviPanel
All Implemented Interfaces:
ContainerListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, FormContainer

public class AppDbObjectNaviPanel
extends FormPanel
implements KeyListener

Panel for object navigation.

The AppDbObjectNaviPanel provides object navigation in a tree and a table in parallel. The user switches between the tree- and the table view. The tree view is primarily for navigation through object relations and operations on objects by means of a context-driven popup menu. The table view is for sorting, building sums, cutting the list and a table popup to export to spreadsheet, xml or print the table. Furthermore, other navigation panels may be created on-the-fly, for example to sum up the details (childs) of a given type for some object within a tree.

Author:
harald
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String ACTION_CANCEL
          "cancel" action
static String ACTION_CLOSE
          "close" action
static String ACTION_SELECT
          "select" action
static int SHOW_BUTTONS
          show default buttons: cancel and select
static int SHOW_CANCEL
          show cancel button
static int SHOW_CLOSE
          show close button
static int SHOW_NOBUTTON
          don't show any button
static int SHOW_SELECT
          show select button
static int VIEW_CURRENT
          current view (don't change)
static int VIEW_LIST
          switch to table/list view
static int VIEW_TREE
          switch to tree view
 
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
AppDbObjectNaviPanel()
          Creates an empty navigation panel.
AppDbObjectNaviPanel(AppDbObject obj)
          Creates a navigation panel for a single object.
The preferences table name is determined by the object.
AppDbObjectNaviPanel(AppDbObject obj, Class[] selectClasses)
          Creates a navigation panel for a single object.
The preferences table name is determined by the object.
AppDbObjectNaviPanel(AppDbObject obj, Class[] selectClasses, int buttonMode, boolean showTable)
          Creates a navigation panel for a single object.
The preferences table name is determined by the object.
AppDbObjectNaviPanel(AppDbObject obj, Class[] selectClasses, int buttonMode, boolean showTable, String tableName)
          Creates a navigation panel for a single object.
AppDbObjectNaviPanel(List<? extends AppDbObject> list)
          Creates a navigation panel.
The preferences table name is determined by the first object.
AppDbObjectNaviPanel(List<? extends AppDbObject> list, Class[] selectClasses)
          Creates a navigation panel.
The preferences table name is determined by the first object.
AppDbObjectNaviPanel(List<? extends AppDbObject> list, Class[] selectClasses, int buttonMode, boolean showTable)
          Creates a navigation panel.
The preferences table name is determined by the first object.
AppDbObjectNaviPanel(List<? extends AppDbObject> list, Class[] selectClasses, int buttonMode, boolean showTable, String tableName)
          Creates a navigation panel.
 
Method Summary
 void addListSelectionListener(ListSelectionListener listener)
          Adds a selection changed listener.
 void addSelectionInterval(int firstIndex, int lastIndex)
          Adds a selection for a given range of objects.
 void clearSelection()
          Clears the selections.
 int getButtonMode()
          Gets the button mode.
 FormButton getCancelButton()
          Gives access to cancel button (to modify the text, i.e.)
 FormTable getNaviTable()
          Gives access to the table list.
 AppDbObjectTree getNaviTree()
          Gives access to the navigation tree.
 List<? extends AppDbObject> getObjects()
          Gets the current list of objects shown.
 FormButton getSelectButton()
          Gives access to select button (to modify the text, i.e.)
 Class[] getSelectClasses()
          Gets the classes of objects that are allowed to select.
 AppDbObject getSelectedObject()
          Gets the selected object.
 List<AppDbObject> getSelectedObjects()
          Gets all selected objects.
 Class<? extends AppDbObject> getTableClass()
          Gets the class of objects which is shown in the table.
 String getTableIntro()
          Gets the table intro text.
 String getTableTitle()
          Gets the table's title.
 int getViewMode()
          Gets the current viewmode
 boolean isAutoPack()
          Gets the pack mode.
 boolean isCancelButtonVisible()
          Gets the visibility of the cancel button.
 boolean isCloseButtonVisible()
          Gets the visibility of the select button.
 boolean isDisposeKeyEnabled()
          Returns whether the dispose key is enabled.
 boolean isPopupEnabled()
          Returns whether popup menu is allowed in the tree view.
 boolean isSelectButtonVisible()
          Gets the visibility of the select button.
 void keyPressed(KeyEvent e)
          Invoked when a key has been pressed.
 void keyReleased(KeyEvent e)
          Invoked when a key has been released.
 void keyTyped(KeyEvent e)
          Invoked when a key has been typed.
 void listUpdated()
          Notifies the navigation panel that the list of objects or objects within the list have changed and the view needs to be updated.
 void removeListSelectionListener(ListSelectionListener listener)
          Removes a selection changed listener.
 void removeSelectionInterval(int firstIndex, int lastIndex)
          Removes a selection for a given range of objects.
 void requestFocusForFirstItem()
          Requests the focus for the first object, whether list- or tree-view.
 void scrollToFirstItem()
          Scrolls to the first object, whether list- or tree-view.
 void scrollToIndex(int index)
          Scrolls to object at given index.
 void setAutoPack(boolean autoPack)
          Sets the pack mode.
 void setButtonMode(int buttonMode)
          Sets the button mode.
 void setCancelButtonVisible(boolean visible)
          Sets the visibility of the cancel button.
 void setCloseButtonVisible(boolean visible)
          Sets the visibility of the select button.
 void setDisposeKeyEnabled(boolean enabled)
          Sets whether the cancel/dispose-key is enabled.
If this key is pressed when tree or table has the focus the enclosing window is disposed.
 void setListSelectionMode(int mode)
          Sets the list selection mode.
 void setObjects(List<? extends AppDbObject> list)
          Replaces the current list of objects and updates the view.
 void setObjects(List<? extends AppDbObject> list, boolean rebuildView)
          Replaces the current list of objects and updates the view.
 void setObjects(List<? extends AppDbObject> list, int viewMode)
          Replaces the current list of objects and updates the view.
 void setPopupEnabled(boolean enabled)
          Allow/disallow popup-menu in the tree view.
 void setSelectButtonVisible(boolean visible)
          Sets the visibility of the select button.
 void setSelectClasses(Class[] selectClasses)
          Sets the classes of objects that are allowed to select.
 void setTableIntro(String tableIntro)
          Sets the table's intro-text that appears on the first page of the printout, usually the selection criteria from a qbfparameter.
 void setTableTitle(String tableTitle)
          Sets the table's title-text that appears on the printout.
 void setTreeSelectionMode(int mode)
          Sets the tree selection mode.
 void setup(List<? extends AppDbObject> list, Class[] selectClasses, int buttonMode, boolean showTable, String tableName)
          setup panel
 
Methods inherited from class org.tentackle.ui.FormPanel
addActionListener, areValuesChanged, componentAdded, componentRemoved, fireActionPerformed, getFormValues, getHelpURL, getParentWindow, getTitle, invalidateParentInfo, isAllChangeable, isHonourAllChangeable, removeActionListener, saveValues, setAllChangeable, setFormValues, setFormValuesKeepChanged, setHelpURL, setHonourAllChangeable, setTitle, showHelp, triggerValuesChanged
 
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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

SHOW_CANCEL

public static final int SHOW_CANCEL
show cancel button

See Also:
Constant Field Values

SHOW_SELECT

public static final int SHOW_SELECT
show select button

See Also:
Constant Field Values

SHOW_CLOSE

public static final int SHOW_CLOSE
show close button

See Also:
Constant Field Values

SHOW_BUTTONS

public static final int SHOW_BUTTONS
show default buttons: cancel and select

See Also:
Constant Field Values

SHOW_NOBUTTON

public static final int SHOW_NOBUTTON
don't show any button

See Also:
Constant Field Values

ACTION_SELECT

public static final String ACTION_SELECT
"select" action

See Also:
Constant Field Values

ACTION_CANCEL

public static final String ACTION_CANCEL
"cancel" action

See Also:
Constant Field Values

ACTION_CLOSE

public static final String ACTION_CLOSE
"close" action

See Also:
Constant Field Values

VIEW_CURRENT

public static final int VIEW_CURRENT
current view (don't change)

See Also:
Constant Field Values

VIEW_TREE

public static final int VIEW_TREE
switch to tree view

See Also:
Constant Field Values

VIEW_LIST

public static final int VIEW_LIST
switch to table/list view

See Also:
Constant Field Values
Constructor Detail

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(List<? extends AppDbObject> list,
                            Class[] selectClasses,
                            int buttonMode,
                            boolean showTable,
                            String tableName)
Creates a navigation panel.

Parameters:
list - the list of objects
selectClasses - the class allowed to select, null = nothing selectable (view only)
buttonMode - the visibility of buttons, one of SHOW_...
showTable - true if initially show the table view, false = tree view
tableName - the preferences tablename, null if preferences by getFormTableName() from 1st object in list

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(List<? extends AppDbObject> list,
                            Class[] selectClasses,
                            int buttonMode,
                            boolean showTable)
Creates a navigation panel.
The preferences table name is determined by the first object.

Parameters:
list - the list of objects
selectClasses - the class allowed to select, null = nothing selectable (view only)
buttonMode - the visibility of buttons, one of SHOW_...
showTable - true if initially show the table view, false = tree view

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(List<? extends AppDbObject> list,
                            Class[] selectClasses)
Creates a navigation panel.
The preferences table name is determined by the first object. The default buttons are shown (select and cancel). The initial view mode is tree-view.

Parameters:
list - the list of objects
selectClasses - the class allowed to select, null = nothing selectable (view only)

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(List<? extends AppDbObject> list)
Creates a navigation panel.
The preferences table name is determined by the first object. The default buttons are shown (select and cancel). The initial view mode is tree-view. Nothing to select.

Parameters:
list - the list of objects

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(AppDbObject obj,
                            Class[] selectClasses,
                            int buttonMode,
                            boolean showTable,
                            String tableName)
Creates a navigation panel for a single object.

Parameters:
obj - the database object
selectClasses - the class allowed to select, null = nothing selectable (view only)
buttonMode - the visibility of buttons, one of SHOW_...
showTable - true if initially show the table view, false = tree view
tableName - the preferences tablename, null if preferences object

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(AppDbObject obj,
                            Class[] selectClasses,
                            int buttonMode,
                            boolean showTable)
Creates a navigation panel for a single object.
The preferences table name is determined by the object.

Parameters:
obj - the database object
selectClasses - the class allowed to select, null = nothing selectable (view only)
buttonMode - the visibility of buttons, one of SHOW_...
showTable - true if initially show the table view, false = tree view

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(AppDbObject obj,
                            Class[] selectClasses)
Creates a navigation panel for a single object.
The preferences table name is determined by the object. The default buttons are shown (select and cancel). The initial view mode is tree-view.

Parameters:
obj - the database object
selectClasses - the class allowed to select, null = nothing selectable (view only)

AppDbObjectNaviPanel

public AppDbObjectNaviPanel(AppDbObject obj)
Creates a navigation panel for a single object.
The preferences table name is determined by the object. The default buttons are shown (select and cancel). The initial view mode is tree-view. Nothing to select.

Parameters:
obj - the database object

AppDbObjectNaviPanel

public AppDbObjectNaviPanel()
Creates an empty navigation panel. This constructor makes it a bean.

Method Detail

setTableIntro

public void setTableIntro(String tableIntro)
Sets the table's intro-text that appears on the first page of the printout, usually the selection criteria from a qbfparameter. Must be invoked before setObjects().

Parameters:
tableIntro - the table intro text, null if none

getTableIntro

public String getTableIntro()
Gets the table intro text.

Returns:
the intro text, null if none

setTableTitle

public void setTableTitle(String tableTitle)
Sets the table's title-text that appears on the printout. Must be invoked before setObjects().

Parameters:
tableTitle - the table title, null if none

getTableTitle

public String getTableTitle()
Gets the table's title.

Returns:
the title, null if none

getTableClass

public Class<? extends AppDbObject> getTableClass()
Gets the class of objects which is shown in the table.

Returns:
the database object class, null if not determined yet

setSelectClasses

public void setSelectClasses(Class[] selectClasses)
Sets the classes of objects that are allowed to select.

If there are already objects selected their selections will be cleared.

Parameters:
selectClasses - the classes, null if none

getSelectClasses

public Class[] getSelectClasses()
Gets the classes of objects that are allowed to select.

Returns:
the classes, null if none

setPopupEnabled

public void setPopupEnabled(boolean enabled)
Allow/disallow popup-menu in the tree view.

Parameters:
enabled - true if allow popup menu (default)

isPopupEnabled

public boolean isPopupEnabled()
Returns whether popup menu is allowed in the tree view.

Returns:
true if allowed (default)

requestFocusForFirstItem

public void requestFocusForFirstItem()
Requests the focus for the first object, whether list- or tree-view.


scrollToFirstItem

public void scrollToFirstItem()
Scrolls to the first object, whether list- or tree-view.


getObjects

public List<? extends AppDbObject> getObjects()
Gets the current list of objects shown.

Returns:
the list of objects

setObjects

public void setObjects(List<? extends AppDbObject> list,
                       int viewMode)
Replaces the current list of objects and updates the view.

Parameters:
list - the list of objects
viewMode - is VIEW_CURRENT to keep current view, else VIEW_TREE or VIEW_LIST to rebuild the view as a tree or table

setObjects

public void setObjects(List<? extends AppDbObject> list,
                       boolean rebuildView)
Replaces the current list of objects and updates the view.

Parameters:
list - the list of objects
rebuildView - is true to rebuild the view, false if keep it

setObjects

public void setObjects(List<? extends AppDbObject> list)
Replaces the current list of objects and updates the view.

Parameters:
list - the list of objects

getViewMode

public int getViewMode()
Gets the current viewmode

Returns:
one of VIEW_.... (CURRENT means: nothing at all)

isAutoPack

public boolean isAutoPack()
Gets the pack mode.

Returns:
true if parent window is packed whenever the view is updated, default is false

setAutoPack

public void setAutoPack(boolean autoPack)
Sets the pack mode.

Parameters:
autoPack - true to pack the parent window if view is updated, default is false

setButtonMode

public void setButtonMode(int buttonMode)
Sets the button mode.

Parameters:
buttonMode - sets the buttons (see SHOW_... above)

getButtonMode

public int getButtonMode()
Gets the button mode.

Returns:
the buttonMode (see SHOW_... above)

setCancelButtonVisible

public void setCancelButtonVisible(boolean visible)
Sets the visibility of the cancel button.

Parameters:
visible - is true if visible, false if not

isCancelButtonVisible

public boolean isCancelButtonVisible()
Gets the visibility of the cancel button.

Returns:
true if visible, false if not

setSelectButtonVisible

public void setSelectButtonVisible(boolean visible)
Sets the visibility of the select button.

Parameters:
visible - is true if visible, false if not

isSelectButtonVisible

public boolean isSelectButtonVisible()
Gets the visibility of the select button.

Returns:
true if visible, false if not

setCloseButtonVisible

public void setCloseButtonVisible(boolean visible)
Sets the visibility of the select button.

Parameters:
visible - is true if visible, false if not

isCloseButtonVisible

public boolean isCloseButtonVisible()
Gets the visibility of the select button.

Returns:
true if visible, false if not

setup

public void setup(List<? extends AppDbObject> list,
                  Class[] selectClasses,
                  int buttonMode,
                  boolean showTable,
                  String tableName)
setup panel

Parameters:
list - is the initial list of objects to be shown
selectClasses - are the classes allowed to be selected
buttonMode - tells what buttons are visible/invisible (one of SHOW_...)
showTable - is true if initially show the table view, false = tree view
tableName - is != null if preferences not by getFormTableName() from 1st object in list

getCancelButton

public FormButton getCancelButton()
Gives access to cancel button (to modify the text, i.e.)

Returns:
the cancel button

getSelectButton

public FormButton getSelectButton()
Gives access to select button (to modify the text, i.e.)

Returns:
the select button

setListSelectionMode

public void setListSelectionMode(int mode)
Sets the list selection mode. The tree selection mode is updated accordingly.

Parameters:
mode - the list selection mode from ListSelectionModel
See Also:
ListSelectionModel, TreeSelectionModel

setTreeSelectionMode

public void setTreeSelectionMode(int mode)
Sets the tree selection mode. The list selection mode is updated accordingly.

Parameters:
mode - the list selection mode from TreeSelectionModel
See Also:
ListSelectionModel, TreeSelectionModel

getNaviTree

public AppDbObjectTree getNaviTree()
Gives access to the navigation tree.

Returns:
the tree, null if not yet created

getNaviTable

public FormTable getNaviTable()
Gives access to the table list.

Returns:
the table, null if not yet created

clearSelection

public void clearSelection()
Clears the selections.


listUpdated

public void listUpdated()
Notifies the navigation panel that the list of objects or objects within the list have changed and the view needs to be updated.


addSelectionInterval

public void addSelectionInterval(int firstIndex,
                                 int lastIndex)
Adds a selection for a given range of objects.

Parameters:
firstIndex - the index of the first object in the current list of objects
lastIndex - the index of the last object in the current list of objects

removeSelectionInterval

public void removeSelectionInterval(int firstIndex,
                                    int lastIndex)
Removes a selection for a given range of objects.

Parameters:
firstIndex - the index of the first object in the current list of objects
lastIndex - the index of the last object in the current list of objects

scrollToIndex

public void scrollToIndex(int index)
Scrolls to object at given index.

Parameters:
index - the index of the object in the current list of objects

setDisposeKeyEnabled

public void setDisposeKeyEnabled(boolean enabled)
Sets whether the cancel/dispose-key is enabled.
If this key is pressed when tree or table has the focus the enclosing window is disposed.

Parameters:
enabled - true to enable, false to disable

isDisposeKeyEnabled

public boolean isDisposeKeyEnabled()
Returns whether the dispose key is enabled.

Returns:
true if enabled

addListSelectionListener

public void addListSelectionListener(ListSelectionListener listener)
Adds a selection changed listener.

Parameters:
listener - the listener to add

removeListSelectionListener

public void removeListSelectionListener(ListSelectionListener listener)
Removes a selection changed listener.

Parameters:
listener - the listener to remove

getSelectedObject

public AppDbObject getSelectedObject()
Gets the selected object. If there are more than one object in the current list of selections, the object "clicked last" is returned.

Returns:
the object, null if nothing selected

getSelectedObjects

public List<AppDbObject> getSelectedObjects()
Gets all selected objects.

Returns:
the list of selected objects, null if nothing selected

keyTyped

public void keyTyped(KeyEvent e)
Description copied from interface: java.awt.event.KeyListener
Invoked when a key has been typed. See the class description for KeyEvent for a definition of a key typed event.

Specified by:
keyTyped in interface KeyListener

keyPressed

public void keyPressed(KeyEvent e)
Description copied from interface: java.awt.event.KeyListener
Invoked when a key has been pressed. See the class description for KeyEvent for a definition of a key pressed event.

Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent e)
Description copied from interface: java.awt.event.KeyListener
Invoked when a key has been released. See the class description for KeyEvent for a definition of a key released event.

Specified by:
keyReleased in interface KeyListener


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de