com.google.code.validationframework.swing.resulthandler.bool
Class TabIconBooleanFeedback

java.lang.Object
  extended by com.google.code.validationframework.swing.resulthandler.bool.TabIconBooleanFeedback
All Implemented Interfaces:
com.google.code.validationframework.api.common.Disposable, com.google.code.validationframework.api.resulthandler.ResultHandler<Boolean>

public class TabIconBooleanFeedback
extends Object
implements com.google.code.validationframework.api.resulthandler.ResultHandler<Boolean>, com.google.code.validationframework.api.common.Disposable

Result handler showing an icon in the tab of a specific index inside a tabbed pane.
Note that the tab to which it is attached must already be present in the tabbed pane. This restriction will be lifted out in the future.
Finally, note that any icon set using the method JTabbedPane.setIconAt(int, Icon) will not be shown.


Field Summary
static int DEFAULT_ICON_POSITION
          Default icon position with respect to the tab title.
static int DEFAULT_ICON_TEXT_GAP
          Default spacing between the icon and the tab title.
static Icon DEFAULT_INVALID_ICON
          Default icon to represent invalid results.
static Icon DEFAULT_VALID_ICON
          Default icon to represent valid results.
 
Constructor Summary
TabIconBooleanFeedback(JTabbedPane tabbedPane, int tabIndex)
          Constructor specifying the tabbed pane and the index of the tab to show the decoration on.
The default valid icon and default invalid icons will be used.
TabIconBooleanFeedback(JTabbedPane tabbedPane, int tabIndex, Icon invalidIcon, String invalidText)
          Constructor specifying the tabbed pane, the index of the tab to show the decoration on, the invalid icon and the tooltip text to be shown for the invalid icon.
No valid icon will be shown.
TabIconBooleanFeedback(JTabbedPane tabbedPane, int tabIndex, Icon validIcon, String validText, Icon invalidIcon, String invalidText)
          Constructor specifying the tabbed pane and the index of the tab to show the decoration on, as well as the icon and tooltip text representing valid and invalid results.
TabIconBooleanFeedback(JTabbedPane tabbedPane, int tabIndex, Icon validIcon, String validText, Icon invalidIcon, String invalidText, int iconPosition, int iconTextGap)
          Constructor specifying the tabbed pane and the index of the tab to show the decoration on, as well as the icon and tooltip text representing valid and invalid results, and the position and spacing of the decoration icon with respect to the tab title.
TabIconBooleanFeedback(JTabbedPane tabbedPane, int tabIndex, String invalidText)
          Constructor specifying the tabbed pane, the index of the tab to show the decoration on, and the tooltip text to be shown for the invalid icon.
No valid icon will be shown, and the default invalid icon will be used.
 
Method Summary
 void dispose()
           
 void handleResult(Boolean result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VALID_ICON

public static final Icon DEFAULT_VALID_ICON
Default icon to represent valid results.


DEFAULT_INVALID_ICON

public static final Icon DEFAULT_INVALID_ICON
Default icon to represent invalid results.


DEFAULT_ICON_POSITION

public static final int DEFAULT_ICON_POSITION
Default icon position with respect to the tab title.

See Also:
Constant Field Values

DEFAULT_ICON_TEXT_GAP

public static final int DEFAULT_ICON_TEXT_GAP
Default spacing between the icon and the tab title.

See Also:
Constant Field Values
Constructor Detail

TabIconBooleanFeedback

public TabIconBooleanFeedback(JTabbedPane tabbedPane,
                              int tabIndex)
Constructor specifying the tabbed pane and the index of the tab to show the decoration on.
The default valid icon and default invalid icons will be used. No tooltip will be shown for these icons.

Parameters:
tabbedPane - Tabbed pane to show the icon tip feedback on.
tabIndex - Index of the tab to show the icon tip feedback on.

TabIconBooleanFeedback

public TabIconBooleanFeedback(JTabbedPane tabbedPane,
                              int tabIndex,
                              String invalidText)
Constructor specifying the tabbed pane, the index of the tab to show the decoration on, and the tooltip text to be shown for the invalid icon.
No valid icon will be shown, and the default invalid icon will be used.

Parameters:
tabbedPane - Tabbed pane to show the icon tip feedback on.
tabIndex - Index of the tab to show the icon tip feedback on.
invalidText - Tooltip text to be shown for the invalid icon, or null.

TabIconBooleanFeedback

public TabIconBooleanFeedback(JTabbedPane tabbedPane,
                              int tabIndex,
                              Icon invalidIcon,
                              String invalidText)
Constructor specifying the tabbed pane, the index of the tab to show the decoration on, the invalid icon and the tooltip text to be shown for the invalid icon.
No valid icon will be shown.

Parameters:
tabbedPane - Tabbed pane to show the icon tip feedback on.
tabIndex - Index of the tab to show the icon tip feedback on.
invalidIcon - Icon representing invalid results, or null.
invalidText - Tooltip text to be shown for the invalid icon, or null.

TabIconBooleanFeedback

public TabIconBooleanFeedback(JTabbedPane tabbedPane,
                              int tabIndex,
                              Icon validIcon,
                              String validText,
                              Icon invalidIcon,
                              String invalidText)
Constructor specifying the tabbed pane and the index of the tab to show the decoration on, as well as the icon and tooltip text representing valid and invalid results.

Parameters:
tabbedPane - Tabbed pane to show the icon tip feedback on.
tabIndex - Index of the tab to show the icon tip feedback on.
validIcon - Icon representing valid results, or null.
validText - Tooltip text on the valid icon explaining the valid results, or null.
invalidIcon - Icon representing invalid results, or null.
invalidText - Tooltip text on the invalid icon explaining the invalid results, or null.

TabIconBooleanFeedback

public TabIconBooleanFeedback(JTabbedPane tabbedPane,
                              int tabIndex,
                              Icon validIcon,
                              String validText,
                              Icon invalidIcon,
                              String invalidText,
                              int iconPosition,
                              int iconTextGap)
Constructor specifying the tabbed pane and the index of the tab to show the decoration on, as well as the icon and tooltip text representing valid and invalid results, and the position and spacing of the decoration icon with respect to the tab title.

Parameters:
tabbedPane - Tabbed pane to show the icon tip feedback on.
tabIndex - Index of the tab to show the icon tip feedback on.
validIcon - Icon representing valid results, or null.
validText - Tooltip text on the valid icon explaining the valid results, or null.
invalidIcon - Icon representing invalid results, or null.
invalidText - Tooltip text on the invalid icon explaining the invalid results, or null.
iconPosition - Position of the icon with respect to the tab title.
It can be SwingConstants.LEADING, SwingConstants.LEFT, SwingConstants.TRAILING or SwingConstants.RIGHT.
iconTextGap - Spacing between the icon and the text.
Method Detail

handleResult

public void handleResult(Boolean result)
Specified by:
handleResult in interface com.google.code.validationframework.api.resulthandler.ResultHandler<Boolean>
See Also:
ResultHandler.handleResult(Object)

dispose

public void dispose()
Specified by:
dispose in interface com.google.code.validationframework.api.common.Disposable
See Also:
Disposable.dispose()


Copyright © 2013. All Rights Reserved.