ed_mann's fix for ticket #322
[phpeclipse.git] / net.sourceforge.phpeclipse.externaltools / src / net / sourceforge / phpdt / externaltools / variable / SpecificFolderResourceComponent.java
index e0b4aa7..b217d5c 100644 (file)
@@ -1,13 +1,13 @@
 package net.sourceforge.phpdt.externaltools.variable;
 
 /**********************************************************************
-Copyright (c) 2002 IBM Corp. and others. All rights reserved.
-This file is made available under the terms of the Common Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/cpl-v10.html
-Contributors:
-**********************************************************************/
+ Copyright (c) 2002 IBM Corp. and others. All rights reserved.
+ This file is made available under the terms of the Common Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/cpl-v10.html
+ �
+ Contributors:
+ **********************************************************************/
 
 import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages;
 
@@ -22,9 +22,9 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Label;
 
 /**
- * Visual component to edit the resource type variable
- * value for the working directory. Variable is limited to a specific
- * <code>IContainer</code> resource.
+ * Visual component to edit the resource type variable value for the working
+ * directory. Variable is limited to a specific <code>IContainer</code>
+ * resource.
  * <p>
  * This class is not intended to be extended by clients.
  * </p>
@@ -38,15 +38,15 @@ public class SpecificFolderResourceComponent extends ResourceComponent {
                super();
        }
 
-       /* (non-Javadoc)
-        * Method declared on ResourceComponent.
+       /*
+        * (non-Javadoc) Method declared on ResourceComponent.
         */
        protected void createSelectedResourceOption() {
                // Do not present this option...
        }
-       
-       /* (non-Javadoc)
-        * Method declared on ResourceComponent.
+
+       /*
+        * (non-Javadoc) Method declared on ResourceComponent.
         */
        protected void createResourceList() {
                super.createResourceList();
@@ -54,54 +54,60 @@ public class SpecificFolderResourceComponent extends ResourceComponent {
                        resourceList.addFilter(new FileFilter());
        }
 
-       /* (non-Javadoc)
-        * Method declared on ResourceComponent.
+       /*
+        * (non-Javadoc) Method declared on ResourceComponent.
         */
        protected void createSpecificResourceOption() {
                Label label = new Label(mainGroup, SWT.NONE);
                GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
                label.setLayoutData(data);
                label.setFont(mainGroup.getFont());
-               label.setText(ExternalToolsModelMessages.getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
+               label.setText(ExternalToolsModelMessages
+                               .getString("ResourceComponent.specificResLabel")); //$NON-NLS-1$
        }
 
-       /* (non-Javadoc)
-        * Method declared on ResourceComponent.
+       /*
+        * (non-Javadoc) Method declared on ResourceComponent.
         */
        protected boolean validateResourceListSelection() {
                if (resourceList == null)
                        return true;
-                       
-               IStructuredSelection sel = (IStructuredSelection) resourceList.getSelection();
+
+               IStructuredSelection sel = (IStructuredSelection) resourceList
+                               .getSelection();
                IResource resource = (IResource) sel.getFirstElement();
                if (resource == null || resource.getType() == IResource.FILE) {
-                       getPage().setMessage(ExternalToolsModelMessages.getString("ResourceComponent.selectionRequired"), IMessageProvider.WARNING); //$NON-NLS-1$
+                       getPage()
+                                       .setMessage(
+                                                       ExternalToolsModelMessages
+                                                                       .getString("ResourceComponent.selectionRequired"), IMessageProvider.WARNING); //$NON-NLS-1$
                        setIsValid(false);
                        return false;
                }
-               
+
                return true;
        }
-       
-       
+
        /**
         * Filter to remove any IFile resources.
         */
        private static final class FileFilter extends ViewerFilter {
-               /* (non-Javadoc)
-                * Method declared on ViewerFilter.
+               /*
+                * (non-Javadoc) Method declared on ViewerFilter.
                 */
-               public boolean select(Viewer viewer, Object parentElement, Object element) {
+               public boolean select(Viewer viewer, Object parentElement,
+                               Object element) {
                        IResource resource = null;
                        if (element instanceof IResource) {
                                resource = (IResource) element;
                        } else {
                                if (element instanceof IAdaptable) {
                                        IAdaptable adaptable = (IAdaptable) element;
-                                       resource = (IResource) adaptable.getAdapter(IResource.class);
+                                       resource = (IResource) adaptable
+                                                       .getAdapter(IResource.class);
                                }
                        }
-                       
+
                        if (resource != null)
                                return resource.getType() != IResource.FILE;
                        else