Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-08-25 01:38:01 -0400
committerEike Stepper2011-08-25 01:38:01 -0400
commitfdd242d0e82758453c76779cb014b9946b5aa2bd (patch)
tree4b357858873dfee7bf45639da1ec18c9d4b73a32
parentdd98ab42864f925fa00ba4b2a14d05340e07916c (diff)
downloadcdo-fdd242d0e82758453c76779cb014b9946b5aa2bd.tar.gz
cdo-fdd242d0e82758453c76779cb014b9946b5aa2bd.tar.xz
cdo-fdd242d0e82758453c76779cb014b9946b5aa2bd.zip
added dumpContributionMarkup() and getReceiverType()
-rw-r--r--plugins/org.eclipse.emf.cdo.workspace/plugin.xml17
-rw-r--r--plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/WorkspaceProperties.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/plugin.xml29
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java10
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/DefaultPropertyTester.java35
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/IProperties.java2
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/Properties.java12
8 files changed, 93 insertions, 26 deletions
diff --git a/plugins/org.eclipse.emf.cdo.workspace/plugin.xml b/plugins/org.eclipse.emf.cdo.workspace/plugin.xml
index ddd24b9567..a671058d15 100644
--- a/plugins/org.eclipse.emf.cdo.workspace/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.workspace/plugin.xml
@@ -21,14 +21,13 @@
type="folder"/>
</extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- id="org.eclipse.emf.cdo.workspace.WorkspaceTester"
- type="org.eclipse.emf.cdo.workspace.CDOWorkspace"
- namespace="org.eclipse.emf.cdo.workspace"
- properties="open,branchPath,timeStamp,fixed,dirty"
- class="org.eclipse.emf.cdo.internal.workspace.WorkspaceProperties$Tester"/>
- </extension>
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ id="org.eclipse.emf.cdo.internal.workspace.WorkspaceProperties$Tester"
+ type="org.eclipse.emf.cdo.workspace.CDOWorkspace"
+ namespace="org.eclipse.emf.cdo.workspace"
+ properties="open,branchPath,timeStamp,fixed,dirty,idGenerationLocation,base,local,remote"
+ class="org.eclipse.emf.cdo.internal.workspace.WorkspaceProperties$Tester"/>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/WorkspaceProperties.java b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/WorkspaceProperties.java
index 80eabd33a8..476d8432f3 100644
--- a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/WorkspaceProperties.java
+++ b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/WorkspaceProperties.java
@@ -28,6 +28,8 @@ public class WorkspaceProperties extends Properties<CDOWorkspace>
private WorkspaceProperties()
{
+ super(CDOWorkspace.class);
+
add(new Property<CDOWorkspace>("open", //$NON-NLS-1$
"Open", "Whether this workspace is open or not.")
{
@@ -119,6 +121,11 @@ public class WorkspaceProperties extends Properties<CDOWorkspace>
});
}
+ public static void main(String[] args)
+ {
+ new Tester().dumpContributionMarkup();
+ }
+
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.emf.cdo/plugin.xml b/plugins/org.eclipse.emf.cdo/plugin.xml
index f2fa1e0a02..ffacfc2463 100644
--- a/plugins/org.eclipse.emf.cdo/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo/plugin.xml
@@ -37,20 +37,19 @@
</parser>
</extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- id="org.eclipse.emf.cdo.SessionTester"
- type="org.eclipse.emf.cdo.session.CDOSession"
- namespace="org.eclipse.emf.cdo.session"
- properties="open,sessionID,userID,passiveUpdateEnabled,passiveUpdateMode,supportingAudits,supportingBranches,repositoryName,repositoryUUID,repositoryType,repositoryState,repositoryCreationTime"
- class="org.eclipse.emf.internal.cdo.session.SessionProperties$Tester"/>
- <propertyTester
- id="org.eclipse.emf.cdo.ViewTester"
- type="org.eclipse.emf.cdo.view.CDOView"
- namespace="org.eclipse.emf.cdo.view"
- properties="open,viewID,branchName,branchPath,timeStamp,readOnly,dirty,durable,sessionID,userID"
- class="org.eclipse.emf.internal.cdo.view.ViewProperties$Tester"/>
- </extension>
+ <extension point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ id="org.eclipse.emf.internal.cdo.session.SessionProperties$Tester"
+ 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,supportingEcore,ensureReferentialIntegrity,idGenerationLocation,storeType,objectIDTypes"
+ class="org.eclipse.emf.internal.cdo.session.SessionProperties$Tester"/>
+ <propertyTester
+ id="org.eclipse.emf.internal.cdo.view.ViewProperties$Tester"
+ type="org.eclipse.emf.cdo.view.CDOView"
+ namespace="org.eclipse.emf.cdo.view"
+ properties="open,viewID,branchName,branch,timeStamp,lastUpdateTime,readOnly,dirty,durable,sessionID,userID"
+ class="org.eclipse.emf.internal.cdo.view.ViewProperties$Tester"/>
+ </extension>
</plugin>
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 c237c38a31..81d229e1c3 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
@@ -34,6 +34,8 @@ public class SessionProperties extends Properties<CDOSession>
private SessionProperties()
{
+ super(CDOSession.class);
+
add(new Property<CDOSession>("open", Messages.getString("SessionPropertyTester_34"),//
Messages.getString("SessionPropertyTester_35"), //$NON-NLS-1$
CATEGORY_SESSION)
@@ -244,6 +246,11 @@ public class SessionProperties extends Properties<CDOSession>
});
}
+ public static void main(String[] args)
+ {
+ new Tester().dumpContributionMarkup();
+ }
+
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java
index bce3e50d90..38ba6af35a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/ViewProperties.java
@@ -31,6 +31,8 @@ public class ViewProperties extends Properties<CDOView>
private ViewProperties()
{
+ super(CDOView.class);
+
add(new Property<CDOView>("open", //$NON-NLS-1$
"Open", "Whether this view is open or not.", CATEGORY_VIEW)
{
@@ -142,6 +144,14 @@ public class ViewProperties extends Properties<CDOView>
}
/**
+ *
+ */
+ public static void main(String[] args)
+ {
+ new Tester().dumpContributionMarkup();
+ }
+
+ /**
* @author Eike Stepper
*/
public static final class Tester extends DefaultPropertyTester<CDOView>
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/DefaultPropertyTester.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/DefaultPropertyTester.java
index 1473d062a0..49569b9780 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/DefaultPropertyTester.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/DefaultPropertyTester.java
@@ -29,6 +29,11 @@ public class DefaultPropertyTester<RECEIVER> extends PropertyTester implements I
this.properties = properties;
}
+ public Class<RECEIVER> getReceiverType()
+ {
+ return properties.getReceiverType();
+ }
+
public Property<RECEIVER> getProperty(String name)
{
return properties.getProperty(name);
@@ -56,4 +61,34 @@ public class DefaultPropertyTester<RECEIVER> extends PropertyTester implements I
RECEIVER typed = (RECEIVER)receiver;
return property.testValue(typed, args, expectedValue);
}
+
+ public void dumpContributionMarkup()
+ {
+ System.out.println(" <extension point=\"org.eclipse.core.expressions.propertyTesters\">");
+ System.out.println(" <propertyTester");
+ System.out.println(" id=\"" + getClass().getName() + "\"");
+ System.out.println(" type=\"" + getReceiverType().getName() + "\"");
+ System.out.println(" namespace=\"" + getClass().getPackage().getName() + "\"");
+ System.out.print(" properties=\"");
+
+ boolean first = true;
+ for (Property<RECEIVER> property : getProperties())
+ {
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ System.out.print(",");
+ }
+
+ System.out.print(property.getName());
+ }
+
+ System.out.println("\"");
+ System.out.println(" class=\"" + getClass().getName() + "\"/>");
+ System.out.println(" </extension>");
+
+ }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/IProperties.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/IProperties.java
index 9248b3a265..480fc03010 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/IProperties.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/IProperties.java
@@ -18,6 +18,8 @@ package org.eclipse.net4j.util.properties;
*/
public interface IProperties<RECEIVER> extends IPropertyProvider<RECEIVER>
{
+ public Class<RECEIVER> getReceiverType();
+
public Property<RECEIVER> getProperty(String name);
public void add(Property<RECEIVER> property);
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/Properties.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/Properties.java
index 10e80333f6..afcc95b500 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/Properties.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/properties/Properties.java
@@ -23,10 +23,18 @@ import java.util.List;
*/
public class Properties<RECEIVER> implements IProperties<RECEIVER>
{
- private List<Property<RECEIVER>> properties = new ArrayList<Property<RECEIVER>>();
+ private final List<Property<RECEIVER>> properties = new ArrayList<Property<RECEIVER>>();
- public Properties()
+ private final Class<RECEIVER> receiverType;
+
+ public Properties(Class<RECEIVER> receiverType)
+ {
+ this.receiverType = receiverType;
+ }
+
+ public final Class<RECEIVER> getReceiverType()
{
+ return receiverType;
}
public final void add(Property<RECEIVER> property)

Back to the top