org.eclipse.ecf.presence.ui.roster
Class AbstractRosterEntryContributionItem

java.lang.Object
  extended by org.eclipse.jface.action.ContributionItem
      extended by org.eclipse.ui.actions.CompoundContributionItem
          extended by org.eclipse.ecf.presence.ui.roster.AbstractPresenceContributionItem
              extended by org.eclipse.ecf.presence.ui.roster.AbstractRosterEntryContributionItem
All Implemented Interfaces:
org.eclipse.jface.action.IContributionItem
Direct Known Subclasses:
ConsoleShareRosterEntryContributionItem, ScreenCaptureShareRosterEntryContributionItem, URLShareRosterEntryContributionItem, ViewShareRosterEntryContributionItem

public abstract class AbstractRosterEntryContributionItem
extends AbstractPresenceContributionItem

Abstract contribution item class for creating menu contribution items for roster entries. Subclasses should be created as appropriate.


Field Summary
 
Fields inherited from class org.eclipse.ecf.presence.ui.roster.AbstractPresenceContributionItem
EMPTY_ARRAY
 
Constructor Summary
AbstractRosterEntryContributionItem()
           
AbstractRosterEntryContributionItem(java.lang.String id)
           
 
Method Summary
protected  IContainer getContainerForRosterEntry(IRosterEntry entry)
          Get container for the given IRosterEntry.
protected  IRosterEntry getSelectedRosterEntry()
          Get the currently selected IRosterEntry.
protected  boolean isAvailable(IRosterEntry entry)
          Return true if given IRosterEntry has an IPresence, and it's IPresence.Type and IPresence.Mode are both AVAILABLE.
 
Methods inherited from class org.eclipse.ecf.presence.ui.roster.AbstractPresenceContributionItem
getContributionItems, getSelection, makeActions
 
Methods inherited from class org.eclipse.ui.actions.CompoundContributionItem
dispose, fill, isDirty, isDynamic, setParent
 
Methods inherited from class org.eclipse.jface.action.ContributionItem
fill, fill, fill, getId, getParent, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setVisible, toString, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractRosterEntryContributionItem

public AbstractRosterEntryContributionItem()

AbstractRosterEntryContributionItem

public AbstractRosterEntryContributionItem(java.lang.String id)
Method Detail

getSelectedRosterEntry

protected IRosterEntry getSelectedRosterEntry()
Get the currently selected IRosterEntry.

Returns:
IRosterEntry that is current workbenchwindow selection. Returns null if nothing is selected or if something other than IRosterEntry is selected.

getContainerForRosterEntry

protected IContainer getContainerForRosterEntry(IRosterEntry entry)
Get container for the given IRosterEntry.

Parameters:
entry - the IRosterEntry. May be null.
Returns:
IContainer associated with currently selected IRosterEntry. Returns null if the given entry is null, or if the container associated with the entry cannot be accessed.

isAvailable

protected boolean isAvailable(IRosterEntry entry)
Return true if given IRosterEntry has an IPresence, and it's IPresence.Type and IPresence.Mode are both AVAILABLE.

Parameters:
entry - the IRosterEntry to check. If null, false will be returned.
Returns:
true if given entry's IPresence.Mode and IPresence.Type are both AVAILABLE. false otherwise.