JIDE 3.5.15

com.jidesoft.pivot
Class FieldBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.AbstractButton
                  extended by javax.swing.JButton
                      extended by com.jidesoft.swing.JideButton
                          extended by com.jidesoft.swing.HeaderBox
                              extended by 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

Nested Class Summary
 class FieldBox.ArrowIcon
           
 
Nested classes/interfaces inherited from class javax.swing.JButton
JButton.AccessibleJButton
 
Nested classes/interfaces inherited from class javax.swing.AbstractButton
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener
 
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
protected  Object HIDE_POPUP_KEY
           
static String PROPERTY_ASCENDING
           
static String PROPERTY_FILTER
           
static String PROPERTY_FILTER_BUTTON_VISIBLE
           
static String PROPERTY_POSSIBLE_VALUES
           
static String PROPERTY_SELECTED_POSSIBLE_VALUES
           
static String PROPERTY_SORT_ARROW_VISIBLE
           
static String PROPERTY_SORT_BY
           
static String PROPERTY_SORT_ORDER
           
 
Fields inherited from class com.jidesoft.swing.HeaderBox
CLIENT_PROPERTY_TABLE_CELL_EDITOR
 
Fields inherited from class com.jidesoft.swing.JideButton
CLIENT_PROPERTY_HIDE_POPUPMENU, PROPERTY_ALWAYS_SHOW_HYPERLINK
 
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 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.jidesoft.swing.Alignable
PROPERTY_ORIENTATION
 
Fields inherited from interface com.jidesoft.swing.ButtonStyle
BUTTON_STYLE_PROPERTY, CLIENT_PROPERTY_SEGMENT_POSITION, FLAT_STYLE, HYPERLINK_STYLE, SEGMENT_POSITION_FIRST, SEGMENT_POSITION_LAST, SEGMENT_POSITION_MIDDLE, SEGMENT_POSITION_ONLY, TOOLBAR_STYLE, TOOLBOX_STYLE
 
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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
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()
          Gets the filter button visible flag.
 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)
          Sets the filter button visible flag.
 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.HeaderBox
getUIClassID
 
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.JButton
getAccessibleContext, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jidesoft.swing.AlignmentSupport
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 

Field Detail

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
Constructor Detail

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)
Method Detail

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()
Gets the filter button visible flag.

Returns:
true if the filter button should be visible always or on mouse over. Otherwise false.

setFilterButtonVisible

public void setFilterButtonVisible(boolean filterButtonVisible)
Sets the filter button visible flag.

If PivotTablePane.isShowFilterButtonsOnMouseOver() returns false, this flag itself controls the visibility of the filter button. However, if PivotTablePane.isShowFilterButtonsOnMouseOver() returns true, this flag just means that if the filter button could be visible when the mouse is over the FieldBox.

Parameters:
filterButtonVisible - the flag
See Also:
PivotTablePane.isShowFilterButtonsOnMouseOver()

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()

JIDE 3.5.15