summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-05-10 08:14:15 -0400
committerEike Stepper2018-05-10 08:14:15 -0400
commit5a38f1bf4091b5e40710e4cbd94b08eb840bb81b (patch)
tree0bbddd8aaa8b861ff91aea94e731621d8ef7377a
parent217a0f1811e5db0791f682d0460d9380218e750e (diff)
downloadcdo-5a38f1bf4091b5e40710e4cbd94b08eb840bb81b.zip
cdo-5a38f1bf4091b5e40710e4cbd94b08eb840bb81b.tar.gz
cdo-5a38f1bf4091b5e40710e4cbd94b08eb840bb81b.tar.xz
[534535] Provide property support for repositories
https://bugs.eclipse.org/bugs/show_bug.cgi?id=534535
-rw-r--r--plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.cdo.common/build.properties3
-rw-r--r--plugins/org.eclipse.emf.cdo.common/plugin.xml25
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/AbstractRepositoryProperties.java324
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/RepositoryProperties.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/messages/messages.properties30
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/plugin.xml6
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/CDOPropertyAdapterFactory.java14
-rw-r--r--plugins/org.eclipse.emf.cdo/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties30
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java302
11 files changed, 473 insertions, 322 deletions
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 2f7f8e6..b6c4093 100644
--- a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.emf.cdo.common
+Bundle-SymbolicName: org.eclipse.emf.cdo.common;singleton:=true
Bundle-Version: 4.7.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
@@ -10,6 +10,7 @@ Bundle-Activator: org.eclipse.emf.cdo.internal.common.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";visibility:=reexport,
+ org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";resolution:=optional,
org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.change;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
diff --git a/plugins/org.eclipse.emf.cdo.common/build.properties b/plugins/org.eclipse.emf.cdo.common/build.properties
index 8fbead1..e7dc9d8 100644
--- a/plugins/org.eclipse.emf.cdo.common/build.properties
+++ b/plugins/org.eclipse.emf.cdo.common/build.properties
@@ -15,7 +15,8 @@ bin.includes = META-INF/,\
.,\
about.html,\
plugin.properties,\
- .options
+ .options,\
+ plugin.xml
src.includes = about.html,\
pom.xml
diff --git a/plugins/org.eclipse.emf.cdo.common/plugin.xml b/plugins/org.eclipse.emf.cdo.common/plugin.xml
new file mode 100644
index 0000000..37c72d0
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/plugin.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<!--
+ Copyright (c) 2018 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
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ id="org.eclipse.emf.cdo.repository.properties"
+ type="org.eclipse.emf.cdo.common.CDOCommonRepository"
+ namespace="org.eclipse.emf.cdo.repository"
+ properties="repositoryName,repositoryUUID,repositoryType,repositoryState,repositoryCreationTime,authenticating,supportingAudits,supportingBranches,supportingUnits,serializeCommits,ensureReferentialIntegrity,idGenerationLocation,commitInfoStorage,storeType,objectIDTypes"
+ class="org.eclipse.emf.cdo.internal.common.RepositoryProperties$Tester"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/AbstractRepositoryProperties.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/AbstractRepositoryProperties.java
new file mode 100644
index 0000000..d4ac2b1
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/AbstractRepositoryProperties.java
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2011-2013, 2015, 2016 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Christian W. Damus (CEA LIST) - bug 418452
+ */
+package org.eclipse.emf.cdo.internal.common;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOID.ObjectType;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
+import org.eclipse.emf.cdo.internal.common.messages.Messages;
+
+import org.eclipse.net4j.util.AdapterUtil;
+import org.eclipse.net4j.util.properties.Properties;
+import org.eclipse.net4j.util.properties.Property;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import java.util.Set;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class AbstractRepositoryProperties<RECEIVER> extends Properties<RECEIVER> implements CDOCommonRepository
+{
+ private static final String CATEGORY_REPOSITORY = "Repository"; //$NON-NLS-1$
+
+ public AbstractRepositoryProperties(Class<RECEIVER> receiverType)
+ {
+ super(receiverType);
+ initProperties();
+ }
+
+ protected abstract CDOCommonRepository getRepository(RECEIVER receiver);
+
+ protected void initProperties()
+ {
+ add(new Property<RECEIVER>("repositoryName", Messages.getString("RepositoryPropertyTester_10"), //
+ Messages.getString("RepositoryPropertyTester_11"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).getName();
+ }
+ });
+
+ add(new Property<RECEIVER>("repositoryUUID", Messages.getString("RepositoryPropertyTester_12"), //
+ Messages.getString("RepositoryPropertyTester_13"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).getUUID();
+ }
+ });
+
+ add(new Property<RECEIVER>("repositoryType", Messages.getString("RepositoryPropertyTester_14"), //
+ Messages.getString("RepositoryPropertyTester_15"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).getType();
+ }
+ });
+
+ add(new Property<RECEIVER>("repositoryState", Messages.getString("RepositoryPropertyTester_16"), //
+ Messages.getString("RepositoryPropertyTester_17"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).getState();
+ }
+ });
+
+ add(new Property<RECEIVER>("repositoryCreationTime", Messages.getString("RepositoryPropertyTester_18"), //
+ Messages.getString("RepositoryPropertyTester_19"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return CDOCommonUtil.formatTimeStamp(getRepository(receiver).getCreationTime());
+ }
+ });
+
+ add(new Property<RECEIVER>("authenticating", Messages.getString("RepositoryPropertyTester_40"), //
+ Messages.getString("RepositoryPropertyTester_41"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).isAuthenticating();
+ }
+ });
+
+ add(new Property<RECEIVER>("supportingAudits", Messages.getString("RepositoryPropertyTester_20"), //
+ Messages.getString("RepositoryPropertyTester_21"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).isSupportingAudits();
+ }
+ });
+
+ add(new Property<RECEIVER>("supportingBranches", Messages.getString("RepositoryPropertyTester_22"), //
+ Messages.getString("RepositoryPropertyTester_23"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).isSupportingBranches();
+ }
+ });
+
+ add(new Property<RECEIVER>("supportingUnits", Messages.getString("RepositoryPropertyTester_28"), //
+ Messages.getString("RepositoryPropertyTester_29"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).isSupportingBranches();
+ }
+ });
+
+ add(new Property<RECEIVER>("serializeCommits", Messages.getString("RepositoryPropertyTester_38"), //
+ Messages.getString("RepositoryPropertyTester_39"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).isSerializingCommits();
+ }
+ });
+
+ add(new Property<RECEIVER>("ensureReferentialIntegrity", Messages.getString("RepositoryPropertyTester_30"), //
+ Messages.getString("RepositoryPropertyTester_31"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).isEnsuringReferentialIntegrity();
+ }
+ });
+
+ add(new Property<RECEIVER>("idGenerationLocation", Messages.getString("RepositoryPropertyTester_32"), //
+ Messages.getString("RepositoryPropertyTester_33"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).getIDGenerationLocation();
+ }
+ });
+
+ add(new Property<RECEIVER>("commitInfoStorage", Messages.getString("RepositoryPropertyTester_42"), //
+ Messages.getString("RepositoryPropertyTester_43"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).getCommitInfoStorage();
+ }
+ });
+
+ add(new Property<RECEIVER>("storeType", Messages.getString("RepositoryPropertyTester_24"), //
+ Messages.getString("RepositoryPropertyTester_25"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ return getRepository(receiver).getStoreType();
+ }
+ });
+
+ add(new Property<RECEIVER>("objectIDTypes", Messages.getString("RepositoryPropertyTester_26"), //
+ Messages.getString("RepositoryPropertyTester_27"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(RECEIVER receiver)
+ {
+ StringBuilder builder = new StringBuilder();
+ CDOCommonRepository repository = getRepository(receiver);
+ for (CDOID.ObjectType objectIDType : repository.getObjectIDTypes())
+ {
+ if (builder.length() != 0)
+ {
+ builder.append(", "); //$NON-NLS-1$
+ }
+
+ builder.append(objectIDType);
+ }
+
+ return builder;
+ }
+ });
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public Object getAdapter(Class adapter)
+ {
+ return AdapterUtil.adapt(this, adapter, false);
+ }
+
+ public long getTimeStamp()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getName()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getUUID()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Type getType()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public State getState()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public long getCreationTime()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getStoreType()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set<ObjectType> getObjectIDTypes()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public IDGenerationLocation getIDGenerationLocation()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public CommitInfoStorage getCommitInfoStorage()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public CDOID getRootResourceID()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isAuthenticating()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSupportingAudits()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSupportingBranches()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSupportingUnits()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Deprecated
+ public boolean isSupportingEcore()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSerializingCommits()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isEnsuringReferentialIntegrity()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/RepositoryProperties.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/RepositoryProperties.java
new file mode 100644
index 0000000..458ae74
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/RepositoryProperties.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2011-2013, 2015, 2016 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ * Christian W. Damus (CEA LIST) - bug 418452
+ */
+package org.eclipse.emf.cdo.internal.common;
+
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
+
+import org.eclipse.net4j.util.properties.DefaultPropertyTester;
+import org.eclipse.net4j.util.properties.IProperties;
+
+/**
+ * @author Eike Stepper
+ */
+public class RepositoryProperties extends AbstractRepositoryProperties<CDOCommonRepository>
+{
+ public static final IProperties<CDOCommonRepository> INSTANCE = new RepositoryProperties();
+
+ private RepositoryProperties()
+ {
+ super(CDOCommonRepository.class);
+ }
+
+ @Override
+ protected CDOCommonRepository getRepository(CDOCommonRepository receiver)
+ {
+ return receiver;
+ }
+
+ public static void main(String[] args)
+ {
+ new Tester().dumpContributionMarkup();
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class Tester extends DefaultPropertyTester<CDOCommonRepository>
+ {
+ public static final String NAMESPACE = "org.eclipse.emf.cdo.repository";
+
+ public Tester()
+ {
+ super(NAMESPACE, INSTANCE);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/messages/messages.properties b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/messages/messages.properties
index 660a655..1120c64 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/messages/messages.properties
@@ -38,3 +38,33 @@ DLRevisionList.3=Holder {0} is still linked in different list
DLRevisionList.5=Holder {0} does not belong to this list
LRURevisionHolder.0=Not a {0}: {1}
MEMRevisionCache.1=Invalid referenceType: {0}
+RepositoryPropertyTester_10=Name
+RepositoryPropertyTester_11=The name of the repository.
+RepositoryPropertyTester_12=UUID
+RepositoryPropertyTester_13=The UUID of the repository.
+RepositoryPropertyTester_14=Type
+RepositoryPropertyTester_15=The type of the repository. One of MASTER, BACKUP, CLONE.
+RepositoryPropertyTester_16=State
+RepositoryPropertyTester_17=The state of the repository. One of OFFLINE, SYNCING, ONLINE.
+RepositoryPropertyTester_18=Creation Time
+RepositoryPropertyTester_19=The creation time of the repository.
+RepositoryPropertyTester_20=Supporting Audits
+RepositoryPropertyTester_21=Whether the repository supports auditing.
+RepositoryPropertyTester_22=Supporting Branches
+RepositoryPropertyTester_23=Whether the repository supports branching.
+RepositoryPropertyTester_24=Store Type
+RepositoryPropertyTester_25=The type of the store that backs the repository.
+RepositoryPropertyTester_26=Object ID Types
+RepositoryPropertyTester_27=The types of object IDs created by the store that backs the repository.
+RepositoryPropertyTester_28=Supporting Units
+RepositoryPropertyTester_29=Whether the repository supports units.
+RepositoryPropertyTester_30=Ensure Referential Integrity
+RepositoryPropertyTester_31=Whether the repository is ensuring referential integrity.
+RepositoryPropertyTester_32=ID Generation Location
+RepositoryPropertyTester_33=One of STORE, CLIENT.
+RepositoryPropertyTester_38=Serialize Commits
+RepositoryPropertyTester_39=Whether the repository is serializing commits.
+RepositoryPropertyTester_40=Authenticating
+RepositoryPropertyTester_41=Whether the repository is authenticating users.
+RepositoryPropertyTester_42=Commit Info Storage
+RepositoryPropertyTester_43=One of NO, YES, WITH_MERGE_SOURCE.
diff --git a/plugins/org.eclipse.emf.cdo.ui/plugin.xml b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
index a3150ae..622c968 100644
--- a/plugins/org.eclipse.emf.cdo.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.ui/plugin.xml
@@ -171,6 +171,12 @@
<extension
point="org.eclipse.core.runtime.adapters">
<factory
+ adaptableType="org.eclipse.emf.cdo.common.CDOCommonRepository"
+ class="org.eclipse.emf.cdo.internal.ui.CDOPropertyAdapterFactory">
+ <adapter type="org.eclipse.ui.views.properties.IPropertySourceProvider"/>
+ <adapter type="org.eclipse.ui.IActionFilter"/>
+ </factory>
+ <factory
adaptableType="org.eclipse.emf.cdo.session.CDOSession"
class="org.eclipse.emf.cdo.internal.ui.CDOPropertyAdapterFactory">
<adapter type="org.eclipse.ui.views.properties.IPropertySourceProvider"/>
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/CDOPropertyAdapterFactory.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/CDOPropertyAdapterFactory.java
index 129d811..c4be7fe 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/CDOPropertyAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/CDOPropertyAdapterFactory.java
@@ -11,7 +11,9 @@
package org.eclipse.emf.cdo.internal.ui;
import org.eclipse.emf.cdo.CDOElement;
+import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.edit.CDOItemProviderAdapter.CDOPropertyDescriptor;
+import org.eclipse.emf.cdo.internal.common.RepositoryProperties;
import org.eclipse.emf.cdo.internal.ui.bundle.OM;
import org.eclipse.emf.cdo.internal.ui.editor.CDOEditor;
import org.eclipse.emf.cdo.session.CDOSession;
@@ -54,6 +56,8 @@ import java.util.Map;
*/
public class CDOPropertyAdapterFactory extends AbstractPropertyAdapterFactory
{
+ private static final IActionFilter REPOSITORY_ACTION_FILTER = new DefaultActionFilter<CDOCommonRepository>(RepositoryProperties.INSTANCE);
+
private static final IActionFilter SESSION_ACTION_FILTER = new DefaultActionFilter<CDOSession>(SessionProperties.INSTANCE);
private static final IActionFilter VIEW_ACTION_FILTER = new DefaultActionFilter<CDOView>(ViewProperties.INSTANCE);
@@ -69,6 +73,11 @@ public class CDOPropertyAdapterFactory extends AbstractPropertyAdapterFactory
{
try
{
+ if (object instanceof CDOCommonRepository)
+ {
+ return new DefaultPropertySource<CDOCommonRepository>((CDOCommonRepository)object, RepositoryProperties.INSTANCE);
+ }
+
if (object instanceof CDOSession)
{
return new DefaultPropertySource<CDOSession>((CDOSession)object, SessionProperties.INSTANCE);
@@ -202,6 +211,11 @@ public class CDOPropertyAdapterFactory extends AbstractPropertyAdapterFactory
@Override
protected IActionFilter createActionFilter(Object object)
{
+ if (object instanceof CDOCommonRepository)
+ {
+ return REPOSITORY_ACTION_FILTER;
+ }
+
if (object instanceof CDOSession)
{
return SESSION_ACTION_FILTER;
diff --git a/plugins/org.eclipse.emf.cdo/plugin.xml b/plugins/org.eclipse.emf.cdo/plugin.xml
index 90e772d..6379492 100644
--- a/plugins/org.eclipse.emf.cdo/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo/plugin.xml
@@ -49,11 +49,11 @@
</extension>
<extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
+ <propertyTester
id="org.eclipse.emf.cdo.session.properties"
type="org.eclipse.emf.cdo.session.CDOSession"
namespace="org.eclipse.emf.cdo.session"
- properties="open,sessionID,userID,passiveUpdateEnabled,lastUpdateTime,passiveUpdateMode,repositoryName,repositoryUUID,repositoryType,repositoryState,repositoryCreationTime,supportingAudits,supportingBranches,serializeCommits,ensureReferentialIntegrity,idGenerationLocation,storeType,objectIDTypes,userAuthenticated"
+ properties="open,sessionID,userID,passiveUpdateEnabled,lastUpdateTime,passiveUpdateMode,repositoryName,repositoryUUID,repositoryType,repositoryState,repositoryCreationTime,authenticating,supportingAudits,supportingBranches,supportingUnits,serializeCommits,ensureReferentialIntegrity,idGenerationLocation,commitInfoStorage,storeType,objectIDTypes,userAuthenticated"
class="org.eclipse.emf.internal.cdo.session.SessionProperties$Tester"/>
<propertyTester
id="org.eclipse.emf.cdo.view.properties"
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties
index 614542e..4854f10 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties
@@ -100,37 +100,7 @@ SessionPropertyTester_6=Passive Updates Enabled
SessionPropertyTester_7=Whether this session is receiving passive updates from the repository.
SessionPropertyTester_8=Passive Updates Mode
SessionPropertyTester_9=One of INVALIDATIONS, CHANGES, ADDITIONS.
-SessionPropertyTester_10=Name
-SessionPropertyTester_11=The name of the repository of this session.
-SessionPropertyTester_12=UUID
-SessionPropertyTester_13=The UUID of the repository of this session.
-SessionPropertyTester_14=Type
-SessionPropertyTester_15=The type of the repository of this session. One of MASTER, BACKUP, CLONE.
-SessionPropertyTester_16=State
-SessionPropertyTester_17=The state of the repository of this session. One of OFFLINE, SYNCING, ONLINE.
-SessionPropertyTester_18=Creation Time
-SessionPropertyTester_19=The creation time of the repository of this session.
-SessionPropertyTester_20=Supporting Audits
-SessionPropertyTester_21=Whether the repository of this session is supporting auditing.
-SessionPropertyTester_22=Supporting Branches
-SessionPropertyTester_23=Whether the repository of this session is supporting branching.
-SessionPropertyTester_42=Supporting Units
-SessionPropertyTester_43=Whether the repository of this session is supporting units.
-SessionPropertyTester_24=Store Type
-SessionPropertyTester_25=The type of the store that backs the repository of this session.
-SessionPropertyTester_26=Object ID Types
-SessionPropertyTester_27=The types of object IDs created by the store that backs the repository of this session.
-SessionPropertyTester_30=Ensure Referential Integrity
-SessionPropertyTester_31=Whether the repository of this session is ensuring referential integrity.
-SessionPropertyTester_32=ID Generation Location
-SessionPropertyTester_33=One of STORE, CLIENT.
SessionPropertyTester_34=Open
SessionPropertyTester_35=Whether this session is open or not.
SessionPropertyTester_36=Last Update
SessionPropertyTester_37=The time stamp of the last passive update.
-SessionPropertyTester_38=Serialize Commits
-SessionPropertyTester_39=Whether the repository of this session is serializing commits.
-SessionPropertyTester_40=Authenticating
-SessionPropertyTester_41=Whether the repository of this session is authenticating users.
-SessionPropertyTester_42=Commit Info Storage
-SessionPropertyTester_43=One of NO, YES, WITH_MERGE_SOURCE.
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 52f9847..64438f3 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
@@ -12,39 +12,41 @@
package org.eclipse.emf.internal.cdo.session;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
-import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOID.ObjectType;
import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
+import org.eclipse.emf.cdo.internal.common.AbstractRepositoryProperties;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.internal.cdo.messages.Messages;
-import org.eclipse.net4j.util.AdapterUtil;
import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.properties.DefaultPropertyTester;
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 java.util.Set;
-
/**
* @author Eike Stepper
*/
-public class SessionProperties extends Properties<CDOSession> implements CDOCommonRepository
+public class SessionProperties extends AbstractRepositoryProperties<CDOSession>
{
public static final IProperties<CDOSession> INSTANCE = new SessionProperties();
private static final String CATEGORY_SESSION = "Session"; //$NON-NLS-1$
- private static final String CATEGORY_REPOSITORY = "Repository"; //$NON-NLS-1$
-
private SessionProperties()
{
super(CDOSession.class);
+ }
+
+ @Override
+ protected CDOCommonRepository getRepository(CDOSession session)
+ {
+ return session.getRepositoryInfo();
+ }
+
+ @Override
+ protected void initProperties()
+ {
add(new Property<CDOSession>("open", Messages.getString("SessionPropertyTester_34"), //
Messages.getString("SessionPropertyTester_35"), //$NON-NLS-1$
CATEGORY_SESSION)
@@ -111,181 +113,7 @@ public class SessionProperties extends Properties<CDOSession> implements CDOComm
}
});
- add(new Property<CDOSession>("repositoryName", Messages.getString("SessionPropertyTester_10"), //
- Messages.getString("SessionPropertyTester_11"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().getName();
- }
- });
-
- add(new Property<CDOSession>("repositoryUUID", Messages.getString("SessionPropertyTester_12"), //
- Messages.getString("SessionPropertyTester_13"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().getUUID();
- }
- });
-
- add(new Property<CDOSession>("repositoryType", Messages.getString("SessionPropertyTester_14"), //
- Messages.getString("SessionPropertyTester_15"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().getType();
- }
- });
-
- add(new Property<CDOSession>("repositoryState", Messages.getString("SessionPropertyTester_16"), //
- Messages.getString("SessionPropertyTester_17"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().getState();
- }
- });
-
- add(new Property<CDOSession>("repositoryCreationTime", Messages.getString("SessionPropertyTester_18"), //
- Messages.getString("SessionPropertyTester_19"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return CDOCommonUtil.formatTimeStamp(session.getRepositoryInfo().getCreationTime());
- }
- });
-
- add(new Property<CDOSession>("authenticating", Messages.getString("SessionPropertyTester_40"), //
- Messages.getString("SessionPropertyTester_41"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().isAuthenticating();
- }
- });
-
- add(new Property<CDOSession>("supportingAudits", Messages.getString("SessionPropertyTester_20"), //
- Messages.getString("SessionPropertyTester_21"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().isSupportingAudits();
- }
- });
-
- add(new Property<CDOSession>("supportingBranches", Messages.getString("SessionPropertyTester_22"), //
- Messages.getString("SessionPropertyTester_23"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().isSupportingBranches();
- }
- });
-
- add(new Property<CDOSession>("supportingUnits", Messages.getString("SessionPropertyTester_22"), //
- Messages.getString("SessionPropertyTester_23"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().isSupportingBranches();
- }
- });
-
- add(new Property<CDOSession>("serializeCommits", Messages.getString("SessionPropertyTester_38"), //
- Messages.getString("SessionPropertyTester_39"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().isSerializingCommits();
- }
- });
-
- add(new Property<CDOSession>("ensureReferentialIntegrity", Messages.getString("SessionPropertyTester_30"), //
- Messages.getString("SessionPropertyTester_31"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().isEnsuringReferentialIntegrity();
- }
- });
-
- add(new Property<CDOSession>("idGenerationLocation", Messages.getString("SessionPropertyTester_32"), //
- Messages.getString("SessionPropertyTester_33"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().getIDGenerationLocation();
- }
- });
-
- add(new Property<CDOSession>("commitInfoStorage", Messages.getString("SessionPropertyTester_42"), //
- Messages.getString("SessionPropertyTester_43"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().getCommitInfoStorage();
- }
- });
-
- add(new Property<CDOSession>("storeType", Messages.getString("SessionPropertyTester_24"), //
- Messages.getString("SessionPropertyTester_25"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- return session.getRepositoryInfo().getStoreType();
- }
- });
-
- add(new Property<CDOSession>("objectIDTypes", Messages.getString("SessionPropertyTester_26"), //
- Messages.getString("SessionPropertyTester_27"), //$NON-NLS-1$
- CATEGORY_REPOSITORY)
- {
- @Override
- protected Object eval(CDOSession session)
- {
- StringBuilder builder = new StringBuilder();
- for (CDOID.ObjectType objectIDType : session.getRepositoryInfo().getObjectIDTypes())
- {
- if (builder.length() != 0)
- {
- builder.append(", "); //$NON-NLS-1$
- }
-
- builder.append(objectIDType);
- }
-
- return builder;
- }
- });
+ super.initProperties();
add(new Property<CDOSession>("userAuthenticated")
{
@@ -297,108 +125,6 @@ public class SessionProperties extends Properties<CDOSession> implements CDOComm
});
}
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public Object getAdapter(Class adapter)
- {
- return AdapterUtil.adapt(this, adapter, false);
- }
-
- public long getTimeStamp()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getName()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getUUID()
- {
- throw new UnsupportedOperationException();
- }
-
- public Type getType()
- {
- throw new UnsupportedOperationException();
- }
-
- public State getState()
- {
- throw new UnsupportedOperationException();
- }
-
- public long getCreationTime()
- {
- throw new UnsupportedOperationException();
- }
-
- public String getStoreType()
- {
- throw new UnsupportedOperationException();
- }
-
- public Set<ObjectType> getObjectIDTypes()
- {
- throw new UnsupportedOperationException();
- }
-
- public IDGenerationLocation getIDGenerationLocation()
- {
- throw new UnsupportedOperationException();
- }
-
- public CommitInfoStorage getCommitInfoStorage()
- {
- throw new UnsupportedOperationException();
- }
-
- public CDOID getRootResourceID()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isAuthenticating()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isSupportingAudits()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isSupportingBranches()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isSupportingUnits()
- {
- throw new UnsupportedOperationException();
- }
-
- @Deprecated
- public boolean isSupportingEcore()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isSerializingCommits()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isEnsuringReferentialIntegrity()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean waitWhileInitial(IProgressMonitor monitor)
- {
- throw new UnsupportedOperationException();
- }
-
public static void main(String[] args)
{
new Tester().dumpContributionMarkup();