[Title] Change prompter interface
authorBon-Yong Lee <bonyong.lee@samsung.com>
Wed, 14 Nov 2012 01:32:55 +0000 (10:32 +0900)
committerBon-Yong Lee <bonyong.lee@samsung.com>
Wed, 14 Nov 2012 01:32:55 +0000 (10:32 +0900)
[Desc.] Fix design for requirement
[Issue] #7420

org.tizen.common/src/org/tizen/common/core/command/Prompter.java
org.tizen.common/src/org/tizen/common/core/command/PrompterConstants.java [new file with mode: 0755]
org.tizen.common/src/org/tizen/common/core/command/UserField.java
org.tizen.common/src/org/tizen/common/core/command/prompter/EclipsePrompter.java
org.tizen.common/src/org/tizen/common/core/command/prompter/NopPrompter.java
org.tizen.common/src/org/tizen/common/core/command/prompter/SWTPrompter.java

index f2866af..a67c909 100755 (executable)
@@ -46,6 +46,7 @@ import org.tizen.common.core.command.prompter.Option;
 public interface
 Prompter
 {
+    
        /**
         * <p>
         * Input user selection.
@@ -95,10 +96,10 @@ Prompter
        
        
        /**
-        * Batch process for user interaction
+        * Batch process for user interaction with option
         * 
-        * @param userFields
-        * @return
+        * @param userFields user interaction specifications
+        * @param options options for prompter
         */
-       Map<String, Object> batch( Collection<UserField> userFields );
+       void batch( Collection<UserField> userFields, Map<String, Object> options );
 }
diff --git a/org.tizen.common/src/org/tizen/common/core/command/PrompterConstants.java b/org.tizen.common/src/org/tizen/common/core/command/PrompterConstants.java
new file mode 100755 (executable)
index 0000000..143fbb2
--- /dev/null
@@ -0,0 +1,33 @@
+/*\r
+ * Common\r
+ *\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact: \r
+ * BonYong Lee <bonyong.lee@samsung.com>\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ *\r
+ */\r
+package org.tizen.common.core.command;\r
+\r
+public class PrompterConstants\r
+{\r
+    public static final String SUPPORT_CONSOLE = "console";\r
+    \r
+    public static final String SUPPORT_IDE = "eclipse";\r
+\r
+}\r
index 8fb7507..1f5c46a 100755 (executable)
@@ -24,6 +24,7 @@
  */\r
 package org.tizen.common.core.command;\r
 \r
+import java.util.ArrayList;\r
 import java.util.Arrays;\r
 import java.util.Collection;\r
 \r
@@ -97,6 +98,11 @@ public class UserField
         return bModify;\r
     }\r
     \r
+    public void setModify( boolean bModify )\r
+    {\r
+        this.bModify = bModify;\r
+    }\r
+    \r
     public Object getValue()\r
     {\r
         return this.value;\r
@@ -123,6 +129,10 @@ public class UserField
     \r
     public void addChild( final UserField... children )\r
     {\r
+        if ( null  == this.children )\r
+        {\r
+            this.children = new ArrayList<UserField>();\r
+        }\r
         this.children.addAll( Arrays.asList( children ) );\r
     }\r
  \r
index 27c3028..fc24a39 100755 (executable)
@@ -201,11 +201,18 @@ implements Prompter
            return getClass().getSimpleName() + "@" + Integer.toHexString( hashCode() ).substring( 0, 4 );
        }
 
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#batch(java.util.Collection)
+     */
     @Override
-    public Map<String, Object> batch(Collection<UserField> userFields)
+    public
+    void
+    batch(
+        final Collection<UserField> userFields,
+        final Map<String, Object> options
+    )
     {
         // TODO implement
-        return null;
     }
        
 }
index 8ea26f2..25c3c3f 100755 (executable)
@@ -130,11 +130,18 @@ implements Prompter
                this.password = password;
        }
 
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#batch(java.util.Collection)
+     */
     @Override
-    public Map<String, Object> batch(Collection<UserField> userFields)
+    public
+    void
+    batch(
+        final Collection<UserField> userFields,
+        final Map<String, Object> options
+    )
     {
         // TODO implement
-        return null;
     }
 
 }
index 429050b..3f53b1c 100755 (executable)
@@ -233,11 +233,18 @@ implements Prompter
                        
        }
 
+    /* (non-Javadoc)
+     * @see org.tizen.common.core.command.Prompter#batch(java.util.Collection)
+     */
     @Override
-    public Map<String, Object> batch(Collection<UserField> userFields)
+    public
+    void
+    batch(
+        final Collection<UserField> userFields,
+        final Map<String, Object> options
+    )
     {
         // TODO implement
-        return null;
     }
 
 }