Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-07-30 08:19:15 -0400
committerEike Stepper2016-07-30 08:19:38 -0400
commit6dc966a83269a207a5538850648ea23697c682bc (patch)
tree7cf7392277825440a53ca835ba593662729e70e0 /plugins/org.eclipse.emf.cdo.ui
parentdaae9e913594dd5b8317bd26d7e778d6020a8d4d (diff)
downloadcdo-6dc966a83269a207a5538850648ea23697c682bc.tar.gz
cdo-6dc966a83269a207a5538850648ea23697c682bc.tar.xz
cdo-6dc966a83269a207a5538850648ea23697c682bc.zip
[$387563] $Generalize the "lock of new objects on commit" feature to the "lock/unlock objects on commit"
Task-Url: $https://bugs.eclipse.org/bugs/show_bug.cgi?id=387563
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF36
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/plugin.xml1
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java91
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java119
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties1
9 files changed, 145 insertions, 111 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
index fc258b6e14..575ed4ced0 100644
--- a/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.ui;singleton:=true
-Bundle-Version: 4.5.0.qualifier
+Bundle-Version: 4.5.100.qualifier
Bundle-Activator: org.eclipse.emf.cdo.internal.ui.bundle.OM$Activator
Bundle-Vendor: %providerName
Bundle-ClassPath: .
@@ -27,7 +27,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";reso
org.eclipse.emf.ecp.edit;bundle-version="[1.5.0,2.0.0)";resolution:=optional,
org.eclipse.emf.ecp.edit.swt;bundle-version="[1.5.0,2.0.0)";resolution:=optional,
org.eclipse.emf.ecp.ui.view.swt;bundle-version="[1.5.0,2.0.0)";resolution:=optional
-Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
+Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -37,7 +37,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.actions;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.actions;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -47,7 +47,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.handlers;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.handlers;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -57,9 +57,9 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.actions.delegates;version="4.5.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.ui.bundle;version="4.5.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.ui.dialogs;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.actions.delegates;version="4.5.100";x-internal:=true,
+ org.eclipse.emf.cdo.internal.ui.bundle;version="4.5.100";x-internal:=true,
+ org.eclipse.emf.cdo.internal.ui.dialogs;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -69,7 +69,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.dnd;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.dnd;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -79,7 +79,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.editor;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.editor;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -89,7 +89,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.filters;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.filters;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -99,7 +99,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.history;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.history;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -109,7 +109,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.messages;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.messages;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -119,7 +119,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.perspectives;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.perspectives;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -129,7 +129,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.preferences;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.preferences;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -139,7 +139,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.transfer;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.transfer;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -149,7 +149,7 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.internal.ui.views;version="4.5.0";
+ org.eclipse.emf.cdo.internal.ui.views;version="4.5.100";
x-friends:="org.eclipse.emf.cdo.ui.defs,
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.ui.location,
@@ -159,5 +159,5 @@ Export-Package: org.eclipse.emf.cdo.internal.ui;version="4.5.0";
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.ui.team,
org.eclipse.emf.cdo.ui.compare",
- org.eclipse.emf.cdo.ui;version="4.5.0",
- org.eclipse.emf.cdo.ui.widgets;version="4.5.0"
+ org.eclipse.emf.cdo.ui;version="4.5.100",
+ org.eclipse.emf.cdo.ui.widgets;version="4.5.100"
diff --git a/plugins/org.eclipse.emf.cdo.ui/plugin.xml b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
index 3f9cb46f1e..cdd6485193 100644
--- a/plugins/org.eclipse.emf.cdo.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
@@ -411,7 +411,6 @@
</iterate>
</with>
</visibleWhen>
-
</command>
<command
commandId="org.eclipse.emf.cdo.ui.UnlockObject"
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java
index 0af905748a..9966a073fd 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractLockObjectsAction.java
@@ -30,7 +30,9 @@ import java.util.List;
/**
* @author Simon McDuff
+ * @deprecated As of 4.6 no longer supported.
*/
+@Deprecated
public abstract class AbstractLockObjectsAction extends EditingDomainAction
{
private List<InternalCDOObject> objects = new ArrayList<InternalCDOObject>();
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java
new file mode 100644
index 0000000000..794f1cf0a9
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AutoReleaseLockExemptionAction.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2016 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.internal.ui.actions;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.internal.ui.messages.Messages;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.util.CDOUtil;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+/**
+ * @author Eike Stepper
+ */
+public class AutoReleaseLockExemptionAction extends EditingDomainAction
+{
+ public static final String ID = "AutoReleaseLockExemption"; //$NON-NLS-1$
+
+ private static final String TITLE = Messages.getString("AutoReleaseLockExemptionAction.1"); //$NON-NLS-1$
+
+ private CDOObject selectedObject;
+
+ public AutoReleaseLockExemptionAction()
+ {
+ super(TITLE);
+ setId(ID);
+ }
+
+ public void selectionChanged(IStructuredSelection selection)
+ {
+ selectedObject = null;
+
+ if (selection != null && selection.size() == 1)
+ {
+ Object element = selection.getFirstElement();
+ if (element instanceof EObject)
+ {
+ EObject object = (EObject)element;
+ selectedObject = CDOUtil.getCDOObject(object);
+ }
+ }
+ }
+
+ public boolean init()
+ {
+ if (selectedObject != null && selectedObject.cdoWriteLock().isLocked())
+ {
+ CDOTransaction transaction = (CDOTransaction)selectedObject.cdoView();
+ setChecked(transaction.options().isAutoReleaseLocksExemption(selectedObject));
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public void update()
+ {
+ setEnabled(true);
+ }
+
+ @Override
+ protected void doRun(IProgressMonitor progressMonitor) throws Exception
+ {
+ if (selectedObject != null)
+ {
+ CDOTransaction transaction = (CDOTransaction)selectedObject.cdoView();
+ if (transaction.options().isAutoReleaseLocksExemption(selectedObject))
+ {
+ transaction.options().removeAutoReleaseLocksExemptions(false, selectedObject);
+ }
+ else
+ {
+ transaction.options().addAutoReleaseLocksExemptions(false, selectedObject);
+ }
+ }
+
+ update();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java
index b42596924f..ff5c91113b 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ChangePassiveUpdateAction.java
@@ -24,7 +24,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
* {@link CDOSession session}.
*
* @author Victor Roldan Betancort
+ * @deprecated As of 4.6 no longer supported.
*/
+@Deprecated
public class ChangePassiveUpdateAction extends EditingDomainAction
{
public static final String ID = "change-passiveupdate"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java
index b2be9b79c2..707ccb2b26 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReadLockObjectsAction.java
@@ -19,7 +19,9 @@ import org.eclipse.emf.spi.cdo.InternalCDOObject;
/**
* @author Simon McDuff
+ * @deprecated As of 4.6 no longer supported.
*/
+@Deprecated
public class ReadLockObjectsAction extends AbstractLockObjectsAction
{
public static final String ID = "readlock-objects"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java
index a96f14771d..3f418f7bc9 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/WriteLockObjectsAction.java
@@ -19,7 +19,9 @@ import org.eclipse.emf.spi.cdo.InternalCDOObject;
/**
* @author Simon McDuff
+ * @deprecated As of 4.6 no longer supported.
*/
+@Deprecated
public class WriteLockObjectsAction extends AbstractLockObjectsAction
{
public static final String ID = "writelock-objects"; //$NON-NLS-1$
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java
index f5977d7f87..2e6e898465 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java
@@ -12,12 +12,8 @@
package org.eclipse.emf.cdo.internal.ui.editor;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.ui.actions.ChangePassiveUpdateAction;
+import org.eclipse.emf.cdo.internal.ui.actions.AutoReleaseLockExemptionAction;
import org.eclipse.emf.cdo.internal.ui.actions.ImportRootsAction;
-import org.eclipse.emf.cdo.internal.ui.actions.ReadLockObjectsAction;
-import org.eclipse.emf.cdo.internal.ui.actions.WriteLockObjectsAction;
-import org.eclipse.emf.cdo.internal.ui.messages.Messages;
-import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -76,17 +72,7 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
/**
* @ADDED
*/
- protected ReadLockObjectsAction readLockObjectsAction;
-
- /**
- * @ADDED
- */
- protected WriteLockObjectsAction writeLockObjectsAction;
-
- /**
- * @ADDED
- */
- protected ChangePassiveUpdateAction changePassiveUpdateAction;
+ protected AutoReleaseLockExemptionAction autoReleaseLockExemptionAction;
/**
* This keeps track of the active editor.
@@ -196,12 +182,7 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
loadResourceAction.setId(LOAD_RESOURCE_ID);
importRootsAction = new ImportRootsAction();
- importRootsAction.setId(ImportRootsAction.ID);
-
- changePassiveUpdateAction = new ChangePassiveUpdateAction();
-
- readLockObjectsAction = new ReadLockObjectsAction();
- writeLockObjectsAction = new WriteLockObjectsAction();
+ autoReleaseLockExemptionAction = new AutoReleaseLockExemptionAction();
validateAction = new ValidateAction();
controlAction = new ControlAction();
@@ -375,18 +356,10 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection)
{
- if (readLockObjectsAction != null)
- {
- readLockObjectsAction.selectionChanged((IStructuredSelection)selection);
- }
-
- if (writeLockObjectsAction != null)
- {
- writeLockObjectsAction.selectionChanged((IStructuredSelection)selection);
- }
-
if (((IStructuredSelection)selection).size() == 1)
{
+ autoReleaseLockExemptionAction.selectionChanged((IStructuredSelection)selection);
+
Object object = ((IStructuredSelection)selection).getFirstElement();
EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
@@ -394,16 +367,13 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
newChildDescriptors = domain.getNewChildDescriptors(object, null);
newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
- if (importRootsAction != null)
+ if (object instanceof CDOResource)
{
- if (object instanceof CDOResource)
- {
- importRootsAction.setTargetResource((CDOResource)object);
- }
- else
- {
- importRootsAction.setTargetResource(null);
- }
+ importRootsAction.setTargetResource((CDOResource)object);
+ }
+ else
+ {
+ importRootsAction.setTargetResource(null);
}
}
}
@@ -578,37 +548,21 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
refreshViewerAction.setId(REFRESH_VIEWER_ID);
menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$
- MenuManager lockingSubMenu = new MenuManager(Messages.getString("CDOActionBarContributor_0")); //$NON-NLS-1$
- lockingSubMenu.add(new Separator("ui-actions")); //$NON-NLS-1$
-
- lockingSubMenu.insertAfter("ui-actions", writeLockObjectsAction); //$NON-NLS-1$
- writeLockObjectsAction.update();
-
- lockingSubMenu.insertAfter("ui-actions", readLockObjectsAction); //$NON-NLS-1$
- readLockObjectsAction.update();
-
- menuManager.insertAfter("ui-actions", lockingSubMenu); //$NON-NLS-1$
-
- menuManager.insertAfter("ui-actions", changePassiveUpdateAction); //$NON-NLS-1$
- changePassiveUpdateAction.update();
- changePassiveUpdateAction.setEnabled(true);
+ if (autoReleaseLockExemptionAction.init())
+ {
+ menuManager.insertAfter("additions", autoReleaseLockExemptionAction); //$NON-NLS-1$
+ autoReleaseLockExemptionAction.update();
+ }
super.addGlobalActions(menuManager);
if (loadResourceAction != null)
{
- if (importRootsAction != null)
- {
- menuManager.insertAfter(loadResourceAction.getId(), importRootsAction);
- }
+ menuManager.insertAfter(loadResourceAction.getId(), importRootsAction);
}
else
{
- if (importRootsAction != null)
- {
- menuManager.insertBefore("additions-end", importRootsAction); //$NON-NLS-1$
- }
-
+ menuManager.insertBefore("additions-end", importRootsAction); //$NON-NLS-1$
menuManager.insertBefore("additions-end", new Separator()); //$NON-NLS-1$
}
}
@@ -631,28 +585,15 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
@Override
public void activate()
{
- if (importRootsAction != null)
+ importRootsAction.setActiveWorkbenchPart(activeEditor);
+ Object input = ((CDOEditor)getActiveEditor()).getViewer().getInput();
+ if (input instanceof CDOResource)
{
- importRootsAction.setActiveWorkbenchPart(activeEditor);
- Object input = ((CDOEditor)getActiveEditor()).getViewer().getInput();
- if (input instanceof CDOResource)
- {
- importRootsAction.setTargetResource((CDOResource)input);
- }
- else
- {
- importRootsAction.setTargetResource(null);
- }
+ importRootsAction.setTargetResource((CDOResource)input);
}
-
- if (changePassiveUpdateAction != null)
+ else
{
- Object input = ((CDOEditor)getActiveEditor()).getViewer().getInput();
- if (input instanceof CDOResource)
- {
- CDOView view = ((CDOResource)input).cdoView();
- changePassiveUpdateAction.setSession(view.getSession());
- }
+ importRootsAction.setTargetResource(null);
}
super.activate();
@@ -664,11 +605,8 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
@Override
public void deactivate()
{
- if (importRootsAction != null)
- {
- importRootsAction.setActiveWorkbenchPart(null);
- importRootsAction.setTargetResource(null);
- }
+ importRootsAction.setActiveWorkbenchPart(null);
+ importRootsAction.setTargetResource(null);
super.deactivate();
}
@@ -680,9 +618,6 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
public void update()
{
super.update();
- if (importRootsAction != null)
- {
- importRootsAction.update();
- }
+ importRootsAction.update();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
index 6f4045eb55..0c5302e65c 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties
@@ -91,6 +91,7 @@ CDOWatchListView.7=Remove all subscriptions
CDOWatchListView.8=Reset Changes
CDOWatchListView.9=Reset all change notifications from the selected subscriptions
ChangePassiveUpdateAction.1=Passive Updates
+AutoReleaseLockExemptionAction.1=Auto Release Lock Exemption
ChangePasswordAction_0=Change Password...
ChangePasswordAction_1=Change the connected user's password
CloseSessionAction.0=Close

Back to the top