Integrated resource model related changes with eclipse plug-ins.
[platform/upstream/iotivity.git] / service / simulator / java / eclipse-plugin / ServiceProviderPlugin / src / oic / simulator / serviceprovider / view / dialogs / SimpleResourceBasicDetailsPage.java
index dcd4131..0932566 100644 (file)
@@ -53,6 +53,7 @@ public class SimpleResourceBasicDetailsPage extends WizardPage {
     private Text                resTypeTxt;
 
     private Button              observeBtn;
+    private Button              discoverBtn;
     private Button              addIfTypeBtn;
     private Button              removeIfTypeBtn;
 
@@ -62,6 +63,7 @@ public class SimpleResourceBasicDetailsPage extends WizardPage {
     private String              resURI;
     private String              resType;
     private boolean             observable;
+    private boolean             discoverable;
     private Map<String, String> ifTypes;
     private Set<String>         selectedIfTypes;
 
@@ -164,6 +166,11 @@ public class SimpleResourceBasicDetailsPage extends WizardPage {
         gd = new GridData(SWT.FILL, SWT.FILL, true, true);
         otherOptionsGrp.setLayoutData(gd);
 
+        discoverBtn = new Button(otherOptionsGrp, SWT.CHECK);
+        discoverBtn.setText("Discoverable");
+        discoverBtn.setSelection(true);
+        discoverable = true;
+
         observeBtn = new Button(otherOptionsGrp, SWT.CHECK);
         observeBtn.setText("Observable");
         observeBtn.setSelection(true);
@@ -216,6 +223,13 @@ public class SimpleResourceBasicDetailsPage extends WizardPage {
             }
         });
 
+        discoverBtn.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                discoverable = discoverBtn.getSelection();
+            }
+        });
+
         observeBtn.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
@@ -318,8 +332,6 @@ public class SimpleResourceBasicDetailsPage extends WizardPage {
             MessageDialog
                     .openError(getShell(), "Resource URI in use",
                             "Entered resource URI is in use. Please try a different one.");
-            // TODO: Instead of MessageDialog, errors may be shown on wizard
-            // itself.
             return null;
         }
 
@@ -362,4 +374,8 @@ public class SimpleResourceBasicDetailsPage extends WizardPage {
     public boolean isObservable() {
         return observable;
     }
+
+    public boolean isDiscoverable() {
+        return discoverable;
+    }
 }