Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 82673 Details for
Bug 206811
Adopt J2SE 5.0 in Transaction Component
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated TriggerCommand patch
clipboard.txt (text/plain), 3.98 KB, created by
Christian Damus
on 2007-11-12 11:49:26 EST
(
hide
)
Description:
Updated TriggerCommand patch
Filename:
MIME Type:
Creator:
Christian Damus
Created:
2007-11-12 11:49:26 EST
Size:
3.98 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.transaction >Index: src/org/eclipse/emf/transaction/util/TriggerCommand.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.transaction/plugins/org.eclipse.emf.transaction/src/org/eclipse/emf/transaction/util/TriggerCommand.java,v >retrieving revision 1.5 >diff -u -r1.5 TriggerCommand.java >--- src/org/eclipse/emf/transaction/util/TriggerCommand.java 13 Jun 2007 12:27:32 -0000 1.5 >+++ src/org/eclipse/emf/transaction/util/TriggerCommand.java 12 Nov 2007 16:46:48 -0000 >@@ -36,7 +36,7 @@ > */ > public class TriggerCommand extends ConditionalRedoCommand.Compound { > private final Command triggeringCommand; >- private final List triggers; >+ private final List<Command> triggers; > > /** > * Initializes me with a list of commands triggered not by the execution of >@@ -47,11 +47,12 @@ > * > * @param triggers the trigger commands that I encapsulate > */ >- public TriggerCommand(List triggers) { >- super(0, "Triggers", "Triggered Changes", triggers); //$NON-NLS-1$ //$NON-NLS-2$ >+ public TriggerCommand(List<? extends Command> triggers) { >+ super(0, "Triggers", "Triggered Changes", //$NON-NLS-1$ //$NON-NLS-2$ >+ new java.util.ArrayList<Command>(triggers)); > > this.triggeringCommand = null; >- this.triggers = triggers; >+ this.triggers = commandList; > } > > /** >@@ -62,11 +63,12 @@ > * @param triggeringCommand the command that triggered further commands > * @param triggers the trigger commands that I encapsulate > */ >- public TriggerCommand(Command triggeringCommand, List triggers) { >- super(0, triggeringCommand.getLabel(), triggeringCommand.getDescription(), triggers); >+ public TriggerCommand(Command triggeringCommand, List<? extends Command> triggers) { >+ super(0, triggeringCommand.getLabel(), triggeringCommand.getDescription(), >+ new java.util.ArrayList<Command>(triggers)); > > this.triggeringCommand = triggeringCommand; >- this.triggers = triggers; >+ this.triggers = commandList; > } > > /** >@@ -85,11 +87,12 @@ > * > * @return my triggers, as a list of {@link Command}s. Will not be empty > */ >- public final List getTriggers() { >+ public final List<Command> getTriggers() { > return triggers; > } > > // Documentation copied from the inherited specification >+ @Override > protected boolean prepare() { > // we will check canExecute() as we go > return !triggers.isEmpty(); >@@ -99,11 +102,12 @@ > * Executes all of my trigger commands, then prepends the original triggering > * command (if any) so that it will be undone/redone with the others. > */ >+ @Override > public void execute() { > // execute just the triggers >- for (ListIterator iter = commandList.listIterator(); iter.hasNext();) { >+ for (ListIterator<Command> iter = commandList.listIterator(); iter.hasNext();) { > try { >- Command command = (Command) iter.next(); >+ Command command = iter.next(); > > if (command.canExecute()) { > command.execute(); >@@ -123,7 +127,7 @@ > // Iterate back over the executed commands to undo them. > // > while (iter.hasPrevious()) { >- Command command = (Command) iter.previous(); >+ Command command = iter.previous(); > if (command.canUndo()) { > command.undo(); > } else { >@@ -147,7 +151,7 @@ > // then replace the command-list with a new list that includes > // the > // originally executed command (for undo/redo) >- commandList = new java.util.ArrayList(triggers.size() + 1); >+ commandList = new java.util.ArrayList<Command>(triggers.size() + 1); > commandList.add(triggeringCommand); > commandList.addAll(triggers); > } >@@ -157,7 +161,8 @@ > * Extends the inherited implementation by disposing my triggering command, > * also (if any). > */ >- public void dispose() { >+ @Override >+ public void dispose() { > super.dispose(); > > if (triggeringCommand != null) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 206811
:
82668
|
82673
|
82864