Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Down arrow functionality for annotation combo box. Done by Nikhil.
authorlingutln <lingutln@localhost>
Thu, 22 Dec 2011 22:26:25 +0000 (22:26 +0000)
committerlingutln <lingutln@localhost>
Thu, 22 Dec 2011 22:26:25 +0000 (22:26 +0000)
svn path=/; revision=232

Annotation/src/ie/dcu/apps/ist/views/SegmentationView.java

index 460c785ae14c08a9756bfdaf31a8485451fcabeb..9104c2679a4819294b0d91591bc642818ca112c4 100644 (file)
@@ -204,14 +204,16 @@ public class SegmentationView extends Composite {
                comboLabel.addKeyListener(new KeyListener() {
                        @Override
                        public void keyReleased(KeyEvent e) {
-                               comboLabel.remove(0,comboLabel.getItemCount()-1);
-                               setLabel(comboLabel.getText());
-                               Display.getCurrent().asyncExec(new Runnable() {
-                               public void run() {
-                                       comboLabel.setText(comboLabel.getText());
-                                       comboLabel.forceFocus();
-                                       }
-                               });
+                               if(e.keyCode == 16777218)
+                               {
+                                       comboLabel.setListVisible(true);
+                               }
+                               else if (!(e.keyCode == 13))
+                               {
+                                       comboLabel.setListVisible(false);
+                                       setLabel(comboLabel.getText());
+                               }
+                               //comboLabel.setSelection(arg0);
                        }
                        @Override
                        public void keyPressed(KeyEvent arg0) {
@@ -800,10 +802,11 @@ public class SegmentationView extends Composite {
        private void setLabel(String content) {
                try
            {
-                       String content1 = URLEncoder.encode(content.toString(),"UTF-8");
-                       URL url = new URL("http://palea.cgrb.oregonstate.edu/services/PO_web_service.php?request_type=term_search&search_value="+content1+"&inc_synonyms&branch_filter=plant_anatomy&max=20");
+                       comboLabel.remove(0,comboLabel.getItemCount()-1);
+                       String encodedContent = URLEncoder.encode(content.toString(),"UTF-8");
+                       URL url = new URL("http://palea.cgrb.oregonstate.edu/services/PO_web_service.php?request_type=term_search&search_value="+encodedContent+"&inc_synonyms&branch_filter=plant_anatomy&max=20");
                        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-                        BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+                       BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                if(connection.getResponseCode() == 200)
                {
                        String inputLine;
@@ -839,6 +842,10 @@ public class SegmentationView extends Composite {
            catch(Exception ex)
            {
            }
+           /*if(comboLabel.getText().equals(null) && comboLabel.getItemCount()>0)
+           {
+               comboLabel.setText(comboLabel.getItem(0));
+           }*/
            assign.setEnabled(!(comboLabel.getText().isEmpty()));
        }