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
Answertopia.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.navigator
Class SaveablesProvider


java.lang.Object
  extended by 
org.eclipse.ui.navigator.SaveablesProvider
All Implemented Interfaces:
IDisposable

public abstract class SaveablesProvider
extends Object
implements IDisposable

Provides Saveable objects to the common navigator, and allows to map between elements in the tree and models.

This class is intended to be subclassed by clients.

Instances of subclasses will be returned from content extensions that implement IAdaptable.

Since:
3.2

Constructor Summary
protected SaveablesProvider ()
          Creates a new saveable model provider.
 
Method Summary
 void dispose ()
          Disposes of this saveables provider.
protected  void doInit ()
          May be overridden by clients.
protected  void fireSaveablesClosed ( Saveable[] models)
          Notifies the listener that the given models were closed in this model provider.
protected  boolean fireSaveablesClosing ( Saveable[] models, boolean force)
          Notifies the listener that the given models are about to be closed in this model provider.
protected  void fireSaveablesDirtyChanged ( Saveable[] models)
          Notifies the listener that the given models' dirty state has changed.
protected  void fireSaveablesOpened ( Saveable[] models)
          Notifies the listener that the given models were opened in this model provider.
abstract   Object[] getElements ( Saveable saveable)
          Returns the elements representing the given saveable.
abstract   Saveable getSaveable ( Object element)
          Returns the saveable for the given element, or null if the element does not represent a saveable.
abstract   Saveable[] getSaveables ()
          Returns the saveables reachable through this provider.
 void init ( ISaveablesLifecycleListener listener)
          Initializes this SaveablesProvider with the given listener, and calls the hook method doInit().
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveablesProvider

protected SaveablesProvider()
Creates a new saveable model provider. May only be called by subclasses.

Method Detail

init

public final void init(
ISaveablesLifecycleListener listener)
Initializes this SaveablesProvider with the given listener, and calls the hook method doInit().

Parameters:
listener -

doInit

protected void doInit()
May be overridden by clients. The default implementation does nothing.


fireSaveablesOpened

protected final void fireSaveablesOpened(
Saveable[] models)
Notifies the listener that the given models were opened in this model provider. This method must be called on the UI thread.

Parameters:
models -

fireSaveablesClosing

protected final boolean fireSaveablesClosing(
Saveable[] models,
                                             boolean force)
Notifies the listener that the given models are about to be closed in this model provider. This method must be called on the UI thread.

Parameters:
models -
force - true if the closing may be canceled by the user
Returns:
true if the listener vetoed the closing (may be ignored if force is true)

fireSaveablesClosed

protected final void fireSaveablesClosed(
Saveable[] models)
Notifies the listener that the given models were closed in this model provider. This method must be called on the UI thread.

Parameters:
models -

fireSaveablesDirtyChanged

protected final void fireSaveablesDirtyChanged(
Saveable[] models)
Notifies the listener that the given models' dirty state has changed. This method must be called on the UI thread.

Parameters:
models -

getSaveables

public abstract 
Saveable[] getSaveables()
Returns the saveables reachable through this provider. Changes to the list of saveables or to the saveables' dirty state must be announced using the appropriate fire* methods.

Returns:
the saveables returned by this saveables provider.

getElements

public abstract 
Object[] getElements(
Saveable saveable)
Returns the elements representing the given saveable. It is recommended that a saveable be represented by only one element.

Parameters:
saveable -
Returns:
the elements representing the given saveable (array may be empty)

getSaveable

public abstract 
Saveable getSaveable(
Object element)
Returns the saveable for the given element, or null if the element does not represent a saveable.

Parameters:
element -
Returns:
the saveable for the given element, or null

dispose

public void dispose()
Disposes of this saveables provider. Subclasses may extend, but must call the super implementation.

Specified by:
dispose in interface IDisposable

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