com.jidesoft.pivot
Class FieldBox
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
com.jidesoft.swing.JideButton
com.jidesoft.swing.HeaderBox
com.jidesoft.pivot.FieldBox
- All Implemented Interfaces:
- Alignable, AlignmentSupport, ButtonStyle, ComponentStateSupport, ImageObserver, ItemSelectable, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, SwingConstants
public class FieldBox
- extends HeaderBox
- implements PropertyChangeListener
The component that represents a field in pivot table.
- See Also:
- Serialized Form
| Fields inherited from class javax.swing.AbstractButton |
actionListener, BORDER_PAINTED_CHANGED_PROPERTY, changeEvent, changeListener, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, itemListener, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, model, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
|
Constructor Summary |
FieldBox()
Creates a button with no set text or icon. |
FieldBox(PivotField field)
|
FieldBox(PivotField field,
boolean sortArrowVisible,
boolean filterButtonVisible)
|
FieldBox(PivotField field,
Icon icon)
|
FieldBox(PivotField field,
String title)
|
FieldBox(PivotField field,
String title,
Icon icon)
|
FieldBox(PivotField field,
String title,
Icon icon,
boolean sortArrowVisible,
boolean filterButtonVisible)
|
FieldBox(PivotField field,
String title,
Icon icon,
String description,
boolean sortArrowVisible,
boolean filterButtonVisible)
|
|
Method Summary |
void |
addDynamicTableFilter(DynamicTableFilter filter)
Add a DynamicTableFilter. |
protected Point |
calculatePopupLocation(PopupPanel popupPanel)
calculate the popup location. |
protected CustomFilterEditor |
createCustomFilterEditor(FilterFactoryManager filterFactoryManager,
Class<?> type,
ConverterContext converterContext,
Object[] possibleValues)
Creates the CustomFilterEditor used in the FieldBox's custom filter drop down list. |
protected AbstractButton |
createDefaultButton()
Creates the default combobox button. |
protected PopupPanel |
createPopupPanel(PivotTablePane pivotTablePane,
PivotField field,
Object[] possibleValues)
|
protected JidePopup |
createPopupWindow()
Creates the popup window. |
protected void |
customizePopupWindow(JidePopup popup,
PopupPanel popupPanel)
|
Dimension |
getActualPreferredSize()
|
DynamicTableFilter[] |
getDynamicTableFilters()
Gets all the DynamicTableFilters. |
PivotField |
getField()
|
Filter |
getFilter()
|
PivotTablePane |
getPivotTablePane()
|
Object[] |
getPossibleValues()
|
Dimension |
getPreferredSize()
|
Object[] |
getSelectedPossibleValues()
|
void |
hidePopup()
Causes the combo box to close its popup window. |
protected void |
initComponents(PivotField field,
String text,
Icon icon,
String description,
boolean sortArrowVisible,
boolean filterButtonVisible)
|
protected void |
installListeners()
|
boolean |
isAscending()
|
boolean |
isFilterButtonVisible()
|
boolean |
isPopupVisible()
Determines the visibility of the popup. |
boolean |
isSortArrowVisible()
|
void |
propertyChange(PropertyChangeEvent evt)
|
void |
removeDynamicTableFilter(DynamicTableFilter filter)
Removes a DynamicTableFilter which was added earlier. |
void |
setAscending(boolean ascending)
|
void |
setFilter(Filter filter)
|
void |
setFilterButtonVisible(boolean filterButtonVisible)
|
void |
setFont(Font font)
|
void |
setIcon(Icon icon)
|
void |
setPivotTablePane(PivotTablePane pivotTablePane)
|
void |
setPossibleValues(Object[] possibleValues)
|
void |
setSelectedPossibleValues(Object[] selectedPossibleValues)
|
void |
setSortArrowVisible(boolean sortArrowVisible)
|
void |
setTitle(String title)
|
void |
toggleAscending()
|
protected void |
uninstallListeners()
|
void |
updateFilterIcon()
|
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
| Methods inherited from class com.jidesoft.swing.JideButton |
getBackgroundOfState, getButtonStyle, getDefaultForeground, getForegroundOfState, getOrientation, isAlwaysShowHyperlink, setAlwaysShowHyperlink, setBackgroundOfState, setButtonStyle, setDefaultForeground, setForegroundOfState, setOrientation, setRolloverEnabled, setText, supportHorizontalOrientation, supportVerticalOrientation |
| Methods inherited from class javax.swing.AbstractButton |
actionPropertyChanged, addActionListener, addChangeListener, addImpl, addItemListener, checkHorizontalKey, checkVerticalKey, configurePropertiesFromAction, createActionListener, createActionPropertyChangeListener, createChangeListener, createItemListener, doClick, doClick, fireActionPerformed, fireItemStateChanged, fireStateChanged, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHideActionText, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, init, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, paintBorder, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setEnabled, setFocusPainted, setHideActionText, setHorizontalAlignment, setHorizontalTextPosition, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setUI, setVerticalAlignment, setVerticalTextPosition |
| 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, 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, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, 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, 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, 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, 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 |
PROPERTY_SORT_ARROW_VISIBLE
public static final String PROPERTY_SORT_ARROW_VISIBLE
- See Also:
- Constant Field Values
PROPERTY_FILTER_BUTTON_VISIBLE
public static final String PROPERTY_FILTER_BUTTON_VISIBLE
- See Also:
- Constant Field Values
PROPERTY_ASCENDING
public static final String PROPERTY_ASCENDING
- See Also:
- Constant Field Values
PROPERTY_SORT_ORDER
public static final String PROPERTY_SORT_ORDER
- See Also:
- Constant Field Values
PROPERTY_SORT_BY
public static final String PROPERTY_SORT_BY
- See Also:
- Constant Field Values
PROPERTY_POSSIBLE_VALUES
public static final String PROPERTY_POSSIBLE_VALUES
- See Also:
- Constant Field Values
PROPERTY_SELECTED_POSSIBLE_VALUES
public static final String PROPERTY_SELECTED_POSSIBLE_VALUES
- See Also:
- Constant Field Values
PROPERTY_FILTER
public static final String PROPERTY_FILTER
- See Also:
- Constant Field Values
HIDE_POPUP_KEY
protected Object HIDE_POPUP_KEY
FieldBox
public FieldBox()
- Creates a button with no set text or icon.
FieldBox
public FieldBox(PivotField field)
FieldBox
public FieldBox(PivotField field,
String title)
FieldBox
public FieldBox(PivotField field,
Icon icon)
FieldBox
public FieldBox(PivotField field,
String title,
Icon icon)
FieldBox
public FieldBox(PivotField field,
boolean sortArrowVisible,
boolean filterButtonVisible)
FieldBox
public FieldBox(PivotField field,
String title,
Icon icon,
boolean sortArrowVisible,
boolean filterButtonVisible)
FieldBox
public FieldBox(PivotField field,
String title,
Icon icon,
String description,
boolean sortArrowVisible,
boolean filterButtonVisible)
initComponents
protected void initComponents(PivotField field,
String text,
Icon icon,
String description,
boolean sortArrowVisible,
boolean filterButtonVisible)
installListeners
protected void installListeners()
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Specified by:
propertyChange in interface PropertyChangeListener
addDynamicTableFilter
public void addDynamicTableFilter(DynamicTableFilter filter)
- Add a
DynamicTableFilter. DynamicTableFilter allows to add your own customize filter to
the drop down filter list. Any DynamicTableFilter will become an entry in the list. If user clicks
on that entry, the filter will be used to filter the column. What's special about DynamicTableFilter
is it allows to to create a filter on fly. For example, in initializeFilter method of DynamicTableFilter, you can
pop up a dialog to allow user to select certain information and you return a filter based on user selection.
- Parameters:
filter - a DynamicTableFilter.
removeDynamicTableFilter
public void removeDynamicTableFilter(DynamicTableFilter filter)
- Removes a
DynamicTableFilter which was added earlier.
- Parameters:
filter - a DynamicTableFilter.
getDynamicTableFilters
public DynamicTableFilter[] getDynamicTableFilters()
- Gets all the
DynamicTableFilters.
- Returns:
- an array of
DynamicTableFilters.
updateFilterIcon
public void updateFilterIcon()
uninstallListeners
protected void uninstallListeners()
isSortArrowVisible
public boolean isSortArrowVisible()
setSortArrowVisible
public void setSortArrowVisible(boolean sortArrowVisible)
isFilterButtonVisible
public boolean isFilterButtonVisible()
setFilterButtonVisible
public void setFilterButtonVisible(boolean filterButtonVisible)
setTitle
public void setTitle(String title)
setIcon
public void setIcon(Icon icon)
- Overrides:
setIcon in class JideButton
setFont
public void setFont(Font font)
- Overrides:
setFont in class JComponent
isAscending
public boolean isAscending()
toggleAscending
public void toggleAscending()
setAscending
public void setAscending(boolean ascending)
getPossibleValues
public Object[] getPossibleValues()
setPossibleValues
public void setPossibleValues(Object[] possibleValues)
setSelectedPossibleValues
public void setSelectedPossibleValues(Object[] selectedPossibleValues)
setFilter
public void setFilter(Filter filter)
getSelectedPossibleValues
public Object[] getSelectedPossibleValues()
getFilter
public Filter getFilter()
createDefaultButton
protected AbstractButton createDefaultButton()
- Creates the default combobox button. This method is used only if createButtonComponent() returns null. The idea
is each combobox can implement createButtonComponent() to provide its own button. However the default
implementation should still be the button created by this method.
- Returns:
- the default combobox button.
createPopupWindow
protected JidePopup createPopupWindow()
- Creates the popup window. By default it will create a JidePopup which is not detached and not resizable. Subclass
can override it to create your own JidePopup or customize the default one.
- Returns:
- the popup window.
createPopupPanel
protected PopupPanel createPopupPanel(PivotTablePane pivotTablePane,
PivotField field,
Object[] possibleValues)
createCustomFilterEditor
protected CustomFilterEditor createCustomFilterEditor(FilterFactoryManager filterFactoryManager,
Class<?> type,
ConverterContext converterContext,
Object[] possibleValues)
- Creates the CustomFilterEditor used in the FieldBox's custom filter drop down list.
- Parameters:
filterFactoryManager - the FilterFactoryManager.type - the type.converterContext - the ConverterContext.possibleValues - the possible values.
- Returns:
- a new instance of CustomFilterEditor.
customizePopupWindow
protected void customizePopupWindow(JidePopup popup,
PopupPanel popupPanel)
calculatePopupLocation
protected Point calculatePopupLocation(PopupPanel popupPanel)
- calculate the popup location.
- Parameters:
popupPanel - the PopupPanel
- Returns:
- the location of popup.
hidePopup
public void hidePopup()
- Causes the combo box to close its popup window.
isPopupVisible
public boolean isPopupVisible()
- Determines the visibility of the popup.
- Returns:
- true if the popup is visible, otherwise returns false
getField
public PivotField getField()
getPivotTablePane
public PivotTablePane getPivotTablePane()
setPivotTablePane
public void setPivotTablePane(PivotTablePane pivotTablePane)
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
getPreferredSize in class JComponent
getActualPreferredSize
public Dimension getActualPreferredSize()
updateUI
public void updateUI()
- Description copied from class:
HeaderBox
- Resets the UI property to a value from the current look and feel.
- Overrides:
updateUI in class HeaderBox
- See Also:
JComponent.updateUI()