You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by xa...@apache.org on 2008/01/14 11:26:52 UTC

svn commit: r611752 [11/11] - in /ant/ivy/ivyde/trunk: ./ .settings/ doc/ doc/style/ src/java/org/apache/ivyde/eclipse/ src/java/org/apache/ivyde/eclipse/cpcontainer/ src/java/org/apache/ivyde/eclipse/cpcontainer/fragmentinfo/ src/java/org/apache/ivyde...

Modified: ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizard.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizard.java?rev=611752&r1=611751&r2=611752&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizard.java (original)
+++ ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizard.java Mon Jan 14 02:26:37 2008
@@ -1,166 +1,172 @@
-package org.apache.ivyde.eclipse.ui.wizards;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.InvocationTargetException;
-
-import org.apache.ivyde.eclipse.ui.core.IvyFileEditorInput;
-import org.apache.ivyde.eclipse.ui.editors.IvyEditor;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-
-public class IvyNewWizard extends Wizard implements INewWizard {
-    private IvyNewWizardPage page;
-
-    private ISelection selection;
-
-    /**
-     * Constructor for IvyNewWizard.
-     */
-    public IvyNewWizard() {
-        super();
-        setNeedsProgressMonitor(true);
-    }
-
-    /**
-     * Adding the page to the wizard.
-     */
-
-    public void addPages() {
-        page = new IvyNewWizardPage(selection);
-        addPage(page);
-    }
-
-    /**
-     * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
-     */
-    public boolean performFinish() {
-        final String containerName = page.getContainerName();
-        final String fileName = page.getFileName();
-        final String orgName = page.getOrganisationName();
-        final String moduleName = page.getModuleName();
-        final String status = page.getStatus();
-
-        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-        IResource resource = root.findMember(new Path(containerName));
-        if (!resource.exists() || !(resource instanceof IContainer)) {
-            MessageDialog.openError(getShell(), "Error", "Container \"" + containerName + "\" does not exist.");
-        }
-        IContainer container = (IContainer) resource;
-        final IFile file = container.getFile(new Path(fileName));
-        if (file.exists() && !MessageDialog.openConfirm(getShell(), "overwrite existing ?", "The file you selected already exist. Do you want to overwrite its content ?")) {
-            return false;
-        }
-        
-        IRunnableWithProgress op = new IRunnableWithProgress() {
-            public void run(IProgressMonitor monitor) throws InvocationTargetException {
-                try {
-                    doFinish(file, orgName, moduleName, status, monitor);
-                } catch (CoreException e) {
-                    throw new InvocationTargetException(e);
-                } finally {
-                    monitor.done();
-                }
-            }
-        };
-        try {
-            getContainer().run(true, false, op);
-        } catch (InterruptedException e) {
-            return false;
-        } catch (InvocationTargetException e) {
-            Throwable realException = e.getTargetException();
-            MessageDialog.openError(getShell(), "Error", realException.getMessage());
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * The worker method. It will find the container, create the file if missing or just replace its contents, and open the editor on the newly created file.
-     */
-
-    private void doFinish(final IFile file, String org, String module, String status, final IProgressMonitor monitor) throws CoreException {
-        // create a sample file
-        monitor.beginTask("Creating " + file.getName(), 2);
-        try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(openContentStream()));
-            final StringBuffer buf = new StringBuffer();
-            for (String line = reader.readLine(); line != null; line = reader.readLine()) {
-                line = line.replaceAll("@ORGANISATION@", org);
-                line = line.replaceAll("@MODULE@", module);
-                line = line.replaceAll("@STATUS@", status);
-                buf.append(line).append(System.getProperty("line.separator", "\n"));
-            }
-            reader.close();
-            InputStream stream = new ByteArrayInputStream(buf.toString().getBytes());
-            if (file.exists()) {
-                file.setContents(stream, true, true, monitor);
-            } else {
-                file.create(stream, true, monitor);
-            }
-            stream.close();
-        } catch (IOException e) {
-        }
-        monitor.worked(1);
-        monitor.setTaskName("Opening file for editing...");
-        getShell().getDisplay().asyncExec(new Runnable() {
-            public void run() {
-                IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-                try {
-                    page.openEditor(new IvyFileEditorInput(file), IvyEditor.ID, true);
-//                    IDE.openEditor(page, file, IvyEditor.ID, true);
-                } catch (PartInitException e) {
-                }
-            }
-        });
-        monitor.worked(1);
-    }
-
-    /**
-     * We will initialize file contents with a sample text.
-     */
-
-    private InputStream openContentStream() {
-        return getClass().getResourceAsStream("ivy-template.xml");
-    }
-
-    private void throwCoreException(String message) throws CoreException {
-        IStatus status = new Status(IStatus.ERROR, "org.apache.ivyde", IStatus.OK, message, null);
-        throw new CoreException(status);
-    }
-
-    /**
-     * We will accept the selection in the workbench to see if we can initialize from it.
-     * 
-     * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
-     */
-    public void init(IWorkbench workbench, IStructuredSelection selection) {
-        this.selection = selection;
-    }
-//    public Image getDefaultPageImage() {
-//        return IvyPlugin.getImageDescriptor("icons/logo16x16.gif").createImage();
-//    }
-}
\ No newline at end of file
+package org.apache.ivyde.eclipse.ui.wizards;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.InvocationTargetException;
+
+import org.apache.ivyde.eclipse.ui.core.IvyFileEditorInput;
+import org.apache.ivyde.eclipse.ui.editors.IvyEditor;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+public class IvyNewWizard extends Wizard implements INewWizard {
+    private IvyNewWizardPage page;
+
+    private ISelection selection;
+
+    /**
+     * Constructor for IvyNewWizard.
+     */
+    public IvyNewWizard() {
+        super();
+        setNeedsProgressMonitor(true);
+    }
+
+    /**
+     * Adding the page to the wizard.
+     */
+
+    public void addPages() {
+        page = new IvyNewWizardPage(selection);
+        addPage(page);
+    }
+
+    /**
+     * This method is called when 'Finish' button is pressed in the wizard. We will create an
+     * operation and run it using wizard as execution context.
+     */
+    public boolean performFinish() {
+        final String containerName = page.getContainerName();
+        final String fileName = page.getFileName();
+        final String orgName = page.getOrganisationName();
+        final String moduleName = page.getModuleName();
+        final String status = page.getStatus();
+
+        IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+        IResource resource = root.findMember(new Path(containerName));
+        if (!resource.exists() || !(resource instanceof IContainer)) {
+            MessageDialog.openError(getShell(), "Error", "Container \"" + containerName
+                    + "\" does not exist.");
+        }
+        IContainer container = (IContainer) resource;
+        final IFile file = container.getFile(new Path(fileName));
+        if (file.exists()
+                && !MessageDialog.openConfirm(getShell(), "overwrite existing ?",
+                    "The file you selected already exist. Do you want to overwrite its content ?")) {
+            return false;
+        }
+
+        IRunnableWithProgress op = new IRunnableWithProgress() {
+            public void run(IProgressMonitor monitor) throws InvocationTargetException {
+                try {
+                    doFinish(file, orgName, moduleName, status, monitor);
+                } catch (CoreException e) {
+                    throw new InvocationTargetException(e);
+                } finally {
+                    monitor.done();
+                }
+            }
+        };
+        try {
+            getContainer().run(true, false, op);
+        } catch (InterruptedException e) {
+            return false;
+        } catch (InvocationTargetException e) {
+            Throwable realException = e.getTargetException();
+            MessageDialog.openError(getShell(), "Error", realException.getMessage());
+            return false;
+        }
+        return true;
+    }
+
+    /**
+     * The worker method. It will find the container, create the file if missing or just replace its
+     * contents, and open the editor on the newly created file.
+     */
+
+    private void doFinish(final IFile file, String org, String module, String status,
+            final IProgressMonitor monitor) throws CoreException {
+        // create a sample file
+        monitor.beginTask("Creating " + file.getName(), 2);
+        try {
+            BufferedReader reader = new BufferedReader(new InputStreamReader(openContentStream()));
+            final StringBuffer buf = new StringBuffer();
+            for (String line = reader.readLine(); line != null; line = reader.readLine()) {
+                line = line.replaceAll("@ORGANISATION@", org);
+                line = line.replaceAll("@MODULE@", module);
+                line = line.replaceAll("@STATUS@", status);
+                buf.append(line).append(System.getProperty("line.separator", "\n"));
+            }
+            reader.close();
+            InputStream stream = new ByteArrayInputStream(buf.toString().getBytes());
+            if (file.exists()) {
+                file.setContents(stream, true, true, monitor);
+            } else {
+                file.create(stream, true, monitor);
+            }
+            stream.close();
+        } catch (IOException e) {
+        }
+        monitor.worked(1);
+        monitor.setTaskName("Opening file for editing...");
+        getShell().getDisplay().asyncExec(new Runnable() {
+            public void run() {
+                IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+                        .getActivePage();
+                try {
+                    page.openEditor(new IvyFileEditorInput(file), IvyEditor.ID, true);
+                    // IDE.openEditor(page, file, IvyEditor.ID, true);
+                } catch (PartInitException e) {
+                }
+            }
+        });
+        monitor.worked(1);
+    }
+
+    /**
+     * We will initialize file contents with a sample text.
+     */
+
+    private InputStream openContentStream() {
+        return getClass().getResourceAsStream("ivy-template.xml");
+    }
+
+    private void throwCoreException(String message) throws CoreException {
+        IStatus status = new Status(IStatus.ERROR, "org.apache.ivyde", IStatus.OK, message, null);
+        throw new CoreException(status);
+    }
+
+    /**
+     * We will accept the selection in the workbench to see if we can initialize from it.
+     * 
+     * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+     */
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
+        this.selection = selection;
+    }
+    // public Image getDefaultPageImage() {
+    // return IvyPlugin.getImageDescriptor("icons/logo16x16.gif").createImage();
+    // }
+}

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

Modified: ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizardPage.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizardPage.java?rev=611752&r1=611751&r2=611752&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizardPage.java (original)
+++ ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/IvyNewWizardPage.java Mon Jan 14 02:26:37 2008
@@ -1,255 +1,257 @@
-package org.apache.ivyde.eclipse.ui.wizards;
-
-import org.apache.ivyde.eclipse.IvyPlugin;
-import org.apache.ivyde.eclipse.ui.preferences.PreferenceConstants;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-
-
-/**
- * The "New" wizard page allows setting the container for the new file as well
- * as the file name. The page will only accept file name without the extension
- * OR with the extension that matches the expected one (ivy.xml).
- */
-
-public class IvyNewWizardPage extends WizardPage {
-	private Text containerText;
-
-    private Text fileText;
-    private Text orgText;
-    private Text moduleText;
-    private Combo statusText;
-
-	private ISelection selection;
-
-	/**
-	 * Constructor for SampleNewWizardPage.
-	 * 
-	 * @param pageName
-	 */
-	public IvyNewWizardPage(ISelection selection) {
-		super("wizardPage");
-		setTitle("Ivy File");
-		setDescription("This wizard creates a new ivy.xml that can be opened by the ivy multi-page editor.");
-		this.selection = selection;
-	}
-
-	/**
-	 * @see IDialogPage#createControl(Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite container = new Composite(parent, SWT.NULL);
-		GridLayout layout = new GridLayout();
-		container.setLayout(layout);
-		layout.numColumns = 3;
-		layout.verticalSpacing = 9;
-		Label label = new Label(container, SWT.NULL);
-		label.setText("&Container:");
-
-		containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
-		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-		containerText.setLayoutData(gd);
-		containerText.addModifyListener(new ModifyListener() {
-			public void modifyText(ModifyEvent e) {
-				dialogChanged();
-			}
-		});
-
-		Button button = new Button(container, SWT.PUSH);
-		button.setText("Browse...");
-		button.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent e) {
-				handleBrowse();
-			}
-		});
-        
-        label = new Label(container, SWT.NULL);
-        label.setText("&File name:");
-
-        fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
-        gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        fileText.setLayoutData(gd);
-        fileText.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
-                dialogChanged();
-            }
-        });
-
-        label = new Label(container, SWT.NULL);
-        label.setText("&Organisation:");
-
-        orgText = new Text(container, SWT.BORDER | SWT.SINGLE);
-        gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        orgText.setLayoutData(gd);
-        orgText.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
-                dialogChanged();
-            }
-        });
-        
-        label = new Label(container, SWT.NULL);
-        label.setText("&Module name:");
-
-        moduleText = new Text(container, SWT.BORDER | SWT.SINGLE);
-        gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        moduleText.setLayoutData(gd);
-        moduleText.addModifyListener(new ModifyListener() {
-            public void modifyText(ModifyEvent e) {
-                dialogChanged();
-            }
-        });
-        
-        label = new Label(container, SWT.NULL);
-        label.setText("&Status:");
-
-        statusText = new Combo(container, SWT.READ_ONLY | SWT.DROP_DOWN);
-        statusText.add("integration");
-        statusText.add("milestone");
-        statusText.add("release");
-        gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        statusText.setLayoutData(gd);
-        statusText.addSelectionListener(new SelectionAdapter() {
-            public void widgetSelected(SelectionEvent e) {
-                dialogChanged();
-            }
-        });
-        
-        initialize();
-		dialogChanged();
-		setControl(container);
-	}
-
-	/**
-	 * Tests if the current workbench selection is a suitable container to use.
-	 */
-
-	private void initialize() {
-		if (selection != null && selection.isEmpty() == false
-				&& selection instanceof IStructuredSelection) {
-			IStructuredSelection ssel = (IStructuredSelection) selection;
-			if (ssel.size() > 1)
-				return;
-			Object obj = ssel.getFirstElement();
-			if (obj instanceof IResource) {
-				IContainer container;
-				if (obj instanceof IContainer)
-					container = (IContainer) obj;
-				else
-					container = ((IResource) obj).getParent();
-				containerText.setText(container.getFullPath().toString());
-                moduleText.setText(container.getProject().getName());
-			}
-		}
-		fileText.setText("ivy.xml");
-        statusText.select(0);
-        try {
-            orgText.setText(IvyPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.ORGANISATION));
-        } catch (Exception ex) {            
-        }
-	}
-
-	/**
-	 * Uses the standard container selection dialog to choose the new value for
-	 * the container field.
-	 */
-
-	private void handleBrowse() {
-		ContainerSelectionDialog dialog = new ContainerSelectionDialog(
-				getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
-				"Select new file container");
-		if (dialog.open() == ContainerSelectionDialog.OK) {
-			Object[] result = dialog.getResult();
-			if (result.length == 1) {
-				containerText.setText(((Path) result[0]).toString());
-			}
-		}
-	}
-
-	/**
-	 * Ensures that both text fields are set.
-	 */
-
-	private void dialogChanged() {
-		IResource container = ResourcesPlugin.getWorkspace().getRoot()
-				.findMember(new Path(getContainerName()));
-		String fileName = getFileName();
-
-		if (getContainerName().length() == 0) {
-			updateStatus("File container must be specified");
-			return;
-		}
-		if (container == null
-				|| (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
-			updateStatus("File container must exist");
-			return;
-		}
-		if (!container.isAccessible()) {
-			updateStatus("Project must be writable");
-			return;
-		}
-		if (fileName.length() == 0) {
-			updateStatus("File name must be specified");
-			return;
-		}
-		if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
-			updateStatus("File name must be valid");
-			return;
-		}
-		int dotLoc = fileName.lastIndexOf('.');
-		if (dotLoc != -1) {
-			String ext = fileName.substring(dotLoc + 1);
-			if (ext.equalsIgnoreCase("xml") == false) {
-				updateStatus("File extension must be \".xml\"");
-				return;
-			}
-		}
-		updateStatus(null);
-	}
-
-	private void updateStatus(String message) {
-		setErrorMessage(message);
-		setPageComplete(message == null);
-	}
-
-	public String getContainerName() {
-		return containerText.getText();
-	}
-
-	public String getFileName() {
-		return fileText.getText();
-	}
-
-    public String getOrganisationName() {
-        return orgText.getText();
-    }
-
-    public String getModuleName() {
-        return moduleText.getText();
-    }
-
-    public String getStatus() {
-        return statusText.getText();
-    }
-}
\ No newline at end of file
+package org.apache.ivyde.eclipse.ui.wizards;
+
+import org.apache.ivyde.eclipse.IvyPlugin;
+import org.apache.ivyde.eclipse.ui.preferences.PreferenceConstants;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+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.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+/**
+ * The "New" wizard page allows setting the container for the new file as well as the file name. The
+ * page will only accept file name without the extension OR with the extension that matches the
+ * expected one (ivy.xml).
+ */
+
+public class IvyNewWizardPage extends WizardPage {
+    private Text containerText;
+
+    private Text fileText;
+
+    private Text orgText;
+
+    private Text moduleText;
+
+    private Combo statusText;
+
+    private ISelection selection;
+
+    /**
+     * Constructor for SampleNewWizardPage.
+     * 
+     * @param pageName
+     */
+    public IvyNewWizardPage(ISelection selection) {
+        super("wizardPage");
+        setTitle("Ivy File");
+        setDescription("This wizard creates a new ivy.xml that can be opened by the ivy multi-page editor.");
+        this.selection = selection;
+    }
+
+    /**
+     * @see IDialogPage#createControl(Composite)
+     */
+    public void createControl(Composite parent) {
+        Composite container = new Composite(parent, SWT.NULL);
+        GridLayout layout = new GridLayout();
+        container.setLayout(layout);
+        layout.numColumns = 3;
+        layout.verticalSpacing = 9;
+        Label label = new Label(container, SWT.NULL);
+        label.setText("&Container:");
+
+        containerText = new Text(container, SWT.BORDER | SWT.SINGLE);
+        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+        containerText.setLayoutData(gd);
+        containerText.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                dialogChanged();
+            }
+        });
+
+        Button button = new Button(container, SWT.PUSH);
+        button.setText("Browse...");
+        button.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                handleBrowse();
+            }
+        });
+
+        label = new Label(container, SWT.NULL);
+        label.setText("&File name:");
+
+        fileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+        gd = new GridData(GridData.FILL_HORIZONTAL);
+        gd.horizontalSpan = 2;
+        fileText.setLayoutData(gd);
+        fileText.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                dialogChanged();
+            }
+        });
+
+        label = new Label(container, SWT.NULL);
+        label.setText("&Organisation:");
+
+        orgText = new Text(container, SWT.BORDER | SWT.SINGLE);
+        gd = new GridData(GridData.FILL_HORIZONTAL);
+        gd.horizontalSpan = 2;
+        orgText.setLayoutData(gd);
+        orgText.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                dialogChanged();
+            }
+        });
+
+        label = new Label(container, SWT.NULL);
+        label.setText("&Module name:");
+
+        moduleText = new Text(container, SWT.BORDER | SWT.SINGLE);
+        gd = new GridData(GridData.FILL_HORIZONTAL);
+        gd.horizontalSpan = 2;
+        moduleText.setLayoutData(gd);
+        moduleText.addModifyListener(new ModifyListener() {
+            public void modifyText(ModifyEvent e) {
+                dialogChanged();
+            }
+        });
+
+        label = new Label(container, SWT.NULL);
+        label.setText("&Status:");
+
+        statusText = new Combo(container, SWT.READ_ONLY | SWT.DROP_DOWN);
+        statusText.add("integration");
+        statusText.add("milestone");
+        statusText.add("release");
+        gd = new GridData(GridData.FILL_HORIZONTAL);
+        gd.horizontalSpan = 2;
+        statusText.setLayoutData(gd);
+        statusText.addSelectionListener(new SelectionAdapter() {
+            public void widgetSelected(SelectionEvent e) {
+                dialogChanged();
+            }
+        });
+
+        initialize();
+        dialogChanged();
+        setControl(container);
+    }
+
+    /**
+     * Tests if the current workbench selection is a suitable container to use.
+     */
+
+    private void initialize() {
+        if (selection != null && selection.isEmpty() == false
+                && selection instanceof IStructuredSelection) {
+            IStructuredSelection ssel = (IStructuredSelection) selection;
+            if (ssel.size() > 1)
+                return;
+            Object obj = ssel.getFirstElement();
+            if (obj instanceof IResource) {
+                IContainer container;
+                if (obj instanceof IContainer)
+                    container = (IContainer) obj;
+                else
+                    container = ((IResource) obj).getParent();
+                containerText.setText(container.getFullPath().toString());
+                moduleText.setText(container.getProject().getName());
+            }
+        }
+        fileText.setText("ivy.xml");
+        statusText.select(0);
+        try {
+            orgText.setText(IvyPlugin.getDefault().getPreferenceStore().getString(
+                PreferenceConstants.ORGANISATION));
+        } catch (Exception ex) {
+        }
+    }
+
+    /**
+     * Uses the standard container selection dialog to choose the new value for the container field.
+     */
+
+    private void handleBrowse() {
+        ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin
+                .getWorkspace().getRoot(), false, "Select new file container");
+        if (dialog.open() == ContainerSelectionDialog.OK) {
+            Object[] result = dialog.getResult();
+            if (result.length == 1) {
+                containerText.setText(((Path) result[0]).toString());
+            }
+        }
+    }
+
+    /**
+     * Ensures that both text fields are set.
+     */
+
+    private void dialogChanged() {
+        IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(
+            new Path(getContainerName()));
+        String fileName = getFileName();
+
+        if (getContainerName().length() == 0) {
+            updateStatus("File container must be specified");
+            return;
+        }
+        if (container == null
+                || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) {
+            updateStatus("File container must exist");
+            return;
+        }
+        if (!container.isAccessible()) {
+            updateStatus("Project must be writable");
+            return;
+        }
+        if (fileName.length() == 0) {
+            updateStatus("File name must be specified");
+            return;
+        }
+        if (fileName.replace('\\', '/').indexOf('/', 1) > 0) {
+            updateStatus("File name must be valid");
+            return;
+        }
+        int dotLoc = fileName.lastIndexOf('.');
+        if (dotLoc != -1) {
+            String ext = fileName.substring(dotLoc + 1);
+            if (ext.equalsIgnoreCase("xml") == false) {
+                updateStatus("File extension must be \".xml\"");
+                return;
+            }
+        }
+        updateStatus(null);
+    }
+
+    private void updateStatus(String message) {
+        setErrorMessage(message);
+        setPageComplete(message == null);
+    }
+
+    public String getContainerName() {
+        return containerText.getText();
+    }
+
+    public String getFileName() {
+        return fileText.getText();
+    }
+
+    public String getOrganisationName() {
+        return orgText.getText();
+    }
+
+    public String getModuleName() {
+        return moduleText.getText();
+    }
+
+    public String getStatus() {
+        return statusText.getText();
+    }
+}

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

Modified: ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/ivy-template.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/ivy-template.xml?rev=611752&r1=611751&r2=611752&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/ivy-template.xml (original)
+++ ant/ivy/ivyde/trunk/src/java/org/apache/ivyde/eclipse/ui/wizards/ivy-template.xml Mon Jan 14 02:26:37 2008
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<ivy-module version="1.0">
-    <info 
-        organisation="@ORGANISATION@"
-        module="@MODULE@"
-        status="@STATUS@">
-	</info>
-</ivy-module>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<ivy-module version="1.0">
+    <info 
+        organisation="@ORGANISATION@"
+        module="@MODULE@"
+        status="@STATUS@">
+	</info>
+</ivy-module>

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

Modified: ant/ivy/ivyde/trunk/test/java/ivy-hibernate.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/java/ivy-hibernate.xml?rev=611752&r1=611751&r2=611752&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/test/java/ivy-hibernate.xml (original)
+++ ant/ivy/ivyde/trunk/test/java/ivy-hibernate.xml Mon Jan 14 02:26:37 2008
@@ -1,71 +1,71 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<?xml-stylesheet type="text/xsl" href="http://www.jayasoft.fr/org/ivyrep/ivy-doc.xsl"?>
-<ivy-module version="1.0">
-    <info 
-        organisation="hibernate"
-        module="hibernate"
-        revision="2.1.8"
-        status="release"
-        publication="20050130000000"
-	>
-		<license name="LGPL" url="http://www.gnu.org/copyleft/lesser.html"/>
-		<ivyauthor name="jayasoft" url="http://www.jayasoft.org/"/>
-
-		<repository name="ivyrep" url="http://www.jayasoft.fr/org/ivyrep/" pattern="[organisation]/[module]/ivy-[revision].xml" ivys="true" artifacts="false"/>
-		<repository name="ibiblio" url="http://www.ibiblio.org/maven/" pattern="[module]/jars/[artifact]-[revision].jar" ivys="false" artifacts="true"/>
-
-		<description homepage="http://hibernate.org/">
-	Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java.<br/><br/>
-	This ivy file has been written from what can be found in the README.txt in the lib directory of hibernate distribution.<br/><br/>
-	<b><i>Known ivy issues:</i></b><br/>
-  There is still a problem with xml-apis: the README file does not tell which version to use,
-	and it's really difficult to figure out. If someone knows, send an email. For the moment, you still have
-	to add a dependency on xml apis themselves.<br/><br/>
-	<code>jboss-cache</code> configuration declares a dependency on jboss-cache, but jboss-cache itself is not
-	described as it should be in this ivy repository... so it does not really help to use this configuration.<br/><br/>
-	<i>Note : Build time configuration has not been written<br/></i>
-		</description>
-	</info>
-    <configurations>
-        <conf name="default" description="for minimal use"/>
-        <conf name="standalone" extends="default" description="configuration to use when outside a j2ee server"/>
-        <conf name="xmldatabinder" extends="default" description="use this conf to benefit from xml data binder feature"/>
-        <conf name="xerces" extends="default" description="some SAX parser is required, xerces is only an example - beware of trouble with xml apis"/>
-        <conf name="1.3" extends="standalone" description="for use in j2se 1.3 (which does not provide jdbc 2.0)"/>
-        
-        <conf name="jca" extends="default" description="to use optional standard JCA API, if not already in your j2ee container"/>
-        <conf name="jca-1.3" extends="1.3" description="to use optional standard JCA API, if not already in your j2ee container, in a j2se 1.3 sdk"/>
-        
-        <conf name="c3p0" extends="default" description="to use optional c3p0 connection pool"/>
-        <conf name="dbcp" extends="default" description="to use optional commons-dbcp connection pool"/>
-        <conf name="proxool" extends="default" description="to use optional proxool connection pool"/>
-        
-        <conf name="jboss-cache" extends="default" description="to use optional jboss-cache - warning: jboss-cache not being described, it is not sufficient for the moment to use this configuration"/>
-        <conf name="oscache" extends="default" description="to use optional oscache"/>
-        <conf name="swarmcache" extends="default" description="to use optional swarmcache"/>
-    </configurations>
-    <dependencies>
-        <dependency org="cglib" name="cglib" rev="2.0.2" conf="default->full"/>
-        <dependency org="apache" name="commons-collections" rev="2.1.1" conf="default"/>
-        <dependency org="apache" name="commons-logging" rev="1.0.4" conf="default"/>
-        <dependency org="dom4j" name="dom4j" rev="1.4" conf="default"/>
-        <dependency org="ehcache" name="ehcache" rev="0.8" conf="default"/>
-        <dependency org="odmg" name="odmg" rev="3.0" conf="default"/>
-        
-        <dependency org="apache" name="xerces" rev="2.4.0" conf="xerces->default"/>
-        <dependency org="apache" name="xalan" rev="2.4.0" conf="xmldatabinder->default"/>
-        
-        <dependency org="sun" name="jta" rev="1.0" conf="standalone->default"/>
-        <dependency org="sun" name="jdbc" rev="2.0" conf="1.3->default"/>
-        <dependency org="sun" name="jca" rev="1.0" conf="jca->default;jca-1.3->1.3"/>
-        
-        <dependency org="c3p0" name="c3p0" rev="0.8.4.5" conf="c3p0->default"/>
-        <dependency org="apache" name="commons-dbcp" rev="1.2.1" conf="dbcp->default"/>
-
-        <dependency org="jboss" name="jboss-cache" rev="1.1.1" conf="jboss-cache->default"/>
-        <dependency org="opensymphony" name="oscache" rev="2.0" conf="oscache->default"/>
-        <dependency org="proxool" name="proxool" rev="0.8.3" conf="proxool->default"/>
-        <dependency org="swarmcache" name="swarmcache" rev="1.0RC2" conf="swarmcache->default"/>
-        
-    </dependencies>
-</ivy-module>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml-stylesheet type="text/xsl" href="http://www.jayasoft.fr/org/ivyrep/ivy-doc.xsl"?>
+<ivy-module version="1.0">
+    <info 
+        organisation="hibernate"
+        module="hibernate"
+        revision="2.1.8"
+        status="release"
+        publication="20050130000000"
+	>
+		<license name="LGPL" url="http://www.gnu.org/copyleft/lesser.html"/>
+		<ivyauthor name="jayasoft" url="http://www.jayasoft.org/"/>
+
+		<repository name="ivyrep" url="http://www.jayasoft.fr/org/ivyrep/" pattern="[organisation]/[module]/ivy-[revision].xml" ivys="true" artifacts="false"/>
+		<repository name="ibiblio" url="http://www.ibiblio.org/maven/" pattern="[module]/jars/[artifact]-[revision].jar" ivys="false" artifacts="true"/>
+
+		<description homepage="http://hibernate.org/">
+	Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java.<br/><br/>
+	This ivy file has been written from what can be found in the README.txt in the lib directory of hibernate distribution.<br/><br/>
+	<b><i>Known ivy issues:</i></b><br/>
+  There is still a problem with xml-apis: the README file does not tell which version to use,
+	and it's really difficult to figure out. If someone knows, send an email. For the moment, you still have
+	to add a dependency on xml apis themselves.<br/><br/>
+	<code>jboss-cache</code> configuration declares a dependency on jboss-cache, but jboss-cache itself is not
+	described as it should be in this ivy repository... so it does not really help to use this configuration.<br/><br/>
+	<i>Note : Build time configuration has not been written<br/></i>
+		</description>
+	</info>
+    <configurations>
+        <conf name="default" description="for minimal use"/>
+        <conf name="standalone" extends="default" description="configuration to use when outside a j2ee server"/>
+        <conf name="xmldatabinder" extends="default" description="use this conf to benefit from xml data binder feature"/>
+        <conf name="xerces" extends="default" description="some SAX parser is required, xerces is only an example - beware of trouble with xml apis"/>
+        <conf name="1.3" extends="standalone" description="for use in j2se 1.3 (which does not provide jdbc 2.0)"/>
+        
+        <conf name="jca" extends="default" description="to use optional standard JCA API, if not already in your j2ee container"/>
+        <conf name="jca-1.3" extends="1.3" description="to use optional standard JCA API, if not already in your j2ee container, in a j2se 1.3 sdk"/>
+        
+        <conf name="c3p0" extends="default" description="to use optional c3p0 connection pool"/>
+        <conf name="dbcp" extends="default" description="to use optional commons-dbcp connection pool"/>
+        <conf name="proxool" extends="default" description="to use optional proxool connection pool"/>
+        
+        <conf name="jboss-cache" extends="default" description="to use optional jboss-cache - warning: jboss-cache not being described, it is not sufficient for the moment to use this configuration"/>
+        <conf name="oscache" extends="default" description="to use optional oscache"/>
+        <conf name="swarmcache" extends="default" description="to use optional swarmcache"/>
+    </configurations>
+    <dependencies>
+        <dependency org="cglib" name="cglib" rev="2.0.2" conf="default->full"/>
+        <dependency org="apache" name="commons-collections" rev="2.1.1" conf="default"/>
+        <dependency org="apache" name="commons-logging" rev="1.0.4" conf="default"/>
+        <dependency org="dom4j" name="dom4j" rev="1.4" conf="default"/>
+        <dependency org="ehcache" name="ehcache" rev="0.8" conf="default"/>
+        <dependency org="odmg" name="odmg" rev="3.0" conf="default"/>
+        
+        <dependency org="apache" name="xerces" rev="2.4.0" conf="xerces->default"/>
+        <dependency org="apache" name="xalan" rev="2.4.0" conf="xmldatabinder->default"/>
+        
+        <dependency org="sun" name="jta" rev="1.0" conf="standalone->default"/>
+        <dependency org="sun" name="jdbc" rev="2.0" conf="1.3->default"/>
+        <dependency org="sun" name="jca" rev="1.0" conf="jca->default;jca-1.3->1.3"/>
+        
+        <dependency org="c3p0" name="c3p0" rev="0.8.4.5" conf="c3p0->default"/>
+        <dependency org="apache" name="commons-dbcp" rev="1.2.1" conf="dbcp->default"/>
+
+        <dependency org="jboss" name="jboss-cache" rev="1.1.1" conf="jboss-cache->default"/>
+        <dependency org="opensymphony" name="oscache" rev="2.0" conf="oscache->default"/>
+        <dependency org="proxool" name="proxool" rev="0.8.3" conf="proxool->default"/>
+        <dependency org="swarmcache" name="swarmcache" rev="1.0RC2" conf="swarmcache->default"/>
+        
+    </dependencies>
+</ivy-module>

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

Modified: ant/ivy/ivyde/trunk/test/java/org/apache/ivyde/eclipse/core/model/IvyFileUtilTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/java/org/apache/ivyde/eclipse/core/model/IvyFileUtilTest.java?rev=611752&r1=611751&r2=611752&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/test/java/org/apache/ivyde/eclipse/core/model/IvyFileUtilTest.java (original)
+++ ant/ivy/ivyde/trunk/test/java/org/apache/ivyde/eclipse/core/model/IvyFileUtilTest.java Mon Jan 14 02:26:37 2008
@@ -1,93 +1,95 @@
-package org.apache.ivyde.eclipse.core.model;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.util.Map;
-
-import org.apache.ivyde.eclipse.ui.core.model.IvyFile;
-
-
-import junit.framework.TestCase;
-
-public class IvyFileUtilTest extends TestCase {
-    String hibContentStr;
-
-    public IvyFileUtilTest(String name) {
-        super(name);
-        byte content[];
-        try {
-            RandomAccessFile accessFile =new RandomAccessFile(getClass().getResource("/ivy-hibernate.xml").getFile(), "r");
-            content = new byte[(int)accessFile.length()];
-            accessFile.read(content);
-            hibContentStr = new String(content);
-        } catch (FileNotFoundException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-
-    public void testInTag() {
-        IvyFile ivyFile = new IvyFile("", hibContentStr);
-        boolean b = ivyFile.inTag(200);
-        assertEquals(b, true);
-    }
-
-    public void testGetTagName() {
-        IvyFile ivyFile = new IvyFile("", hibContentStr);
-        String  tag = ivyFile.getTagName(200);
-        assertEquals("info", tag);
-        tag = ivyFile.getTagName(864);
-        assertEquals("description", tag);
-//        tag = IvyFileUtil.getTagName(1000);
-    }
-    
-    public void testGetAllAttsValues() {
-        String test = "<test att1=\"value1\" att2 =\"value 2 \"  att3 =\" value3 \" att4   =   \"  4  \"";
-        IvyFile ivyFile = new IvyFile("", test);
-        Map all = ivyFile.getAllAttsValues(1);
-        assertNotNull(all);
-        assertEquals(4, all.size());
-        assertEquals("value1", all.get("att1"));
-        assertEquals("value 2 ", all.get("att2"));
-        assertEquals(" value3 ", all.get("att3"));
-        assertEquals("  4  ", all.get("att4"));
-    }
-
-    public void testGetAttributeName() {
-        String test = "<test nospace=\"\" 1Space =\"\"  2Space = \"\" lotofSpace   =   \"    \"";
-        IvyFile ivyFile = new IvyFile("", test);
-        String  name = ivyFile.getAttributeName(15);
-        assertEquals("nospace", name);
-        name = ivyFile.getAttributeName(28);
-        assertEquals("1Space", name);
-        name = ivyFile.getAttributeName(39);
-        assertEquals("2Space", name);
-        name = ivyFile.getAttributeName(60);
-        assertEquals("lotofSpace", name);
-    }
-
-    public void testGetParentTagName() {
-        IvyFile ivyFile = new IvyFile("", hibContentStr);
-        String  tag = ivyFile.getParentTagName(200);
-        assertEquals("ivy-module", tag);
-        tag = ivyFile.getParentTagName(2000);
-        assertEquals("configurations", tag);
-        tag = ivyFile.getParentTagName(1981);
-        assertEquals("configurations", tag);
-        tag = ivyFile.getParentTagName(1000);
-        assertEquals("description", tag);
-        tag = ivyFile.getParentTagName(5015);
-        assertNull(tag);
-    }
-    
-    public void testReadyForValue() {
-    }
-    public void testGetStringIndex() {
-    }
-    public void testGetQualifier() {
-    }
-}
+package org.apache.ivyde.eclipse.core.model;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.ivyde.eclipse.ui.core.model.IvyFile;
+
+public class IvyFileUtilTest extends TestCase {
+    String hibContentStr;
+
+    public IvyFileUtilTest(String name) {
+        super(name);
+        byte content[];
+        try {
+            RandomAccessFile accessFile = new RandomAccessFile(getClass().getResource(
+                "/ivy-hibernate.xml").getFile(), "r");
+            content = new byte[(int) accessFile.length()];
+            accessFile.read(content);
+            hibContentStr = new String(content);
+        } catch (FileNotFoundException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (IOException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    public void testInTag() {
+        IvyFile ivyFile = new IvyFile("", hibContentStr);
+        boolean b = ivyFile.inTag(200);
+        assertEquals(b, true);
+    }
+
+    public void testGetTagName() {
+        IvyFile ivyFile = new IvyFile("", hibContentStr);
+        String tag = ivyFile.getTagName(200);
+        assertEquals("info", tag);
+        tag = ivyFile.getTagName(864);
+        assertEquals("description", tag);
+        // tag = IvyFileUtil.getTagName(1000);
+    }
+
+    public void testGetAllAttsValues() {
+        String test = "<test att1=\"value1\" att2 =\"value 2 \"  att3 =\" value3 \" att4   =   \"  4  \"";
+        IvyFile ivyFile = new IvyFile("", test);
+        Map all = ivyFile.getAllAttsValues(1);
+        assertNotNull(all);
+        assertEquals(4, all.size());
+        assertEquals("value1", all.get("att1"));
+        assertEquals("value 2 ", all.get("att2"));
+        assertEquals(" value3 ", all.get("att3"));
+        assertEquals("  4  ", all.get("att4"));
+    }
+
+    public void testGetAttributeName() {
+        String test = "<test nospace=\"\" 1Space =\"\"  2Space = \"\" lotofSpace   =   \"    \"";
+        IvyFile ivyFile = new IvyFile("", test);
+        String name = ivyFile.getAttributeName(15);
+        assertEquals("nospace", name);
+        name = ivyFile.getAttributeName(28);
+        assertEquals("1Space", name);
+        name = ivyFile.getAttributeName(39);
+        assertEquals("2Space", name);
+        name = ivyFile.getAttributeName(60);
+        assertEquals("lotofSpace", name);
+    }
+
+    public void testGetParentTagName() {
+        IvyFile ivyFile = new IvyFile("", hibContentStr);
+        String tag = ivyFile.getParentTagName(200);
+        assertEquals("ivy-module", tag);
+        tag = ivyFile.getParentTagName(2000);
+        assertEquals("configurations", tag);
+        tag = ivyFile.getParentTagName(1981);
+        assertEquals("configurations", tag);
+        tag = ivyFile.getParentTagName(1000);
+        assertEquals("description", tag);
+        tag = ivyFile.getParentTagName(5015);
+        assertNull(tag);
+    }
+
+    public void testReadyForValue() {
+    }
+
+    public void testGetStringIndex() {
+    }
+
+    public void testGetQualifier() {
+    }
+}

Propchange: ant/ivy/ivyde/trunk/test/java/org/apache/ivyde/eclipse/core/model/IvyFileUtilTest.java
------------------------------------------------------------------------------
    svn:eol-style = native