axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sandak...@apache.org
Subject svn commit: r473286 - /webservices/axis2/branches/java/1_1/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java
Date Fri, 10 Nov 2006 09:34:27 GMT
Author: sandakith
Date: Fri Nov 10 01:34:26 2006
New Revision: 473286

URL: http://svn.apache.org/viewvc?view=rev&rev=473286
Log:
Resolved the issue AXIS2-1485, same entry can be added  more than one time to the list entries

Modified:
    webservices/axis2/branches/java/1_1/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java

Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java?view=diff&rev=473286&r1=473285&r2=473286
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-eclipse-codegen-plugin/src/main/java/org/apache/axis2/tool/codegen/eclipse/ui/JavaSourceSelectionPage.java
Fri Nov 10 01:34:26 2006
@@ -53,7 +53,7 @@
 
     protected void initializeDefaultSettings() {
         settings.put(JAVA_CLASS_NAME, "");
-        settings.put(JAVA_CLASS_PATH_ENTRIES, new String[]{});
+        settings.put(JAVA_CLASS_PATH_ENTRIES, new String[]{""});
     }
 
     /*
@@ -144,6 +144,7 @@
         javaClasspathList = new List(container,SWT.READ_ONLY | SWT.BORDER| SWT.V_SCROLL);
         javaClasspathList.setLayoutData(gd);
         javaClasspathList.setItems(settings.getArray(JAVA_CLASS_PATH_ENTRIES));
+        javaClasspathList.setSize(300, 300);
         container.redraw();
 
 
@@ -216,8 +217,10 @@
         DirectoryDialog fileDialog = new DirectoryDialog(this.getShell());
         String dirName = fileDialog.open();
         if (dirName != null) {
-        	javaClasspathList.add(dirName);
-        	updateListEntries();
+        	if (!checkFilenameExistsInList(dirName)){  
+        		javaClasspathList.add(dirName);
+        		updateListEntries();
+        	}
         }
         updateStatusTextField(false,"");
     }
@@ -246,10 +249,29 @@
         fileDialog.setFilterExtensions(new String[]{"*.jar"});
         String fileName = fileDialog.open();
         if (fileName != null) {
-        	javaClasspathList.add(fileName);
-        	updateListEntries();
+        	if (!checkFilenameExistsInList(fileName)){
+            	javaClasspathList.add(fileName);
+            	updateListEntries();
+        	}
         }
         updateStatusTextField(false,"");
+    }
+    
+    /**
+     * Method checks the list antries and compare that to the file name 
+     * return the results of the comparison
+     * @param filename
+     * @return
+     */
+    private boolean checkFilenameExistsInList(String filename){
+    	String[] array = javaClasspathList.getItems();
+
+    	for (int i = 0; i < array.length; i++) {
+			if (array[i].equals(filename)) {
+				return true;
+			}
+		}
+    	return false;
     }
     
     private void updateStatusTextField(boolean success,String text){



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message