click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r1086326 - /click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java
Date Mon, 28 Mar 2011 18:19:48 GMT
Author: takezoe
Date: Mon Mar 28 18:19:48 2011
New Revision: 1086326

URL: http://svn.apache.org/viewvc?rev=1086326&view=rev
Log:
Fixed: source folder shows only the element name

Modified:
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java?rev=1086326&r1=1086325&r2=1086326&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java
(original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java
Mon Mar 28 18:19:48 2011
@@ -308,16 +308,18 @@ public class NewClickPageWizardPage exte
 		sourceFolder = new Text(sourceField, SWT.BORDER);
 		sourceField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 		sourceFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+		IJavaProject project = ClickUtils.getJavaProject(selection);
 		IPackageFragmentRoot root = ClickUtils.getSourceFolder(selection);
-		if(root!=null){
-			sourceFolder.setText(root.getElementName());
-		} else if(selection!=null){
+
+		if(root != null){
+			sourceFolder.setText(root.getPath().makeRelativeTo(project.getPath()).toString());
+		} else if(selection != null){
 			try {
-				IJavaProject project = ClickUtils.getJavaProject(selection);
 				if(project!=null){
 					IPackageFragmentRoot[] roots = project.getPackageFragmentRoots();
 					if(roots.length >= 1){
-						sourceFolder.setText(roots[0].getElementName());
+						sourceFolder.setText(roots[0].getPath().makeRelativeTo(project.getPath()).toString());
 					}
 				}
 			} catch(Exception ex){
@@ -779,7 +781,8 @@ public class NewClickPageWizardPage exte
 			dialog.addFilter(filter);
 			dialog.setInitialSelection(init);
 			if (dialog.open() == FolderSelectionDialog.OK) {
-				sourceFolder.setText(((IPackageFragmentRoot)dialog.getFirstResult()).getElementName());
+				IPackageFragmentRoot root = (IPackageFragmentRoot) dialog.getFirstResult();
+				sourceFolder.setText(root.getPath().makeRelativeTo(project.getPath()).toString());
 			}
 
 		} catch (Throwable t) {



Mime
View raw message