Enterprise Information Portal APIs

com.ibm.mm.beans.gui
Class CMBFolderViewer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ibm.mm.beans.gui.CMBFolderViewer
All Implemented Interfaces:
javax.accessibility.Accessible, CMBViewFolderListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class CMBFolderViewer
extends javax.swing.JPanel
implements CMBViewFolderListener

The CMBFolderViewer bean displays a panel which provides a Windows Explorer-style presentation of folders and their contents, with a tree view of the folders in a pane on the left, and a notebook of tables with details of documents within the selected folder in a pane on the right. The two panes are separated by a resizable splitter.

Tree Pane

The tree pane contains a main folder for each folder being viewed. Beneath each of these folders are folders for each nested folder (if any).

Details Pane

The details pane contains a notebook, with a table for each index class/server the items are indexed under. The tab has the name:

index class @ server
where index class is the name of the index class and server is the name of the server. Within each page of the notebook is a table displaying the documents and folders within the selected folder. The columns of the table change to display the attributes according to the index class on the selected notebook tab. This arrangement allows the attributes of all the documents and folders within the selected folder to be examined.

Popup Menus

When a right click is performed on a column heading, a popup menu appears with the following selections:

When a right click is performed on a folder or document, a popup menu appears with the following selections:

This popup menu can be supressed by calling setDefaultPopupEnabled(false). A CMBItemPopupEvent will be generated instead. This event can be used to display a custom popup menu.

Double-Click Action

The double-click action on a folder in the tree pane or item in the details pane will cause the same action as the "View" menu item. If the popup menu for items is being suppressed, a CMBItemActionEvent will be generated.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int SORT_ASCENDING
          Used as an argument to the sort() method.
static int SORT_DESCENDING
          Used as an argument to the sort() method.
 
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 com.ibm.mm.beans.gui.CMBViewFolderListener
copyright
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CMBFolderViewer()
           
 
Method Summary
 void addEditItemAttributesListener(CMBEditItemAttributesListener listener)
          Adds the specified listener to receive Edit Item Attributes events.
 void addFolderActionListener(CMBFolderActionListener listener)
          Adds the specified listener to receive Folder Action events.
 void addFolderPopupListener(CMBFolderPopupListener listener)
          Adds the specified listener to receive Folder Popup events.
 void addFolderSelectedListener(CMBFolderSelectedListener listener)
          Adds the specified listener to receive Folder Selected events.
 void addHelpListener(CMBHelpListener listener)
          Adds the specified listener to receive Help events.
 void addItemActionListener(CMBItemActionListener listener)
          Adds the specified listener to receive Item Action events.
 void addItemPopupListener(CMBItemPopupListener listener)
          Adds the specified listener to receive Item Popup events.
 void addItemSelectedListener(CMBItemSelectedListener listener)
          Adds the specified listener to receive Item Selected events.
 void addViewDocumentListener(CMBViewDocumentListener listener)
          Adds the specified listener to receive View Document events.
 void addViewVersionsListener(CMBViewVersionsListener listener)
          Adds the specified listener to receive View Versions events.
 int getCollationStrength()
          Gets the collation strength, which determines the exactness of comparisons when sorting items in the table
 CMBConnection getConnection()
          Gets the CMBConnection bean associated with this folder viewer.
 CMBItem[] getFolders()
          Gets the CMBItem objects representing the folders being displayed.
 java.awt.Color getLineContrastColor()
          Gets the line contrast Color property.
 CMBItem getSelectedFolder()
          Gets the CMBItem object representing the folder selected in the tree pane.
 CMBItem getSelectedItem()
          Gets the selected item in the details pane (single-select) or the first selected item (multi-select).
 CMBItem[] getSelectedItems()
          Gets the selected items in the details pane.
 int getTreePaneWidth()
          Gets the width of the tree pane.
 boolean isDefaultPopupEnabled()
          Determines if the default popup menu will appear when the user clicks on items in the details pane.
 boolean isDetailsHorizontalLinesVisible()
          Determines if horizontal lines are showing between items in the details pane.
 boolean isDetailsVerticalLinesVisible()
          Determines if vertical lines are showing between columns in the details pane.
 boolean isMultiSelectEnabled()
          Determines if multiple selection of items in the details pane is allowed.
 boolean isTableLineContrast()
          Gets the value of line contrast property.
 void onViewFolder(CMBViewFolderEvent event)
          Implementation of CMBViewFolderListener, to simplify connecting to the CMBSearchResultsViewer bean.
 void refresh()
          Restores template display fields to sizes/position as specified in the search template.
 void removeEditItemAttributesListener(CMBEditItemAttributesListener listener)
          Removes the specified listener so that it no longer receives Edit Item Attributes events.
 void removeFolderActionListener(CMBFolderActionListener listener)
          Removes the specified listener so that it no longer receives Folder Action events.
 void removeFolderPopupListener(CMBFolderPopupListener listener)
          Removes the specified listener so that it no longer receives Folder Popup events.
 void removeFolderSelectedListener(CMBFolderSelectedListener listener)
          Removes the specified listener so that it no longer receives Folder Selected events.
 void removeHelpListener(CMBHelpListener listener)
          Removes the specified listener so that it no longer receives Help events.
 void removeItemActionListener(CMBItemActionListener listener)
          Removes the specified listener so that it no longer receives Item Action events.
 void removeItemPopupListener(CMBItemPopupListener listener)
          Removes the specified listener so that it no longer receives I tem Popup events.
 void removeItemSelectedListener(CMBItemSelectedListener listener)
          Removes the specified listener so that it no longer receives Item Selected events.
 void removeViewDocumentListener(CMBViewDocumentListener listener)
          Removes the specified listener so that it no longer receives View Document events.
 void removeViewVersionsListener(CMBViewVersionsListener listener)
          Removes the specified listener so that it no longer receives View Versions events.
 void restoreConfiguration(java.util.Properties properties)
          Restores the column sizes and ordering by template, as well as the size of the tree pane.
 void saveConfiguration(java.util.Properties properties)
          Saves the column sizes and ordering by template, as well as the size of the tree pane.
 void setBackground(java.awt.Color newColor)
          Overridden to set background of contained controls
 void setCollationStrength(int newStrength)
          Sets the collation strength, which determines the exactness of comparisons when sorting items in the table
 void setConnection(CMBConnection newConnection)
          Sets the CMBConnection bean associated with this folder viewer.
 void setCursor(java.awt.Cursor newCursor)
          Overridden to set cursor of contained controls
 void setDefaultPopupEnabled(boolean newValue)
          Sets if the default popup menu will appear when the user clicks on items in the details pane.
 void setDetailsHorizontalLinesVisible(boolean newValue)
          Sets if horizontal lines are shown between items in the details pane.
 void setDetailsVerticalLinesVisible(boolean newValue)
          Sets if vertical lines are shown between columns in the details pane.
 void setEnabled(boolean newEnable)
          Overridden to disable contained controls
 void setFolders(CMBItem[] newFolders)
          Sets the folders being displayed.
 void setFont(java.awt.Font newFont)
          Overridden to set font of contained controls
 void setForeground(java.awt.Color newColor)
          Overridden to set foreground of contained controls
 void setLineContrastColor(java.awt.Color newColor)
          Sets the line contrast Color property.
 void setMultiSelectEnabled(boolean newValue)
          Sets if multiple selection of items in the details pane is allowed.
 void setOpaque(boolean newOpaque)
          Overridden to set opaque on contained controls
 void setSelectedFolder(CMBItem newFolder)
          Sets the folder selected in the tree pane.
 void setSelectedItem(CMBItem newItem)
          Set the selected item in the details pane.
 void setSelectedItems(CMBItem[] newItems)
          Sets the selected items in the details pane.
 void setTableLineContrast(boolean newVal)
          Sets the value of line contrast property.
 void setToolTipText(java.lang.String newTooltip)
          Overridden to set tooltip text on contained controls
 void setTreePaneWidth(int newWidth)
          Sets the width of the tree pane.
 void sort(java.lang.String field, int order)
          Sorts the list in the details pane by a field in ascending or descending order.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SORT_ASCENDING

public static final int SORT_ASCENDING
Used as an argument to the sort() method. Indicates that the sort should be performed in ascending order.

SORT_DESCENDING

public static final int SORT_DESCENDING
Used as an argument to the sort() method. Indicates that the sort should be performed in descending order.
Constructor Detail

CMBFolderViewer

public CMBFolderViewer()
Method Detail

isTableLineContrast

public boolean isTableLineContrast()
Gets the value of line contrast property. This indicates whether rows in the JTable should be set to contrasting colors to improve readability

setTableLineContrast

public void setTableLineContrast(boolean newVal)
Sets the value of line contrast property. This indicates whether rows in the JTable should be set to contrasting colors to improve readability

getLineContrastColor

public java.awt.Color getLineContrastColor()
Gets the line contrast Color property. This indicates the color to use in painting the contrasting rows in the JTable when the tableLineContrast property is true. If the tableLineContrast property is false, this setting is ignored.

setLineContrastColor

public void setLineContrastColor(java.awt.Color newColor)
Sets the line contrast Color property. This indicates the color to use in painting the contrasting rows in the JTable when the tableLineContrast property is true. If the tableLineContrast property is false, this setting is ignored.

getTreePaneWidth

public int getTreePaneWidth()
Gets the width of the tree pane. If the tree pane is not showing, the value returned will be the width of the tree pane the last time it was visible or was set.

setTreePaneWidth

public void setTreePaneWidth(int newWidth)
Sets the width of the tree pane.

getConnection

public CMBConnection getConnection()
Gets the CMBConnection bean associated with this folder viewer.

setConnection

public void setConnection(CMBConnection newConnection)
Sets the CMBConnection bean associated with this folder viewer.

getFolders

public CMBItem[] getFolders()
Gets the CMBItem objects representing the folders being displayed.

setFolders

public void setFolders(CMBItem[] newFolders)
Sets the folders being displayed.
Parameters:
newFolders - the CMBItem objects representing the folders to display.

onViewFolder

public void onViewFolder(CMBViewFolderEvent event)
Implementation of CMBViewFolderListener, to simplify connecting to the CMBSearchResultsViewer bean.
Specified by:
onViewFolder in interface CMBViewFolderListener

getSelectedFolder

public CMBItem getSelectedFolder()
Gets the CMBItem object representing the folder selected in the tree pane. If the "Search Results" folder is selected, null is returned.

setSelectedFolder

public void setSelectedFolder(CMBItem newFolder)
Sets the folder selected in the tree pane.
Parameters:
newFolder - the CMBItem object for the folder to select. If this is not a folder within the selection results, the selection is not changed.

getSelectedItem

public CMBItem getSelectedItem()
Gets the selected item in the details pane (single-select) or the first selected item (multi-select).

setSelectedItem

public void setSelectedItem(CMBItem newItem)
Set the selected item in the details pane.
Parameters:
newItem - the CMBItem object for the item to select. If this is not an item in the currently displayed table, the selection is not changed. An item of null will deselect any selected item(s).

getSelectedItems

public CMBItem[] getSelectedItems()
Gets the selected items in the details pane.

setSelectedItems

public void setSelectedItems(CMBItem[] newItems)
Sets the selected items in the details pane.
Parameters:
newItems - the CMBItem objects for the items to select. If an item or items are not in the currently displayed table, the selection is cleared.

getCollationStrength

public int getCollationStrength()
Gets the collation strength, which determines the exactness of comparisons when sorting items in the table

setCollationStrength

public void setCollationStrength(int newStrength)
Sets the collation strength, which determines the exactness of comparisons when sorting items in the table

isDetailsHorizontalLinesVisible

public boolean isDetailsHorizontalLinesVisible()
Determines if horizontal lines are showing between items in the details pane.

setDetailsHorizontalLinesVisible

public void setDetailsHorizontalLinesVisible(boolean newValue)
Sets if horizontal lines are shown between items in the details pane.

isDetailsVerticalLinesVisible

public boolean isDetailsVerticalLinesVisible()
Determines if vertical lines are showing between columns in the details pane.

setDetailsVerticalLinesVisible

public void setDetailsVerticalLinesVisible(boolean newValue)
Sets if vertical lines are shown between columns in the details pane.

isMultiSelectEnabled

public boolean isMultiSelectEnabled()
Determines if multiple selection of items in the details pane is allowed.

setMultiSelectEnabled

public void setMultiSelectEnabled(boolean newValue)
Sets if multiple selection of items in the details pane is allowed.

isDefaultPopupEnabled

public boolean isDefaultPopupEnabled()
Determines if the default popup menu will appear when the user clicks on items in the details pane.

setDefaultPopupEnabled

public void setDefaultPopupEnabled(boolean newValue)
Sets if the default popup menu will appear when the user clicks on items in the details pane.

refresh

public void refresh()
Restores template display fields to sizes/position as specified in the search template. Note: To have this reflect current values on the federated database, a CMBSchemaManagement.clearSchemaCache() should be performed first.

sort

public void sort(java.lang.String field,
                 int order)
Sorts the list in the details pane by a field in ascending or descending order.
Parameters:
field - the name of a column. This must the name of one of the columns currently displayed in the details pane.
order - the order of the sort. Must be either SORT_ASCENDING or SORT_DESCENDING.

saveConfiguration

public void saveConfiguration(java.util.Properties properties)
Saves the column sizes and ordering by template, as well as the size of the tree pane. The values are saved in Java properties format.

restoreConfiguration

public void restoreConfiguration(java.util.Properties properties)
Restores the column sizes and ordering by template, as well as the size of the tree pane. The input stream is assumed to be Java properties format as created using saveConfiguration. Any properties not related to the search results viewer are ignored.

addFolderSelectedListener

public void addFolderSelectedListener(CMBFolderSelectedListener listener)
Adds the specified listener to receive Folder Selected events.

removeFolderSelectedListener

public void removeFolderSelectedListener(CMBFolderSelectedListener listener)
Removes the specified listener so that it no longer receives Folder Selected events.

addFolderPopupListener

public void addFolderPopupListener(CMBFolderPopupListener listener)
Adds the specified listener to receive Folder Popup events.

removeFolderPopupListener

public void removeFolderPopupListener(CMBFolderPopupListener listener)
Removes the specified listener so that it no longer receives Folder Popup events.

addFolderActionListener

public void addFolderActionListener(CMBFolderActionListener listener)
Adds the specified listener to receive Folder Action events.

removeFolderActionListener

public void removeFolderActionListener(CMBFolderActionListener listener)
Removes the specified listener so that it no longer receives Folder Action events.

addItemSelectedListener

public void addItemSelectedListener(CMBItemSelectedListener listener)
Adds the specified listener to receive Item Selected events.

removeItemSelectedListener

public void removeItemSelectedListener(CMBItemSelectedListener listener)
Removes the specified listener so that it no longer receives Item Selected events.

addItemPopupListener

public void addItemPopupListener(CMBItemPopupListener listener)
Adds the specified listener to receive Item Popup events.

removeItemPopupListener

public void removeItemPopupListener(CMBItemPopupListener listener)
Removes the specified listener so that it no longer receives I tem Popup events.

addItemActionListener

public void addItemActionListener(CMBItemActionListener listener)
Adds the specified listener to receive Item Action events.

removeItemActionListener

public void removeItemActionListener(CMBItemActionListener listener)
Removes the specified listener so that it no longer receives Item Action events.

addViewDocumentListener

public void addViewDocumentListener(CMBViewDocumentListener listener)
Adds the specified listener to receive View Document events.

removeViewDocumentListener

public void removeViewDocumentListener(CMBViewDocumentListener listener)
Removes the specified listener so that it no longer receives View Document events.

addViewVersionsListener

public void addViewVersionsListener(CMBViewVersionsListener listener)
Adds the specified listener to receive View Versions events.
Since:
8.1

removeViewVersionsListener

public void removeViewVersionsListener(CMBViewVersionsListener listener)
Removes the specified listener so that it no longer receives View Versions events.
Since:
8.1

addEditItemAttributesListener

public void addEditItemAttributesListener(CMBEditItemAttributesListener listener)
Adds the specified listener to receive Edit Item Attributes events.

removeEditItemAttributesListener

public void removeEditItemAttributesListener(CMBEditItemAttributesListener listener)
Removes the specified listener so that it no longer receives Edit Item Attributes events.

addHelpListener

public void addHelpListener(CMBHelpListener listener)
Adds the specified listener to receive Help events.

removeHelpListener

public void removeHelpListener(CMBHelpListener listener)
Removes the specified listener so that it no longer receives Help events.

setForeground

public void setForeground(java.awt.Color newColor)
Overridden to set foreground of contained controls
Overrides:
setForeground in class javax.swing.JComponent

setBackground

public void setBackground(java.awt.Color newColor)
Overridden to set background of contained controls
Overrides:
setBackground in class javax.swing.JComponent

setFont

public void setFont(java.awt.Font newFont)
Overridden to set font of contained controls
Overrides:
setFont in class javax.swing.JComponent

setCursor

public void setCursor(java.awt.Cursor newCursor)
Overridden to set cursor of contained controls
Overrides:
setCursor in class java.awt.Component

setOpaque

public void setOpaque(boolean newOpaque)
Overridden to set opaque on contained controls
Overrides:
setOpaque in class javax.swing.JComponent

setToolTipText

public void setToolTipText(java.lang.String newTooltip)
Overridden to set tooltip text on contained controls
Overrides:
setToolTipText in class javax.swing.JComponent

setEnabled

public void setEnabled(boolean newEnable)
Overridden to disable contained controls
Overrides:
setEnabled in class javax.swing.JComponent

EIP JavaBeans

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.