com.groovemanager.gui.custom
Class InfoGroupContainer

java.lang.Object
  extended by com.groovemanager.gui.custom.InfoGroupContainer

public class InfoGroupContainer
extends java.lang.Object

An InfoGropContainer is needed for showing InfoGorups. When InfoGroups are closed, they are accessible for re-opening in the bottom of the container as a Button

Author:
Manu Robledo

Nested Class Summary
private static class InfoGroupContainer.LabelUpdater
          A Runnable implementation used for Thread-safe updating of Labels
private static class InfoGroupContainer.ProgBarUpdater
          A Runnable implementation used for Thread-safe updating of ProgressBars
private static class InfoGroupContainer.TextUpdater
          A Runnable implementation used for Thread-safe updating of Text fields
 
Field Summary
private  org.eclipse.swt.widgets.Composite buttonComp
          The Composite containing the re-open Buttons
private  java.util.HashMap buttons
          The map containing all re-open Buttons
private  org.eclipse.swt.widgets.Display display
          The Display to use for thread-safe updating
private  org.eclipse.swt.widgets.Group group
          The main group surrounding all
private  org.eclipse.swt.widgets.Composite groupComp
          The Composite containing the InfoGroups
private static InfoGroupContainer.LabelUpdater labelUpdater
          Runnable for Thread-indipendent update operations
private  InfoGroup lastgroup
          The last opened InfoGroup
private static InfoGroupContainer.ProgBarUpdater progBarUpdater
          Runnable for Thread-indipendent update operations
private static InfoGroupContainer.TextUpdater textUpdater
          Runnable for Thread-indipendent update operations
 
Constructor Summary
InfoGroupContainer(org.eclipse.swt.widgets.Composite parent)
          Construct a new InfoGroupContainer without headline
InfoGroupContainer(org.eclipse.swt.widgets.Composite parent, java.lang.String headline)
          Construct a new InfoGroupContainer without headline
 
Method Summary
(package private)  void close(InfoGroup g)
          Close the specified InfoGroup.
 org.eclipse.swt.widgets.Composite getComposite()
          Get the main Composite of this InfoGroupContainer
(package private)  org.eclipse.swt.widgets.Composite getGroupComp()
          Get the Composite which contains the InfoGroup instances
 InfoGroup newGroup(java.lang.String name)
          Create and return a new InfoGroup which is added to this container
(package private)  void open(InfoGroup g)
          Open the specified InfoGroup.
 void update(org.eclipse.swt.widgets.Label l, java.lang.String text)
          Update a Labelīs content.
 void update(org.eclipse.swt.widgets.ProgressBar b, int selection)
          Update a ProgressBar.
 void update(org.eclipse.swt.widgets.ProgressBar b, int min, int max, int selection)
          Update a ProgressBar.
 void update(org.eclipse.swt.widgets.Text t, java.lang.String text)
          Update a Text fieldīs content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buttonComp

private org.eclipse.swt.widgets.Composite buttonComp
The Composite containing the re-open Buttons


buttons

private java.util.HashMap buttons
The map containing all re-open Buttons


display

private final org.eclipse.swt.widgets.Display display
The Display to use for thread-safe updating


group

private org.eclipse.swt.widgets.Group group
The main group surrounding all


groupComp

private org.eclipse.swt.widgets.Composite groupComp
The Composite containing the InfoGroups


labelUpdater

private static final InfoGroupContainer.LabelUpdater labelUpdater
Runnable for Thread-indipendent update operations


lastgroup

private InfoGroup lastgroup
The last opened InfoGroup


progBarUpdater

private static final InfoGroupContainer.ProgBarUpdater progBarUpdater
Runnable for Thread-indipendent update operations


textUpdater

private static final InfoGroupContainer.TextUpdater textUpdater
Runnable for Thread-indipendent update operations

Constructor Detail

InfoGroupContainer

public InfoGroupContainer(org.eclipse.swt.widgets.Composite parent)
Construct a new InfoGroupContainer without headline

Parameters:
parent - The parent Composite

InfoGroupContainer

public InfoGroupContainer(org.eclipse.swt.widgets.Composite parent,
                          java.lang.String headline)
Construct a new InfoGroupContainer without headline

Parameters:
parent - The parent Composite
headline - The headline of this InfoGroupContainer
Method Detail

close

void close(InfoGroup g)
Close the specified InfoGroup. This method is called from the InfoGroup instance when it is closed

Parameters:
g - The InfoGroup being closed

getComposite

public org.eclipse.swt.widgets.Composite getComposite()
Get the main Composite of this InfoGroupContainer

Returns:
This InfoGroupContainerīs main Composite

getGroupComp

org.eclipse.swt.widgets.Composite getGroupComp()
Get the Composite which contains the InfoGroup instances

Returns:
The Composite for creating new InfoGroup instances

newGroup

public InfoGroup newGroup(java.lang.String name)
Create and return a new InfoGroup which is added to this container

Parameters:
name - The name of the group
Returns:
The new created InfoGroup

open

void open(InfoGroup g)
Open the specified InfoGroup. This method is called from the InfoGroup instance when it is opened

Parameters:
g - The InfoGroup being opened

update

public void update(org.eclipse.swt.widgets.Label l,
                   java.lang.String text)
Update a Labelīs content. This method is thread-safe. So it can be called from any Thread, not only the one that created the Label.

Parameters:
l - The Label to update.
text - The new content of the Label

update

public void update(org.eclipse.swt.widgets.ProgressBar b,
                   int selection)
Update a ProgressBar. This method is thread-safe. So it can be called from any Thread, not only the one that created the Text field.

Parameters:
b - The ProgressBar to update
selection - The new value for the ProgressBarīs selection

update

public void update(org.eclipse.swt.widgets.ProgressBar b,
                   int min,
                   int max,
                   int selection)
Update a ProgressBar. This method is thread-safe. So it can be called from any Thread, not only the one that created the Text field.

Parameters:
b - The ProgressBar to update
min - The new value for the ProgressBarīs minimum
max - The new value for the ProgressBarīs maximum
selection - The new value for the ProgressBarīs selection

update

public void update(org.eclipse.swt.widgets.Text t,
                   java.lang.String text)
Update a Text fieldīs content. This method is thread-safe. So it can be called from any Thread, not only the one that created the Text field.

Parameters:
t - The Text field to update
text - The new content of the Text field