Package org.eclipse.team.ui.synchronize
Class AbstractSynchronizeScope
java.lang.Object
org.eclipse.team.ui.synchronize.AbstractSynchronizeScope
- All Implemented Interfaces:
ISynchronizeScope
- Direct Known Subclasses:
ResourceScope
,WorkingSetScope
,WorkspaceScope
Abstract superclass of resource scopes for
SubscriberParticipant
instances.- Since:
- 3.0
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields inherited from interface org.eclipse.team.ui.synchronize.ISynchronizeScope
NAME, ROOTS
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor a scope from scratchprotected
AbstractSynchronizeScope
(IMemento memento) Constructor a scope from a previously saved state -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a property change listener that will get invoked when a property of the receiver changes.boolean
Return whether the given resource is within this scope.protected static ISynchronizeScope
createScope
(IMemento settings) Restore a scope from the given mementovoid
dispose()
Dispose of the scope when it is no longer needed.protected void
Fires the given property change event to all registered listeners.protected void
Fires a change event for propertyISynchronizeScope.ROOTS
containing the new roots.Return the resource mappings that define this scope.protected void
Method invoked from the constructor which populates the fields of this scopevoid
Remove a property change listener.protected static void
saveScope
(ISynchronizeScope scope, IMemento settings) Save the scope to the given mementovoid
Persist the state of this scope.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.team.ui.synchronize.ISynchronizeScope
getName, getRoots
-
Constructor Details
-
AbstractSynchronizeScope
protected AbstractSynchronizeScope()Constructor a scope from scratch -
AbstractSynchronizeScope
Constructor a scope from a previously saved state
-
-
Method Details
-
saveScope
Save the scope to the given memento- Parameters:
scope
- a scopesettings
- a memento
-
createScope
Restore a scope from the given memento- Parameters:
settings
- a memento- Returns:
- the scope restored from the given memento
-
addPropertyChangeListener
Description copied from interface:ISynchronizeScope
Add a property change listener that will get invoked when a property of the receiver changes.- Specified by:
addPropertyChangeListener
in interfaceISynchronizeScope
- Parameters:
listener
- The listener to add.
-
removePropertyChangeListener
Description copied from interface:ISynchronizeScope
Remove a property change listener. Removing an unregistered listener has no effect.- Specified by:
removePropertyChangeListener
in interfaceISynchronizeScope
- Parameters:
listener
- The listener to remove.
-
dispose
public void dispose()Description copied from interface:ISynchronizeScope
Dispose of the scope when it is no longer needed.- Specified by:
dispose
in interfaceISynchronizeScope
-
firePropertyChangedEvent
Fires the given property change event to all registered listeners.- Parameters:
event
- the property change event to be fired
-
fireRootsChanges
protected void fireRootsChanges()Fires a change event for propertyISynchronizeScope.ROOTS
containing the new roots. The old roots are not provided in the event. -
saveState
Persist the state of this scope. Clients must persist enough additional state to know what type (i.e. subclass) of scope to be recreated.- Parameters:
memento
- the memento into which the scope is to be saved
-
init
Method invoked from the constructor which populates the fields of this scope- Parameters:
memento
- the memento into which the scope was previously saved
-
contains
Return whether the given resource is within this scope. By default, a resource is considered in the scope if it is a root or a descendant of a root.- Parameters:
resource
- the resource- Returns:
- whether the given resource is within this scope
- Since:
- 3.2
-
getMappings
Return the resource mappings that define this scope. By default, the mappings are just be deep traversals of the roots of the scope but subclasses may override.- Returns:
- the resource mappings that define this scope
- Since:
- 3.2
-