ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r830356 - in /ant/ivy/ivyde/trunk: ./ org.apache.ivyde.eclipse/META-INF/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/ org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/ org.apache.ivyde.eclipse/src/jav...
Date Tue, 27 Oct 2009 21:55:45 GMT
Author: hibou
Date: Tue Oct 27 21:55:44 2009
New Revision: 830356

URL: http://svn.apache.org/viewvc?rev=830356&view=rev
Log:
IVYDE-152 : Support for Eclipse variables
 - make the ivy settings path editor and the property file editor support eclipse varibles
 - move the settigns editor so it's own tab as it is bigger now
 - add some test projects to test the feature
This will also resolve IVYDE-183 and IVYDE-138

Added:
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java   (with props)
    ant/ivy/ivyde/trunk/test/variables/   (with props)
    ant/ivy/ivyde/trunk/test/variables-props/   (with props)
    ant/ivy/ivyde/trunk/test/variables-props/.classpath
    ant/ivy/ivyde/trunk/test/variables-props/.project
    ant/ivy/ivyde/trunk/test/variables-props/ivy.xml   (with props)
    ant/ivy/ivyde/trunk/test/variables-props/src/
    ant/ivy/ivyde/trunk/test/variables/.classpath
    ant/ivy/ivyde/trunk/test/variables/.project
    ant/ivy/ivyde/trunk/test/variables/ivy.xml   (with props)
    ant/ivy/ivyde/trunk/test/variables/src/
Modified:
    ant/ivy/ivyde/trunk/CHANGES.txt
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyFilePathText.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java

Modified: ant/ivy/ivyde/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/CHANGES.txt?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/CHANGES.txt (original)
+++ ant/ivy/ivyde/trunk/CHANGES.txt Tue Oct 27 21:55:44 2009
@@ -10,6 +10,7 @@
 - NEW: Add an option in the container to automatically laucnh a resolve before each launch (IVYDE-204)
 - NEW: "Reverse Dependency Explorer" View for synchronizing revisions across multiple projects in a workspace (IVYDE-195) (thanks to Jon Schneider)
 - NEW: Make the Ivy console filter on the logging level (IVYDE-205)
+- NEW: Support for Eclipse variables (IVYDE-152)
 
 - IMPROVE: Wrap cache cleaning in a job so that it does not block the workspace (IVYDE-207) (thanks to Jon Schneider)
 - IMPROVE: Allow workspace resolver to skip version matcher (IVYDE-187) (thanks to Phillip Webb)

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF Tue Oct 27 21:55:44 2009
@@ -35,6 +35,8 @@
  org.eclipse.help,
  org.eclipse.wst.xml.core,
  org.eclipse.debug.core,
- org.eclipse.jdt.launching
+ org.eclipse.jdt.launching,
+ org.eclipse.debug.ui,
+ org.eclipse.core.variables
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: J2SE-1.4

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java Tue Oct 27 21:55:44 2009
@@ -44,6 +44,8 @@
 
     private static final String PROJECT_SCHEME_PREFIX = "project://";
 
+    private static final int PROJECT_SCHEME_PREFIX_LENGTH = PROJECT_SCHEME_PREFIX.length();
+
     private IvyClasspathContainerConfAdapter() {
         // utility class
     }
@@ -181,7 +183,9 @@
 
     /**
      * Read old configuration that were based on relative urls, like: "file://./ivysettings.xml" or
-     * "file:./ivysettings.xml". This kind of URL "project:///ivysettings.xml" should be used now.
+     * "file:./ivysettings.xml", and also URL like "project:///ivysettings.xml".
+     * <p>
+     * It will be replaced by the Eclipse variable ${workspace_loc: ... }
      * 
      * @param value
      *            the value to read
@@ -191,6 +195,13 @@
         if (FakeProjectManager.isFake(conf.getJavaProject())) {
             return value;
         }
+        if (value.startsWith(PROJECT_SCHEME_PREFIX)) {
+            String path = value.substring(PROJECT_SCHEME_PREFIX_LENGTH);
+            if (path.startsWith("/")) {
+                path = conf.getJavaProject().getProject().getName() + path;
+            }
+            return "${workspace_loc:" + path + "}";
+        }
         URL url;
         try {
             url = new URL(value);
@@ -206,7 +217,8 @@
         if (urlpath != null && urlpath.startsWith("./")) {
             urlpath = urlpath.substring(1);
         }
-        return PROJECT_SCHEME_PREFIX + urlpath;
+        conf.getJavaProject().getProject().getName();
+        return "${workspace_loc:" + conf.getJavaProject().getProject().getName() + urlpath + "}";
     }
 
     private static void checkNonNullConf(IvyClasspathContainerConfiguration conf) {
@@ -214,9 +226,9 @@
         IvySettingsSetup settingsSetup = conf.getIvySettingsSetup();
         ContainerMappingSetup prefStoreMappingSetup = IvyPlugin.getPreferenceStoreHelper()
                 .getContainerMappingSetup();
-        if (settingsSetup.getPropertyFiles() == null) {
+        if (settingsSetup.getRawPropertyFiles() == null) {
             settingsSetup.setPropertyFiles(IvyPlugin.getPreferenceStoreHelper()
-                    .getIvySettingsSetup().getPropertyFiles());
+                    .getIvySettingsSetup().getRawPropertyFiles());
         }
         if (mappingSetup.getAcceptedTypes() == null) {
             mappingSetup.setAcceptedTypes(prefStoreMappingSetup.getAcceptedTypes());
@@ -244,9 +256,9 @@
             append(path, "confs", conf.getConfs());
             if (conf.isSettingsProjectSpecific()) {
                 IvySettingsSetup setup = conf.getIvySettingsSetup();
-                append(path, "ivySettingsPath", setup.getIvySettingsPath());
+                append(path, "ivySettingsPath", setup.getRawIvySettingsPath());
                 append(path, "loadSettingsOnDemand", setup.isLoadSettingsOnDemand());
-                append(path, "propertyFiles", setup.getPropertyFiles());
+                append(path, "propertyFiles", setup.getRawPropertyFiles());
             }
             if (conf.isRetrieveProjectSpecific()) {
                 RetrieveSetup setup = conf.getRetrieveSetup();

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerConfiguration.java Tue Oct 27 21:55:44 2009
@@ -21,8 +21,12 @@
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.ivyde.eclipse.IvyDEException;
 import org.apache.ivyde.eclipse.IvyPlugin;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.variables.IStringVariableManager;
+import org.eclipse.core.variables.VariablesPlugin;
 import org.eclipse.jdt.core.IClasspathAttribute;
 import org.eclipse.jdt.core.IJavaProject;
 
@@ -204,11 +208,11 @@
     // Getters that take into account the global preferences
     // ///////////////////////////
 
-    public String getInheritedIvySettingsPath() {
+    public String getInheritedIvySettingsPath() throws IvyDEException {
         if (!isSettingsProjectSpecific) {
-            return IvyPlugin.getPreferenceStoreHelper().getIvySettingsSetup().getIvySettingsPath();
+            return IvyPlugin.getPreferenceStoreHelper().getIvySettingsSetup().getResolvedIvySettingsPath();
         }
-        return ivySettingsSetup.getIvySettingsPath();
+        return ivySettingsSetup.getResolvedIvySettingsPath();
     }
 
     public boolean getInheritedLoadSettingsOnDemandPath() {
@@ -219,11 +223,11 @@
         return ivySettingsSetup.isLoadSettingsOnDemand();
     }
 
-    public Collection getInheritedPropertyFiles() {
+    public Collection getInheritedPropertyFiles() throws IvyDEException {
         if (!isSettingsProjectSpecific) {
-            return IvyPlugin.getPreferenceStoreHelper().getIvySettingsSetup().getPropertyFiles();
+            return IvyPlugin.getPreferenceStoreHelper().getIvySettingsSetup().getResolvedPropertyFiles();
         } else {
-            return ivySettingsSetup.getPropertyFiles();
+            return ivySettingsSetup.getResolvedPropertyFiles();
         }
     }
 

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathContainerState.java Tue Oct 27 21:55:44 2009
@@ -43,7 +43,6 @@
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
@@ -57,10 +56,6 @@
  */
 public class IvyClasspathContainerState {
 
-    private static final String PROJECT_SCHEME_PREFIX = "project://";
-
-    private static final int PROJECT_SCHEME_PREFIX_LENGTH = PROJECT_SCHEME_PREFIX.length();
-
     private Ivy ivy;
 
     private long ivySettingsLastModified = -1;
@@ -172,47 +167,6 @@
             return ivy;
         }
 
-        if (settingsPath.startsWith(PROJECT_SCHEME_PREFIX)) {
-            int pathIndex = settingsPath.indexOf("/", PROJECT_SCHEME_PREFIX_LENGTH);
-            String projectName = settingsPath.substring(PROJECT_SCHEME_PREFIX_LENGTH, pathIndex);
-            String path = settingsPath.substring(pathIndex + 1);
-            if (projectName.equals("")) {
-                if (FakeProjectManager.isFake(conf.getJavaProject())) {
-                    // this is a fake project, we are in the launch config, project:// is forbidden
-                    IvyDEException ex = new IvyDEException("Invalid Ivy settings path",
-                            "the project:/// scheme is not allowed in the launch configurations '"
-                                    + settingsPath + "'", null);
-                    setConfStatus(ex);
-                    throw ex;
-                }
-                File file = conf.getJavaProject().getProject().getLocation().append(path).toFile();
-                if (!file.exists()) {
-                    IvyDEException ex = new IvyDEException("Ivy settings file not found",
-                            "The Ivy settings file '" + settingsPath + "' cannot be found", null);
-                    setConfStatus(ex);
-                    throw ex;
-                }
-                return getIvy(file);
-            } else {
-                IResource p = ResourcesPlugin.getWorkspace().getRoot().findMember(projectName);
-                if (p == null) {
-                    IvyDEException ex = new IvyDEException("Project '" + projectName
-                            + "' not found", "The project name '" + projectName + "' from '"
-                            + settingsPath + "' was not found", null);
-                    setConfStatus(ex);
-                    throw ex;
-                }
-                File file = p.getProject().getFile(path).getLocation().toFile();
-                if (!file.exists()) {
-                    IvyDEException ex = new IvyDEException("Ivy settings file not found",
-                            "The Ivy settings file '" + path + "' cannot be found in project '"
-                                    + projectName + "'", null);
-                    setConfStatus(ex);
-                    throw ex;
-                }
-                return getIvy(file);
-            }
-        }
         // before returning the found ivy, try to refresh it if the settings changed
         URL url;
         try {
@@ -255,7 +209,7 @@
     }
 
     private Ivy getIvy(File file) throws IvyDEException {
-        String ivySettingsPath = conf.getIvySettingsSetup().getIvySettingsPath();
+        String ivySettingsPath = conf.getIvySettingsSetup().getResolvedIvySettingsPath();
         if (!file.exists()) {
             IvyDEException ex = new IvyDEException("Ivy settings file not found",
                     "The Ivy settings file '" + ivySettingsPath + "' cannot be found", null);

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvyClasspathUtil.java Tue Oct 27 21:55:44 2009
@@ -29,6 +29,7 @@
 
 import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
 import org.apache.ivyde.eclipse.FakeProjectManager;
+import org.apache.ivyde.eclipse.IvyDEException;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
@@ -180,7 +181,14 @@
                         IClasspathContainer cp = JavaCore.getClasspathContainer(path, javaProject);
                         if (cp instanceof IvyClasspathContainer) {
                             IvyClasspathContainer ivycp = (IvyClasspathContainer) cp;
-                            if (ivycp.getConf().getInheritedIvySettingsPath().equals(
+                            String settingsPath;
+                            try {
+                                settingsPath = ivycp.getConf().getInheritedIvySettingsPath();
+                            } catch (IvyDEException e) {
+                                // cannot resolve the ivy settings so just ignore
+                                continue;
+                            }
+                            if (settingsPath.equals(
                                 ivySettings.getProjectRelativePath().toString())) {
                                 containers.add(ivycp);
                             }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvySettingsSetup.java Tue Oct 27 21:55:44 2009
@@ -17,8 +17,19 @@
  */
 package org.apache.ivyde.eclipse.cpcontainer;
 
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
+import org.apache.ivyde.eclipse.IvyDEException;
+import org.apache.ivyde.eclipse.IvyPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.variables.IStringVariableManager;
+import org.eclipse.core.variables.VariablesPlugin;
+
 /**
  * This class is just a simple bean defining the properties which configure an IvyDE classpath
  * container.
@@ -44,7 +55,28 @@
         this.loadSettingsOnDemand = setup.loadSettingsOnDemand;
     }
 
-    public String getIvySettingsPath() {
+    public String getResolvedIvySettingsPath() throws IvyDEException {
+        String url;
+        IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
+        try {
+            url = manager.performStringSubstitution(ivySettingsPath, false);
+        } catch (CoreException e) {
+            throw new IvyDEException("Unrecognized variables",
+                    "Unrecognized variables in the Ivy settings file " + ivySettingsPath, e);
+        }
+        if (ivySettingsPath.trim().startsWith("$")) {
+            // it starts with a variable, let's add the file protocol.
+            try {
+                url = new File(url).toURI().toURL().toExternalForm();
+            } catch (MalformedURLException e) {
+                IvyPlugin.log(IStatus.ERROR,
+                    "The file got from the workspace browser has not a valid URL", e);
+            }
+        }
+        return url;
+    }
+
+    public String getRawIvySettingsPath() {
         return ivySettingsPath;
     }
 
@@ -52,10 +84,27 @@
         this.ivySettingsPath = ivySettingsPath;
     }
 
-    public List getPropertyFiles() {
+    public List getRawPropertyFiles() {
         return propertyFiles;
     }
 
+    public List getResolvedPropertyFiles() throws IvyDEException {
+        List resolvedProps = new ArrayList();
+        IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
+        try {
+            Iterator it = propertyFiles.iterator();
+            while (it.hasNext()) {
+                String propFile = (String) it.next();
+                String resolvedProp = manager.performStringSubstitution(propFile, false);
+                resolvedProps.add(resolvedProp);
+            }
+        } catch (CoreException e) {
+            throw new IvyDEException("Unrecognized variables",
+                    "Unrecognized variables in the Ivy settings file " + ivySettingsPath, e);
+        }
+        return resolvedProps;
+    }
+
     public void setPropertyFiles(List propertyFiles) {
         this.propertyFiles = propertyFiles;
     }

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/cpcontainer/IvydeContainerPage.java Tue Oct 27 21:55:44 2009
@@ -292,6 +292,10 @@
         mainTab.setText("Main");
         mainTab.setControl(createMainTab(tabs));
 
+        TabItem settingsTab = new TabItem(tabs, SWT.NONE);
+        settingsTab.setText("Settings");
+        settingsTab.setControl(createSettingsTab(tabs));
+
         TabItem retrieveTab = new TabItem(tabs, SWT.NONE);
         retrieveTab.setText("Retrieve");
         retrieveTab.setControl(createRetrieveTab(tabs));
@@ -319,53 +323,11 @@
         composite.setLayout(new GridLayout());
         composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 
-        Composite headerComposite = new Composite(composite, SWT.NONE);
-        headerComposite.setLayout(new GridLayout(2, false));
-        headerComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
-
-        settingsProjectSpecificButton = new Button(headerComposite, SWT.CHECK);
-        settingsProjectSpecificButton.setText("Enable project specific settings");
-        settingsProjectSpecificButton.addSelectionListener(new SelectionAdapter() {
-            public void widgetSelected(SelectionEvent e) {
-                updateFieldsStatusSettings();
-                conf.setIvySettingsSetup(settingsEditor.getIvySettingsSetup());
-                settingsUpdated();
-            }
-        });
-
-        mainGeneralSettingsLink = new Link(headerComposite, SWT.NONE);
-        mainGeneralSettingsLink.setFont(headerComposite.getFont());
-        mainGeneralSettingsLink.setText("<A>Configure Workspace Settings...</A>");
-        mainGeneralSettingsLink.addSelectionListener(new SelectionAdapter() {
-            public void widgetSelected(SelectionEvent e) {
-                PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),
-                    SettingsPreferencePage.PEREFERENCE_PAGE_ID, null, null);
-                dialog.open();
-            }
-        });
-        mainGeneralSettingsLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
-
-        Label horizontalLine = new Label(headerComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
-        horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
-
         // CheckStyle:MagicNumber| OFF
         Composite configComposite = new Composite(composite, SWT.NONE);
         configComposite.setLayout(new GridLayout(3, false));
         configComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
 
-        settingsEditor = new SettingsEditor(configComposite, SWT.NONE);
-        settingsEditor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
-        settingsEditor.addListener(new SettingsEditorListener() {
-            public void settingsEditorUpdated(IvySettingsSetup setup) {
-                conf.setIvySettingsSetup(setup);
-                settingsUpdated();
-            }
-        });
-
-        horizontalLine = new Label(configComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
-        horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
-        // CheckStyle:MagicNumber| OFN
-
         // Label for ivy file field
         Label pathLabel = new Label(configComposite, SWT.NONE);
         pathLabel.setText("Ivy File");
@@ -378,7 +340,7 @@
             }
         });
         ivyFilePathText
-                .setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+                .setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
 
         // Label for ivy configurations field
         Label confLabel = new Label(configComposite, SWT.NONE);
@@ -414,6 +376,57 @@
         return composite;
     }
 
+    private Control createSettingsTab(Composite parent) {
+        Composite composite = new Composite(parent, SWT.NONE);
+        composite.setLayout(new GridLayout());
+        composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+
+        Composite headerComposite = new Composite(composite, SWT.NONE);
+        headerComposite.setLayout(new GridLayout(2, false));
+        headerComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+
+        settingsProjectSpecificButton = new Button(headerComposite, SWT.CHECK);
+        settingsProjectSpecificButton.setText("Enable project specific settings");
+        settingsProjectSpecificButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                updateFieldsStatusSettings();
+                conf.setIvySettingsSetup(settingsEditor.getIvySettingsSetup());
+                settingsUpdated();
+            }
+        });
+
+        mainGeneralSettingsLink = new Link(headerComposite, SWT.NONE);
+        mainGeneralSettingsLink.setFont(headerComposite.getFont());
+        mainGeneralSettingsLink.setText("<A>Configure Workspace Settings...</A>");
+        mainGeneralSettingsLink.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getShell(),
+                    SettingsPreferencePage.PEREFERENCE_PAGE_ID, null, null);
+                dialog.open();
+            }
+        });
+        mainGeneralSettingsLink.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
+
+        Label horizontalLine = new Label(headerComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
+        horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
+
+        // CheckStyle:MagicNumber| OFF
+        Composite configComposite = new Composite(composite, SWT.NONE);
+        configComposite.setLayout(new GridLayout(3, false));
+        configComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
+
+        settingsEditor = new SettingsEditor(configComposite, SWT.NONE);
+        settingsEditor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1));
+        settingsEditor.addListener(new SettingsEditorListener() {
+            public void settingsEditorUpdated(IvySettingsSetup setup) {
+                conf.setIvySettingsSetup(setup);
+                settingsUpdated();
+            }
+        });
+
+        return composite;
+    }
+
     private Control createRetrieveTab(Composite parent) {
         Composite composite = new Composite(parent, SWT.NONE);
         composite.setLayout(new GridLayout());

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyFilePathText.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyFilePathText.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyFilePathText.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/IvyFilePathText.java Tue Oct 27 21:55:44 2009
@@ -98,7 +98,7 @@
 
         ivyFilePathText = (Text) ivyFilePathTextDeco.getControl();
         ivyFilePathTextDeco.getLayoutControl().setLayoutData(
-            new GridData(GridData.FILL, GridData.FILL, true, false));
+            new GridData(GridData.FILL, GridData.CENTER, true, false));
         ivyFilePathText.addModifyListener(new ModifyListener() {
             public void modifyText(ModifyEvent ev) {
                 ivyXmlPathUpdated();

Added: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java?rev=830356&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java (added)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java Tue Oct 27 21:55:44 2009
@@ -0,0 +1,183 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.ivyde.eclipse.ui;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.debug.ui.StringVariableSelectionDialog;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.model.BaseWorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+
+public abstract class PathEditor extends Composite {
+
+    protected Text text;
+
+    private Button variableButton;
+
+    private Button browseFileSystem;
+
+    private Button browseWorkspace;
+
+    private final IJavaProject project;
+
+    public PathEditor(Composite parent, int style, String label, IJavaProject project) {
+        super(parent, style);
+        this.project = project;
+
+        GridLayout layout = new GridLayout(2, false);
+        setLayout(layout);
+
+        Label l = new Label(this, SWT.NONE);
+        l.setText(label);
+
+        text = createText(this);
+
+        Composite buttons = new Composite(this, SWT.NONE);
+        buttons.setLayoutData(new GridData(GridData.FILL, GridData.FILL, false, true, 2, 1));
+        layout = new GridLayout(4, false);
+        layout.marginHeight = 0;
+        layout.marginWidth = 0;
+        buttons.setLayout(layout);
+
+        boolean added = addButtons(buttons);
+
+        browseWorkspace = new Button(buttons, SWT.NONE);
+        browseWorkspace.setLayoutData(new GridData(GridData.END, GridData.CENTER, !added, false));
+        browseWorkspace.setText("Workspace...");
+        browseWorkspace.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                selectInWorkspace();
+            }
+        });
+
+        browseFileSystem = new Button(buttons, SWT.NONE);
+        browseFileSystem
+                .setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
+        browseFileSystem.setText("File System...");
+        browseFileSystem.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                selectInFileSystem();
+            }
+        });
+
+        variableButton = new Button(buttons, SWT.NONE);
+        variableButton.setLayoutData(new GridData(GridData.CENTER, GridData.CENTER, false, false));
+        variableButton.setText("Variables...");
+        variableButton.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                selectVariable();
+            }
+        });
+    }
+
+    private void selectInWorkspace() {
+        ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(),
+                new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
+        dialog.setTitle("Select a workspace relative file:");
+        dialog.setMessage("Select a workspace relative file:");
+        dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
+        // TODO try to preselect the current file
+        dialog.open();
+        Object[] results = dialog.getResult();
+        if ((results != null) && (results.length > 0) && (results[0] instanceof IFile)) {
+            IPath path = ((IFile) results[0]).getFullPath();
+            if (project != null && path.segment(0).equals(project.getProject().getName())) {
+                setWorkspaceLoc(path.removeFirstSegments(1).makeRelative().toString());
+            } else {
+                String containerName = path.makeRelative().toString();
+                setWorkspaceLoc("${workspace_loc:" + containerName + "}");
+            }
+        }
+    }
+
+    private void selectInFileSystem() {
+        FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
+        if (text != null) {
+            dialog.setFileName(text.getText());
+        }
+        dialog.setFilterExtensions(new String[] {"*.xml", "*"});
+        String file = dialog.open();
+        if (file != null) {
+            setFile(file);
+        }
+    }
+
+    private void selectVariable() {
+        StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
+        dialog.open();
+        String variable = dialog.getVariableExpression();
+        if (variable != null) {
+            addVariable(variable);
+        }
+    }
+
+    protected void addVariable(String variable) {
+        text.insert(variable);
+        textUpdated();
+    }
+
+    protected void setFile(String file) {
+        text.setText(file);
+        textUpdated();
+    }
+
+    protected void setWorkspaceLoc(String workspaceLoc) {
+        text.setText(workspaceLoc);
+        textUpdated();
+    }
+
+    protected void textUpdated() {
+        // nothing to do
+    }
+
+    protected Text createText(Composite parent) {
+        Text t = new Text(parent, SWT.BORDER);
+        t.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+        return t;
+    }
+
+    protected boolean addButtons(Composite buttons) {
+        return false;
+    }
+
+    public Text getText() {
+        return text;
+    }
+
+    public void setEnabled(boolean enabled) {
+        super.setEnabled(enabled);
+        text.setEnabled(enabled);
+        browseFileSystem.setEnabled(enabled);
+        browseWorkspace.setEnabled(enabled);
+        variableButton.setEnabled(enabled);
+
+    }
+}

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/PathEditor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/SettingsEditor.java Tue Oct 27 21:55:44 2009
@@ -43,122 +43,137 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
 
 public class SettingsEditor extends Composite {
 
     public static final String TOOLTIP_SETTINGS_PATH = "The url where your ivysettings file can be"
             + " found. \nLeave it empty to reference the default ivy settings. \n"
-            + "Relative paths are handled relative to the project.\n"
-            + " Example: 'project:///ivysettings.xml' or 'project://myproject/ivysettings.xml'.";
+            + "Relative paths are handled relative to the project.";
 
     public static final String TOOLTIP_PROPERTY_FILES = "Comma separated list of build property"
             + " files.\nExample: build.properties, override.properties";
 
-    private Text settingsText;
-
-    private DecoratedField settingsTextDeco;
-
     private final List listeners = new ArrayList();
 
     private IvyDEException settingsError;
 
     private FieldDecoration errorDecoration;
 
-    private Text propFilesText;
+    private PathEditor propFilesEditor;
+
+    private DecoratedField settingsTextDeco;
 
     private Button loadOnDemandButton;
 
+    private PathEditor settingsEditor;
+
+    private Button defaultButton;
+
     public SettingsEditor(Composite parent, int style) {
         super(parent, style);
-        // CheckStyle:MagicNumber| OFF
-        GridLayout layout = new GridLayout(3, false);
-        // CheckStyle:MagicNumber| ON
-        layout.marginHeight = 0;
-        layout.marginWidth = 0;
+
+        GridLayout layout = new GridLayout();
         setLayout(layout);
 
-        Label label = new Label(this, SWT.NONE);
-        label.setText("Ivy settings path:");
+        loadOnDemandButton = new Button(this, SWT.CHECK);
+        loadOnDemandButton.setText("reload the settings only on demand");
+        loadOnDemandButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 
-        errorDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
-            FieldDecorationRegistry.DEC_ERROR);
+        settingsEditor = new PathEditor(this, SWT.NONE, "Ivy settings path:", null) {
 
-        settingsTextDeco = new DecoratedField(this, SWT.LEFT | SWT.TOP, new IControlCreator() {
-            public Control createControl(Composite p, int s) {
-                return new Text(p, SWT.SINGLE | SWT.BORDER);
-            }
-        });
-        settingsTextDeco.addFieldDecoration(errorDecoration, SWT.TOP | SWT.LEFT, false);
-        // settingsTextDeco.setMarginWidth(2);
-        settingsTextDeco.hideDecoration(errorDecoration);
-        // this doesn't work well: we want the decoration image to be clickable, but it actually
-        // hides the clickable area
-        // settingsTextDeco.getLayoutControl().addMouseListener(new MouseAdapter() {
-        // public void mouseDoubleClick(MouseEvent e) {
-        // super.mouseDoubleClick(e);
-        // }
-        // public void mouseDown(MouseEvent e) {
-        // if (settingsError != null) {
-        // settingsError.show(IStatus.ERROR, "IvyDE configuration problem", null);
-        // }
-        // }
-        // });
-
-        settingsText = (Text) settingsTextDeco.getControl();
-        settingsText.setToolTipText(TOOLTIP_SETTINGS_PATH);
-        settingsTextDeco.getLayoutControl().setLayoutData(
-            new GridData(GridData.FILL, GridData.FILL, true, false));
-        settingsText.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
-                settingsPathUpdated();
+            protected Text createText(Composite parent) {
+                errorDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
+                    FieldDecorationRegistry.DEC_ERROR);
+
+                settingsTextDeco = new DecoratedField(parent, SWT.LEFT | SWT.TOP,
+                        new IControlCreator() {
+                            public Control createControl(Composite p, int s) {
+                                return new Text(p, SWT.SINGLE | SWT.BORDER);
+                            }
+                        });
+                settingsTextDeco.addFieldDecoration(errorDecoration, SWT.TOP | SWT.LEFT, false);
+                // settingsTextDeco.setMarginWidth(2);
+                settingsTextDeco.hideDecoration(errorDecoration);
+                // this doesn't work well: we want the decoration image to be clickable, but it
+                // actually
+                // hides the clickable area
+                // settingsTextDeco.getLayoutControl().addMouseListener(new MouseAdapter() {
+                // public void mouseDoubleClick(MouseEvent e) {
+                // super.mouseDoubleClick(e);
+                // }
+                // public void mouseDown(MouseEvent e) {
+                // if (settingsError != null) {
+                // settingsError.show(IStatus.ERROR, "IvyDE configuration problem", null);
+                // }
+                // }
+                // });
+
+                Text settingsText = (Text) settingsTextDeco.getControl();
+                settingsText.setToolTipText(TOOLTIP_SETTINGS_PATH);
+                settingsTextDeco.getLayoutControl().setLayoutData(
+                    new GridData(GridData.FILL, GridData.CENTER, true, false));
+                settingsText.addModifyListener(new ModifyListener() {
+                    public void modifyText(ModifyEvent e) {
+                        settingsPathUpdated();
+                    }
+                });
+
+                return settingsText;
             }
-        });
 
-        Button browse = new Button(this, SWT.NONE);
-        browse.setText("Browse");
-        browse.addSelectionListener(new SelectionAdapter() {
-            public void widgetSelected(SelectionEvent e) {
-                File f = getFile(new File("/"));
-                if (f != null) {
-                    try {
-                        settingsText.setText(f.toURI().toURL().toExternalForm());
-                        settingsPathUpdated();
-                    } catch (MalformedURLException ex) {
-                        // this cannot happen
-                        IvyPlugin.log(IStatus.ERROR,
-                            "The file got from the file browser has not a valid URL", ex);
+            protected boolean addButtons(Composite buttons) {
+                defaultButton = new Button(buttons, SWT.NONE);
+                defaultButton
+                        .setLayoutData(new GridData(GridData.END, GridData.CENTER, true, false));
+                defaultButton.setText("Default");
+                defaultButton.addSelectionListener(new SelectionAdapter() {
+                    public void widgetSelected(SelectionEvent e) {
+                        getText().setText("");
                     }
+                });
+                return true;
+            }
+
+            protected void setFile(String f) {
+                try {
+                    getText().setText(new File(f).toURI().toURL().toExternalForm());
+                } catch (MalformedURLException ex) {
+                    // this cannot happen
+                    IvyPlugin.log(IStatus.ERROR,
+                        "The file got from the file browser has not a valid URL", ex);
                 }
             }
-        });
 
-        loadOnDemandButton = new Button(this, SWT.CHECK);
-        loadOnDemandButton.setText("reload the settings only on demand");
-        // CheckStyle:MagicNumber| OFF
-        loadOnDemandButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3,
-                1));
-        // CheckStyle:MagicNumber| ON
-
-        label = new Label(this, SWT.NONE);
-        label.setText("Property files:");
-
-        propFilesText = new Text(this, SWT.BORDER);
-        propFilesText.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
-        propFilesText.setToolTipText(TOOLTIP_PROPERTY_FILES);
-        propFilesText.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
+            protected void textUpdated() {
                 settingsPathUpdated();
             }
-        });
+        };
+        settingsEditor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
+
+        propFilesEditor = new PathEditor(this, SWT.NONE, "Property files:", null) {
+            protected void textUpdated() {
+                settingsPathUpdated();
+            }
+
+            protected void setFile(String file) {
+                text.insert(file);
+                textUpdated();
+            }
+
+            protected void setWorkspaceLoc(String workspaceLoc) {
+                text.insert(workspaceLoc);
+                textUpdated();
+            }
+        };
+        propFilesEditor.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
     }
 
     public IvySettingsSetup getIvySettingsSetup() {
         IvySettingsSetup setup = new IvySettingsSetup();
-        setup.setIvySettingsPath(settingsText.getText());
+        setup.setIvySettingsPath(settingsEditor.getText().getText());
         setup.setLoadSettingsOnDemand(loadOnDemandButton.getSelection());
-        setup.setPropertyFiles(IvyClasspathUtil.split(propFilesText.getText()));
+        setup.setPropertyFiles(IvyClasspathUtil.split(propFilesEditor.getText().getText()));
         return setup;
     }
 
@@ -196,7 +211,7 @@
         } else if (!error.equals(settingsError)) {
             settingsError = error;
             settingsTextDeco.showDecoration(errorDecoration);
-            if (settingsText.isVisible()) {
+            if (settingsEditor.getText().isVisible()) {
                 errorDecoration.setDescription(error.getShortMsg());
                 settingsTextDeco.showHoverText(error.getShortMsg());
             }
@@ -229,15 +244,16 @@
     }
 
     public void init(IvySettingsSetup setup) {
-        settingsText.setText(setup.getIvySettingsPath());
-        propFilesText.setText(IvyClasspathUtil.concat(setup.getPropertyFiles()));
+        settingsEditor.getText().setText(setup.getRawIvySettingsPath());
+        propFilesEditor.getText().setText(IvyClasspathUtil.concat(setup.getRawPropertyFiles()));
         loadOnDemandButton.setSelection(setup.isLoadSettingsOnDemand());
     }
 
     public void setEnabled(boolean enabled) {
         super.setEnabled(enabled);
-        settingsText.setEnabled(enabled);
-        propFilesText.setEnabled(enabled);
+        settingsEditor.setEnabled(enabled);
+        defaultButton.setEnabled(enabled);
+        propFilesEditor.setEnabled(enabled);
         loadOnDemandButton.setEnabled(enabled);
     }
 

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java?rev=830356&r1=830355&r2=830356&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java Tue Oct 27 21:55:44 2009
@@ -58,9 +58,9 @@
     }
 
     public void setIvySettingsSetup(IvySettingsSetup setup) {
-        prefStore.setValue(PreferenceConstants.IVYSETTINGS_PATH, setup.getIvySettingsPath());
+        prefStore.setValue(PreferenceConstants.IVYSETTINGS_PATH, setup.getRawIvySettingsPath());
         prefStore.setValue(PreferenceConstants.PROPERTY_FILES, IvyClasspathUtil.concat(setup
-                .getPropertyFiles()));
+                .getRawPropertyFiles()));
         prefStore.setValue(PreferenceConstants.LOAD_SETTINGS_ON_DEMAND, setup
                 .isLoadSettingsOnDemand());
     }

Propchange: ant/ivy/ivyde/trunk/test/variables/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct 27 21:55:44 2009
@@ -0,0 +1 @@
+bin

Propchange: ant/ivy/ivyde/trunk/test/variables-props/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct 27 21:55:44 2009
@@ -0,0 +1 @@
+bin

Added: ant/ivy/ivyde/trunk/test/variables-props/.classpath
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/variables-props/.classpath?rev=830356&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/variables-props/.classpath (added)
+++ ant/ivy/ivyde/trunk/test/variables-props/.classpath Tue Oct 27 21:55:44 2009
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&amp;confs=*&amp;ivySettingsPath=%24%7Bworkspace_loc%3Aivydetest-property-files%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=%24%7Bworkspace_loc%3Aivydetest-property-files%2Fbuild.properties%7D&amp;doRetrieve=false&amp;retrievePattern=lib%2F%5Bconf%5D%2F%5Bartifact%5D.%5Bext%5D&amp;retrieveSync=false&amp;retrieveConfs=*&amp;retrieveTypes=*&amp;acceptedTypes=jar&amp;sourceTypes=source&amp;javadocTypes=javadoc&amp;sourceSuffixes=-source%2C-sources%2C-src&amp;javadocSuffixes=-javadoc%2C-javadocs%2C-doc%2C-docs&amp;alphaOrder=false&amp;resolveInWorkspace=false&amp;resolveBeforeLaunch=false"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: ant/ivy/ivyde/trunk/test/variables-props/.project
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/variables-props/.project?rev=830356&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/variables-props/.project (added)
+++ ant/ivy/ivyde/trunk/test/variables-props/.project Tue Oct 27 21:55:44 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ivydetest-variables-props</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: ant/ivy/ivyde/trunk/test/variables-props/ivy.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/variables-props/ivy.xml?rev=830356&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/variables-props/ivy.xml (added)
+++ ant/ivy/ivyde/trunk/test/variables-props/ivy.xml Tue Oct 27 21:55:44 2009
@@ -0,0 +1,31 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0">
+    <info organisation="org.apache.ivyde" module="ivytest-variables-props">
+        <description>
+            Project with settings properties composed of variables
+        </description>
+    </info>
+    <configurations>
+        <conf name="default" />
+    </configurations>
+    <dependencies>
+        <dependency org="myorg" name="mymodule" rev="1.1" conf="default" />
+    </dependencies>
+</ivy-module>

Propchange: ant/ivy/ivyde/trunk/test/variables-props/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/test/variables-props/ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/test/variables-props/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ant/ivy/ivyde/trunk/test/variables/.classpath
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/variables/.classpath?rev=830356&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/variables/.classpath (added)
+++ ant/ivy/ivyde/trunk/test/variables/.classpath Tue Oct 27 21:55:44 2009
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?ivyXmlPath=ivy.xml&amp;confs=*&amp;ivySettingsPath=%24%7Bworkspace_loc%3Aivydetest-local-settings%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=&amp;doRetrieve=false&amp;retrievePattern=lib%2F%5Bconf%5D%2F%5Bartifact%5D.%5Bext%5D&amp;retrieveSync=false&amp;retrieveConfs=*&amp;retrieveTypes=*&amp;acceptedTypes=jar&amp;sourceTypes=source&amp;javadocTypes=javadoc&amp;sourceSuffixes=-source%2C-sources%2C-src&amp;javadocSuffixes=-javadoc%2C-javadocs%2C-doc%2C-docs&amp;alphaOrder=false&amp;resolveInWorkspace=false&amp;resolveBeforeLaunch=false"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: ant/ivy/ivyde/trunk/test/variables/.project
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/variables/.project?rev=830356&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/variables/.project (added)
+++ ant/ivy/ivyde/trunk/test/variables/.project Tue Oct 27 21:55:44 2009
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ivydetest-variables</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: ant/ivy/ivyde/trunk/test/variables/ivy.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/variables/ivy.xml?rev=830356&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/test/variables/ivy.xml (added)
+++ ant/ivy/ivyde/trunk/test/variables/ivy.xml Tue Oct 27 21:55:44 2009
@@ -0,0 +1,31 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.0">
+    <info organisation="org.apache.ivyde" module="ivytest-variables">
+        <description>
+            Project with settings path composed of variables
+        </description>
+    </info>
+    <configurations>
+        <conf name="default" />
+    </configurations>
+    <dependencies>
+        <dependency org="myorg" name="mymodule" rev="1.1" conf="default" />
+    </dependencies>
+</ivy-module>

Propchange: ant/ivy/ivyde/trunk/test/variables/ivy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/test/variables/ivy.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/test/variables/ivy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message