Knopflerfish OSGi 5.2.0

org.knopflerfish.service.desktop
Class DefaultBundleSelectionModel

java.lang.Object
  extended by org.knopflerfish.service.desktop.DefaultBundleSelectionModel
All Implemented Interfaces:
BundleSelectionModel

public class DefaultBundleSelectionModel
extends java.lang.Object
implements BundleSelectionModel

Default implementation of BundleSelectionModel.


Constructor Summary
DefaultBundleSelectionModel()
           
 
Method Summary
 void addBundleSelectionListener(BundleSelectionListener l)
          Add a BundleSelectionListener to the set of listeners that gets notified at bundle selection changes.
 void clearSelection()
          Clear the entire selection and notify all listeners.
 void fireChange(long bid)
           
 long getSelected()
          Get selected bundle.
 int getSelectionCount()
          Get the number of selected bundles.
 boolean isSelected(long bid)
          Get selection status of a bundle Id.
 void removeBundleSelectionListener(BundleSelectionListener l)
          Remove a BundleSelectionListener from the set of listeners that gets notified at bundle selection changes.
 void setSelected(java.util.List<java.lang.Long> bids, boolean bSelected)
          Set selection status of all bundle id in the given list and notify all listeners.
 void setSelected(long bid, boolean bSelected)
          Set selection status of a bundle id and notify all listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBundleSelectionModel

public DefaultBundleSelectionModel()
Method Detail

clearSelection

public void clearSelection()
Description copied from interface: BundleSelectionModel
Clear the entire selection and notify all listeners.

Specified by:
clearSelection in interface BundleSelectionModel

getSelectionCount

public int getSelectionCount()
Description copied from interface: BundleSelectionModel
Get the number of selected bundles.

Specified by:
getSelectionCount in interface BundleSelectionModel
Returns:
Number of selected bundles.

getSelected

public long getSelected()
Description copied from interface: BundleSelectionModel
Get selected bundle. Return the bundle id of one of the selected bundles.

Specified by:
getSelected in interface BundleSelectionModel
Returns:
The bundle ID of one of the selected bundles (arbitrary). If no selection this method returns -1.

isSelected

public boolean isSelected(long bid)
Description copied from interface: BundleSelectionModel
Get selection status of a bundle Id.

Specified by:
isSelected in interface BundleSelectionModel
Parameters:
bid - Bundle Id to check.
Returns:
true if bid is selected by the model, false otherwise.

setSelected

public void setSelected(long bid,
                        boolean bSelected)
Description copied from interface: BundleSelectionModel
Set selection status of a bundle id and notify all listeners.

Specified by:
setSelected in interface BundleSelectionModel
Parameters:
bid - Bundle Id to set selection status.
bSelected - new selection status of the bundle.

setSelected

public void setSelected(java.util.List<java.lang.Long> bids,
                        boolean bSelected)
Description copied from interface: BundleSelectionModel
Set selection status of all bundle id in the given list and notify all listeners.

Specified by:
setSelected in interface BundleSelectionModel
Parameters:
bids - List of bundle ids to set selection status for.
bSelected - new selection status of the bundles in the list.

addBundleSelectionListener

public void addBundleSelectionListener(BundleSelectionListener l)
Description copied from interface: BundleSelectionModel
Add a BundleSelectionListener to the set of listeners that gets notified at bundle selection changes.

Specified by:
addBundleSelectionListener in interface BundleSelectionModel
Parameters:
l - listener to add.

removeBundleSelectionListener

public void removeBundleSelectionListener(BundleSelectionListener l)
Description copied from interface: BundleSelectionModel
Remove a BundleSelectionListener from the set of listeners that gets notified at bundle selection changes.

Specified by:
removeBundleSelectionListener in interface BundleSelectionModel
Parameters:
l - listener to remove.

fireChange

public void fireChange(long bid)

Knopflerfish OSGi 5.2.0