Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.view
Class SystemViewLabelAndContentProvider

java.lang.Object
  extended byLabelProvider
      extended bycom.ibm.etools.systems.core.ui.view.SystemViewLabelAndContentProvider

public class SystemViewLabelAndContentProvider
extends LabelProvider

Provides tree contents for objects that have the ISystemViewElement adapter registered. Also provides label contents, so can be used for both a content and label provider for TreeViewers.

This has a general flavour, which is used in most cases, and also has a specialized flavour for universal file systems, which allows restricting the list to files only or folders only. It also allows further subsetting by setting an input filter or filterstring.

See Also:
Serialized Form

Field Summary
static String copyright
           
protected  Viewer viewer
           
 
Constructor Summary
SystemViewLabelAndContentProvider()
          Constructor
SystemViewLabelAndContentProvider(boolean foldersOnly, boolean filesOnly)
          Constructor to restrict to remote folders or files
 
Method Summary
 void cancelJobs(Object location)
          Cancel any jobs that are fetching content from the given location.
protected  ImageDescriptor decorateImage(ImageDescriptor input, Object element)
          Returns an image descriptor that is based on the given descriptor, but decorated with additional information relating to the state of the provided object.
protected  String decorateText(String input, Object element)
          Returns a label that is based on the given label, but decorated with additional information relating to the state of the provided object.
 void dispose()
          The visual part that is using this content provider is about to be disposed.
 void flushCache()
          Flush the in-memory cache which remembers the result of the last getChildren request when we are in files-only or folders-only mode.
protected  ISystemViewElementAdapter getAdapter(Object o)
          Returns the implementation of ISystemViewElement for the given object.
 Object[] getChildren(Object element)
           
 Image getColumnImage(Object element, int columnIndex)
           
 String getColumnText(Object element, int columnIndex)
           
 Object[] getElements(Object element)
           
 String getFilterString()
          Get the current filter string being used to subset the list by.
 Image getImage(Object element)
           
 Object getParent(Object element)
           
 String getText(Object element)
          Returns the label text for the given object.
 Viewer getViewer()
          Return the current viewer we are associated with
 boolean hasChildren(Object element)
          hasChildren method comment.
 void inputChanged(Viewer viewer, Object oldInput, Object newInput)
          inputChanged method comment.
 void setFilterString(String filterString)
          Set a filter string to subset the list by.
protected  boolean supportsDeferredQueries()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

viewer

protected Viewer viewer
Constructor Detail

SystemViewLabelAndContentProvider

public SystemViewLabelAndContentProvider()
Constructor


SystemViewLabelAndContentProvider

public SystemViewLabelAndContentProvider(boolean foldersOnly,
                                         boolean filesOnly)
Constructor to restrict to remote folders or files

Method Detail

setFilterString

public void setFilterString(String filterString)
Set a filter string to subset the list by. For example, "A*.java" or "java,class," Only valid if filesOnly or foldersOnly mode. If the latter, its recorded and used the next time files are requested from any folder.


getFilterString

public String getFilterString()
Get the current filter string being used to subset the list by. Will be null unless setFilterString has previously been called.


flushCache

public void flushCache()
Flush the in-memory cache which remembers the result of the last getChildren request when we are in files-only or folders-only mode. Only applies when the two-boolean constructor is used.


getViewer

public Viewer getViewer()
Return the current viewer we are associated with


dispose

public void dispose()
The visual part that is using this content provider is about to be disposed. Deallocate all allocated SWT resources.


getAdapter

protected ISystemViewElementAdapter getAdapter(Object o)
Returns the implementation of ISystemViewElement for the given object. Returns null if the adapter is not defined or the object is not adaptable.


cancelJobs

public void cancelJobs(Object location)
Cancel any jobs that are fetching content from the given location.

Parameters:
location -

supportsDeferredQueries

protected boolean supportsDeferredQueries()

getChildren

public Object[] getChildren(Object element)
See Also:
ITreeContentProvider

getElements

public Object[] getElements(Object element)
See Also:
ITreeContentProvider

getParent

public Object getParent(Object element)
See Also:
ITreeContentProvider

hasChildren

public boolean hasChildren(Object element)
hasChildren method comment. This method has been optimized over its original code so that we don't actually retrieve all the children (horrors!) just to decide if it has children. For performance reasons we just assume if it can have children it does. That means we always get a plus but that is way better than a very slow remote system query just to decide if we want a plus or not!


inputChanged

public void inputChanged(Viewer viewer,
                         Object oldInput,
                         Object newInput)
inputChanged method comment. AS LONG AS WE DON'T SUPPORT IWORKSPACE OBJECT THIS IS NOT NEEDED. WE LEAVE IT IN BECAUSE IT IS HARMLESS AND MIGHT BE OF VALUE SOMEDAY.


getColumnImage

public Image getColumnImage(Object element,
                            int columnIndex)

getColumnText

public String getColumnText(Object element,
                            int columnIndex)

getImage

public Image getImage(Object element)

getText

public String getText(Object element)
Returns the label text for the given object.


decorateImage

protected ImageDescriptor decorateImage(ImageDescriptor input,
                                        Object element)
Returns an image descriptor that is based on the given descriptor, but decorated with additional information relating to the state of the provided object. Subclasses may reimplement this method to decorate an object's image.

See Also:
ImageDescriptor

decorateText

protected String decorateText(String input,
                              Object element)
Returns a label that is based on the given label, but decorated with additional information relating to the state of the provided object. Subclasses may implement this method to decorate an object's label.


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.