RSE
Release 2.0

org.eclipse.rse.core.events
Class SystemRemoteChangeEvent

java.lang.Object
  extended by org.eclipse.rse.core.events.SystemRemoteChangeEvent
All Implemented Interfaces:
ISystemRemoteChangeEvent

public class SystemRemoteChangeEvent
extends Object
implements ISystemRemoteChangeEvent

For listeners interested in changes with remote resources. These events are designed to state what the change to the resource was, not to optimize those events for a GUI (eg, a delete event versus a refresh event)


Constructor Summary
SystemRemoteChangeEvent()
          Constructor you shouldn't use unless you intend to call the setters
SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem)
          Constructor for non-rename event
SystemRemoteChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName)
          Constructor for a rename event.
 
Method Summary
 int getEventType()
          Get the event type, such as ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED.
 String getOldName()
          Get the old name of the resource, in the event of a resource rename.
 Object getOriginatingViewer()
          Get the originating viewer from which this remote resource change event comes from.
 Object getResource()
          Get the resource that this event applies to It must either be the binary object of the resource, or the absolute name of the resource, or List of absoluteNames.
 Object getResourceParent()
          Get the parent remote object for the affected remote object.
 ISubSystem getSubSystem()
          Get the subsystem in which this resource resides.
 void setEventType(int eventType)
          Reset the event type
 void setOldName(String oldName)
          Reset the old name on a rename event
 void setOriginatingViewer(Object originatingViewer)
          Set the originating viewer.
 void setResource(Object resource)
          Reset the resource
 void setResourceParent(Object resourceParent)
          Reset the resource's remote resource parent
 void setSubSystem(ISubSystem subsystem)
          Reset the subsystem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemRemoteChangeEvent

public SystemRemoteChangeEvent(int eventType,
                               Object resource,
                               Object resourceParent,
                               ISubSystem subsystem)
Constructor for non-rename event

Parameters:
eventType - - one of the constants from ISystemRemoteChangeEvents
resource - - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter, or List of absoluteNames
resourceParent - - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
subsystem - - the subsystem which contains this remote resource. This allows the search for impacts to be limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.

SystemRemoteChangeEvent

public SystemRemoteChangeEvent(int eventType,
                               Object resource,
                               Object resourceParent,
                               ISubSystem subsystem,
                               String oldName)
Constructor for a rename event.

Parameters:
eventType - - one of the constants from ISystemRemoteChangeEvents
resource - - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter, or List of absoluteNames
resourceParent - - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
subsystem - - the subsystem which contains this remote resource. This allows the search for impacts to be limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
oldName - - on a rename operation, this is the absolute name of the resource prior to the rename

SystemRemoteChangeEvent

public SystemRemoteChangeEvent()
Constructor you shouldn't use unless you intend to call the setters

Method Detail

setEventType

public void setEventType(int eventType)
Reset the event type


setResource

public void setResource(Object resource)
Reset the resource


setResourceParent

public void setResourceParent(Object resourceParent)
Reset the resource's remote resource parent


setSubSystem

public void setSubSystem(ISubSystem subsystem)
Reset the subsystem


setOldName

public void setOldName(String oldName)
Reset the old name on a rename event


getEventType

public int getEventType()
Get the event type, such as ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED.

Specified by:
getEventType in interface ISystemRemoteChangeEvent
Returns:
the event type.
See Also:
ISystemRemoteChangeEvents

getResource

public Object getResource()
Get the resource that this event applies to It must either be the binary object of the resource, or the absolute name of the resource, or List of absoluteNames.

Specified by:
getResource in interface ISystemRemoteChangeEvent
Returns:
the resource that this event applies to.

getResourceParent

public Object getResourceParent()
Get the parent remote object for the affected remote object. This is not always known, but when it is (ie, non null) then it can be used to refresh all expanded occurrences of that parent

Specified by:
getResourceParent in interface ISystemRemoteChangeEvent
Returns:
the parent remote object of the affected resource, or null if not applicable.

getSubSystem

public ISubSystem getSubSystem()
Get the subsystem in which this resource resides. This allows the search for impacts to be limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.

Specified by:
getSubSystem in interface ISystemRemoteChangeEvent
Returns:
the subsystem in which this resource resides.

getOldName

public String getOldName()
Get the old name of the resource, in the event of a resource rename. Null for other event types.

Specified by:
getOldName in interface ISystemRemoteChangeEvent
Returns:
the old name of the resource in case of a rename event, or null if not applicable.

setOriginatingViewer

public void setOriginatingViewer(Object originatingViewer)
Set the originating viewer. Only this viewer is candidate for updating the selection. Eg, on a create event, if this and the resource parent is set, the newly created object is selected after the parent's contents are refreshed, for the originating viewer.


getOriginatingViewer

public Object getOriginatingViewer()
Get the originating viewer from which this remote resource change event comes from. The combination of this, if non-null, plus the resource parent, allows viewers to decide whether to update the selection within the parent resource, after refreshing that resource.


RSE
Release 2.0

Copyright (c) IBM Corporation and others 2000, 2007. All Rights Reserved.