samples.javaclient.analyzer
Class FavoritesExplorer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bysamples.javaclient.analyzer.CatalogExplorer
                      extended bysamples.javaclient.analyzer.FavoritesExplorer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.dnd.DragGestureListener, java.awt.dnd.DragSourceListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class FavoritesExplorer
extends CatalogExplorer
implements java.awt.event.ActionListener

The Saved Selections tab in the Sidebar. This Explorer is a CatalogExplorer that presents only saved selection objects that are stored in the Catalog. Users can apply a selection to a query in an open crosstab or graph. They can replace the current selection with the saved selection, or they can add the saved selection step to the current selection. The members in the saved selection can be added to the current selection, removed from the current selection, or kept (all others removed) in the current selection.

To apply the selection, the user can drag the selection to the worksheet, double-click the saved selection, or click the Go button.

The setQuery(oracle.dss.dataSource.client.QueryClient) method specifies the query whose selections will be changed by user actions in this Explorer. The Analyzer application calls setQuery whenever the user selects a worksheet to make it the active worksheet.

The applySelection(java.lang.String) method applies the saved selection to the active query.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JComboBox actions
          Drop-down list for what to do with the selected members.
private static java.lang.String ADD
          "Add saved selection" text for the actions combo box.
private static java.lang.String APPLY_BUTTON_TEXT
          Text for the Go button.
private static java.lang.String FAVORITE_INVALID
          Text to display when user tries to apply a selection to the wrong dimension.
private static java.lang.String FAVORITES_DESCRIPTION
          Instruction text.
private static java.lang.String FAVORITES_NOT_AVAILABLE
          Text to display when no worksheets are open.
private static java.lang.String KEEP
          "Keep saved selection" text for the actions combo box.
private  javax.swing.JButton m_applyButton
          Go button.
private  java.awt.event.MouseAdapter m_listener
          Mouse listener for double-clicks in the tree.
private  oracle.dss.dataSource.client.QueryClient m_query
          The active query, which is modified when the user clicks Go or drags a selection to a worksheet.
private static java.lang.String OPTION_TITLE
          Label for the actions combo box: "Update selected document:"
private static java.lang.String REMOVE
          "Remove saved selection" text for the actions combo box.
private static java.lang.String REPLACE
          "Replace with saved selection" text for the actions combo box.
 
Fields inherited from class samples.javaclient.analyzer.CatalogExplorer
 
Fields inherited from class javax.swing.JPanel
 
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.Container
 
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
FavoritesExplorer()
          Constuctor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Responds to user clicks in this Explorer.
 void addFavoritesListener()
          Adds a listener for mouse events in the JTree.
 void applySelection(java.lang.String favoriteName)
          Applies the specified saved selection to the related query.
 oracle.dss.dataSource.client.QueryClient getQuery()
          Gets the query for this Explorer.
 void initializeExplorer()
          Initializes the user interface for this Explorer.
 void setMDRoot(oracle.dss.metadataManager.common.MDRoot root)
          Sets the root folder for this Explorer, without populating the JTree.
 void setMetadataManager(oracle.dss.metadataManager.client.MetadataManager mm)
          Sets the MetadataManager for this Explorer.
 void setQuery(oracle.dss.dataSource.client.QueryClient query)
          Sets the active query for this Explorer.
 
Methods inherited from class samples.javaclient.analyzer.CatalogExplorer
addListeners, dragDropEnd, dragEnter, dragExit, dragGestureRecognized, dragOver, dropActionChanged, getBasicAttributes, getDescription, getDragSource, getExplorerType, getFilter, getJTree, getMDRoot, getMetadataManager, getNotAvailableText, populateTree, refreshTree, setBasicAttributes, setDescription, setDragSource, setExplorerType, setFilter, setMDRoot, setNotAvailable, setNotAvailableText
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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

m_query

private oracle.dss.dataSource.client.QueryClient m_query
The active query, which is modified when the user clicks Go or drags a selection to a worksheet.


APPLY_BUTTON_TEXT

private static final java.lang.String APPLY_BUTTON_TEXT
Text for the Go button.

See Also:
Constant Field Values

FAVORITES_DESCRIPTION

private static final java.lang.String FAVORITES_DESCRIPTION
Instruction text. Currently not displayed.

See Also:
Constant Field Values

REPLACE

private static final java.lang.String REPLACE
"Replace with saved selection" text for the actions combo box.

See Also:
Constant Field Values

ADD

private static final java.lang.String ADD
"Add saved selection" text for the actions combo box.

See Also:
Constant Field Values

KEEP

private static final java.lang.String KEEP
"Keep saved selection" text for the actions combo box.

See Also:
Constant Field Values

REMOVE

private static final java.lang.String REMOVE
"Remove saved selection" text for the actions combo box.

See Also:
Constant Field Values

OPTION_TITLE

private static final java.lang.String OPTION_TITLE
Label for the actions combo box: "Update selected document:"

See Also:
Constant Field Values

FAVORITES_NOT_AVAILABLE

private static final java.lang.String FAVORITES_NOT_AVAILABLE
Text to display when no worksheets are open.

See Also:
Constant Field Values

FAVORITE_INVALID

private static final java.lang.String FAVORITE_INVALID
Text to display when user tries to apply a selection to the wrong dimension.

See Also:
Constant Field Values

m_listener

private java.awt.event.MouseAdapter m_listener
Mouse listener for double-clicks in the tree.


actions

private javax.swing.JComboBox actions
Drop-down list for what to do with the selected members. Users can add, keep, or remove saved selections, or replace the current selection with the saved selection.


m_applyButton

private javax.swing.JButton m_applyButton
Go button.

Constructor Detail

FavoritesExplorer

public FavoritesExplorer()
Constuctor. This constructor:
  1. Calls the CatalogExplorer's constructor.
  2. Sets attributes so that it displays only saved selections.
  3. Specifies "not available" text and sets the Explorer as not available.
  4. Adds this class as an action listener to the Go button.

Method Detail

setMDRoot

public void setMDRoot(oracle.dss.metadataManager.common.MDRoot root)
Sets the root folder for this Explorer, without populating the JTree. The tree is populated after the query is set.

Overrides:
setMDRoot in class CatalogExplorer
Parameters:
root - The root folder.

setMetadataManager

public void setMetadataManager(oracle.dss.metadataManager.client.MetadataManager mm)
Sets the MetadataManager for this Explorer. Analyzer.initializeUI calls this method to set the application's MetadataManager on this Explorer. This Explorer uses the MetadataManager to get information about the dimensions in the query.

Overrides:
setMetadataManager in class CatalogExplorer
Parameters:
mm - MetadataManager that the application uses.
See Also:
Analyzer.initializeUI()

setQuery

public void setQuery(oracle.dss.dataSource.client.QueryClient query)
Sets the active query for this Explorer. Saved selections that the user chooses in this Explorer will be applied to this query. If the query is null, then the panel is disabled. If the query changes from null to a non-null query, then this method initializes the Explorer tree.

The Analyzer.setActiveWorksheet method calls this method when the user selects a worksheet. The Analyzerz.disconnectCleanUp method calls this method to set the query to null.

Parameters:
query - The query for this Explorer.
See Also:
Analyzer.disconnectCleanUp(), Analyzer.setActiveWorksheet(samples.javaclient.analyzer.Worksheet)

initializeExplorer

public void initializeExplorer()
Initializes the user interface for this Explorer. This method:
  1. Sets the text on the Go button.
  2. Sets the choices in the Add, Replace, Keep, or Remove combo box.
  3. Adds the combo box and the Go button to the panel.


getQuery

public oracle.dss.dataSource.client.QueryClient getQuery()
Gets the query for this Explorer. This is the query whose selections are altered by the user's interaction with this Explorer.

Returns:
The query for this Explorer.

addFavoritesListener

public void addFavoritesListener()
Adds a listener for mouse events in the JTree. This listener processes double-clicks on a saved selection by applying the selection.

See Also:
applySelection(java.lang.String)

applySelection

public void applySelection(java.lang.String favoriteName)
Applies the specified saved selection to the related query. This method retrieves the saved selection from the Catalog. It checks the actions JComboBox to see whether the user wants to replace the current selection, add to the current selection, remove from the current selection, keep members from the current selection.

If the user has selected replacing, then this method removes all steps from the selection and adds the saved selection step to the selection.

If the user has selected adding, keeping, or removing, then this method adds the saved selection step to the current selection, with the selected action.

The actionPerformed method calls this method.

Parameters:
favoriteName - The name of the favorite to apply on the dataview
See Also:
actions, actionPerformed(java.awt.event.ActionEvent)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Responds to user clicks in this Explorer. This method responds when a user clicks the Go button.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - Information about the user action.
See Also:
applySelection(java.lang.String)