You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by js...@apache.org on 2004/10/19 23:47:29 UTC

svn commit: rev 55104 - incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property

Author: jsong
Date: Tue Oct 19 14:47:28 2004
New Revision: 55104

Added:
   incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java   (contents, props changed)
   incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.jcs   (contents, props changed)
Log:
Add back one SinglePropertyControl which was removed in r55102 by mistake.



Added: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SingleProperty.java	Tue Oct 19 14:47:28 2004
@@ -0,0 +1,24 @@
+package org.apache.beehive.controls.test.controls.property;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import org.apache.beehive.controls.api.bean.ControlInterface;
+import org.apache.beehive.controls.api.properties.PropertySet;
+
+/**
+ * A control interface with one propertySet and one method declared
+ */
+@ControlInterface
+public interface SingleProperty
+{
+	static final String GREET_DEFAULT = "Hello";
+
+	@PropertySet
+	@Retention(RetentionPolicy.RUNTIME)
+	public @interface Greeting
+	{
+		public String GreetWord() default GREET_DEFAULT;
+    }
+
+	public String sayHello();
+}

Added: incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.jcs
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/property/SinglePropertyImpl.jcs	Tue Oct 19 14:47:28 2004
@@ -0,0 +1,25 @@
+package org.apache.beehive.controls.test.controls.property;
+
+import org.apache.beehive.controls.api.bean.ControlImplementation;
+import org.apache.beehive.controls.api.context.Context;
+import org.apache.beehive.controls.api.context.ControlBeanContext;
+
+/**
+ * A control impl that accesses the property declared by its control interface via control context
+ */
+
+@ControlImplementation
+public class SinglePropertyImpl implements SingleProperty
+{ 
+    @Context ControlBeanContext context;
+
+    /*Accesses the propertySet value and returns the value*/
+    public String sayHello()
+    {
+    	/**BUG: could not refer to Greeting directly*/
+        Greeting greeting=(SingleProperty.Greeting)context.getControlPropertySet(SingleProperty.Greeting.class);
+        
+        return greeting.GreetWord();
+    }
+
+} 
\ No newline at end of file