com.groovemanager.gui.custom.controls
Class BooleanControlComposite

java.lang.Object
  extended by com.groovemanager.gui.custom.CustomComposite
      extended by com.groovemanager.gui.custom.controls.BooleanControlComposite
All Implemented Interfaces:
ControlContainer

public class BooleanControlComposite
extends CustomComposite
implements ControlContainer

This class is used to make a BooleanControl editable for the user

Author:
Manu Robledo

Field Summary
private  boolean auto
          Indicates whether auto-apply is set to on or off
private  javax.sound.sampled.BooleanControl control
          The BooleanControl represented by this Composite
private  org.eclipse.swt.widgets.Button first
          Button for true value
private  org.eclipse.swt.widgets.Button second
          Button for true value
 
Constructor Summary
BooleanControlComposite(javax.sound.sampled.BooleanControl control, org.eclipse.swt.widgets.Composite parent)
          Construct a new BooleanControlComposite using SWT.NONE style constant
BooleanControlComposite(javax.sound.sampled.BooleanControl control, org.eclipse.swt.widgets.Composite parent, int style)
          Construct a new BooleanControlComposite
 
Method Summary
 void apply()
          Appl the changes made by the user to the underlying Control instance
protected  org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent, int style)
          This method is to be overwritten by concrete subclasses to create the real contents of this CustomComposite
protected  int[] getListenerTypes()
          For all types of listeners that should be possible to add to this Composite directly, the corresponding SWT.* constant should be contained in the returned Array.
protected  int getPossibleStyles()
          Get a combination of all allowed SWT.* style constants
 void reset()
          Reset the GUI elements to the value of the underlying Control instance
 void setAutoApply(boolean auto)
          Set this Container into auto-apply mode or out of auto-apply mode.
 
Methods inherited from class com.groovemanager.gui.custom.CustomComposite
addListener, checkStyle, getComposite, getData, getListeners, getParent, removeListener, setData, setLayoutData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

auto

private boolean auto
Indicates whether auto-apply is set to on or off


control

private javax.sound.sampled.BooleanControl control
The BooleanControl represented by this Composite


first

private org.eclipse.swt.widgets.Button first
Button for true value


second

private org.eclipse.swt.widgets.Button second
Button for true value

Constructor Detail

BooleanControlComposite

public BooleanControlComposite(javax.sound.sampled.BooleanControl control,
                               org.eclipse.swt.widgets.Composite parent)
Construct a new BooleanControlComposite using SWT.NONE style constant

Parameters:
control - The BooleanControl to edit
parent - The parent Composite

BooleanControlComposite

public BooleanControlComposite(javax.sound.sampled.BooleanControl control,
                               org.eclipse.swt.widgets.Composite parent,
                               int style)
Construct a new BooleanControlComposite

Parameters:
control - The BooleanControl to edit
parent - The parent Composite
style - Combination of SWT.* style constants
Method Detail

apply

public void apply()
Description copied from interface: ControlContainer
Appl the changes made by the user to the underlying Control instance

Specified by:
apply in interface ControlContainer
See Also:
ControlContainer.apply()

createComposite

protected org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent,
                                                            int style)
Description copied from class: CustomComposite
This method is to be overwritten by concrete subclasses to create the real contents of this CustomComposite

Specified by:
createComposite in class CustomComposite
Parameters:
parent - The parent Composite under which this Composite should be created
style - Combination of valid SWT.* style constants
Returns:
The new created main composite
See Also:
CustomComposite.createComposite(org.eclipse.swt.widgets.Composite, int)

getListenerTypes

protected int[] getListenerTypes()
Description copied from class: CustomComposite
For all types of listeners that should be possible to add to this Composite directly, the corresponding SWT.* constant should be contained in the returned Array.

Specified by:
getListenerTypes in class CustomComposite
Returns:
An Array of SWT.* constants defining the set of listeners types applicable to this Composite
See Also:
CustomComposite.getListenerTypes()

getPossibleStyles

protected int getPossibleStyles()
Description copied from class: CustomComposite
Get a combination of all allowed SWT.* style constants

Specified by:
getPossibleStyles in class CustomComposite
Returns:
A combination of all allowed style constants, for example SWT.BORDER | SWT.LEFT | SWT.BORDER
See Also:
CustomComposite.getPossibleStyles()

reset

public void reset()
Description copied from interface: ControlContainer
Reset the GUI elements to the value of the underlying Control instance

Specified by:
reset in interface ControlContainer
See Also:
ControlContainer.reset()

setAutoApply

public void setAutoApply(boolean auto)
Description copied from interface: ControlContainer
Set this Container into auto-apply mode or out of auto-apply mode. In auto-apply mode all changes made by the user will be directly made to the underlying Control instance

Specified by:
setAutoApply in interface ControlContainer
Parameters:
auto - true if auto-apply should be turned on, false otherwise
See Also:
ControlContainer.setAutoApply(boolean)