Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-08-06 09:02:22 +0000
committerEike Stepper2013-08-06 09:02:22 +0000
commit7e565e1875ada453bbb2ec1a22075a0e328fc2f0 (patch)
treed525a2bbaceb18d41b35a74983e81d7a816f92ed /plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui
parentb86b778fe100d22c6409ce2ea3af5ee6b1a7093f (diff)
downloadcdo-7e565e1875ada453bbb2ec1a22075a0e328fc2f0.tar.gz
cdo-7e565e1875ada453bbb2ec1a22075a0e328fc2f0.tar.xz
cdo-7e565e1875ada453bbb2ec1a22075a0e328fc2f0.zip
[414473] Deprecate reload() methods because it is unsafe to reload
single objects https://bugs.eclipse.org/bugs/show_bug.cgi?id=414473
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java88
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadViewAction.java43
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOActionBarContributor.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/messages/messages.properties3
4 files changed, 0 insertions, 162 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java
deleted file mode 100644
index c43a751dc2..0000000000
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadObjectsAction.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2007-2009, 2011, 2012 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
- * Victor Roldan Betancort - maintenance
- */
-package org.eclipse.emf.cdo.internal.ui.actions;
-
-import org.eclipse.emf.cdo.internal.ui.messages.Messages;
-import org.eclipse.emf.cdo.ui.CDOEditorUtil;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import org.eclipse.emf.internal.cdo.view.CDOStateMachine;
-
-import org.eclipse.emf.spi.cdo.InternalCDOObject;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPage;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author Eike Stepper
- */
-public class ReloadObjectsAction extends EditingDomainAction
-{
- public static final String ID = "reload-objects"; //$NON-NLS-1$
-
- private static final String TITLE = Messages.getString("ReloadObjectsAction.1"); //$NON-NLS-1$
-
- private List<InternalCDOObject> objects = new ArrayList<InternalCDOObject>();
-
- public ReloadObjectsAction()
- {
- super(TITLE);
- setId(ID);
- }
-
- public void selectionChanged(IStructuredSelection selection)
- {
- objects.clear();
- if (selection != null)
- {
- for (Iterator<?> it = selection.iterator(); it.hasNext();)
- {
- Object object = it.next();
- if (object instanceof InternalCDOObject)
- {
- objects.add((InternalCDOObject)object);
- }
- }
- }
-
- update();
- }
-
- @Override
- public void update()
- {
- setEnabled(!objects.isEmpty());
- }
-
- @Override
- protected void doRun(IProgressMonitor progressMonitor) throws Exception
- {
- if (!objects.isEmpty())
- {
- InternalCDOObject[] array = objects.toArray(new InternalCDOObject[objects.size()]);
-
- CDOStateMachine.INSTANCE.reload(array);
-
- IWorkbenchPage page = getPage();
- if (page != null)
- {
- CDOView view = array[0].cdoView();
- CDOEditorUtil.refreshEditors(page, view);
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadViewAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadViewAction.java
deleted file mode 100644
index aabbdef9aa..0000000000
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/ReloadViewAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2007-2009, 2011, 2012 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
- * Victor Roldan Betancort - maintenance
- */
-package org.eclipse.emf.cdo.internal.ui.actions;
-
-import org.eclipse.emf.cdo.internal.ui.messages.Messages;
-import org.eclipse.emf.cdo.ui.CDOEditorUtil;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * @author Eike Stepper
- */
-public final class ReloadViewAction extends ViewAction
-{
- private static final String TITLE = Messages.getString("ReloadViewAction.0"); //$NON-NLS-1$
-
- private static final String TOOL_TIP = Messages.getString("ReloadViewAction.1"); //$NON-NLS-1$
-
- public ReloadViewAction(IWorkbenchPage page, CDOView view)
- {
- super(page, TITLE, TOOL_TIP, null, view);
- }
-
- @Override
- protected void doRun(IProgressMonitor progressMonitor) throws Exception
- {
- if (getView().reload() != 0)
- {
- CDOEditorUtil.refreshEditors(getPage(), getView());
- }
- }
-}
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 a87237a8bc..c43d9e9c90 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
@@ -15,7 +15,6 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.ui.actions.ChangePassiveUpdateAction;
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.ReloadObjectsAction;
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;
@@ -77,11 +76,6 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
/**
* @ADDED
*/
- protected ReloadObjectsAction reloadObjectsAction;
-
- /**
- * @ADDED
- */
protected ReadLockObjectsAction readLockObjectsAction;
/**
@@ -204,7 +198,6 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
importRootsAction = new ImportRootsAction();
importRootsAction.setId(ImportRootsAction.ID);
- reloadObjectsAction = new ReloadObjectsAction();
changePassiveUpdateAction = new ChangePassiveUpdateAction();
readLockObjectsAction = new ReadLockObjectsAction();
@@ -382,11 +375,6 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection)
{
- if (reloadObjectsAction != null)
- {
- reloadObjectsAction.selectionChanged((IStructuredSelection)selection);
- }
-
if (readLockObjectsAction != null)
{
readLockObjectsAction.selectionChanged((IStructuredSelection)selection);
@@ -589,7 +577,6 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
refreshViewerAction.setId(REFRESH_VIEWER_ID);
menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$
- menuManager.insertBefore(refreshViewerAction.getId(), reloadObjectsAction);
MenuManager lockingSubMenu = new MenuManager(Messages.getString("CDOActionBarContributor_0")); //$NON-NLS-1$
lockingSubMenu.add(new Separator("ui-actions")); //$NON-NLS-1$
@@ -658,11 +645,6 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
}
}
- if (reloadObjectsAction != null)
- {
- reloadObjectsAction.setActiveWorkbenchPart(activeEditor);
- }
-
if (changePassiveUpdateAction != null)
{
Object input = ((CDOEditor)getActiveEditor()).getViewer().getInput();
@@ -688,11 +670,6 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
importRootsAction.setTargetResource(null);
}
- if (reloadObjectsAction != null)
- {
- reloadObjectsAction.setActiveWorkbenchPart(null);
- }
-
super.deactivate();
}
@@ -707,10 +684,5 @@ public class CDOActionBarContributor extends EditingDomainActionBarContributor i
{
importRootsAction.update();
}
-
- if (reloadObjectsAction != null)
- {
- reloadObjectsAction.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 70c3a08d8c..a0f77707a3 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
@@ -183,9 +183,6 @@ RegisterPackagesAction.0=Failed to register package {0}
RegisterPackagesAction.1=\ {0} package has not been registered due to errors.\nSee the log for details.
RegisterPackagesAction.2=\ {0} packages have not been registered due to errors.\nSee the log for details.
RegisterSinglePackageAction.0=Register the package
-ReloadObjectsAction.1=Reload
-ReloadViewAction.0=Reload
-ReloadViewAction.1=Reload this view
EnableViewDurabilityAction.0=Make Durable
EnableViewDurabilityAction.1=Make this view durable
DisableViewDurabilityAction.0=Make Not Durable

Back to the top