Runtime

org.eclipse.gmf.runtime.diagram.ui.commands
Class SetViewMutabilityCommand

java.lang.Object
  extended byorg.eclipse.gef.commands.Command
      extended byorg.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand

public class SetViewMutabilityCommand
extends Command

Command that sets the view's mutability. if a view is Mutability state is used by the Diagram Listener to decide if a view can move from the transient childern list of its container to the persisted list. so a mutable view will never be persisted keep in mind that the mutability state of the view is a transient state so as soon as the model is closed and oppened again all views will be immutable.


Constructor Summary
SetViewMutabilityCommand(IAdaptable viewAdapter, boolean immutable)
          Creates a command instance.
SetViewMutabilityCommand(java.util.List viewAdapters, boolean immutable)
          Creates a command instance.
 
Method Summary
 void execute()
           
 java.util.Collection getAffectedObjects()
          Returns the view that would be affected if this command were executed, undone, or redone.
protected  java.util.List getViewAdapters()
          gets an unmodifiable copy of the cached view adapters.
static SetViewMutabilityCommand makeImmutable(IAdaptable viewAdapter)
          Convenience method returning a command to make the supplied view immutable.
static SetViewMutabilityCommand makeImmutable(java.util.List viewAdapters)
          Convenience method returning a command to make the supplied views immutable.
static SetViewMutabilityCommand makeMutable(IAdaptable viewAdapter)
          Convenience method returning a command to make the supplied view mutable.
static SetViewMutabilityCommand makeMutable(java.util.List viewAdapters)
          Convenience method returning a command to make the supplied views mutable.
 void redo()
           
 void undo()
           
 
Methods inherited from class org.eclipse.gef.commands.Command
canExecute, canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetViewMutabilityCommand

public SetViewMutabilityCommand(IAdaptable viewAdapter,
                                boolean immutable)
Creates a command instance.

Parameters:
viewAdapter - an IAdaptable that adapts to View
immutable - immutable state

SetViewMutabilityCommand

public SetViewMutabilityCommand(java.util.List viewAdapters,
                                boolean immutable)
Creates a command instance.

Parameters:
viewAdapters - a list of IAdaptable objects that adapts to View
immutable - immutable state
Method Detail

makeMutable

public static SetViewMutabilityCommand makeMutable(java.util.List viewAdapters)
Convenience method returning a command to make the supplied views mutable.

Parameters:
viewAdapters - views to be associated with the command
Returns:
SetViewMutabilityCommand

makeMutable

public static SetViewMutabilityCommand makeMutable(IAdaptable viewAdapter)
Convenience method returning a command to make the supplied view mutable.

Parameters:
viewAdapter - view to be associated with the command
Returns:
SetViewMutabilityCommand

makeImmutable

public static SetViewMutabilityCommand makeImmutable(java.util.List viewAdapters)
Convenience method returning a command to make the supplied views immutable.

Parameters:
viewAdapters - views to be associated with the command
Returns:
SetViewMutabilityCommand

makeImmutable

public static SetViewMutabilityCommand makeImmutable(IAdaptable viewAdapter)
Convenience method returning a command to make the supplied view immutable.

Parameters:
viewAdapter - views to be associated with the command
Returns:
SetViewMutabilityCommand

getViewAdapters

protected java.util.List getViewAdapters()
gets an unmodifiable copy of the cached view adapters.

Returns:
view adapters

execute

public void execute()

getAffectedObjects

public java.util.Collection getAffectedObjects()
Returns the view that would be affected if this command were executed, undone, or redone.

Returns:
views adapter Collection

redo

public void redo()

undo

public void undo()

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.