Remote Systems
v6.4.1

com.ibm.etools.systems.core
Class SystemResourceListener

java.lang.Object
  extended bycom.ibm.etools.systems.core.SystemResourceListener
All Implemented Interfaces:
Runnable

public class SystemResourceListener
extends Object
implements Runnable

This class manages listening for resource changes within our project. Normally, we do not care about such changes. However, after a team synchronize, we do.


Field Summary
static String copyright
           
 
Method Summary
 void addResourceChangeListener(IResourceChangeListener l)
          Register a listener for resource change events on objects in our remote system project.
static boolean changesPending()
          Return true if changes are pending and hence a reloadRSE is in order
protected  void closeEditors()
          Close active editors in RSE views.
protected  void closeViews()
          Close active view in RSE perspective.
 void ensureOnResourceEventListening()
          Ensure event listening is on.
protected  void fireResourceChangeEvent(IResourceChangeEvent event)
          Fire resource change events to interested listeners.
static String getKindString(int kind)
           
static SystemResourceListener getListener(IProject remoteSystemsProject)
          Return singleton
static String getTypeString(int type)
           
protected  void openViews()
          Open views in RSE perspective.
protected  boolean preScanForIgnore(IResourceDelta delta)
          Prescan for unrelated events.
protected  boolean processDelta(String indent, IResourceDelta delta)
          Process all deltas CURRENTLY NOT USED.
static void reloadRSE()
          Re-load the whole RSE from the workspace.
 void removeResourceChangeListener(IResourceChangeListener l)
          Remove a listener for resource change events on object in our remote system project.
 void resourceChanged(IResourceChangeEvent event)
           
 void run()
          IRunnable run method
 void turnOffResourceEventListening()
          Turn off event listening.
 void turnOnResourceEventListening()
          Turn off event listening.
 
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
Method Detail

getListener

public static SystemResourceListener getListener(IProject remoteSystemsProject)
Return singleton


addResourceChangeListener

public void addResourceChangeListener(IResourceChangeListener l)
Register a listener for resource change events on objects in our remote system project. No attempt is made to filter the events, they are simply passed on and the listener can decide if the event applies to them or not.

However, the event will only be fired if a change is made to that resource outside of the normal activities of the Remote Systems Framework, and only for resources within the Remote Systems Connection project.


removeResourceChangeListener

public void removeResourceChangeListener(IResourceChangeListener l)
Remove a listener for resource change events on object in our remote system project.


turnOffResourceEventListening

public void turnOffResourceEventListening()
Turn off event listening. Please call this before do anything that modifies resources and turn it on again after.


turnOnResourceEventListening

public void turnOnResourceEventListening()
Turn off event listening. Please call this after modifying resources.


ensureOnResourceEventListening

public void ensureOnResourceEventListening()
Ensure event listening is on. Called at start of team synch action to be safe.


resourceChanged

public void resourceChanged(IResourceChangeEvent event)
See Also:
IResourceChangeListener#resourceChanged(IResourceChangeEvent)

fireResourceChangeEvent

protected void fireResourceChangeEvent(IResourceChangeEvent event)
Fire resource change events to interested listeners. This is simply a propogation of the eclipse resource event, once we know it applies to us.


preScanForIgnore

protected boolean preScanForIgnore(IResourceDelta delta)
Prescan for unrelated events.

Returns:
true if event filtered out

processDelta

protected boolean processDelta(String indent,
                               IResourceDelta delta)
Process all deltas CURRENTLY NOT USED. WILL FLESH OUT IN A FUTURE RELEASE AND TRY TO AVOID THE ATOM BOMB APPROACH WE TAKE NOW


getKindString

public static String getKindString(int kind)

getTypeString

public static String getTypeString(int type)

run

public void run()
IRunnable run method

Specified by:
run in interface Runnable

closeEditors

protected void closeEditors()
Close active editors in RSE views. You may prompt the user to save or discard pending changes, but you cannot cancel the operation... the editor must be closed one way or the other.


closeViews

protected void closeViews()
Close active view in RSE perspective. You may either close the view or set its input to null, whichever is appropriate. This is called prior to refreshing from disk. If you close the view, sets its array entry to null.


openViews

protected void openViews()
Open views in RSE perspective. You may either close the view or set its input to null, whichever is appropriate. This is called prior to refreshing from disk.


changesPending

public static boolean changesPending()
Return true if changes are pending and hence a reloadRSE is in order


reloadRSE

public static void reloadRSE()
Re-load the whole RSE from the workspace. This is to be called after a team-sync, say


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.