Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.javatools.ui
Class TriStateButtonModel

java.lang.Object
  extended by javax.swing.DefaultButtonModel
      extended by javax.swing.JToggleButton.ToggleButtonModel
          extended by oracle.javatools.ui.TriStateButtonModel
All Implemented Interfaces:
java.awt.ItemSelectable, java.io.Serializable, javax.swing.ButtonModel

public class TriStateButtonModel
extends javax.swing.JToggleButton.ToggleButtonModel

A button model that has an extra state "Partial" to indicate a state between selected and unselected. Is subverts the isArmed and isRollover states of the standard toggle button model to create the partial state.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.DefaultButtonModel
actionCommand, ARMED, changeEvent, ENABLED, group, listenerList, mnemonic, PRESSED, ROLLOVER, SELECTED, stateMask
 
Constructor Summary
TriStateButtonModel()
           
 
Method Summary
 boolean canUserSetPartial()
           
 boolean getDirection()
           
 boolean isPartial()
           
 void setCanUserSetPartial(boolean userCanSetPartial)
           
 void setDirection(boolean directionTruePartialFalse)
          Set the order of the partial state when cycling through the states.
 void setPartial(boolean isPartial)
           
 void setPressed(boolean b)
          When the button is pressed, cycle the model to the next state.
 void setSelected(boolean b)
           
 
Methods inherited from class javax.swing.JToggleButton.ToggleButtonModel
isSelected
 
Methods inherited from class javax.swing.DefaultButtonModel
addActionListener, addChangeListener, addItemListener, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setRollover
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TriStateButtonModel

public TriStateButtonModel()
Method Detail

isPartial

public boolean isPartial()

setPartial

public void setPartial(boolean isPartial)

setPressed

public void setPressed(boolean b)
When the button is pressed, cycle the model to the next state. The node cannot be cycled to the partial state, only out of it.

Specified by:
setPressed in interface javax.swing.ButtonModel
Overrides:
setPressed in class javax.swing.JToggleButton.ToggleButtonModel
Parameters:
b -

setSelected

public void setSelected(boolean b)
Specified by:
setSelected in interface javax.swing.ButtonModel
Overrides:
setSelected in class javax.swing.JToggleButton.ToggleButtonModel

setCanUserSetPartial

public void setCanUserSetPartial(boolean userCanSetPartial)
Parameters:
userCanSetPartial - if true then then the partial state will be cycled through as the user clicks repeatedly on the checkbox. If false the checkbox will cycle from true to false and back again just like a regular checkbox.

canUserSetPartial

public boolean canUserSetPartial()
Returns:
whether the user can change the state of the checkbox to the partial state by clicking on it.

setDirection

public void setDirection(boolean directionTruePartialFalse)
Set the order of the partial state when cycling through the states.

Parameters:
directionTruePartialFalse - if true then the Partial state will appear when changing from true to false. If false the Partial state will appear when changing from false to true.

getDirection

public boolean getDirection()
Returns:
true if the Partial state appears immediately after the True state.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.