Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.model
Class AdaptableList

java.lang.Object
  extended by 

org.eclipse.ui.model.WorkbenchAdapter
      extended by 
org.eclipse.ui.model.AdaptableList
All Implemented Interfaces:
IAdaptable, IWorkbenchAdapter, IWorkbenchAdapter2

public class AdaptableList
extends WorkbenchAdapter
implements IAdaptable

A modifiable list of IAdaptable objects. The list is adaptable to IWorkbenchAdapter, and can be used to display an arbitrary set of adaptable objects in a viewer.

This class is not intended to be subclassed.

Since:
3.0
See Also:
IWorkbenchAdapter
Restriction:
This class is not intended to be subclassed by clients.

Field Summary
protected   List children
           
 
Fields inherited from class org.eclipse.ui.model. WorkbenchAdapter
NO_CHILDREN
 
Constructor Summary
AdaptableList ()
          Creates a new adaptable list.
AdaptableList ( Collection c)
          Creates a new adaptable list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
AdaptableList ( IAdaptable[] newChildren)
          Creates a new adaptable list containing the given children.
AdaptableList (int initialCapacity)
          Creates a new adaptable list with the given initial capacity.
 
Method Summary
  AdaptableList add ( IAdaptable adaptable)
          Adds the given adaptable object to this list.
  Object getAdapter ( Class adapter)
          Returns an object which is an instance of the given class associated with this object.
  Object[] getChildren ()
          Returns the elements in this list.
  Object[] getChildren ( Object o)
          The default implementation of this IWorkbenchAdapter method returns the empty list.
  Object[] getTypedChildren ( Class type)
          Return the elements in this list in an array of the given type.
 void remove ( IAdaptable adaptable)
          Removes the given adaptable object from this list.
 int size ()
          Returns the number of children in this list.
  String toString ()
           
 
Methods inherited from class org.eclipse.ui.model. WorkbenchAdapter
getBackground, getFont, getForeground, getImageDescriptor, getLabel, getParent
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

children

protected 
List children
Constructor Detail

AdaptableList

public AdaptableList()
Creates a new adaptable list. All of the elements in the list must implement IAdaptable.


AdaptableList

public AdaptableList(int initialCapacity)
Creates a new adaptable list with the given initial capacity. All of the elements in the list must implement IAdaptable.

Parameters:
initialCapacity - the initial capacity of the list

AdaptableList

public AdaptableList(
IAdaptable[] newChildren)
Creates a new adaptable list containing the given children.

Parameters:
newChildren - the list of children

AdaptableList

public AdaptableList(
Collection c)
Creates a new adaptable list containing the elements of the specified collection, in the order they are returned by the collection's iterator. All of the elements in the list must implement IAdaptable.

Parameters:
c - the initial elements of this list (element type: IAdaptable)
Method Detail

add

public 
AdaptableList add(
IAdaptable adaptable)
Adds the given adaptable object to this list.

Parameters:
adaptable - the new element
Returns:
this list

remove

public void remove(
IAdaptable adaptable)
Removes the given adaptable object from this list.

Parameters:
adaptable - the element to remove

size

public int size()
Returns the number of children in this list.

Returns:
the length of this list

getAdapter

public 
Object getAdapter(
Class adapter)
Description copied from interface: IAdaptable
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

Specified by:
getAdapter in interface IAdaptable
Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class

getChildren

public 
Object[] getChildren(
Object o)
Description copied from class: WorkbenchAdapter
The default implementation of this IWorkbenchAdapter method returns the empty list. Subclasses may override.

Specified by:
getChildren in interface IWorkbenchAdapter
Overrides:
getChildren in class WorkbenchAdapter
Parameters:
o - The object to get the children for.
Returns:
Object[]

getChildren

public 
Object[] getChildren()
Returns the elements in this list.

Returns:
the elements in this list

getTypedChildren

public 
Object[] getTypedChildren(
Class type)
Return the elements in this list in an array of the given type.

Parameters:
type - the type of the array to create
Returns:
the elements in the list
Since:
3.1

toString

public 
String toString()
Overrides:
toString in class Object

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire