Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-11-08 13:28:58 -0500
committerEike Stepper2012-11-08 13:36:57 -0500
commit9b6392f3ffa6e68e3076b5a43300e5a1bebae1aa (patch)
tree40b1dcc2311bba613a47a7ae1080ab0a210b76ff
parent36a064c02556267eafbc4cb57ecb99533d553035 (diff)
downloadcdo-9b6392f3ffa6e68e3076b5a43300e5a1bebae1aa.tar.gz
cdo-9b6392f3ffa6e68e3076b5a43300e5a1bebae1aa.tar.xz
cdo-9b6392f3ffa6e68e3076b5a43300e5a1bebae1aa.zip
[393910] Stabilize state management in SynchronizableRepositories
https://bugs.eclipse.org/bugs/show_bug.cgi?id=393910
-rw-r--r--plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonRepository.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java78
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryStateChangedEvent.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryTypeChangedEvent.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java141
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java141
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java66
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionConfigurationImpl.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java26
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java68
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java34
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java32
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateBranchAction.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java67
-rw-r--r--plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java6
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java4
-rw-r--r--plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java4
-rw-r--r--plugins/org.eclipse.net4j.ui/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java5
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jContainerItemProvider.java4
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/StructuredContentProvider.java4
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java5
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerNameSorter.java7
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java2
55 files changed, 829 insertions, 280 deletions
diff --git a/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java b/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java
index fe44ca02e9..98e3196e2c 100644
--- a/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.admin/src/org/eclipse/emf/cdo/internal/admin/CDOAdminClientRepositoryImpl.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.admin.CDOAdminClientRepository;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOID.ObjectType;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.common.util.RepositoryStateChangedEvent;
import org.eclipse.emf.cdo.common.util.RepositoryTypeChangedEvent;
import org.eclipse.emf.cdo.net4j.CDONet4jSession;
@@ -26,6 +27,7 @@ import org.eclipse.net4j.util.event.Notifier;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.om.monitor.NotifyingMonitor;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import java.io.IOException;
@@ -169,6 +171,11 @@ public class CDOAdminClientRepositoryImpl extends Notifier implements CDOAdminCl
return idGenerationLocation;
}
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ return CDOCommonUtil.waitWhileInitial(this, this, monitor);
+ }
+
public long getTimeStamp() throws UnsupportedOperationException
{
throw new UnsupportedOperationException();
diff --git a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
index 88b7caef10..cd8427cf58 100644
--- a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
@@ -11,10 +11,9 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
- org.eclipse.emf.ecore.change;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
+ org.eclipse.emf.ecore.change;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
+ org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
-Import-Package: org.osgi.framework;version="[1.3.0,2.0.0)";resolution:=optional
Export-Package: org.eclipse.emf.cdo.common;version="4.2.0",
org.eclipse.emf.cdo.common.admin;version="4.2.0",
org.eclipse.emf.cdo.common.branch;version="4.2.0",
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonRepository.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonRepository.java
index 694c437292..e921c7028a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonRepository.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonRepository.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.cdo.common.util.CDOTimeProvider;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
import java.util.Set;
@@ -117,6 +118,11 @@ public interface CDOCommonRepository extends CDOTimeProvider, IAdaptable
public boolean isEnsuringReferentialIntegrity();
/**
+ * @since 4.2
+ */
+ public boolean waitWhileInitial(IProgressMonitor monitor);
+
+ /**
* Enumerates the possible {@link CDOCommonRepository#getIDGenerationLocation() ID generation locations} of a CDO
* repository.
*
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
index f42c4ecf29..3424c26bf8 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
@@ -10,6 +10,8 @@
*/
package org.eclipse.emf.cdo.common.util;
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfoManager;
@@ -24,9 +26,14 @@ import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
import org.eclipse.emf.cdo.spi.common.protocol.CDODataInputImpl;
import org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.INotifier;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutput;
+import org.eclipse.core.runtime.IProgressMonitor;
+
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -176,4 +183,75 @@ public final class CDOCommonUtil
return DATE_FORMAT.parse(timeStamp).getTime();
}
+
+ /**
+ * @since 4.2
+ */
+ public static boolean waitWhileInitial(CDOCommonRepository repository, INotifier notifier, IProgressMonitor monitor)
+ {
+ double rest = 10000000;
+ if (monitor != null)
+ {
+ monitor.beginTask("Waiting for repository " + repository.getName() + " to become initialized...", (int)rest);
+ }
+
+ IListener listener = null;
+
+ try
+ {
+ while (repository.getState() == State.INITIAL)
+ {
+ if (monitor.isCanceled())
+ {
+ return false;
+ }
+
+ if (listener == null)
+ {
+ listener = new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ synchronized (this)
+ {
+ notifyAll();
+ }
+ }
+ };
+
+ notifier.addListener(listener);
+ }
+
+ synchronized (listener)
+ {
+ listener.wait(10L);
+ }
+
+ double work = rest / 1000;
+ if (work >= 0)
+ {
+ monitor.worked((int)work);
+ rest -= work;
+ }
+ }
+
+ return true;
+ }
+ catch (InterruptedException ex)
+ {
+ return false;
+ }
+ finally
+ {
+ if (listener != null)
+ {
+ notifier.removeListener(listener);
+ }
+
+ if (monitor != null)
+ {
+ monitor.done();
+ }
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryStateChangedEvent.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryStateChangedEvent.java
index 9b1c3d4eb1..029f47921d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryStateChangedEvent.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryStateChangedEvent.java
@@ -19,10 +19,10 @@ import org.eclipse.net4j.util.event.INotifier;
/**
* An {@link IEvent event} fired when the {@link org.eclipse.emf.cdo.common.CDOCommonRepository.State state} of a
* repository has changed.
- *
+ *
* @author Eike Stepper
* @since 3.0
- * @noextend This interface is not intended to be extended by clients.
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class RepositoryStateChangedEvent extends Event implements CDOCommonRepository.StateChangedEvent
{
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryTypeChangedEvent.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryTypeChangedEvent.java
index f4242ce17f..a08b6a9338 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryTypeChangedEvent.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/RepositoryTypeChangedEvent.java
@@ -19,10 +19,10 @@ import org.eclipse.net4j.util.event.INotifier;
/**
* An {@link IEvent event} fired when the {@link org.eclipse.emf.cdo.common.CDOCommonRepository.Type type} of a
* repository has changed.
- *
+ *
* @author Eike Stepper
* @since 3.0
- * @noextend This interface is not intended to be extended by clients.
+ * @noextend This class is not intended to be subclassed by clients.
*/
public class RepositoryTypeChangedEvent extends Event implements CDOCommonRepository.TypeChangedEvent
{
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml b/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
index b1ebac6968..fd19181fb4 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
@@ -46,6 +46,10 @@
<extension
point="org.eclipse.ui.views">
<view
+ class="org.eclipse.emf.cdo.examples.client.offline.ClientView"
+ id="org.eclipse.emf.cdo.examples.client.offline.ClientView"
+ name="Client"/>
+ <view
class="org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView"
id="org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView"
name="Clone Repository"/>
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
index cddad8ec48..3f5b46b771 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
@@ -78,11 +78,6 @@ public abstract class AbstractView<T extends IContainer<?>> extends ViewPart
public void run()
{
String text = events.getText();
- // if (text.length() != 0)
- // {
- // text += StringUtil.NL;
- // }
- //
events.setText(event + StringUtil.NL + text);
}
});
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
index 40503b9a6d..61a102709f 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
@@ -21,9 +21,10 @@ public class ClientPerspective implements IPerspectiveFactory
public void createInitialLayout(IPageLayout layout)
{
layout.setFixed(true);
- layout.addView("org.eclipse.emf.cdo.ui.CDOSessionsView", IPageLayout.LEFT, 0.5f, IPageLayout.ID_EDITOR_AREA);
- layout.addView("org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView", IPageLayout.BOTTOM, 0.37f,
- "org.eclipse.emf.cdo.ui.CDOSessionsView");
- layout.addView("org.eclipse.ui.views.PropertySheet", IPageLayout.BOTTOM, 0.61f, IPageLayout.ID_EDITOR_AREA);
+ layout.addView("org.eclipse.emf.cdo.examples.client.offline.ClientView", IPageLayout.LEFT, 0.5f,
+ IPageLayout.ID_EDITOR_AREA);
+ layout.addView("org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView", IPageLayout.BOTTOM, 0.46f,
+ "org.eclipse.emf.cdo.examples.client.offline.ClientView");
+ layout.addView("org.eclipse.ui.views.PropertySheet", IPageLayout.BOTTOM, 0.67f, IPageLayout.ID_EDITOR_AREA);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java
new file mode 100644
index 0000000000..85749e4a6a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2004 - 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
+ */
+package org.eclipse.emf.cdo.examples.client.offline;
+
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.ui.CDOItemProvider;
+
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * @author Eike Stepper
+ */
+public class ClientView extends AbstractView<CDOSession>
+{
+ public static final String ID = "org.eclipse.emf.cdo.examples.client.offline.ClientView"; //$NON-NLS-1$
+
+ private CDOItemProvider itemProvider;
+
+ private TreeViewer treeViewer;
+
+ public ClientView()
+ {
+ super(CDOSession.class);
+ }
+
+ @Override
+ protected void createPane(Composite parent, CDOSession session)
+ {
+ itemProvider = new CDOItemProvider(getSite().getPage())
+ {
+ @Override
+ protected void handleElementEvent(final IEvent event)
+ {
+ addEvent(event);
+ }
+ };
+
+ treeViewer = new TreeViewer(parent, SWT.BORDER);
+ treeViewer.setLabelProvider(itemProvider);
+ treeViewer.setContentProvider(itemProvider);
+ treeViewer.setInput(session);
+
+ hookDoubleClick();
+ hookContextMenu();
+ }
+
+ protected void hookDoubleClick()
+ {
+ treeViewer.addDoubleClickListener(new IDoubleClickListener()
+ {
+ public void doubleClick(DoubleClickEvent event)
+ {
+ ITreeSelection selection = (ITreeSelection)treeViewer.getSelection();
+ Object object = selection.getFirstElement();
+ if (object instanceof ContainerItemProvider.ErrorElement)
+ {
+ try
+ {
+ UIUtil.getActiveWorkbenchPage().showView(UIUtil.ERROR_LOG_ID);
+ }
+ catch (PartInitException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ else if (object != null && treeViewer.isExpandable(object))
+ {
+ if (treeViewer.getExpandedState(object))
+ {
+ treeViewer.collapseToLevel(object, TreeViewer.ALL_LEVELS);
+ }
+ else
+ {
+ treeViewer.expandToLevel(object, 1);
+ }
+ }
+ }
+ });
+ }
+
+ protected void hookContextMenu()
+ {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener()
+ {
+ public void menuAboutToShow(IMenuManager manager)
+ {
+ ITreeSelection selection = (ITreeSelection)treeViewer.getSelection();
+ fillContextMenu(manager, selection);
+ }
+ });
+
+ Menu menu = menuMgr.createContextMenu(treeViewer.getControl());
+ treeViewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, treeViewer);
+ }
+
+ protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ {
+ itemProvider.fillContextMenu(manager, selection);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ @Override
+ public void setFocus()
+ {
+ treeViewer.getTree().setFocus();
+ }
+
+ @Override
+ public void dispose()
+ {
+ itemProvider.dispose();
+ super.dispose();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
index e6ea12b1fd..70daafc1fc 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
@@ -23,8 +23,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wb.swt.ExampleResourceManager;
-import java.util.concurrent.ExecutorService;
-
/**
* @author Eike Stepper
*/
@@ -49,17 +47,6 @@ public class NormalRepositoryView extends AbstractView<IRepository>
private Image bean = ExampleResourceManager.getPluginImage(Application.PLUGIN_ID, "icons/Bean.gif");
@Override
- public String getText(Object obj)
- {
- if (obj instanceof ExecutorService)
- {
- return "ExecutorService";
- }
-
- return super.getText(obj);
- }
-
- @Override
public Image getImage(Object obj)
{
return bean;
@@ -79,8 +66,6 @@ public class NormalRepositoryView extends AbstractView<IRepository>
treeViewer.setContentProvider(itemProvider);
treeViewer.setInput(repository);
- // ScrolledComposite scrolledComposite = new ScrolledComposite(sash, SWT.NONE);
- // scrolledComposite.setContent(new RepositoryDetails(scrolledComposite, repository));
new RepositoryDetails(sash, repository);
sash.setWeights(new int[] { 1, 1 });
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java
index a3e42743d7..6e33e230f0 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java
@@ -96,6 +96,17 @@ public final class Node implements IElement, Comparable<Node>
return (T)objects.get(type);
}
+ @SuppressWarnings("unchecked")
+ public <T> T setObject(Class<T> type, T object)
+ {
+ if (object == null)
+ {
+ return (T)objects.remove(type);
+ }
+
+ return (T)objects.put(type, object);
+ }
+
public void start()
{
type.start(this);
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java
index aa1422768a..debfda1739 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java
@@ -153,9 +153,16 @@ public class NodeManager extends Container<Object>
return elements;
}
- public Node createNode(NodeType nodeType)
+ Node createNode(NodeType nodeType)
{
Node node = new Node(nodeType);
+ saveNode(node);
+
+ return addNode(node);
+ }
+
+ void saveNode(Node node)
+ {
OutputStream out = null;
try
@@ -175,8 +182,6 @@ public class NodeManager extends Container<Object>
{
IOUtil.close(out);
}
-
- return addNode(node);
}
private Node addNode(Node node)
diff --git a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
index 96076aca50..1820dc0df6 100644
--- a/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
+++ b/plugins/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
@@ -10,6 +10,8 @@
*/
package org.eclipse.emf.cdo.examples.client.offline.nodes;
+import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.model.CDOPackageRegistryPopulator;
import org.eclipse.emf.cdo.common.revision.CDORevisionCache;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
@@ -26,6 +28,8 @@ import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
import org.eclipse.emf.cdo.server.net4j.FailoverAgent;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.CDOSessionConfigurationFactory;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.view.CDOViewTargetChangedEvent;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.acceptor.IAcceptor;
@@ -36,6 +40,8 @@ import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.h2.H2Adapter;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.container.SetContainer;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.jface.viewers.ComboViewer;
@@ -89,6 +95,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
public static final String MONITOR_PROPERTY = "Monitor";
+ public static final String BRANCH_PROPERTY = "branch";
+
private static final String REPOSITORY_NAME = "repository";
private final NodeManager manager;
@@ -208,10 +216,10 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
public void start(Node node)
{
IRepository repository = createRepository(node);
- node.getObjects().put(IRepository.class, repository);
+ node.setObject(IRepository.class, repository);
IAcceptor acceptor = createAcceptor(node);
- node.getObjects().put(IAcceptor.class, acceptor);
+ node.setObject(IAcceptor.class, acceptor);
}
public void stop(Node node)
@@ -510,15 +518,34 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
}
@Override
- public void start(Node node)
+ public void start(final Node node)
{
super.start(node);
- CDOSession session = (CDOSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions", "cdo",
- "jvm://example?repositoryName=" + REPOSITORY_NAME);
+ final CDOSession session = (CDOSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions",
+ "cdo", "jvm://example?repositoryName=" + REPOSITORY_NAME);
CDOPackageRegistryPopulator.populate(session.getPackageRegistry());
- node.getObjects().put(CDOSession.class, session);
+ node.setObject(CDOSession.class, session);
+
+ if (session.getRepositoryInfo().getState() == State.INITIAL)
+ {
+ session.addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ if (session.getRepositoryInfo().getState() != State.INITIAL)
+ {
+ session.removeListener(this);
+ createTransaction(node);
+ }
+ }
+ });
+ }
+ else
+ {
+ createTransaction(node);
+ }
}
@Override
@@ -579,6 +606,31 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
return (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "jvm", "example");
}
+ protected void createTransaction(final Node node)
+ {
+ CDOSession session = node.getObject(CDOSession.class);
+
+ int branchID = Integer.parseInt(node.getSettings().getProperty(BRANCH_PROPERTY, "0"));
+ CDOBranch branch = session.getBranchManager().getBranch(branchID);
+
+ CDOTransaction transaction = session.openTransaction(branch);
+ transaction.addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof CDOViewTargetChangedEvent)
+ {
+ CDOViewTargetChangedEvent e = (CDOViewTargetChangedEvent)event;
+ int branchID = e.getBranchPoint().getBranch().getID();
+ node.getSettings().setProperty(BRANCH_PROPERTY, Integer.toString(branchID));
+ getManager().saveNode(node);
+ }
+ }
+ });
+
+ node.setObject(CDOTransaction.class, transaction);
+ }
+
@Override
public String toString()
{
@@ -718,7 +770,7 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
org.eclipse.emf.cdo.server.net4j.FailoverMonitor monitor = (org.eclipse.emf.cdo.server.net4j.FailoverMonitor)IPluginContainer.INSTANCE
.getElement(org.eclipse.emf.cdo.server.net4j.FailoverMonitor.PRODUCT_GROUP,
org.eclipse.emf.cdo.server.net4j.FailoverMonitor.Factory.TYPE, node.getName());
- node.getObjects().put(org.eclipse.emf.cdo.server.net4j.FailoverMonitor.class, monitor);
+ node.setObject(org.eclipse.emf.cdo.server.net4j.FailoverMonitor.class, monitor);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/plugin.xml b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
index b1ebac6968..fd19181fb4 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/plugin.xml
@@ -46,6 +46,10 @@
<extension
point="org.eclipse.ui.views">
<view
+ class="org.eclipse.emf.cdo.examples.client.offline.ClientView"
+ id="org.eclipse.emf.cdo.examples.client.offline.ClientView"
+ name="Client"/>
+ <view
class="org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView"
id="org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView"
name="Clone Repository"/>
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
index cddad8ec48..3f5b46b771 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/AbstractView.java
@@ -78,11 +78,6 @@ public abstract class AbstractView<T extends IContainer<?>> extends ViewPart
public void run()
{
String text = events.getText();
- // if (text.length() != 0)
- // {
- // text += StringUtil.NL;
- // }
- //
events.setText(event + StringUtil.NL + text);
}
});
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
index 40503b9a6d..61a102709f 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientPerspective.java
@@ -21,9 +21,10 @@ public class ClientPerspective implements IPerspectiveFactory
public void createInitialLayout(IPageLayout layout)
{
layout.setFixed(true);
- layout.addView("org.eclipse.emf.cdo.ui.CDOSessionsView", IPageLayout.LEFT, 0.5f, IPageLayout.ID_EDITOR_AREA);
- layout.addView("org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView", IPageLayout.BOTTOM, 0.37f,
- "org.eclipse.emf.cdo.ui.CDOSessionsView");
- layout.addView("org.eclipse.ui.views.PropertySheet", IPageLayout.BOTTOM, 0.61f, IPageLayout.ID_EDITOR_AREA);
+ layout.addView("org.eclipse.emf.cdo.examples.client.offline.ClientView", IPageLayout.LEFT, 0.5f,
+ IPageLayout.ID_EDITOR_AREA);
+ layout.addView("org.eclipse.emf.cdo.examples.client.offline.CloneRepositoryView", IPageLayout.BOTTOM, 0.46f,
+ "org.eclipse.emf.cdo.examples.client.offline.ClientView");
+ layout.addView("org.eclipse.ui.views.PropertySheet", IPageLayout.BOTTOM, 0.67f, IPageLayout.ID_EDITOR_AREA);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java
new file mode 100644
index 0000000000..85749e4a6a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/ClientView.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2004 - 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
+ */
+package org.eclipse.emf.cdo.examples.client.offline;
+
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.ui.CDOItemProvider;
+
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.ui.UIUtil;
+import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
+
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * @author Eike Stepper
+ */
+public class ClientView extends AbstractView<CDOSession>
+{
+ public static final String ID = "org.eclipse.emf.cdo.examples.client.offline.ClientView"; //$NON-NLS-1$
+
+ private CDOItemProvider itemProvider;
+
+ private TreeViewer treeViewer;
+
+ public ClientView()
+ {
+ super(CDOSession.class);
+ }
+
+ @Override
+ protected void createPane(Composite parent, CDOSession session)
+ {
+ itemProvider = new CDOItemProvider(getSite().getPage())
+ {
+ @Override
+ protected void handleElementEvent(final IEvent event)
+ {
+ addEvent(event);
+ }
+ };
+
+ treeViewer = new TreeViewer(parent, SWT.BORDER);
+ treeViewer.setLabelProvider(itemProvider);
+ treeViewer.setContentProvider(itemProvider);
+ treeViewer.setInput(session);
+
+ hookDoubleClick();
+ hookContextMenu();
+ }
+
+ protected void hookDoubleClick()
+ {
+ treeViewer.addDoubleClickListener(new IDoubleClickListener()
+ {
+ public void doubleClick(DoubleClickEvent event)
+ {
+ ITreeSelection selection = (ITreeSelection)treeViewer.getSelection();
+ Object object = selection.getFirstElement();
+ if (object instanceof ContainerItemProvider.ErrorElement)
+ {
+ try
+ {
+ UIUtil.getActiveWorkbenchPage().showView(UIUtil.ERROR_LOG_ID);
+ }
+ catch (PartInitException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ else if (object != null && treeViewer.isExpandable(object))
+ {
+ if (treeViewer.getExpandedState(object))
+ {
+ treeViewer.collapseToLevel(object, TreeViewer.ALL_LEVELS);
+ }
+ else
+ {
+ treeViewer.expandToLevel(object, 1);
+ }
+ }
+ }
+ });
+ }
+
+ protected void hookContextMenu()
+ {
+ MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener()
+ {
+ public void menuAboutToShow(IMenuManager manager)
+ {
+ ITreeSelection selection = (ITreeSelection)treeViewer.getSelection();
+ fillContextMenu(manager, selection);
+ }
+ });
+
+ Menu menu = menuMgr.createContextMenu(treeViewer.getControl());
+ treeViewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(menuMgr, treeViewer);
+ }
+
+ protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ {
+ itemProvider.fillContextMenu(manager, selection);
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ @Override
+ public void setFocus()
+ {
+ treeViewer.getTree().setFocus();
+ }
+
+ @Override
+ public void dispose()
+ {
+ itemProvider.dispose();
+ super.dispose();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
index e6ea12b1fd..70daafc1fc 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/NormalRepositoryView.java
@@ -23,8 +23,6 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wb.swt.ExampleResourceManager;
-import java.util.concurrent.ExecutorService;
-
/**
* @author Eike Stepper
*/
@@ -49,17 +47,6 @@ public class NormalRepositoryView extends AbstractView<IRepository>
private Image bean = ExampleResourceManager.getPluginImage(Application.PLUGIN_ID, "icons/Bean.gif");
@Override
- public String getText(Object obj)
- {
- if (obj instanceof ExecutorService)
- {
- return "ExecutorService";
- }
-
- return super.getText(obj);
- }
-
- @Override
public Image getImage(Object obj)
{
return bean;
@@ -79,8 +66,6 @@ public class NormalRepositoryView extends AbstractView<IRepository>
treeViewer.setContentProvider(itemProvider);
treeViewer.setInput(repository);
- // ScrolledComposite scrolledComposite = new ScrolledComposite(sash, SWT.NONE);
- // scrolledComposite.setContent(new RepositoryDetails(scrolledComposite, repository));
new RepositoryDetails(sash, repository);
sash.setWeights(new int[] { 1, 1 });
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java
index a3e42743d7..6e33e230f0 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/Node.java
@@ -96,6 +96,17 @@ public final class Node implements IElement, Comparable<Node>
return (T)objects.get(type);
}
+ @SuppressWarnings("unchecked")
+ public <T> T setObject(Class<T> type, T object)
+ {
+ if (object == null)
+ {
+ return (T)objects.remove(type);
+ }
+
+ return (T)objects.put(type, object);
+ }
+
public void start()
{
type.start(this);
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java
index aa1422768a..debfda1739 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeManager.java
@@ -153,9 +153,16 @@ public class NodeManager extends Container<Object>
return elements;
}
- public Node createNode(NodeType nodeType)
+ Node createNode(NodeType nodeType)
{
Node node = new Node(nodeType);
+ saveNode(node);
+
+ return addNode(node);
+ }
+
+ void saveNode(Node node)
+ {
OutputStream out = null;
try
@@ -175,8 +182,6 @@ public class NodeManager extends Container<Object>
{
IOUtil.close(out);
}
-
- return addNode(node);
}
private Node addNode(Node node)
diff --git a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
index 96076aca50..1820dc0df6 100644
--- a/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
+++ b/plugins/org.eclipse.emf.cdo.examples.installer/examples/org.eclipse.emf.cdo.examples.client.offline/src/org/eclipse/emf/cdo/examples/client/offline/nodes/NodeType.java
@@ -10,6 +10,8 @@
*/
package org.eclipse.emf.cdo.examples.client.offline.nodes;
+import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.model.CDOPackageRegistryPopulator;
import org.eclipse.emf.cdo.common.revision.CDORevisionCache;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
@@ -26,6 +28,8 @@ import org.eclipse.emf.cdo.server.db.mapping.IMappingStrategy;
import org.eclipse.emf.cdo.server.net4j.FailoverAgent;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.CDOSessionConfigurationFactory;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.view.CDOViewTargetChangedEvent;
import org.eclipse.net4j.Net4jUtil;
import org.eclipse.net4j.acceptor.IAcceptor;
@@ -36,6 +40,8 @@ import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.h2.H2Adapter;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.container.SetContainer;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.jface.viewers.ComboViewer;
@@ -89,6 +95,8 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
public static final String MONITOR_PROPERTY = "Monitor";
+ public static final String BRANCH_PROPERTY = "branch";
+
private static final String REPOSITORY_NAME = "repository";
private final NodeManager manager;
@@ -208,10 +216,10 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
public void start(Node node)
{
IRepository repository = createRepository(node);
- node.getObjects().put(IRepository.class, repository);
+ node.setObject(IRepository.class, repository);
IAcceptor acceptor = createAcceptor(node);
- node.getObjects().put(IAcceptor.class, acceptor);
+ node.setObject(IAcceptor.class, acceptor);
}
public void stop(Node node)
@@ -510,15 +518,34 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
}
@Override
- public void start(Node node)
+ public void start(final Node node)
{
super.start(node);
- CDOSession session = (CDOSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions", "cdo",
- "jvm://example?repositoryName=" + REPOSITORY_NAME);
+ final CDOSession session = (CDOSession)IPluginContainer.INSTANCE.getElement("org.eclipse.emf.cdo.sessions",
+ "cdo", "jvm://example?repositoryName=" + REPOSITORY_NAME);
CDOPackageRegistryPopulator.populate(session.getPackageRegistry());
- node.getObjects().put(CDOSession.class, session);
+ node.setObject(CDOSession.class, session);
+
+ if (session.getRepositoryInfo().getState() == State.INITIAL)
+ {
+ session.addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ if (session.getRepositoryInfo().getState() != State.INITIAL)
+ {
+ session.removeListener(this);
+ createTransaction(node);
+ }
+ }
+ });
+ }
+ else
+ {
+ createTransaction(node);
+ }
}
@Override
@@ -579,6 +606,31 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
return (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors", "jvm", "example");
}
+ protected void createTransaction(final Node node)
+ {
+ CDOSession session = node.getObject(CDOSession.class);
+
+ int branchID = Integer.parseInt(node.getSettings().getProperty(BRANCH_PROPERTY, "0"));
+ CDOBranch branch = session.getBranchManager().getBranch(branchID);
+
+ CDOTransaction transaction = session.openTransaction(branch);
+ transaction.addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof CDOViewTargetChangedEvent)
+ {
+ CDOViewTargetChangedEvent e = (CDOViewTargetChangedEvent)event;
+ int branchID = e.getBranchPoint().getBranch().getID();
+ node.getSettings().setProperty(BRANCH_PROPERTY, Integer.toString(branchID));
+ getManager().saveNode(node);
+ }
+ }
+ });
+
+ node.setObject(CDOTransaction.class, transaction);
+ }
+
@Override
public String toString()
{
@@ -718,7 +770,7 @@ public abstract class NodeType extends SetContainer<Node> implements IElement
org.eclipse.emf.cdo.server.net4j.FailoverMonitor monitor = (org.eclipse.emf.cdo.server.net4j.FailoverMonitor)IPluginContainer.INSTANCE
.getElement(org.eclipse.emf.cdo.server.net4j.FailoverMonitor.PRODUCT_GROUP,
org.eclipse.emf.cdo.server.net4j.FailoverMonitor.Factory.TYPE, node.getName());
- node.getObjects().put(org.eclipse.emf.cdo.server.net4j.FailoverMonitor.class, monitor);
+ node.setObject(org.eclipse.emf.cdo.server.net4j.FailoverMonitor.class, monitor);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionConfigurationImpl.java
index 3381560c1a..b83e85f135 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionConfigurationImpl.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/CDONet4jSessionConfigurationImpl.java
@@ -12,6 +12,7 @@
package org.eclipse.emf.cdo.internal.net4j;
import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.net4j.CDONet4jSession;
import org.eclipse.emf.cdo.net4j.CDOSession;
import org.eclipse.emf.cdo.session.CDORepositoryInfo;
@@ -27,6 +28,7 @@ import org.eclipse.emf.spi.cdo.CDOSessionProtocol.OpenSessionResult;
import org.eclipse.emf.spi.cdo.CDOSessionProtocol.RepositoryTimeResult;
import org.eclipse.emf.spi.cdo.InternalCDOSession;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.PlatformObject;
import java.util.Set;
@@ -308,6 +310,11 @@ public class CDONet4jSessionConfigurationImpl extends CDOSessionConfigurationImp
return idGenerationLocation;
}
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ return CDOCommonUtil.waitWhileInitial(this, session, monitor);
+ }
+
private RepositoryTimeResult refreshTime()
{
return session.getSessionProtocol().getRepositoryTime();
diff --git a/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java b/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java
index 961f5f8923..4bd615395c 100644
--- a/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server.admin/src/org/eclipse/emf/cdo/server/internal/admin/CDOAdminServerRepository.java
@@ -28,6 +28,7 @@ import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
import org.eclipse.net4j.util.om.monitor.NotifyingMonitor;
import org.eclipse.net4j.util.om.monitor.OMMonitorProgress;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import java.io.IOException;
@@ -176,6 +177,11 @@ public class CDOAdminServerRepository extends Notifier implements CDOAdminReposi
return delegate.isEnsuringReferentialIntegrity();
}
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ return delegate.waitWhileInitial(monitor);
+ }
+
public IDGenerationLocation getIDGenerationLocation()
{
return delegate.getIDGenerationLocation();
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 4ec02988d7..2eb77d09e1 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -182,7 +182,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor,
protected EClass getObjectType(CDOID id)
{
IRepository repository = getStore().getRepository();
- if (repository.getRootResourceID().equals(id))
+ if (id.equals(repository.getRootResourceID()))
{
return EresourcePackage.Literals.CDO_RESOURCE;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java
index 3c709b5e31..029de1ebd3 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ReplicateRepositoryRawIndication.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.server.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.spi.server.InternalRepository;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.OMMonitor.Async;
@@ -59,7 +60,8 @@ public class ReplicateRepositoryRawIndication extends CDOServerReadIndicationWit
try
{
- getRepository().replicateRaw(out, lastReplicatedBranchID, lastReplicatedCommitTime);
+ InternalRepository repository = getRepository();
+ repository.replicateRaw(out, lastReplicatedBranchID, lastReplicatedCommitTime);
}
finally
{
diff --git a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
index dc06696f70..98aad84a7c 100644
--- a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
@@ -9,8 +9,7 @@ Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.emf.cdo.internal.server.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
-Require-Bundle: org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
- org.eclipse.net4j.util;bundle-version="[3.1.0,4.0.0)";visibility:=reexport
+Require-Bundle: org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
Export-Package: org.eclipse.emf.cdo.internal.server;version="4.2.0";
x-friends:="org.eclipse.emf.cdo.server.db,
org.eclipse.emf.cdo.server.net4j,
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 52bbe71196..3cf440b6ea 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -115,6 +115,7 @@ import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.spi.cdo.CDOSessionProtocol.LockObjectsResult;
import org.eclipse.emf.spi.cdo.CDOSessionProtocol.UnlockObjectsResult;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import java.io.IOException;
@@ -145,7 +146,7 @@ public class Repository extends Container<Object> implements InternalRepository
private Type type = Type.MASTER;
- private State state = State.ONLINE;
+ private State state = State.INITIAL;
private Map<String, String> properties;
@@ -295,6 +296,11 @@ public class Repository extends Container<Object> implements InternalRepository
}
}
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ return CDOCommonUtil.waitWhileInitial(this, this, monitor);
+ }
+
public synchronized Map<String, String> getProperties()
{
if (properties == null)
@@ -1203,10 +1209,10 @@ public class Repository extends Container<Object> implements InternalRepository
throws IOException
{
final int fromBranchID = lastReplicatedBranchID + 1;
- final int toBranchID = getStore().getLastBranchID();
+ final int toBranchID = store.getLastBranchID();
final long fromCommitTime = lastReplicatedCommitTime + 1L;
- final long toCommitTime = getStore().getLastCommitTime();
+ final long toCommitTime = store.getLastCommitTime();
out.writeInt(toBranchID);
out.writeLong(toCommitTime);
@@ -1822,6 +1828,11 @@ public class Repository extends Container<Object> implements InternalRepository
}
}
+ protected void setPostActivateState()
+ {
+ setState(State.ONLINE);
+ }
+
@Override
protected void doBeforeActivate() throws Exception
{
@@ -1897,15 +1908,10 @@ public class Repository extends Container<Object> implements InternalRepository
readPackageUnits();
readRootResource();
}
-
- // This check does not work for CDOWorkspace:
- // if (CDOIDUtil.isNull(rootResourceID))
- // {
- // throw new IllegalStateException("Root resource ID is null");
- // }
}
- LifecycleUtil.activate(getLockingManager()); // Needs an initialized main branch / branch manager
+ LifecycleUtil.activate(lockingManager); // Needs an initialized main branch / branch manager
+ setPostActivateState();
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
index e57c0527c1..c9110b118f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
@@ -73,6 +73,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOSession;
import org.eclipse.emf.spi.cdo.InternalCDOTransaction;
import org.eclipse.emf.spi.cdo.InternalCDOView;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.PlatformObject;
import java.util.Collection;
@@ -659,6 +660,11 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
return repository.getIDGenerationLocation();
}
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ return repository.waitWhileInitial(monitor);
+ }
+
public void handleRepositoryTypeChanged(Type oldType, Type newType)
{
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
index 1efd41045e..3c787f9800 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.util.NotAuthenticatedException;
@@ -218,11 +217,6 @@ public class SessionManager extends Container<ISession> implements InternalSessi
*/
public InternalSession openSession(ISessionProtocol sessionProtocol)
{
- if (sessionProtocol != null)
- {
- ensureRootResourceInitialized();
- }
-
int id = lastSessionID.incrementAndGet();
if (TRACER.isEnabled())
{
@@ -243,29 +237,6 @@ public class SessionManager extends Container<ISession> implements InternalSessi
return session;
}
- protected void ensureRootResourceInitialized()
- {
- for (int i = 0; i < 20; i++)
- {
- CDOID rootResourceID = repository.getRootResourceID();
- if (!CDOIDUtil.isNull(rootResourceID))
- {
- return;
- }
-
- try
- {
- Thread.sleep(100);
- }
- catch (InterruptedException ex)
- {
- break;
- }
- }
-
- throw new IllegalStateException("Root resource has not been initialized in " + repository);
- }
-
protected InternalSession createSession(int id, String userID, ISessionProtocol protocol)
{
return new Session(this, protocol, id, userID);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java
index 94de14e944..097567ffbe 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java
@@ -22,6 +22,7 @@ import org.eclipse.net4j.util.CheckUtil;
import org.eclipse.emf.spi.cdo.InternalCDOSession;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.PlatformObject;
import java.util.Set;
@@ -163,5 +164,10 @@ public class EmbeddedClientSessionConfiguration extends CDOSessionConfigurationI
{
return session.getRepository().getObjectIDTypes();
}
+
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ throw new UnsupportedOperationException();
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java
index 9ef66621a5..7bef59caae 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java
@@ -23,7 +23,6 @@ public class FailoverParticipant extends SynchronizableRepository implements Int
public FailoverParticipant()
{
- setState(OFFLINE);
}
public boolean isAllowBackupCommits()
@@ -66,19 +65,6 @@ public class FailoverParticipant extends SynchronizableRepository implements Int
super.changingType(oldType, newType);
}
- @Override
- protected void initRootResource()
- {
- if (getType() == BACKUP)
- {
- super.initRootResource();
- }
- else
- {
- doInitRootResource();
- }
- }
-
protected void doStartSynchronization()
{
super.startSynchronization();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
index 3b66158e2d..5357de4866 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -212,7 +213,11 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
private void handleDisconnect()
{
- OM.LOG.info("Disconnected from master.");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Disconnected from master."); //$NON-NLS-1$
+ }
+
if (localRepository.getRootResourceID() == null)
{
localRepository.setState(CDOCommonRepository.State.INITIAL);
@@ -348,13 +353,16 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
remoteSession = (InternalCDOSession)masterConfiguration.openSession();
ensureNOOPRevisionCache();
- setRootResourceID();
}
catch (Exception ex)
{
if (isActive())
{
- OM.LOG.warn("Connection attempt failed. Retrying in " + retryInterval + " seconds...", ex);
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("ReplConnectionication attempt failed. Retrying in {0} seconds...", retryInterval); //$NON-NLS-1$
+ }
+
fireThrowable(ex);
sleepRetryInterval();
reconnect();
@@ -363,7 +371,11 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
return;
}
- OM.LOG.info("Connected to master.");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Connected to master."); //$NON-NLS-1$
+ }
+
scheduleReplicate();
remoteSession.addListener(remoteSessionListener);
@@ -377,17 +389,6 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
return CONNECT_PRIORITY;
}
- private void setRootResourceID()
- {
- State state = localRepository.getState();
- if (state == CDOCommonRepository.State.INITIAL)
- {
- CDOID rootResourceID = remoteSession.getRepositoryInfo().getRootResourceID();
- localRepository.setRootResourceID(rootResourceID);
- localRepository.setState(CDOCommonRepository.State.OFFLINE);
- }
- }
-
private void ensureNOOPRevisionCache()
{
// Ensure that incoming revisions are not cached!
@@ -419,7 +420,11 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
TRACER.trace("Synchronizing with master..."); //$NON-NLS-1$
}
- localRepository.setState(CDOCommonRepository.State.SYNCING);
+ boolean firstSyncing = localRepository.getLastReplicatedCommitTime() == CDOBranchPoint.UNSPECIFIED_DATE;
+ if (!firstSyncing)
+ {
+ localRepository.setState(CDOCommonRepository.State.SYNCING);
+ }
CDOSessionProtocol sessionProtocol = remoteSession.getSessionProtocol();
OMMonitor monitor = new NotifyingMonitor("Synchronizing", getListeners());
@@ -433,14 +438,27 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
sessionProtocol.replicateRepository(localRepository, monitor);
}
+ if (firstSyncing)
+ {
+ CDOID id = remoteSession.getRepositoryInfo().getRootResourceID();
+ localRepository.setRootResourceID(id);
+ }
+
localRepository.setState(CDOCommonRepository.State.ONLINE);
- OM.LOG.info("Synchronized with master.");
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace("Synchronized with master."); //$NON-NLS-1$
+ }
}
catch (RuntimeException ex)
{
if (isActive())
{
- OM.LOG.warn("Replication attempt failed. Retrying in " + retryInterval + " seconds...", ex);
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Replication attempt failed. Retrying in {0} seconds...", retryInterval); //$NON-NLS-1$
+ }
+
fireThrowable(ex);
sleepRetryInterval();
handleDisconnect();
@@ -548,8 +566,11 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
}
catch (Exception ex)
{
- String simpleName = RetryingRunnable.this.getClass().getSimpleName();
- OM.LOG.error(simpleName + " failed. Exiting.", ex);
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("{0} failed. Exiting.", RetryingRunnable.this.getClass().getSimpleName()); //$NON-NLS-1$
+ }
+
fireThrowable(ex);
}
}
@@ -557,7 +578,12 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
}
else
{
- OM.LOG.error(getErrorMessage(), ex);
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace(ex);
+ }
+
+ fireThrowable(ex);
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
index 3c26a5e102..6ae41c78b1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
@@ -339,6 +339,9 @@ public abstract class SynchronizableRepository extends Repository.Default implem
}
}
+ /**
+ * Called by ReplicateRepositoryRawRequest.confirming().
+ */
public void replicateRaw(CDODataInput in, OMMonitor monitor) throws IOException
{
try
@@ -483,9 +486,6 @@ public abstract class SynchronizableRepository extends Repository.Default implem
{
super.doActivate();
- // Makes setRootResource() being called later in RepositorySynchronizer.ConnectRunnable
- setState(INITIAL);
-
InternalStore store = getStore();
if (!store.isFirstStart())
{
@@ -508,8 +508,17 @@ public abstract class SynchronizableRepository extends Repository.Default implem
store.removePersistentProperties(Collections.singleton(PROP_GRACEFULLY_SHUT_DOWN));
- if (getType() != MASTER)
+ if (getType() == MASTER)
+ {
+ setState(ONLINE);
+ }
+ else
{
+ if (getLastReplicatedCommitTime() != CDOBranchPoint.UNSPECIFIED_DATE)
+ {
+ setState(OFFLINE);
+ }
+
startSynchronization();
}
}
@@ -548,21 +557,26 @@ public abstract class SynchronizableRepository extends Repository.Default implem
}
}
- protected void setReplicationCountersToLatest()
+ @Override
+ protected void setPostActivateState()
{
- setLastReplicatedBranchID(getStore().getLastBranchID());
- setLastReplicatedCommitTime(getStore().getLastNonLocalCommitTime());
+ // Do nothing (keep INITIAL)
}
- protected void doInitRootResource()
+ protected void setReplicationCountersToLatest()
{
- super.initRootResource();
+ setLastReplicatedBranchID(getStore().getLastBranchID());
+ setLastReplicatedCommitTime(getStore().getLastNonLocalCommitTime());
}
@Override
protected void initRootResource()
{
- // Do nothing
+ // Non-MASTER repositories must wait for the first replication to receive their root resource ID
+ if (getType() == MASTER)
+ {
+ super.initRootResource();
+ }
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
index 955d547ee4..38e1c679de 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java
@@ -64,6 +64,9 @@ import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.concurrent.ConcurrencyUtil;
import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.event.IEvent;
+import org.eclipse.net4j.util.event.IListener;
+import org.eclipse.net4j.util.event.ThrowableEvent;
import org.eclipse.net4j.util.io.IOUtil;
import org.eclipse.net4j.util.lifecycle.ILifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
@@ -818,6 +821,18 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf
synchronizer.setRemoteSessionConfigurationFactory(masterFactory);
synchronizer.setRetryInterval(1);
synchronizer.setRawReplication(getTestRawReplication());
+ synchronizer.addListener(new IListener()
+ {
+ public void notifyEvent(IEvent event)
+ {
+ if (event instanceof ThrowableEvent)
+ {
+ ThrowableEvent e = (ThrowableEvent)event;
+ IOUtil.print(e.getThrowable());
+ }
+ }
+ });
+
return synchronizer;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java
index 12740cefc0..c35f55b6c3 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/offline/Bugzilla_376567_Test.java
@@ -13,8 +13,6 @@ package org.eclipse.emf.cdo.tests.offline;
import org.eclipse.emf.cdo.tests.AbstractSyncingTest;
import org.eclipse.emf.cdo.tests.config.impl.ConfigTest.CleanRepositoriesBefore;
-import org.eclipse.net4j.signal.RemoteException;
-
/**
* Clone Repository doesn't retry to init root resource
* <p>
@@ -33,20 +31,20 @@ public class Bugzilla_376567_Test extends AbstractSyncingTest
public void testInitCloneWithoutMaster() throws Exception
{
- try
- {
- openSession();
- fail("IllegalStateException expected");
- }
- catch (Throwable t)
- {
- if (t instanceof RemoteException)
- {
- t = ((RemoteException)t).getCause();
- }
-
- String msg = ((IllegalStateException)t).getMessage();
- assertEquals("Root resource has not been initialized in Repository[repo1]", msg);
- }
+ // try
+ // {
+ // openSession();
+ // fail("IllegalStateException expected");
+ // }
+ // catch (Throwable t)
+ // {
+ // if (t instanceof RemoteException)
+ // {
+ // t = ((RemoteException)t).getCause();
+ // }
+ //
+ // String msg = ((IllegalStateException)t).getMessage();
+ // assertEquals("Root resource has not been initialized in Repository[repo1]", msg);
+ // }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ui.location/META-INF/MANIFEST.MF
index 1b98729829..d5b0053905 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.ui.location/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.ui.location;singleton:=true
-Bundle-Version: 4.0.100.qualifier
+Bundle-Version: 4.0.200.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -13,5 +13,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.cdo.location;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j.util.ui;bundle-version="[3.1.0,4.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.ui.shared;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.emf.cdo.ui.internal.location.bundle;version="4.0.100";x-internal:=true,
- org.eclipse.emf.cdo.ui.internal.location;version="4.0.100";x-internal:=true
+Export-Package: org.eclipse.emf.cdo.ui.internal.location.bundle;version="4.0.200";x-internal:=true,
+ org.eclipse.emf.cdo.ui.internal.location;version="4.0.200";x-internal:=true
diff --git a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java
index 7fb80079d0..de07fb4d63 100644
--- a/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui.location/src/org/eclipse/emf/cdo/ui/internal/location/RepositoryLocationItemProvider.java
@@ -55,7 +55,7 @@ public class RepositoryLocationItemProvider extends ContainerItemProvider<IConta
}
@Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ public void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
super.fillContextMenu(manager, selection);
if (selection.size() == 1)
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java
index eda04d090f..2912ca4ca5 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/AbstractOpenViewAction.java
@@ -4,12 +4,13 @@
* 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.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -29,6 +30,17 @@ public abstract class AbstractOpenViewAction extends SessionAction
@Override
public boolean isEnabled()
{
- return !getSession().getPackageRegistry().isEmpty() && super.isEnabled();
+ CDOSession session = getSession();
+ if (session.getRepositoryInfo().getState() == State.INITIAL)
+ {
+ return false;
+ }
+
+ if (session.getPackageRegistry().isEmpty())
+ {
+ return false;
+ }
+
+ return super.isEnabled();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateBranchAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateBranchAction.java
index 675fa4c7bd..891ab82c33 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateBranchAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/CreateBranchAction.java
@@ -4,13 +4,14 @@
* 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.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.internal.ui.dialogs.CreateBranchDialog;
@@ -48,6 +49,17 @@ public class CreateBranchAction extends SessionAction
}
@Override
+ public boolean isEnabled()
+ {
+ if (getSession().getRepositoryInfo().getState() == State.INITIAL)
+ {
+ return false;
+ }
+
+ return super.isEnabled();
+ }
+
+ @Override
protected void preRun() throws Exception
{
CreateBranchDialog dialog = new CreateBranchDialog(getPage(), getSession(), null, true, null)
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
index 4fd873bad6..ac7d6f52cf 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSessionsView.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.emf.cdo.internal.ui.views;
-import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
import org.eclipse.emf.cdo.eresource.CDOResourceLeaf;
import org.eclipse.emf.cdo.internal.ui.actions.OpenSessionAction;
import org.eclipse.emf.cdo.internal.ui.transfer.RepositoryTransferDragListener;
@@ -23,15 +22,12 @@ import org.eclipse.net4j.util.container.IContainer;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.container.IPluginContainer;
import org.eclipse.net4j.util.ui.views.ContainerItemProvider;
-import org.eclipse.net4j.util.ui.views.ContainerNameSorter;
import org.eclipse.net4j.util.ui.views.ContainerView;
import org.eclipse.net4j.util.ui.views.IElementFilter;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.IWorkbenchPage;
@@ -70,35 +66,6 @@ public class CDOSessionsView extends ContainerView
}
@Override
- protected ViewerSorter createViewerSorter()
- {
- return new ContainerNameSorter()
- {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- if (e1 instanceof CDOResourceFolder)
- {
- if (e2 instanceof CDOResourceLeaf)
- {
- return -1;
- }
- }
-
- if (e1 instanceof CDOResourceLeaf)
- {
- if (e2 instanceof CDOResourceFolder)
- {
- return 1;
- }
- }
-
- return super.compare(viewer, e1, e2);
- }
- };
- }
-
- @Override
protected IManagedContainer getContainer()
{
return IPluginContainer.INSTANCE;
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
index 8b9c11bf6f..a516533205 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
@@ -71,6 +71,7 @@ import org.eclipse.jface.resource.LocalResourceManager;
import org.eclipse.jface.resource.ResourceManager;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorRegistry;
@@ -449,8 +450,11 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
return super.getFont(obj);
}
+ /**
+ * @since 4.2
+ */
@Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ public void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
if (selection.size() == 1)
{
@@ -482,9 +486,9 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
}
/**
- * @since 2.0
+ * @since 4.2
*/
- protected void fillSession(IMenuManager manager, CDOSession session)
+ public void fillSession(IMenuManager manager, CDOSession session)
{
manager.add(new OpenTransactionAction(page, session));
manager.add(new OpenViewAction(page, session));
@@ -499,14 +503,6 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
manager.add(generatedManager);
}
- // IAction a1 = new RegisterWorkspacePackagesAction(page, session);
- // a1.setText(a1.getText() + SafeAction.INTERACTIVE);
- // manager.add(a1);
- //
- // RegisterFilesystemPackagesAction a2 = new RegisterFilesystemPackagesAction(page, session);
- // a2.setText(a2.getText() + SafeAction.INTERACTIVE);
- // manager.add(a2);
-
if (session.getRepositoryInfo().isSupportingBranches())
{
manager.add(new Separator());
@@ -520,9 +516,9 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
}
/**
- * @since 2.0
+ * @since 4.2
*/
- protected boolean fillGenerated(MenuManager manager, CDOSession session)
+ public boolean fillGenerated(MenuManager manager, CDOSession session)
{
List<String> registeredURIs = new ArrayList<String>(EPackage.Registry.INSTANCE.keySet());
Collections.sort(registeredURIs, new Comparator<String>()
@@ -561,9 +557,9 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
}
/**
- * @since 2.0
+ * @since 4.2
*/
- protected void fillView(IMenuManager manager, CDOView view)
+ public void fillView(IMenuManager manager, CDOView view)
{
if (!view.isReadOnly())
{
@@ -611,23 +607,23 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
/**
* @since 4.2
*/
- protected void fillBranch(IMenuManager manager, CDOBranch branch)
+ public void fillBranch(IMenuManager manager, CDOBranch branch)
{
CDOSession session = CDOUtil.getSession(branch);
manager.add(new CreateBranchAction(page, session));
}
/**
- * @since 3.0
+ * @since 4.2
*/
- protected void fillResourceFolder(IMenuManager manager, CDOResourceFolder folder)
+ public void fillResourceFolder(IMenuManager manager, CDOResourceFolder folder)
{
}
/**
* @since 4.2
*/
- protected void fillResourceLeaf(IMenuManager manager, Object object)
+ public void fillResourceLeaf(IMenuManager manager, Object object)
{
CDOEditorUtil.populateMenu(manager, (CDOResourceLeaf)object, page);
@@ -646,9 +642,9 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
}
/**
- * @since 3.0
+ * @since 4.2
*/
- protected void fillResource(IMenuManager manager, CDOResource resource)
+ public void fillResource(IMenuManager manager, CDOResource resource)
{
// manager.add(new OpenResourceEditorAction(page, resource));
}
@@ -656,7 +652,7 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
/**
* @since 4.2
*/
- protected void fillTextResource(IMenuManager manager, CDOTextResource resource)
+ public void fillTextResource(IMenuManager manager, CDOTextResource resource)
{
// manager.add(new OpenResourceEditorAction(page, resource));
}
@@ -664,7 +660,7 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
/**
* @since 4.2
*/
- protected void fillBinaryResource(IMenuManager manager, CDOBinaryResource resource)
+ public void fillBinaryResource(IMenuManager manager, CDOBinaryResource resource)
{
// manager.add(new OpenResourceEditorAction(page, resource));
}
@@ -704,6 +700,31 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
}
/**
+ * @since 4.2
+ */
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2)
+ {
+ if (e1 instanceof CDOResourceFolder)
+ {
+ if (e2 instanceof CDOResourceLeaf)
+ {
+ return -1;
+ }
+ }
+
+ if (e1 instanceof CDOResourceLeaf)
+ {
+ if (e2 instanceof CDOResourceFolder)
+ {
+ return 1;
+ }
+ }
+
+ return super.compare(viewer, e1, e2);
+ }
+
+ /**
* @since 3.0
*/
public static ImageDescriptor getViewImageDescriptor(CDOView view)
diff --git a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
index 470efe8b00..f07f09cb13 100644
--- a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
@@ -9,8 +9,6 @@ Bundle-Localization: plugin
Bundle-Activator: org.eclipse.emf.internal.cdo.bundle.Activator$Implementation
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";resolution:=optional,
- org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.common;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
Export-Package: org.eclipse.emf.cdo;version="4.2.0",
org.eclipse.emf.cdo.eresource;version="4.2.0",
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java
index f71fe1f507..a77b5a4805 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java
@@ -23,6 +23,7 @@ import org.eclipse.net4j.util.properties.IProperties;
import org.eclipse.net4j.util.properties.Properties;
import org.eclipse.net4j.util.properties.Property;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import java.util.Set;
@@ -343,6 +344,11 @@ public class SessionProperties extends Properties<CDOSession> implements CDOComm
throw new UnsupportedOperationException();
}
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ throw new UnsupportedOperationException();
+ }
+
public static void main(String[] args)
{
new Tester().dumpContributionMarkup();
diff --git a/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
index 7a2b1016b1..bc6a8a625b 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.net4j.buddies.ui;singleton:=true
-Bundle-Version: 4.0.100.qualifier
+Bundle-Version: 4.0.200.qualifier
Bundle-Activator: org.eclipse.net4j.buddies.internal.ui.bundle.OM$Activator
Bundle-Vendor: %providerName
Bundle-ClassPath: .
@@ -16,12 +16,12 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.net4j.buddies;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j.buddies.chat;bundle-version="[4.0.0,5.0.0)";resolution:=optional,
org.eclipse.net4j.ui.shared;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.net4j.buddies.internal.ui;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.actions;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.bundle;version="4.0.100";x-internal:=true,
- org.eclipse.net4j.buddies.internal.ui.dnd;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.messages;version="4.0.100";x-internal:=true,
- org.eclipse.net4j.buddies.internal.ui.preferences;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.views;version="4.0.100",
- org.eclipse.net4j.buddies.ui;version="4.0.100"
+Export-Package: org.eclipse.net4j.buddies.internal.ui;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.actions;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.bundle;version="4.0.200";x-internal:=true,
+ org.eclipse.net4j.buddies.internal.ui.dnd;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.messages;version="4.0.200";x-internal:=true,
+ org.eclipse.net4j.buddies.internal.ui.preferences;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.views;version="4.0.200",
+ org.eclipse.net4j.buddies.ui;version="4.0.200"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java
index 381ec467a3..0f6bc2b60e 100644
--- a/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java
+++ b/plugins/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java
@@ -4,7 +4,7 @@
* 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
*/
@@ -177,7 +177,7 @@ public abstract class AbstractItemProvider extends ContainerItemProvider<IContai
}
@Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ public void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
manager.add(new Separator());
if (selection.size() == 1)
diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
index 7a2b1016b1..bc6a8a625b 100644
--- a/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.net4j.buddies.ui;singleton:=true
-Bundle-Version: 4.0.100.qualifier
+Bundle-Version: 4.0.200.qualifier
Bundle-Activator: org.eclipse.net4j.buddies.internal.ui.bundle.OM$Activator
Bundle-Vendor: %providerName
Bundle-ClassPath: .
@@ -16,12 +16,12 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.net4j.buddies;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.net4j.buddies.chat;bundle-version="[4.0.0,5.0.0)";resolution:=optional,
org.eclipse.net4j.ui.shared;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.net4j.buddies.internal.ui;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.actions;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.bundle;version="4.0.100";x-internal:=true,
- org.eclipse.net4j.buddies.internal.ui.dnd;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.messages;version="4.0.100";x-internal:=true,
- org.eclipse.net4j.buddies.internal.ui.preferences;version="4.0.100",
- org.eclipse.net4j.buddies.internal.ui.views;version="4.0.100",
- org.eclipse.net4j.buddies.ui;version="4.0.100"
+Export-Package: org.eclipse.net4j.buddies.internal.ui;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.actions;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.bundle;version="4.0.200";x-internal:=true,
+ org.eclipse.net4j.buddies.internal.ui.dnd;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.messages;version="4.0.200";x-internal:=true,
+ org.eclipse.net4j.buddies.internal.ui.preferences;version="4.0.200",
+ org.eclipse.net4j.buddies.internal.ui.views;version="4.0.200",
+ org.eclipse.net4j.buddies.ui;version="4.0.200"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java b/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java
index 381ec467a3..0f6bc2b60e 100644
--- a/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java
+++ b/plugins/org.eclipse.net4j.examples.installer/examples/org.eclipse.net4j.buddies.ui/src/org/eclipse/net4j/buddies/internal/ui/AbstractItemProvider.java
@@ -4,7 +4,7 @@
* 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
*/
@@ -177,7 +177,7 @@ public abstract class AbstractItemProvider extends ContainerItemProvider<IContai
}
@Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ public void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
manager.add(new Separator());
if (selection.size() == 1)
diff --git a/plugins/org.eclipse.net4j.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.ui/META-INF/MANIFEST.MF
index daa7a8259e..cb6be34e80 100644
--- a/plugins/org.eclipse.net4j.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.ui/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j.ui;singleton:=true
-Bundle-Version: 4.1.100.qualifier
+Bundle-Version: 4.2.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -15,8 +15,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.net4j.ui.shared;bundle-version="[4.0.0,5.0.0)",
org.eclipse.net4j.jvm;bundle-version="[4.0.0,5.0.0)";resolution:=optional,
org.eclipse.net4j.tcp;bundle-version="[4.0.0,5.0.0)";resolution:=optional
-Export-Package: org.eclipse.net4j.internal.ui.bundle;version="4.1.100";x-internal:=true,
- org.eclipse.net4j.internal.ui.container;version="4.1.100";x-internal:=true,
- org.eclipse.net4j.internal.ui.messages;version="4.1.100";x-internal:=true,
- org.eclipse.net4j.internal.ui.views;version="4.1.100";x-friends:="org.eclipse.net4j.ui.defs,org.eclipse.emf.cdo.ui.admin",
- org.eclipse.net4j.ui;version="4.1.100"
+Export-Package: org.eclipse.net4j.internal.ui.bundle;version="4.2.0";x-internal:=true,
+ org.eclipse.net4j.internal.ui.container;version="4.2.0";x-internal:=true,
+ org.eclipse.net4j.internal.ui.messages;version="4.2.0";x-internal:=true,
+ org.eclipse.net4j.internal.ui.views;version="4.2.0";x-friends:="org.eclipse.net4j.ui.defs,org.eclipse.emf.cdo.ui.admin",
+ org.eclipse.net4j.ui;version="4.2.0"
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java
index a16c1b5504..d107bceeab 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/Net4jItemProvider.java
@@ -65,8 +65,11 @@ public class Net4jItemProvider extends ContainerItemProvider<IContainer<Object>>
return super.getImage(obj);
}
+ /**
+ * @since 4.2
+ */
@Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ public void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
if (selection.size() == 1)
{
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jContainerItemProvider.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jContainerItemProvider.java
index 3cf9f2d00c..941be89804 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jContainerItemProvider.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jContainerItemProvider.java
@@ -4,7 +4,7 @@
* 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
*/
@@ -41,7 +41,7 @@ public class Net4jContainerItemProvider extends ContainerItemProvider<IContainer
}
@Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ public void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
manager.add(new RemoveAction(selection));
}
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/StructuredContentProvider.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/StructuredContentProvider.java
index ec810de1b9..6c08cc25aa 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/StructuredContentProvider.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/StructuredContentProvider.java
@@ -19,13 +19,15 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Display;
/**
* @author Eike Stepper
*/
-public abstract class StructuredContentProvider<INPUT> implements IStructuredContentProvider, IListener
+public abstract class StructuredContentProvider<INPUT> extends ViewerSorter implements IStructuredContentProvider,
+ IListener
{
private StructuredViewer viewer;
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
index 43f80322b7..a669c23695 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
@@ -271,8 +271,11 @@ public class ContainerItemProvider<CONTAINER extends IContainer<Object>> extends
return "Error";
}
+ /**
+ * @since 3.3
+ */
@Override
- protected void fillContextMenu(IMenuManager manager, ITreeSelection selection)
+ public void fillContextMenu(IMenuManager manager, ITreeSelection selection)
{
super.fillContextMenu(manager, selection);
if (selection.size() == 1)
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerNameSorter.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerNameSorter.java
index 958eb3e9ee..70305cad25 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerNameSorter.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerNameSorter.java
@@ -4,7 +4,7 @@
* 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
*/
@@ -12,6 +12,11 @@ package org.eclipse.net4j.util.ui.views;
import org.eclipse.jface.viewers.ViewerSorter;
+/**
+ * @author Eike Stepper
+ * @deprecated
+ */
+@Deprecated
public class ContainerNameSorter extends ViewerSorter
{
}
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java
index a07a65ee2d..34c71c6192 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerView.java
@@ -236,7 +236,7 @@ public abstract class ContainerView extends ViewPart implements ISelectionProvid
*/
protected ViewerSorter createViewerSorter()
{
- return new ContainerNameSorter();
+ return itemProvider;
}
/**

Back to the top