it.amattioli.applicate.browsing
Interface GroupBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>

Show UML class diagram
Type Parameters:
I - The class of the group members id
T - The Entity class of the group members
All Superinterfaces:
Browser<I,T>, CommandListener, EventListener, Selector<T>
All Known Implementing Classes:
DefaultGroupBrowser

public interface GroupBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
extends Browser<I,T>, CommandListener

A browser that let you navigate through a set of EntityGroup and its members.

Selection can work in two distinct modes: single and multiple.

In single selection mode every time you select a member using select(Entity) or select(int, int) this will be the only one selected. You can retrieve this selection using Selector.getSelectedObject(). In single mode getSelectedObjects() will always return a list containing one element.

In multiple selection mode each selection will be maintained in a list that can be retrieved using getSelectedObjects() while Selector.getSelectedObject() will retrieve the last selected object. In multiple mode selecting the same object twice will result in deselecting this object

Author:
andrea

Nested Class Summary
static class GroupBrowser.Selection
           
 
Method Summary
 void deselect()
          Removes all the selections
 it.amattioli.dominate.groups.EntityGroup<I,T> getGroup(int index)
          Retrieves the group with a given index inside the getGroups() list.
 List<it.amattioli.dominate.groups.EntityGroup<I,T>> getGroups()
          Retrieves all the available groups
 int getGroupSize(int index)
          Retrieves the size of the group with a given index.
 T getMember(int groupIndex, int memberIndex)
          Retrieves a member of a given group.
 List<Integer> getSelectedGroupsIndex()
          Return the indexes of all the groups that are selected as of isGroupSelected(int)
 List<T> getSelectedObjects()
          Returns a list containing all the selected objects.
 GroupBrowser.Selection getSelection()
          Returns a GroupBrowser.Selection object containing the group and member indexes of the last selected entity.
 List<GroupBrowser.Selection> getSelections()
          Returns a list of GroupBrowser.Selection containing the indexes of all the selected objects.
 boolean isGroupSelected(int index)
          Check if a group is selected.
 boolean isMultiple()
          Check if this browser is in multiple mode
 boolean isSelected(int groupIndex, int memberIndex)
          Check if an entity is selected.
 void select(int groupIndex, int memberIndex)
          Select a member of a group using the group and member index.
 void select(T toBeSelected)
          Select a member of a group.
 void selectGroup(it.amattioli.dominate.groups.EntityGroup<I,T> toBeSelected)
          Select all the members of a group.
 void selectGroup(int index)
          Select all the members of a group.
 void setMultiple(boolean multiple)
          Set the selection mode.
 
Methods inherited from interface it.amattioli.applicate.browsing.Browser
addContentChangeListener, release, removeContentChangeListener
 
Methods inherited from interface it.amattioli.applicate.selection.Selector
addSelectionListener, getSelectedObject, removeSelectionListener
 
Methods inherited from interface it.amattioli.applicate.commands.CommandListener
commandDone
 

Method Detail

getGroups

List<it.amattioli.dominate.groups.EntityGroup<I,T>> getGroups()
Retrieves all the available groups

Returns:
all the available groups

getGroup

it.amattioli.dominate.groups.EntityGroup<I,T> getGroup(int index)
Retrieves the group with a given index inside the getGroups() list.

Parameters:
index - the group index
Returns:
the group with a given index

getGroupSize

int getGroupSize(int index)
Retrieves the size of the group with a given index.

Parameters:
index - the group index
Returns:
the size of the group with the given index

getMember

T getMember(int groupIndex,
            int memberIndex)
Retrieves a member of a given group.

Parameters:
groupIndex - the index of the group inside the getGroups() list
memberIndex - the index of the member inside the group
Returns:
a member of a given group

select

void select(int groupIndex,
            int memberIndex)
Select a member of a group using the group and member index.

Parameters:
groupIndex - the index of the group inside the getGroups() list
memberIndex - the index of the member inside the group

select

void select(T toBeSelected)
Select a member of a group.

Parameters:
toBeSelected - the member to be selected

selectGroup

void selectGroup(int index)
Select all the members of a group.

Parameters:
index - the index of the group inside the getGroups() list

selectGroup

void selectGroup(it.amattioli.dominate.groups.EntityGroup<I,T> toBeSelected)
Select all the members of a group.

Parameters:
toBeSelected - the group to be selected

deselect

void deselect()
Removes all the selections


getSelection

GroupBrowser.Selection getSelection()
Returns a GroupBrowser.Selection object containing the group and member indexes of the last selected entity.

Returns:

getSelections

List<GroupBrowser.Selection> getSelections()
Returns a list of GroupBrowser.Selection containing the indexes of all the selected objects.

In single mode the list will contain only the last selected object.

Returns:

getSelectedObjects

List<T> getSelectedObjects()
Returns a list containing all the selected objects.

In single mode the list will contain only the last selected object.

Returns:

isSelected

boolean isSelected(int groupIndex,
                   int memberIndex)
Check if an entity is selected.

Parameters:
groupIndex - the group index
memberIndex - the index of the member inside the group
Returns:
true if the entity with the given indexes is selected

isGroupSelected

boolean isGroupSelected(int index)
Check if a group is selected. A group is considered selected if all its members are selected.

Parameters:
index - the group index
Returns:
true if the group is selected

getSelectedGroupsIndex

List<Integer> getSelectedGroupsIndex()
Return the indexes of all the groups that are selected as of isGroupSelected(int)

Returns:
the indexes of all the groups that are selected

setMultiple

void setMultiple(boolean multiple)
Set the selection mode. Passing true will set the multiple mode, while passing false will select the single mode.

Parameters:
multiple - true to set the multiple mode, false to set the single mode

isMultiple

boolean isMultiple()
Check if this browser is in multiple mode

Returns:
true if this browser is in multiple mode, false if it is in single mode


Copyright © 2011. All Rights Reserved.