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

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Runtime

org.eclipse.gmf.runtime.common.core.command
Interface ICompositeCommand

All Superinterfaces:
ICommand, IUndoableOperation
All Known Implementing Classes:
CompositeCommand, CompositeTransactionalCommand

public interface ICompositeCommand
extends ICommand

A self-composing undoable operation that is has a CommandResult, a list of affected IFiles, and is composed of child operations.

Does not extend ICompositeOperation because

  • remove(IUndoableOperation) does not dispose the removed operation
  • Children are explicitely composed by the client. Adding to an open composite through the operation history is not supported.


Method Summary
 void add ( IUndoableOperation operation)
           Add the specified operation as a child of this operation.
 boolean isEmpty ()
          Answers whether or not this composite operation has children.
 java.util.Iterator iterator ()
          Obtains an iterator to traverse my child operations.
 java.util.ListIterator listIterator ()
          Obtains an iterator to traverse my child operations in either direction.
 java.util.ListIterator listIterator (int index)
          Obtains an iterator to traverse my child operations in either direction, starting from the specified index.
 void remove ( IUndoableOperation operation)
           Remove the specified operation from this operation.
 int size ()
          Queries the number of child operations that I contain.
 
Methods inherited from interface org.eclipse.gmf.runtime.common.core.command. ICommand
compose, getAffectedFiles, getCommandResult, reduce, setLabel
 
Methods inherited from interface org.eclipse.core.commands.operations. IUndoableOperation
addContext, canExecute, canRedo, canUndo, dispose, execute, getContexts, getLabel, hasContext, redo, removeContext, undo
 

Method Detail

add

void add(
IUndoableOperation operation)

Add the specified operation as a child of this operation.

Parameters:
operation - the operation to be added. If the operation instance has already been added, this method will have no effect.

remove

void remove(
IUndoableOperation operation)

Remove the specified operation from this operation.

Unlike ICompositeOperation, this does not dispose of the removed operation since the composite did not create the operation.

Parameters:
operation - the operation to be removed. The operation should be disposed by the receiver. This method will have no effect if the operation instance is not already a child.

isEmpty

boolean isEmpty()
Answers whether or not this composite operation has children.

Returns:
true if the operation does not have children, false otherwise.

size

int size()
Queries the number of child operations that I contain.

Returns:
my size

iterator

java.util.Iterator iterator()
Obtains an iterator to traverse my child operations. Removing children via this iterator correctly maintains my undo contexts.

Returns:
an iterator of my children

listIterator

java.util.ListIterator listIterator()
Obtains an iterator to traverse my child operations in either direction. Adding and removing children via this iterator correctly maintains my undo contexts.

Note that, unlike list iterators generally, this one does not permit the addition of an operation that I already contain (the composite does not permit duplicates). Moreover, only IUndoableOperations may be added, otherwise ClassCastExceptions will result.

Returns:
an iterator of my children

listIterator

java.util.ListIterator listIterator(int index)
Obtains an iterator to traverse my child operations in either direction, starting from the specified index. Adding and removing children via this iterator correctly maintains my undo contexts.

Note that, unlike list iterators generally, this one does not permit the addition of an operation that I already contain (the composite does not permit duplicates). Moreover, only IUndoableOperations may be added, otherwise ClassCastExceptions will result.

Parameters:
index - the index in my children at which to start iterating
Returns:
an iterator of my children

Runtime

Guidelines for using Eclipse APIs.

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


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire