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 225507 Details for
Bug 397976
Undo Operation should be disabled if no operations are available
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]
Disables/enables undo/revert based on projects dirty state
undoDisabling.patch (text/plain), 3.41 KB, created by
Tobias Verhoeven
on 2013-01-11 10:09:33 EST
(
hide
)
Description:
Disables/enables undo/revert based on projects dirty state
Filename:
MIME Type:
Creator:
Tobias Verhoeven
Created:
2013-01-11 10:09:33 EST
Size:
3.41 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.ecp.emfstore.ui >diff --git plugin.xml plugin.xml >index 2ca1334..e3b6ea1 100644 >--- plugin.xml >+++ plugin.xml >@@ -345,10 +345,36 @@ > <handler > class="org.eclipse.emf.ecp.emfstore.internal.ui.handler.UndoLastOperationHandler" > commandId="org.eclipse.emf.ecp.emfstore.ui.undoLastOperation"> >+ <enabledWhen> >+ <with >+ variable="selection"> >+ <iterate >+ ifEmpty="false" >+ operator="or"> >+ <test >+ property="org.eclipse.emf.ecp.emfstore.ui.testers.canUndo" >+ value="true"> >+ </test> >+ </iterate> >+ </with> >+ </enabledWhen> > </handler> > <handler > class="org.eclipse.emf.ecp.emfstore.internal.ui.handler.RevertAllOperationsHandler" > commandId="org.eclipse.emf.ecp.emfstore.ui.revertAllOperations"> >+ <enabledWhen> >+ <with >+ variable="selection"> >+ <iterate >+ ifEmpty="false" >+ operator="or"> >+ <test >+ property="org.eclipse.emf.ecp.emfstore.ui.testers.canUndo" >+ value="true"> >+ </test> >+ </iterate> >+ </with> >+ </enabledWhen> > </handler> > <handler > class="org.eclipse.emf.ecp.emfstore.internal.ui.handler.ShowHistoryHandler" >@@ -448,6 +474,13 @@ > properties="isServerAdmin" > type="org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProjectWrapper"> > </propertyTester> >+ <propertyTester >+ class="org.eclipse.emf.ecp.emfstore.internal.ui.property.EMFStoreProjectCanUndoTester" >+ id="org.eclipse.emf.ecp.emfstore.ui.canUndo" >+ namespace="org.eclipse.emf.ecp.emfstore.ui.testers" >+ properties="canUndo" >+ type="org.eclipse.emf.ecp.core.ECPProject"> >+ </propertyTester> > </extension> > <extension > point="org.eclipse.emf.emfstore.client.loginObserver"> >diff --git src/org/eclipse/emf/ecp/emfstore/internal/ui/property/EMFStoreProjectCanUndoTester.java src/org/eclipse/emf/ecp/emfstore/internal/ui/property/EMFStoreProjectCanUndoTester.java >new file mode 100644 >index 0000000..e17bcf6 >--- /dev/null >+++ src/org/eclipse/emf/ecp/emfstore/internal/ui/property/EMFStoreProjectCanUndoTester.java >@@ -0,0 +1,28 @@ >+/** >+ * >+ */ >+package org.eclipse.emf.ecp.emfstore.internal.ui.property; >+ >+import org.eclipse.emf.ecp.emfstore.core.internal.EMFStoreProvider; >+import org.eclipse.emf.ecp.spi.core.InternalProject; >+import org.eclipse.emf.emfstore.client.model.ProjectSpace; >+ >+import org.eclipse.core.expressions.PropertyTester; >+ >+/** >+ * @author Tobias Verhoeven >+ * >+ */ >+public class EMFStoreProjectCanUndoTester extends PropertyTester { >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], >+ * java.lang.Object) >+ */ >+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { >+ ProjectSpace ps = EMFStoreProvider.INSTANCE.getProjectSpace((InternalProject) receiver); >+ Boolean result = Boolean.valueOf(ps.isDirty()); >+ return result; >+ } >+}
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
Flags:
eneufeld
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 397976
: 225507