Author: koen.aers(a)jboss.com
Date: 2008-10-16 14:06:11 -0400 (Thu, 16 Oct 2008)
New Revision: 10900
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java
Log:
container wrapper is properties provider
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultContainerPropertySource.java 2008-10-16
18:06:11 UTC (rev 10900)
@@ -0,0 +1,50 @@
+package org.jboss.tools.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);
+ }
+ }
+ }
+}
Added:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java
===================================================================
---
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java
(rev 0)
+++
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/common/properties/DefaultNodePropertySource.java 2008-10-16
18:06:11 UTC (rev 10900)
@@ -0,0 +1,50 @@
+package org.jboss.tools.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();
+ }
+ 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);
+ }
+ }
+ }
+}
Show replies by date