org.pietschy.command

Class ToggleGroupController


public class ToggleGroupController
extends java.lang.Object

GUI Commands Copyright 2004 Andrew Pietsch Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. $Id: ToggleGroupController.java,v 1.2 2005/09/18 00:37:18 pietschy Exp $

Constructor Summary

ToggleGroupController()

Method Summary

void
add(ToggleCommand command)
void
handleSelectionRequest(ToggleCommand toggleCommand, boolean selected)
Handles a particular selection request on a particular command.
boolean
isEmptySelectionAllowed()
Checks if this groups allows empty selection.
boolean
isExclusive()
void
remove(ToggleCommand command)
void
setEmptySelectionAllowed(boolean emptySelectionAllowed)
Sets if this groups allows empty selection.
void
setExclusive(boolean exclusive)

Constructor Details

ToggleGroupController

public ToggleGroupController()

Method Details

add

public void add(ToggleCommand command)

handleSelectionRequest

public void handleSelectionRequest(ToggleCommand toggleCommand,
                                   boolean selected)
Handles a particular selection request on a particular command.
Parameters:
toggleCommand - the command that has been selected
selected - the new state of the command.

isEmptySelectionAllowed

public boolean isEmptySelectionAllowed()
Checks if this groups allows empty selection.
Returns:
true if the group allows empty selection, false if there must always be at least on selected command.

isExclusive

public boolean isExclusive()

remove

public void remove(ToggleCommand command)

setEmptySelectionAllowed

public void setEmptySelectionAllowed(boolean emptySelectionAllowed)
Sets if this groups allows empty selection.
Parameters:
emptySelectionAllowed - true if the group should allow empty selection, false if there must always be at least on selected command.

setExclusive

public void setExclusive(boolean exclusive)