|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.tentackle.ui.FormPanel
org.tentackle.appworx.AppDbObjectNaviPanel
public class AppDbObjectNaviPanel
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.
| 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SHOW_CANCEL
public static final int SHOW_SELECT
public static final int SHOW_CLOSE
public static final int SHOW_BUTTONS
public static final int SHOW_NOBUTTON
public static final String ACTION_SELECT
public static final String ACTION_CANCEL
public static final String ACTION_CLOSE
public static final int VIEW_CURRENT
public static final int VIEW_TREE
public static final int VIEW_LIST
| Constructor Detail |
|---|
public AppDbObjectNaviPanel(List<? extends AppDbObject> list,
Class[] selectClasses,
int buttonMode,
boolean showTable,
String tableName)
list - the list of objectsselectClasses - 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 viewtableName - the preferences tablename, null if preferences by getFormTableName() from 1st object in list
public AppDbObjectNaviPanel(List<? extends AppDbObject> list,
Class[] selectClasses,
int buttonMode,
boolean showTable)
list - the list of objectsselectClasses - 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
public AppDbObjectNaviPanel(List<? extends AppDbObject> list,
Class[] selectClasses)
list - the list of objectsselectClasses - the class allowed to select, null = nothing selectable (view only)public AppDbObjectNaviPanel(List<? extends AppDbObject> list)
list - the list of objects
public AppDbObjectNaviPanel(AppDbObject obj,
Class[] selectClasses,
int buttonMode,
boolean showTable,
String tableName)
obj - the database objectselectClasses - 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 viewtableName - the preferences tablename, null if preferences object
public AppDbObjectNaviPanel(AppDbObject obj,
Class[] selectClasses,
int buttonMode,
boolean showTable)
obj - the database objectselectClasses - 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
public AppDbObjectNaviPanel(AppDbObject obj,
Class[] selectClasses)
obj - the database objectselectClasses - the class allowed to select, null = nothing selectable (view only)public AppDbObjectNaviPanel(AppDbObject obj)
obj - the database objectpublic AppDbObjectNaviPanel()
| Method Detail |
|---|
public void setTableIntro(String tableIntro)
tableIntro - the table intro text, null if nonepublic String getTableIntro()
public void setTableTitle(String tableTitle)
tableTitle - the table title, null if nonepublic String getTableTitle()
public Class<? extends AppDbObject> getTableClass()
public void setSelectClasses(Class[] selectClasses)
If there are already objects selected their selections will be cleared.
selectClasses - the classes, null if nonepublic Class[] getSelectClasses()
public void setPopupEnabled(boolean enabled)
enabled - true if allow popup menu (default)public boolean isPopupEnabled()
public void requestFocusForFirstItem()
public void scrollToFirstItem()
public List<? extends AppDbObject> getObjects()
public void setObjects(List<? extends AppDbObject> list,
int viewMode)
list - the list of objectsviewMode - is VIEW_CURRENT to keep current view, else VIEW_TREE or VIEW_LIST
to rebuild the view as a tree or table
public void setObjects(List<? extends AppDbObject> list,
boolean rebuildView)
list - the list of objectsrebuildView - is true to rebuild the view, false if keep itpublic void setObjects(List<? extends AppDbObject> list)
list - the list of objectspublic int getViewMode()
VIEW_.... (CURRENT means: nothing at all)public boolean isAutoPack()
public void setAutoPack(boolean autoPack)
autoPack - true to pack the parent window if view is updated, default is falsepublic void setButtonMode(int buttonMode)
buttonMode - sets the buttons (see SHOW_... above)public int getButtonMode()
SHOW_... above)public void setCancelButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isCancelButtonVisible()
public void setSelectButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isSelectButtonVisible()
public void setCloseButtonVisible(boolean visible)
visible - is true if visible, false if notpublic boolean isCloseButtonVisible()
public void setup(List<? extends AppDbObject> list,
Class[] selectClasses,
int buttonMode,
boolean showTable,
String tableName)
list - is the initial list of objects to be shownselectClasses - are the classes allowed to be selectedbuttonMode - tells what buttons are visible/invisible (one of SHOW_...)showTable - is true if initially show the table view, false = tree viewtableName - is != null if preferences not by getFormTableName() from 1st object in listpublic FormButton getCancelButton()
public FormButton getSelectButton()
public void setListSelectionMode(int mode)
mode - the list selection mode from ListSelectionModelListSelectionModel,
TreeSelectionModelpublic void setTreeSelectionMode(int mode)
mode - the list selection mode from TreeSelectionModelListSelectionModel,
TreeSelectionModelpublic AppDbObjectTree getNaviTree()
public FormTable getNaviTable()
public void clearSelection()
public void listUpdated()
public void addSelectionInterval(int firstIndex,
int lastIndex)
firstIndex - the index of the first object in the current list of objectslastIndex - the index of the last object in the current list of objects
public void removeSelectionInterval(int firstIndex,
int lastIndex)
firstIndex - the index of the first object in the current list of objectslastIndex - the index of the last object in the current list of objectspublic void scrollToIndex(int index)
index - the index of the object in the current list of objectspublic void setDisposeKeyEnabled(boolean enabled)
enabled - true to enable, false to disablepublic boolean isDisposeKeyEnabled()
public void addListSelectionListener(ListSelectionListener listener)
listener - the listener to addpublic void removeListSelectionListener(ListSelectionListener listener)
listener - the listener to removepublic AppDbObject getSelectedObject()
public List<AppDbObject> getSelectedObjects()
public void keyTyped(KeyEvent e)
java.awt.event.KeyListenerKeyEvent for a definition of
a key typed event.
keyTyped in interface KeyListenerpublic void keyPressed(KeyEvent e)
java.awt.event.KeyListenerKeyEvent for a definition of
a key pressed event.
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
java.awt.event.KeyListenerKeyEvent for a definition of
a key released event.
keyReleased in interface KeyListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||