JXTA

net.jxta.instantp2p.desktop
Class TaskObject

java.lang.Object
  |
  +--net.jxta.instantp2p.desktop.TaskObject
Direct Known Subclasses:
PeerInfoDisplay, RendezVousDisplay

public abstract class TaskObject
extends java.lang.Object
implements java.awt.event.ActionListener

A panel that shows itself in a OptionDialog object if the associated ImageButton was pressed


Field Summary
protected  ApplicationToolbar toolbar
          The ApplicationToolbar that holds this object and is used to supply the current peer and peer group
 
Constructor Summary
TaskObject(java.lang.String imageName, java.lang.String label, ApplicationToolbar bar)
          Creates a new TaskObject
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called if the associated image button is pressed.
abstract  java.awt.Panel showData(net.jxta.peergroup.PeerGroup group, net.jxta.protocol.PeerGroupAdvertisement peer)
          The TaskObject should rerender itself showing information concerning the current peer and peer group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toolbar

protected ApplicationToolbar toolbar
The ApplicationToolbar that holds this object and is used to supply the current peer and peer group
Constructor Detail

TaskObject

public TaskObject(java.lang.String imageName,
                  java.lang.String label,
                  ApplicationToolbar bar)
Creates a new TaskObject
Parameters:
imageName - the image to display on the button. If null, no image is displayed
label - the text displayed on the button. If null, no text is displayed
bar - the ApplicationToolbar object to which to add this task
Method Detail

showData

public abstract java.awt.Panel showData(net.jxta.peergroup.PeerGroup group,
                                        net.jxta.protocol.PeerGroupAdvertisement peer)
The TaskObject should rerender itself showing information concerning the current peer and peer group. The information should be displayed in the returned Panel, which will be displayed in an OptionDialog
Parameters:
group - current peer group
peer - current peer
Returns:
a panel that displays the requested information

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called if the associated image button is pressed. We call showData and then add this panel to an OptionDialog and show it.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the triggering event

JXTA