Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-07-26 14:16:40 +0000
committerEike Stepper2015-07-26 14:16:40 +0000
commit703821d7d29c2429ba8d6643b5634095d83b1556 (patch)
treee40090323fc72b6d2ae0022d9d2f75b8ce99be06 /plugins
parent8743379312de89965370af9e8ef9457581dc8845 (diff)
downloadcdo-703821d7d29c2429ba8d6643b5634095d83b1556.tar.gz
cdo-703821d7d29c2429ba8d6643b5634095d83b1556.tar.xz
cdo-703821d7d29c2429ba8d6643b5634095d83b1556.zip
[458349] Consolidate UI - Add SelectClassDialog and make item providers more robust
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java39
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOTimeMachineView.java2
2 files changed, 40 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index bcd4e5a921..4cfc6c46b7 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -1586,6 +1586,8 @@ public class CDOEditor extends MultiPageEditorPart
//
class MyContentOutlinePage extends ContentOutlinePage
{
+ private CDOInvalidRootAgent invalidRootAgent;
+
@Override
public void createControl(Composite parent)
{
@@ -1618,6 +1620,31 @@ public class CDOEditor extends MultiPageEditorPart
contentOutlineViewer.setInput(null);
}
+ // If the view can be switched to historical times let an InvalidRootAgent handle detached inputs.
+ if (view.isReadOnly())
+ {
+ invalidRootAgent = new CDOInvalidRootAgent(view)
+ {
+ @Override
+ protected Object getRootFromUI()
+ {
+ return contentOutlineViewer.getInput();
+ }
+
+ @Override
+ protected void setRootToUI(Object root)
+ {
+ contentOutlineViewer.setInput(root);
+ }
+
+ @Override
+ protected void closeUI()
+ {
+ closeEditor();
+ }
+ };
+ }
+
// Make sure our popups work.
//
createContextMenuFor(contentOutlineViewer);
@@ -1645,6 +1672,18 @@ public class CDOEditor extends MultiPageEditorPart
super.setActionBars(actionBars);
getActionBarContributor().shareGlobalActions(this, actionBars);
}
+
+ @Override
+ public void dispose()
+ {
+ if (invalidRootAgent != null)
+ {
+ invalidRootAgent.dispose();
+ invalidRootAgent = null;
+ }
+
+ super.dispose();
+ }
}
contentOutlinePage = new MyContentOutlinePage();
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOTimeMachineView.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOTimeMachineView.java
index b744226e02..1fb60b4844 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOTimeMachineView.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOTimeMachineView.java
@@ -71,7 +71,7 @@ public class CDOTimeMachineView extends ViewPart implements ISelectionListener
public void selectionChanged(IWorkbenchPart part, ISelection selection)
{
CDOView view = getView(selection);
- if (view != null && view.properties().getOrDefault(CDOView.PROP_TIME_MACHINE_DISABLED, false) == Boolean.TRUE)
+ if (view != null && view.properties().get(CDOView.PROP_TIME_MACHINE_DISABLED) == Boolean.TRUE)
{
view = null;
}

Back to the top