|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.dataselectors.dataitems.DataItemSelector
public class DataItemSelector
The DataItemSelector provides a user interface for dynamically changing items assigned to query roles.
The selector includes a dual-tree selector for displaying the available and selected items, and a text area to display a description of an item (if available).
With OLAP queries, the selector includes a dropdown list for selecting the roles to assign items to, a dropdown list to set the available tree display to an alphabetical or by item type view, and a Move Item button that allows the user to quickly move items in the selected tree to the opposite role. Note: This implementation currently only supports the Row and Column roles.
With relational queries, the selector includes radio buttons that allow the user to set the query type to view either a detail (shows all rows in the dataset) or a grouped report.
Field Summary | |
---|---|
protected javax.swing.JRadioButton |
detailRadioButton
The radio button for setting the query type to Detail |
protected DualTreeSelector |
dualSelector
The dual tree selector component used to select items for the query |
protected javax.swing.JRadioButton |
groupByRadioButton
The radio button for setting the query type to Group By |
protected javax.swing.JPanel |
lowerPanel
A panel containing the viewItemsPanel and the positionPanel |
protected javax.swing.JPanel |
messagePanel
The panel containing the message text area |
protected javax.swing.JTextArea |
messageTextArea
The text area used to display descriptions of items in the dual selector |
protected DataItemSelectorInterface |
model
The selector data model |
protected javax.swing.JButton |
moveItemButton
The Move Item button used to move selected items between role nodes |
protected javax.swing.JPanel |
positionPanel
The panel containing the Move Item button |
protected javax.swing.JPanel |
querySelectionPanel
The main selector panel |
protected javax.swing.JLabel |
queryTypeLabel
The Query Type label |
protected javax.swing.JPanel |
queryTypePanel
The panel containing the Query Type radio buttons |
protected javax.swing.JComboBox |
roleComboBox
The role selection combobox |
protected javax.swing.JLabel |
roleLabel
The label for the role selection combobox |
protected javax.swing.JPanel |
sourceContainer
The dualSelector container above the available tree containing the role selection combobox |
protected javax.swing.JComboBox |
viewItemsComboBox
The View Items combobox used to set the available tree display type |
protected javax.swing.JLabel |
viewItemsLabel
The label for the View Items combobox |
protected javax.swing.JPanel |
viewItemsPanel
The container for the View Items combobox |
Fields inherited from class com.sas.swing.visuals.dataselectors.BaseSwingSelectorPanel |
---|
command, contentsValid, selectorModel, wasCancelled |
Fields inherited from interface com.sas.swing.visuals.util.LayoutConstants |
---|
DOTS_BUTTON_INSETS, EMPTY_INSETS, HGAP, HMARGIN, INDENTED_BORDER, TAB_BORDER, TEXTFIELD_INSETS, VGAP, VMARGIN |
Fields inherited from interface com.sas.swing.visuals.PanelInterface |
---|
CONTENTS_VALID_PROPERTY |
Constructor Summary | |
---|---|
DataItemSelector()
Default constructor |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Responds to events fired by the role selection combobox, the view items by combobox, the Move Item button, and the query type radio buttons. |
protected void |
addListeners()
Sets the appropriate components as listeners for events fired from the selector. |
protected void |
createComponents()
Creates all of the components of the selector, sets the component properties, and creates the layout for the selector. |
java.lang.String |
getDialogTitle()
Returns a title for this panel that should be displayed on a dialog's title bar. |
void |
onApply()
This method is called when the OK button is clicked. |
void |
setRoleComboBoxModel()
Creates and sets the combobox model for the role selection combobox. |
void |
setSelectorModel(java.lang.Object model)
Sets the selector data model and selector component properties that depend on OLAP or relational models. |
void |
setTreeModels()
Creates and sets the tree models for the available and selected trees of the dual tree selector, expands the folder nodes in the available model, expands the selected role node in the selected tree model, and turns off multiple selection for OLAP queries. |
void |
treeNodesChanged(javax.swing.event.TreeModelEvent e)
Defined in javax.tree.event.TreeModelListener, but not implemented in this class |
void |
treeNodesInserted(javax.swing.event.TreeModelEvent e)
Responds to events fired when nodes are inserted into the selected tree. |
void |
treeNodesRemoved(javax.swing.event.TreeModelEvent e)
Responds to events fired when nodes are removed from the selected tree. |
void |
treeStructureChanged(javax.swing.event.TreeModelEvent e)
Defined in javax.tree.event.TreeModelListener, but not implemented in this class |
void |
valueChanged(javax.swing.event.TreeSelectionEvent e)
Receives and processes TreeSelectionEvents to enable or disable the Move Item button and set the item description in the text entry area. |
Methods inherited from class com.sas.swing.visuals.dataselectors.BaseSwingSelectorPanel |
---|
getCommand, getHelpID, getPanel, getSelectorModel, getTabTitle, isContentsValid, isYesNo, onCancel, onClose, setCommand, setContentsValid |
Methods inherited from interface com.sas.dataselectors.DataSelectorInterface |
---|
isVisible, setVisible |
Field Detail |
---|
protected javax.swing.JLabel roleLabel
protected javax.swing.JComboBox roleComboBox
protected DualTreeSelector dualSelector
protected javax.swing.JLabel viewItemsLabel
protected javax.swing.JComboBox viewItemsComboBox
protected javax.swing.JButton moveItemButton
protected javax.swing.JTextArea messageTextArea
protected javax.swing.JLabel queryTypeLabel
protected javax.swing.JRadioButton groupByRadioButton
protected javax.swing.JRadioButton detailRadioButton
protected DataItemSelectorInterface model
protected javax.swing.JPanel querySelectionPanel
protected javax.swing.JPanel lowerPanel
protected javax.swing.JPanel sourceContainer
protected javax.swing.JPanel viewItemsPanel
protected javax.swing.JPanel positionPanel
protected javax.swing.JPanel messagePanel
protected javax.swing.JPanel queryTypePanel
Constructor Detail |
---|
public DataItemSelector()
Method Detail |
---|
protected void createComponents()
public void onApply()
onApply
in interface PanelInterface
onApply
in class BaseSwingSelectorPanel
protected void addListeners()
public void setSelectorModel(java.lang.Object model)
setSelectorModel
in interface DataSelectorInterface
setSelectorModel
in class BaseSwingSelectorPanel
model
- - the selector data modelDataItemSelectorInterface
public void setRoleComboBoxModel()
DefaultComboBoxModel
public void setTreeModels()
public java.lang.String getDialogTitle()
getDialogTitle
in interface PanelInterface
getDialogTitle
in class BaseSwingSelectorPanel
public void valueChanged(javax.swing.event.TreeSelectionEvent e)
valueChanged
in interface javax.swing.event.TreeSelectionListener
e
- the tree selection eventpublic void actionPerformed(java.awt.event.ActionEvent e)
For the role selection combobox (OLAP only), the node in the selected tree corresponding to the previous role value is collapsed and the node for the new role value is expanded, a new tree model is created for the available tree, and the available and selected trees are repainted.
For View Items By combobox events (OLAP only), a new tree model is created for the available tree to represent the type of view selected by the user. If By Item Type is selected, the category nodes (Hierarchies, Levels, Measures) are expanded. The available tree is then repainted to display the values in the new model.
When an event is received from the Move Item button (OLAP only), the selected node is deleted from its current role node and added to the opposite role node, and new tree models are created for the available and selected trees to display the current items that are available and selected.
Events received for the Query Type radio buttons (relational only) result in a new tree model generated for the available tree. If detail is selected, items in the available tree that do not support detail usage are disabled. If group by is selected, all items in the available tree should be enabled.
actionPerformed
in interface java.awt.event.ActionListener
e
- - the event fired by one of the selector componentsDataItemActionType
public void treeNodesChanged(javax.swing.event.TreeModelEvent e)
treeNodesChanged
in interface javax.swing.event.TreeModelListener
public void treeNodesInserted(javax.swing.event.TreeModelEvent e)
treeNodesInserted
in interface javax.swing.event.TreeModelListener
e
- - the event fired by the selected treeDataItemActionType
,
DataItemSelectorInterface
public void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
treeNodesRemoved
in interface javax.swing.event.TreeModelListener
e
- - the event fired by the selected treeDataItemActionType
,
DataItemSelectorInterface
public void treeStructureChanged(javax.swing.event.TreeModelEvent e)
treeStructureChanged
in interface javax.swing.event.TreeModelListener
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |