Author: koen.aers(a)jboss.com
Date: 2009-01-28 22:59:43 -0500 (Wed, 28 Jan 2009)
New Revision: 13314
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultConnectionWrapperPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/PropertySourceRegistry.java
Removed:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
Log:
adding property support for elements
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-01-28
22:37:43 UTC (rev 13313)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/META-INF/MANIFEST.MF 2009-01-29
03:59:43 UTC (rev 13314)
@@ -23,6 +23,7 @@
org.jboss.tools.flow.common.figure,
org.jboss.tools.flow.common.model,
org.jboss.tools.flow.common.policy,
+ org.jboss.tools.flow.common.properties,
org.jboss.tools.flow.common.registry,
org.jboss.tools.flow.common.strategy,
org.jboss.tools.flow.common.wrapper
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultConnectionWrapperPropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultConnectionWrapperPropertySource.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultConnectionWrapperPropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -0,0 +1,11 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+
+public class DefaultConnectionWrapperPropertySource extends WrapperPropertySource {
+
+ public DefaultConnectionWrapperPropertySource(ConnectionWrapper wrapper) {
+ super(wrapper);
+ }
+
+}
Deleted:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java 2009-01-28
22:37:43 UTC (rev 13313)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -1,50 +0,0 @@
-package org.jboss.tools.flow.common.properties;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
-
-public class DefaultContainerPropertySource implements IPropertySource {
-
- private static final String NAME =
"org.jboss.tools.flow.common.model.DefaultContainer.name";
-
- private DefaultContainerWrapper wrapper = null;
- private IPropertyDescriptor[] propertyDescriptors;
-
- public DefaultContainerPropertySource(DefaultContainerWrapper wrapper) {
- this.wrapper = wrapper;
- }
- public Object getEditableValue() {
- return null;
- }
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (propertyDescriptors == null) {
- propertyDescriptors = new IPropertyDescriptor[] {
- new TextPropertyDescriptor(NAME, "Name") {}
- };
- }
- return propertyDescriptors;
- }
- public Object getPropertyValue(Object id) {
- if (NAME.equals(id)) {
- return wrapper.getName();
- }
- return null;
- }
- public boolean isPropertySet(Object id) {
- if (NAME.equals(id)) {
- return wrapper.getName() != null;
- }
- return false;
- }
- public void resetPropertyValue(Object id) {
- }
- public void setPropertyValue(Object id, Object value) {
- if (NAME.equals(id)) {
- if (value instanceof String) {
- wrapper.setName((String)value);
- }
- }
- }
-}
Copied:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java
(from rev 12582,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerPropertySource.java)
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -0,0 +1,61 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultContainerWrapper;
+
+public class DefaultContainerWrapperPropertySource extends WrapperPropertySource
implements IPropertyId {
+
+ private DefaultContainerWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultContainerWrapperPropertySource(DefaultContainerWrapper wrapper) {
+ super(wrapper);
+ this.wrapper = wrapper;
+ }
+
+ public Object getEditableValue() {
+ return super.getEditableValue();
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ propertyDescriptors = merge(propertyDescriptors, super.getPropertyDescriptors());
+ }
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ } else {
+ return super.getPropertyValue(id);
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ } else {
+ return super.isPropertySet(id);
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ super.resetPropertyValue(id);
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ } else {
+ super.setPropertyValue(id, value);
+ }
+ }
+
+}
Property changes on:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultContainerWrapperPropertySource.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java 2009-01-28
22:37:43 UTC (rev 13313)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -1,50 +0,0 @@
-package org.jboss.tools.flow.common.properties;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
-
-public class DefaultFlowPropertySource implements IPropertySource {
-
- private static final String NAME =
"org.jboss.tools.flow.common.model.DefaultFlow.name";
-
- private DefaultFlowWrapper wrapper = null;
- private IPropertyDescriptor[] propertyDescriptors;
-
- public DefaultFlowPropertySource(DefaultFlowWrapper wrapper) {
- this.wrapper = wrapper;
- }
- public Object getEditableValue() {
- return null;
- }
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (propertyDescriptors == null) {
- propertyDescriptors = new IPropertyDescriptor[] {
- new TextPropertyDescriptor(NAME, "Name") {}
- };
- }
- return propertyDescriptors;
- }
- public Object getPropertyValue(Object id) {
- if (NAME.equals(id)) {
- return wrapper.getName();
- }
- return null;
- }
- public boolean isPropertySet(Object id) {
- if (NAME.equals(id)) {
- return wrapper.getName() != null;
- }
- return false;
- }
- public void resetPropertyValue(Object id) {
- }
- public void setPropertyValue(Object id, Object value) {
- if (NAME.equals(id)) {
- if (value instanceof String) {
- wrapper.setName((String)value);
- }
- }
- }
-}
Copied:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java
(from rev 12582,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowPropertySource.java)
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -0,0 +1,56 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultFlowWrapper;
+
+public class DefaultFlowWrapperPropertySource extends WrapperPropertySource implements
IPropertyId {
+
+ private DefaultFlowWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultFlowWrapperPropertySource(DefaultFlowWrapper wrapper) {
+ super(wrapper);
+ this.wrapper = (DefaultFlowWrapper)wrapper;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ propertyDescriptors = merge(propertyDescriptors, super.getPropertyDescriptors());
+ }
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName();
+ } else {
+ return super.getPropertyValue(id);
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ } else {
+ return super.isPropertySet(id);
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ super.resetPropertyValue(id);
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ } else {
+ super.setPropertyValue(id, value);
+ }
+ }
+}
Property changes on:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultFlowWrapperPropertySource.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java 2009-01-28
22:37:43 UTC (rev 13313)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -1,50 +0,0 @@
-package org.jboss.tools.flow.common.properties;
-
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
-
-public class DefaultNodePropertySource implements IPropertySource {
-
- private static final String NAME =
"org.jboss.tools.flow.common.model.DefaultNode.name";
-
- private DefaultNodeWrapper wrapper = null;
- private IPropertyDescriptor[] propertyDescriptors;
-
- public DefaultNodePropertySource(DefaultNodeWrapper wrapper) {
- this.wrapper = wrapper;
- }
- public Object getEditableValue() {
- return null;
- }
- public IPropertyDescriptor[] getPropertyDescriptors() {
- if (propertyDescriptors == null) {
- propertyDescriptors = new IPropertyDescriptor[] {
- new TextPropertyDescriptor(NAME, "Name") {}
- };
- }
- return propertyDescriptors;
- }
- public Object getPropertyValue(Object id) {
- if (NAME.equals(id)) {
- return wrapper.getName() != null ? wrapper.getName() : "";
- }
- return null;
- }
- public boolean isPropertySet(Object id) {
- if (NAME.equals(id)) {
- return wrapper.getName() != null;
- }
- return false;
- }
- public void resetPropertyValue(Object id) {
- }
- public void setPropertyValue(Object id, Object value) {
- if (NAME.equals(id)) {
- if (value instanceof String) {
- wrapper.setName((String)value);
- }
- }
- }
-}
Copied:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java
(from rev 12582,
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodePropertySource.java)
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -0,0 +1,60 @@
+package org.jboss.tools.flow.common.properties;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.TextPropertyDescriptor;
+import org.jboss.tools.flow.common.wrapper.DefaultNodeWrapper;
+
+public class DefaultNodeWrapperPropertySource extends WrapperPropertySource implements
IPropertyId {
+
+ private DefaultNodeWrapper wrapper = null;
+ private IPropertyDescriptor[] propertyDescriptors;
+
+ public DefaultNodeWrapperPropertySource(DefaultNodeWrapper wrapper) {
+ super(wrapper);
+ this.wrapper = wrapper;
+ }
+
+ public Object getEditableValue() {
+ return super.getEditableValue();
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (propertyDescriptors == null) {
+ propertyDescriptors = new IPropertyDescriptor[] {
+ new TextPropertyDescriptor(NAME, "Name") {}
+ };
+ propertyDescriptors = merge(propertyDescriptors, super.getPropertyDescriptors());
+ }
+ return propertyDescriptors;
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null ? wrapper.getName() : "";
+ } else {
+ return super.getPropertyValue(id);
+ }
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (NAME.equals(id)) {
+ return wrapper.getName() != null;
+ } else {
+ return super.isPropertySet(id);
+ }
+ }
+
+ public void resetPropertyValue(Object id) {
+ super.resetPropertyValue(id);
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (NAME.equals(id)) {
+ if (value instanceof String) {
+ wrapper.setName((String)value);
+ }
+ } else {
+ super.setPropertyValue(id, value);
+ }
+ }
+}
Property changes on:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/DefaultNodeWrapperPropertySource.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/IPropertyId.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -0,0 +1,7 @@
+package org.jboss.tools.flow.common.properties;
+
+public interface IPropertyId {
+
+ String NAME = "org.jboss.tools.flow.common.model.name";
+
+}
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/properties/WrapperPropertySource.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -0,0 +1,75 @@
+package org.jboss.tools.flow.common.properties;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
+
+public class WrapperPropertySource implements IPropertySource {
+
+ private Wrapper wrapper;
+ private IPropertySource elementPropertySource;
+
+ public WrapperPropertySource(Wrapper wrapper) {
+ this.wrapper = wrapper;
+ if (wrapper != null && wrapper.getElement() != null) {
+ Object object = wrapper.getElement().getMetaData("propertySource");
+ if (object != null && object instanceof IPropertySource) {
+ elementPropertySource = (IPropertySource)object;
+ }
+ }
+ }
+
+ public Object getEditableValue() {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getEditableValue();
+ }
+ return null;
+ }
+
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getPropertyDescriptors();
+ }
+ return new IPropertyDescriptor[0];
+ }
+
+ public Object getPropertyValue(Object id) {
+ if (elementPropertySource != null) {
+ return elementPropertySource.getPropertyValue(id);
+ }
+ return null;
+ }
+
+ public boolean isPropertySet(Object id) {
+ if (elementPropertySource != null) {
+ return elementPropertySource.isPropertySet(id);
+ }
+ return false;
+ }
+
+ public void resetPropertyValue(Object id) {
+ if (elementPropertySource != null) {
+ elementPropertySource.resetPropertyValue(id);
+ }
+ }
+
+ public void setPropertyValue(Object id, Object value) {
+ if (elementPropertySource != null) {
+ elementPropertySource.setPropertyValue(id, value);
+ }
+ }
+
+ protected Wrapper getWrapper() {
+ return wrapper;
+ }
+
+ protected IPropertyDescriptor[] merge(IPropertyDescriptor[] first, IPropertyDescriptor[]
second) {
+ List<IPropertyDescriptor> result = Arrays.asList(first);
+ result.addAll(Arrays.asList(second));
+ return (IPropertyDescriptor[])result.toArray();
+ }
+
+}
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/PropertySourceRegistry.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/PropertySourceRegistry.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/registry/PropertySourceRegistry.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -0,0 +1,5 @@
+package org.jboss.tools.flow.common.registry;
+
+public class PropertySourceRegistry {
+
+}
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java 2009-01-28
22:37:43 UTC (rev 13313)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultConnectionWrapper.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -5,13 +5,17 @@
import java.util.List;
import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.flow.common.model.Connection;
import org.jboss.tools.flow.common.model.DefaultConnection;
import org.jboss.tools.flow.common.model.Node;
+import org.jboss.tools.flow.common.properties.DefaultConnectionWrapperPropertySource;
public class DefaultConnectionWrapper extends AbstractConnectionWrapper {
+ private DefaultConnectionWrapperPropertySource propertySource;
+
public Connection getConnection() {
return (Connection)getElement();
}
@@ -74,4 +78,20 @@
}
return result;
}
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if (adapter == IPropertySource.class) {
+ return getPropertySource();
+ }
+ return super.getAdapter(adapter);
+ }
+
+ private IPropertySource getPropertySource() {
+ if (propertySource == null) {
+ propertySource = new DefaultConnectionWrapperPropertySource(this);
+ }
+ return propertySource;
+ }
+
}
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2009-01-28
22:37:43 UTC (rev 13313)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultContainerWrapper.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -8,7 +8,7 @@
import org.jboss.tools.flow.common.model.Container;
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.model.Node;
-import org.jboss.tools.flow.common.properties.DefaultContainerPropertySource;
+import org.jboss.tools.flow.common.properties.DefaultContainerWrapperPropertySource;
import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
@@ -18,7 +18,7 @@
private AcceptsElementStrategy acceptsElementStrategy;
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
- private DefaultContainerPropertySource propertySource;
+ private DefaultContainerWrapperPropertySource propertySource;
protected void internalSetName(String name) {
getNode().setName(name);
@@ -134,7 +134,7 @@
private IPropertySource getPropertySource() {
if (propertySource == null) {
- propertySource = new DefaultContainerPropertySource(this);
+ propertySource = new DefaultContainerWrapperPropertySource(this);
}
return propertySource;
}
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java 2009-01-28
22:37:43 UTC (rev 13313)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultFlowWrapper.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -4,13 +4,13 @@
import org.jboss.tools.flow.common.model.DefaultFlow;
import org.jboss.tools.flow.common.model.Flow;
import org.jboss.tools.flow.common.model.Node;
-import org.jboss.tools.flow.common.properties.DefaultFlowPropertySource;
+import org.jboss.tools.flow.common.properties.DefaultFlowWrapperPropertySource;
import org.jboss.tools.flow.common.strategy.AcceptsElementStrategy;
public class DefaultFlowWrapper extends AbstractFlowWrapper {
private AcceptsElementStrategy acceptsElementStrategy;
- private DefaultFlowPropertySource propertySource;
+ private DefaultFlowWrapperPropertySource propertySource;
public String getName() {
return ((DefaultFlow)getElement()).getName();
@@ -72,7 +72,7 @@
private IPropertySource getPropertySource() {
if (propertySource == null) {
- propertySource = new DefaultFlowPropertySource(this);
+ propertySource = new DefaultFlowWrapperPropertySource(this);
}
return propertySource;
}
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2009-01-28
22:37:43 UTC (rev 13313)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/wrapper/DefaultNodeWrapper.java 2009-01-29
03:59:43 UTC (rev 13314)
@@ -4,7 +4,7 @@
import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.flow.common.model.Connection;
import org.jboss.tools.flow.common.model.Node;
-import org.jboss.tools.flow.common.properties.DefaultNodePropertySource;
+import org.jboss.tools.flow.common.properties.DefaultNodeWrapperPropertySource;
import org.jboss.tools.flow.common.strategy.AcceptsIncomingConnectionStrategy;
import org.jboss.tools.flow.common.strategy.AcceptsOutgoingConnectionStrategy;
@@ -12,7 +12,7 @@
private AcceptsIncomingConnectionStrategy incomingConnectionStrategy;
private AcceptsOutgoingConnectionStrategy outgoingConnectionStrategy;
- private DefaultNodePropertySource propertySource;
+ private DefaultNodeWrapperPropertySource propertySource;
public void setNode(Node node) {
setElement(node);
@@ -117,7 +117,7 @@
private IPropertySource getPropertySource() {
if (propertySource == null) {
- propertySource = new DefaultNodePropertySource(this);
+ propertySource = new DefaultNodeWrapperPropertySource(this);
}
return propertySource;
}