click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r1086162 - in /click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse: ./ core/facet/ ui/editor/ ui/editor/forms/ ui/wizard/
Date Mon, 28 Mar 2011 09:29:13 GMT
Author: takezoe
Date: Mon Mar 28 09:29:13 2011
New Revision: 1086162

URL: http://svn.apache.org/viewvc?rev=1086162&view=rev
Log:
Fixed compiler warnings.

Modified:
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickUtils.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetUninstallDelegate.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/AbstractMasterDetailEditor.java
    click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickUtils.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickUtils.java?rev=1086162&r1=1086161&r2=1086162&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickUtils.java (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ClickUtils.java Mon Mar 28 09:29:13 2011
@@ -77,20 +77,20 @@ import org.w3c.dom.NodeList;
 
 /**
  * Provides utility methods for ClickIDE.
- * 
+ *
  * @author Naoki Takezoe
  */
 public class ClickUtils {
-	
+
 	public static final String CLICK_SERVLET_NAME = "ClickServlet";
 	public static final String CLICK_SERVLET_CLASS = "org.apache.click.ClickServlet";
 	public static final String CLICK_SPRING_SERVLET_CLASS = "org.apache.click.extras.spring.SpringClickServlet";
 	public static final String CAYENNE_FILTER_CLASS = "org.apache.click.extras.cayenne.DataContextFilter";
 	public static final String DEFAULT_FORMAT_CLASS = "org.apache.click.util.Format";
-	
+
 	/**
 	 * Creates <code>GridData</code>.
-	 * 
+	 *
 	 * @param colspan the horizontal span
 	 * @param style the style constants
 	 * @return the created <code>GridData</code>
@@ -100,11 +100,11 @@ public class ClickUtils {
 		gd.horizontalSpan = colspan;
 		return gd;
 	}
-	
+
 	/**
 	 * Creates <code>GridLayout</code> that has no margins.
-	 * 
-	 * @param columns 
+	 *
+	 * @param columns
 	 * @return the created <code>GridLayout</code>
 	 */
 	public static GridLayout createGridLayout(int columns){
@@ -117,10 +117,10 @@ public class ClickUtils {
 		layout.marginWidth = 0;
 		return layout;
 	}
-	
+
 	/**
 	 * Creates <code>Label</code>.
-	 * 
+	 *
 	 * @param parent the parent composite
 	 * @param text the text which will be displayed on the Label
 	 * @return created Label
@@ -130,10 +130,10 @@ public class ClickUtils {
 		label.setText(text);
 		return label;
 	}
-	
+
 	/**
 	 * Escape XML special charactors.
-	 * 
+	 *
 	 * @param value the string
 	 * @return the escaped string
 	 */
@@ -144,7 +144,7 @@ public class ClickUtils {
 		value = value.replaceAll("\"", "&quot;");
 		return value;
 	}
-	
+
 	public static boolean isClickProject(IProject project){
 		IVirtualComponent component = ComponentCore.createComponent(project);
 		try {
@@ -163,10 +163,10 @@ public class ClickUtils {
 		}
 		return false;
 	}
-	
+
 	/**
 	 * Returns IFile that was related with IDocument.
-	 * 
+	 *
 	 * @param document the document object
 	 * @return the file that was related with the specified document
 	 */
@@ -197,7 +197,7 @@ public class ClickUtils {
 		}
 		return resource;
 	}
-	
+
 	/**
 	 * Returns <code>IJavaProject</code> from <code>Object</code>.
 	 * <p>
@@ -207,7 +207,7 @@ public class ClickUtils {
 	 *   <li><code>IJavaElement</code></li>
 	 *   <li><code>IResource</code></li>
 	 * </ul>
-	 * 
+	 *
 	 * @param obj the input object
 	 * @return <code>IJavaProject</code> or <code>null</code>
 	 */
@@ -235,10 +235,10 @@ public class ClickUtils {
 			return project;
 		} catch(Exception ex){
 		}
-		
+
 		return null;
 	}
-	
+
 	public static IPackageFragmentRoot getSourceFolder(Object obj){
 		if(obj instanceof IPackageFragmentRoot){
 			return (IPackageFragmentRoot)obj;
@@ -250,42 +250,42 @@ public class ClickUtils {
 		}
 		return null;
 	}
-	
+
 	/**
 	 * Returns the <code>WebArtifactEdit</code> from the project for write.
-	 * 
+	 *
 	 * @param project the project
 	 * @return the <code>WebArtifactEdit</code> for write
 	 */
 	public static WebArtifactEdit getWebArtifactEditForWrite(IProject project) {
 		return WebArtifactEdit.getWebArtifactEditForWrite(project);
 	}
-	
+
 	/**
 	 * Returns the <code>WebArtifactEdit</code> from the project for read.
-	 * 
+	 *
 	 * @param project the project
 	 * @return the <code>WebArtifactEdit</code> for read
 	 */
 	public static WebArtifactEdit getWebArtifactEditForRead(IProject project) {
 		return WebArtifactEdit.getWebArtifactEditForRead(project);
 	}
-	
+
 	/**
 	 * Finds the ClickServlet from the given <code>WebApp</code>.
 	 * Returns <code>null</code> if this nethod couldn't find ClickServlet.
-	 * 
+	 *
 	 * @param webApp the <code>WebApp</code> object
 	 * @param useSpring If <code>true</code> then use Spring Framework with Click
 	 * @return the <code>Servlet</code> object of the ClickServlet or <code>null</code>
 	 */
 	public static Servlet findClickServlet(WebApp webApp, boolean useSpring) {
 		String servletClassName = useSpring ? CLICK_SPRING_SERVLET_CLASS : CLICK_SERVLET_CLASS;
-		
+
 		Servlet servlet = null;
-		@SuppressWarnings("unchecked")
+		@SuppressWarnings("rawtypes")
 		Iterator it = webApp.getServlets().iterator();
-		
+
 		while (it.hasNext()) {
 			servlet = (Servlet) it.next();
 			if (servlet.getWebType().isServletType()) {
@@ -300,19 +300,19 @@ public class ClickUtils {
 		}
 		return servlet;
 	}
-	
+
 	/**
 	 * Removes the URL mapping from the given <code>WebApp</code>s.
-	 * 
+	 *
 	 * @param webApp the <code>WebApp</code> object
 	 * @param servlet the <code>Servlet</code> object of the ClickServlet
 	 */
 	public static void removeURLMappings(WebApp webApp, Servlet servlet) {
 		String servletName = servlet.getServletName();
 		if (servletName != null) {
-			@SuppressWarnings("unchecked")
+			@SuppressWarnings("rawtypes")
 			Iterator oldMappings = webApp.getServletMappings().iterator();
-			
+
 			while (oldMappings.hasNext()) {
 				ServletMapping mapping = (ServletMapping) oldMappings.next();
 				if (mapping.getServlet().getServletName().equals(servletName)) {
@@ -321,16 +321,16 @@ public class ClickUtils {
 			}
 		}
 	}
-	
+
 	/**
 	 * Creates the <code>welcome-file-list</code> which contains the <code>index.htm</code>.
-	 * 
+	 *
 	 * @param webApp the <code>WebApp</code> object
 	 */
 	@SuppressWarnings("unchecked")
 	public static void createOrUpdateFilelist(WebApp webApp) {
 		WelcomeFileList filelist = webApp.getFileList();
-		
+
 		if(filelist==null){
 			filelist = WebapplicationFactory.eINSTANCE.createWelcomeFileList();
 			filelist.addFileNamed("index.htm");
@@ -340,10 +340,10 @@ public class ClickUtils {
 			filelist.addFileNamed("index.htm");
 		}
 	}
-	
+
 	/**
 	 * Adds or updates the servlet information in the web.xml.
-	 * 
+	 *
 	 * @param webApp  the <code>WebApp</code> object
 	 * @param config the facet installation configuration
 	 * @param servlet the <code>Servlet</code> object of the ClickServlet
@@ -351,10 +351,10 @@ public class ClickUtils {
 	 * @return the <code>Servlet</code> object of the ClickServlet
 	 */
 	@SuppressWarnings("unchecked")
-	public static Servlet createOrUpdateServletRef(WebApp webApp, IDataModel config, 
+	public static Servlet createOrUpdateServletRef(WebApp webApp, IDataModel config,
 			Servlet servlet, boolean useSpring) {
 		//String displayName = config.getStringProperty(CLICK_SERVLET_NAME);
-		
+
 		if (servlet == null) {
 			// Create the servlet instance and set up the parameters from data
 			// model
@@ -382,7 +382,7 @@ public class ClickUtils {
 			}
 			servlet.setWebType(servletType);
 			servlet.setLoadOnStartup(new Integer(1));
-			
+
 			// Add the servlet to the web application model
 			webApp.getServlets().add(servlet);
 		} else {
@@ -392,7 +392,7 @@ public class ClickUtils {
 		}
 		return servlet;
 	}
-	
+
 	@SuppressWarnings("unchecked")
 	public static void setUpURLMappings(WebApp webApp, String[] urlMappingList, Servlet servlet) {
 		// Add mappings
@@ -405,7 +405,7 @@ public class ClickUtils {
 			webApp.getServletMappings().add(mapping);
 		}
 	}
-	
+
 	public static IDOMElement getElement(IDOMElement base, String tagName){
 		NodeList list = base.getElementsByTagName(tagName);
 		if(list.getLength()==0){
@@ -414,7 +414,7 @@ public class ClickUtils {
 			return (IDOMElement)list.item(0);
 		}
 	}
-	
+
 	public static String[] createComboValues(String[] values){
 		String[] result = new String[values.length + 1];
 		result[0] = "";
@@ -423,10 +423,10 @@ public class ClickUtils {
 		}
 		return result;
 	}
-	
+
 	/**
 	 * Returns the path string of the web application root folder.
-	 * 
+	 *
 	 * @param project the project
 	 * @return the path string of the web application root folder.
 	 *    If any errors occurs, returns blank string.
@@ -442,19 +442,19 @@ public class ClickUtils {
 		}
 		return "";
 	}
-	
+
 	/**
 	 * Returns the active <code>IWorkbenchPage</code>.
-	 * 
+	 *
 	 * @return the active workbench page
 	 */
 	public static IWorkbenchPage getActivePage(){
 		return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
 	}
-	
+
 	/**
 	 * Returns the <code>IFile</code> of <tt>click.xml</tt> in the specified project.
-	 * 
+	 *
 	 * @param project the project
 	 * @return <code>IFile</code> of <tt>click.xml</tt>
 	 */
@@ -466,10 +466,10 @@ public class ClickUtils {
 		}
 		return null;
 	}
-	
+
 	/**
 	 * Returns the <code>IStructuredModel</code> of <tt>click.xml</tt> in the specified project.
-	 * 
+	 *
 	 * @param project the project
 	 * @return <code>IStructuredModel</code> for <tt>click.xml</tt>
 	 */
@@ -486,56 +486,56 @@ public class ClickUtils {
 		}
 		return model;
 	}
-	
+
 	/**
 	 * Returns the charset.
 	 * If the charset is not specified, returns <code>null</code>.
-	 * 
+	 *
 	 * @param project the project
 	 * @return the charset
 	 */
 	public static String getCharset(IProject project){
 		return ClickPlugin.getDefault().getConfigurationProvider(project).getCharset(project);
 	}
-	
+
 	/**
 	 * Returns <code>IType</code> of the format object.
 	 * If format element is not defined, this method returns <code>net.sf.click.util.Format</code>.
-	 * 
+	 *
 	 * @param project the project
 	 * @return IType of the format object
 	 */
 	public static IType getFormat(IProject project){
 		return ClickPlugin.getDefault().getConfigurationProvider(project).getFormat(project);
 	}
-	
+
 	/**
 	 * Returns the status of the auto mapping in the specified project.
 	 * <p>
-	 * <strong>Note:</strong> The auto-mapping mode has been available 
+	 * <strong>Note:</strong> The auto-mapping mode has been available
 	 * in default since Click 1.1.
-	 * 
+	 *
 	 * @param project the project
 	 * @return true if the auto mapping is enable; false otherwise
 	 */
 	public static boolean getAutoMapping(IProject project){
 		return ClickPlugin.getDefault().getConfigurationProvider(project).getAutoMapping(project);
 	}
-	
+
 	/**
 	 * Returns the package name of page classes.
 	 * If the package name is not specified, thie method returns <code>null</code>.
-	 * 
+	 *
 	 * @param project the project
 	 * @return the package name of page classes or <code>null</code>
 	 */
 	public static String getPagePackageName(IProject project){
 		return ClickPlugin.getDefault().getConfigurationProvider(project).getPagePackageName(project);
 	}
-	
+
 	/**
 	 * Returns the the HTML file path which paired to the specified class.
-	 *  
+	 *
 	 * @param project the project
 	 * @param className the classname
 	 * @return the HTML file path.
@@ -544,7 +544,7 @@ public class ClickUtils {
 	public static String getHTMLfromClass(IProject project, String className){
 		return ClickPlugin.getDefault().getConfigurationProvider(project).getHTMLfromClass(project, className);
 	}
-	
+
 	/**
 	 * Returns proposals of template filenames.
 	 * <p>
@@ -558,8 +558,8 @@ public class ClickUtils {
 	 *   <li>userInfo.htm</li>
 	 *   <li>userInfoPage.htm</li>
 	 * </ul>
-	 * 
-	 * @param path the page classname which shouldn't contain package name. 
+	 *
+	 * @param path the page classname which shouldn't contain package name.
 	 *   Also, &quot;Page&quot; postfix should be removed.
 	 * @return proposals of template filenames.
 	 */
@@ -567,9 +567,9 @@ public class ClickUtils {
 		String lower = path.substring(0, 1).toLowerCase() + path.substring(1);
 		String hifun = path.replaceAll("([a-z])([A-Z])", "$1-$2").toLowerCase();
 		String under = path.replaceAll("([a-z])([A-Z])", "$1_$2").toLowerCase();
-		
+
 		List<String> list = new ArrayList<String>();
-		
+
 		list.add(path + ".htm");
 		list.add(path + "Page.htm");
 		list.add(lower + ".htm");
@@ -578,26 +578,26 @@ public class ClickUtils {
 		list.add(hifun + "-page.htm");
 		list.add(under + ".htm");
 		list.add(under + "_page.htm");
-		
+
 		return list.toArray(new String[list.size()]);
 	}
-	
+
 	/**
 	 * Returns the full qualified classname of the page class
 	 * which paired to the specified HTML file.
-	 * 
+	 *
 	 * @param project the project
-	 * @param htmlName the HTML file path which registered to the click.xml 
+	 * @param htmlName the HTML file path which registered to the click.xml
 	 * @return the full qulified classname.
 	 *   If unable to find the paired class, returns <code>null</code>.
 	 */
 	public static String getClassfromHTML(IProject project, String htmlName){
 		return ClickPlugin.getDefault().getConfigurationProvider(project).getClassfromHTML(project, htmlName);
 	}
-	
+
 	/**
 	 * Opens the message dialog which shows the given message.
-	 * 
+	 *
 	 * @param message the display message
 	 * @see MessageDialog
 	 */
@@ -606,12 +606,12 @@ public class ClickUtils {
 		MessageDialog.openError(page.getWorkbenchWindow().getShell(),
 				ClickPlugin.getString("message.error"), message);
 	}
-	
+
 	/**
-	 * Returns the <code>IType</code> object of the page class 
+	 * Returns the <code>IType</code> object of the page class
 	 * which corresponded to the specified HTML template.
 	 * If it can't find the page class, this method returns <code>null</code>.
-	 * 
+	 *
 	 * @param file the <code>IFile</code> object of the HTML template
 	 * @return the <code>IType</code> object of the page class
 	 * @see ClickUtils#getTemplateFromPageClass(IType)
@@ -647,12 +647,12 @@ public class ClickUtils {
 		}
 		return null;
 	}
-	
+
 	/**
 	 * Returns the <code>IFile</code> object of the HTML template which
 	 * correnponded to the specified page class.
 	 * If it can't find the HTML template, this method returns <code>null</code>.
-	 * 
+	 *
 	 * @param type the <code>IType</code> object of the page class
 	 * @return the <code>IFile</code> object of the HTML template
 	 * @see ClickUtils#getPageClassFromTemplate(IFile)
@@ -670,10 +670,10 @@ public class ClickUtils {
 		}
 		return null;
 	}
-	
+
 	/**
 	 * Creates a qualified class name from a class name which doesn't contain package name.
-	 * 
+	 *
 	 * @param parent a full qualified class name of the class which uses this variable
 	 * @param type a class name which doesn't contain package name
 	 * @return full a created qualified class name
@@ -724,25 +724,25 @@ public class ClickUtils {
 		}
 		return type;
 	}
-	
+
 	/**
-	 * This method judges whether the type is a primitive type. 
-	 * 
+	 * This method judges whether the type is a primitive type.
+	 *
 	 * @param type type (classname or primitive type)
-	 * @return 
+	 * @return
 	 * <ul>
 	 *   <li>true - primitive type</li>
 	 *   <li>false - not primitive type</li>
 	 * </ul>
 	 */
 	public static boolean isPrimitive(String type){
-		if(type.equals("int") || type.equals("long") || type.equals("double") || type.equals("float") || 
+		if(type.equals("int") || type.equals("long") || type.equals("double") || type.equals("float") ||
 				type.equals("char") || type.equals("boolean") || type.equals("byte")){
 			return true;
 		}
 		return false;
 	}
-	
+
 	public static String removeTypeParameter(String name){
 		String simpleName = name;
 		if(simpleName.indexOf('<')>=0){
@@ -750,7 +750,7 @@ public class ClickUtils {
 		}
 		return simpleName;
 	}
-	
+
 	/**
 	 * Copy data from <code>InputStream</code> to <code>OutputStream</code>.
 	 */
@@ -768,7 +768,7 @@ public class ClickUtils {
 			closeQuietly(out);
 		}
 	}
-	
+
 	/**
 	 * Read <code>InputStream</code> as UTF-8 text.
 	 */
@@ -781,7 +781,7 @@ public class ClickUtils {
 			throw new RuntimeException(ex);
 		}
 	}
-	
+
 	public static void closeQuietly(Closeable closeable){
 		if(closeable != null){
 			try {
@@ -791,26 +791,26 @@ public class ClickUtils {
 			}
 		}
 	}
-	
+
 	/**
 	 * Tests the given string is null or empty.
-	 * 
+	 *
 	 * @param value test string
 	 * @return true if value is null or empty, false otherwise
 	 */
 	public static boolean isEmpty(String value){
 		return value == null || value.length() == 0;
 	}
-	
+
 	/**
 	 * Tests the given string is not null and empty.
-	 * 
+	 *
 	 * @param value test string
 	 * @return true if value is not null and empty, false otherwise
 	 */
 	public static boolean isNotEmpty(String value){
 		return !isEmpty(value);
 	}
-	
+
 
 }

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java?rev=1086162&r1=1086161&r2=1086162&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetInstallDelegate.java Mon Mar 28 09:29:13 2011
@@ -114,7 +114,7 @@ public class ClickFacetInstallDelegate i
 				ProjectConfiguration projectConfig
 					= ConfigurationManager.getManager().getProjectConfiguration(project);
 				ValidatorMetaData[] meta = projectConfig.getValidators();
-				List enables = new ArrayList();
+				List<ValidatorMetaData> enables = new ArrayList<ValidatorMetaData>();
 				for(int i=0;i<meta.length;i++){
 					if(!meta[i].getValidatorUniqueName().equals(HTMLValidator.class.getName())){
 						enables.add(meta[i]);
@@ -183,18 +183,18 @@ public class ClickFacetInstallDelegate i
 			if(!file.exists()){
 				file.createNewFile();
 			}
-			
+
 			URL url = ClickPlugin.getDefault().getBundle().getEntry(
 					ClickFacetUtil.SPRING_DIR + "/spring-beans.xml");
-			
+
 			// Replaces ${rootPackage} by the input package name.
 			String contents = ClickUtils.readStream(url.openStream());
-			contents = contents.replace("${rootPackage}", 
+			contents = contents.replace("${rootPackage}",
 					config.getStringProperty(ClickFacetInstallDataModelProvider.ROOT_PACKAGE));
-			
-			ClickUtils.copyStream(new ByteArrayInputStream(contents.getBytes("UTF-8")), 
+
+			ClickUtils.copyStream(new ByteArrayInputStream(contents.getBytes("UTF-8")),
 					new FileOutputStream(file));
-			
+
 		} catch(Exception ex){
 			ClickPlugin.log(ex);
 		}
@@ -253,12 +253,12 @@ public class ClickFacetInstallDelegate i
 				if(file.getName().equals("click.xml")){
 					// Replaces ${rootPackage} by the input package name.
 					String contents = ClickUtils.readStream(url.openStream());
-					contents = contents.replace("${rootPackage}", 
+					contents = contents.replace("${rootPackage}",
 							config.getStringProperty(ClickFacetInstallDataModelProvider.ROOT_PACKAGE));
-					
-					ClickUtils.copyStream(new ByteArrayInputStream(contents.getBytes("UTF-8")), 
+
+					ClickUtils.copyStream(new ByteArrayInputStream(contents.getBytes("UTF-8")),
 							new FileOutputStream(file));
-					
+
 				} else {
 					ClickUtils.copyStream(url.openStream(), new FileOutputStream(file));
 				}
@@ -291,7 +291,7 @@ public class ClickFacetInstallDelegate i
 	}
 
 	private void createServletAndModifyWebXML(
-			IProject project, final IDataModel config,IProgressMonitor monitor, 
+			IProject project, final IDataModel config,IProgressMonitor monitor,
 			boolean useSpring, boolean useCayenne, boolean usePerformanceFilter) {
 
 		WebApp webApp = null;
@@ -308,24 +308,24 @@ public class ClickFacetInstallDelegate i
 			}
 
 			servlet = ClickUtils.createOrUpdateServletRef(webApp, config, servlet, useSpring);
-			
+
 			if(useSpring){
 				ParamValue contextParam = CommonFactory.eINSTANCE.createParamValue();
 				contextParam.setName("contextConfigLocation");
 				contextParam.setValue("WEB-INF/spring-beans.xml");
 				webApp.getContextParams().add(contextParam);
-				
+
 				Listener listener = CommonFactory.eINSTANCE.createListener();
 				listener.setListenerClassName("org.springframework.web.context.ContextLoaderListener");
 				webApp.getListeners().add(listener);
 			}
-			
+
 			// Add PerformanceFilter
 			if(usePerformanceFilter){
 				Filter filter = WebapplicationFactory.eINSTANCE.createFilter();
 				filter.setName("PerformanceFilter");
 				filter.setFilterClassName("org.apache.click.extras.filter.PerformanceFilter");
-				
+
 				if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) {
 					// J2EE 1.4
 					ParamValue initParam = CommonFactory.eINSTANCE.createParamValue();
@@ -339,14 +339,14 @@ public class ClickFacetInstallDelegate i
 					initParam.setParamValue("/assets/*");
 					filter.getInitParams().add(initParam);
 				}
-				
+
 				webApp.getFilters().add(filter);
 
 				FilterMapping mapping = WebapplicationFactory.eINSTANCE.createFilterMapping();
 				mapping.setServletName(servlet.getServletName());
 				mapping.setFilter(filter);
 				webApp.getFilterMappings().add(mapping);
-				
+
 				String[] filterPatterns = {"*.css", "*.js", "*.gif", "*.png"};
 				for(String pattern: filterPatterns){
 					mapping = WebapplicationFactory.eINSTANCE.createFilterMapping();
@@ -355,7 +355,7 @@ public class ClickFacetInstallDelegate i
 					webApp.getFilterMappings().add(mapping);
 				}
 			}
-			
+
 			// init mappings
 			String[] listOfMappings = {"*.htm"};
 			ClickUtils.setUpURLMappings(webApp, listOfMappings, servlet);

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetUninstallDelegate.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetUninstallDelegate.java?rev=1086162&r1=1086161&r2=1086162&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetUninstallDelegate.java (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/core/facet/ClickFacetUninstallDelegate.java Mon Mar 28 09:29:13 2011
@@ -38,29 +38,29 @@ import org.eclipse.wst.common.project.fa
 
 /**
  * Uninstalls the click facet.
- * 
+ *
  * @author Naoki Takezoe
  */
 public class ClickFacetUninstallDelegate implements IDelegate {
 
-	public void execute(IProject project, IProjectFacetVersion fv, 
+	public void execute(IProject project, IProjectFacetVersion fv,
 			Object config, IProgressMonitor monitor) throws CoreException {
-		
+
 		IDataModel dataModel = (IDataModel) config;
-		
+
 		if (monitor != null) {
 			monitor.beginTask("", 3); //$NON-NLS-1$
 		}
-		
+
 		removeClickFiles(project, dataModel, monitor);
 		monitor.worked(1);
-		
+
 		// Removes the nature
 		ClickProjectNature.removeNature(project);
 		if (monitor != null) {
 			monitor.worked(1);
 		}
-		
+
 		try {
 			// Removes the facet
 			uninstallClickReferencesFromWebApp(project, dataModel, monitor);
@@ -72,12 +72,12 @@ public class ClickFacetUninstallDelegate
 			if (monitor != null) {
 				monitor.done();
 			}
-		}	
+		}
 	}
-	
+
 	protected void removeClickFiles(IProject project, IDataModel config, IProgressMonitor monitor) {
 		IPath destPath = project.getLocation().append(ClickFacetUtil.getWebContentPath(project));
-		
+
 		File webInf = destPath.append("WEB-INF").toFile();
 		// remove Click files
 		for(int i=0;i<ClickFacetUtil.COPY_FILES.length;i++){
@@ -86,7 +86,7 @@ public class ClickFacetUninstallDelegate
 				file.delete();
 			}
 		}
-		
+
 		// remove Spring files
 		for(int i=0;i<ClickFacetUtil.SPRING_LIBS.length;i++){
 			File file = new File(webInf, ClickFacetUtil.SPRING_LIBS[i]);
@@ -94,7 +94,7 @@ public class ClickFacetUninstallDelegate
 				file.delete();
 			}
 		}
-		
+
 		// remove Cayenne files
 		for(int i=0;i<ClickFacetUtil.CAYENNE_LIBS.length;i++){
 			File file = new File(webInf, ClickFacetUtil.CAYENNE_LIBS[i]);
@@ -103,8 +103,8 @@ public class ClickFacetUninstallDelegate
 			}
 		}
 	}
-	
-	private void uninstallClickReferencesFromWebApp(IProject project, 
+
+	private void uninstallClickReferencesFromWebApp(IProject project,
 			IDataModel config, IProgressMonitor monitor) {
 		WebArtifactEdit artifactEdit = ClickUtils.getWebArtifactEditForWrite(project);
 		WebApp webApp = artifactEdit.getWebApp();
@@ -119,10 +119,10 @@ public class ClickFacetUninstallDelegate
 			}
 			// remove faces url mappings
 			removeClickURLMappings(webApp, servlet);
-			
+
 			// remove Cayenne filter
 			removeCayenneFilter(webApp);
-			
+
 			// remove servlet
 			removeClickServlet(webApp, servlet);
 
@@ -133,11 +133,11 @@ public class ClickFacetUninstallDelegate
 			}
 		}
 	}
-	
+
 	private void removeCayenneFilter(WebApp webApp){
-		@SuppressWarnings("unchecked")
+		@SuppressWarnings("rawtypes")
 		List filters = webApp.getFilters();
-		
+
 		Filter cayenneFilter = null;
 		for(int i=0;i<filters.size();i++){
 			Filter filter = (Filter) filters.get(i);
@@ -152,17 +152,17 @@ public class ClickFacetUninstallDelegate
 						webApp.getFilterMapping(cayenneFilter));
 			}
 		}
-		
+
 		webApp.getFilters().remove(cayenneFilter);
 	}
-	
+
 	private void removeClickURLMappings(WebApp webApp, Servlet servlet) {
 		while (webApp.getServletMapping(servlet) != null) {
 			webApp.getServletMappings().remove(
 					webApp.getServletMapping(servlet));
 		}
 	}
-	
+
 	private void removeClickServlet(WebApp webApp, Servlet servlet) {
 		webApp.getServlets().remove(servlet);
 	}

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java?rev=1086162&r1=1086161&r2=1086162&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java Mon Mar 28 09:29:13 2011
@@ -180,7 +180,7 @@ public class ClickEditor extends MultiPa
 		setActivePage(0);
 	}
 
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings("rawtypes")
 	public Object getAdapter(Class key) {
 		if (key.equals(IContentOutlinePage.class)) {
 			return sourceEditor.getAdapter(IContentOutlinePage.class);

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java?rev=1086162&r1=1086161&r2=1086162&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java Mon Mar 28 09:29:13 2011
@@ -38,13 +38,13 @@ import org.eclipse.wst.xml.core.internal
  * The <code>LineStyleProvider</code> implementation for the Velocity template.
  * <p>
  * TODO multi-line comment (#* ... *#)
- * 
+ *
  * @author Naoki Takezoe
  */
 public class LineStyleProviderForVelocity extends LineStyleProviderForHTML {
 
 	@Override
-	@SuppressWarnings("unchecked")
+	@SuppressWarnings({"unchecked", "rawtypes"})
 	public boolean prepareRegions(ITypedRegion currentRegion, int start, int length, Collection styleRanges) {
 		List<Object> results = new ArrayList<Object>();
 		boolean result = super.prepareRegions(currentRegion, start, length, results);
@@ -55,10 +55,10 @@ public class LineStyleProviderForVelocit
     	Color colorComment   = ClickPlugin.getDefault().getColorManager().get(ClickPlugin.PREF_COLOR_CMT);
 
         IStructuredDocument document = getDocument();
-        
+
         for(Iterator ite = results.iterator(); ite.hasNext();){
             StyleRange styleRange = (StyleRange)ite.next();
-            
+
             IStructuredDocumentRegion region = document.getRegionAtCharacterOffset(styleRange.start);
             String text = region.getText();
             int mStart = styleRange.start - region.getStartOffset();
@@ -85,9 +85,9 @@ public class LineStyleProviderForVelocit
             Matcher m = p.matcher(text);
             int pos = 0;
             while(m.find()) {
-            	Color color = m.group().startsWith("##") ? colorComment : 
+            	Color color = m.group().startsWith("##") ? colorComment :
             		          m.group().startsWith("#") ? colorDirective : colorVariable;
-            	
+
                 if(m.start() < mStart){
                     if(m.end() < mStart){
                         continue;
@@ -145,5 +145,5 @@ public class LineStyleProviderForVelocit
 
         return result;
 	}
-	
+
 }

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/AbstractMasterDetailEditor.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/AbstractMasterDetailEditor.java?rev=1086162&r1=1086161&r2=1086162&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/AbstractMasterDetailEditor.java (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/forms/AbstractMasterDetailEditor.java Mon Mar 28 09:29:13 2011
@@ -51,50 +51,50 @@ public abstract class AbstractMasterDeta
 	protected SashForm sash;
 	protected TreeViewer viewer;
 	protected Composite currentEditor;
-	
+
 	protected MenuManager menu;
 	protected MenuManager newMenu;
 	protected ElementRemoveAction deleteAction = new ElementRemoveAction();
-	
+
 	protected abstract String[] getAcceptElementNames();
-	
+
 	protected abstract IAttributeEditor getAttributeEditor(String elementName);
-	
+
 	protected abstract void createMenu(IDOMElement element);
-	
+
 	public void initModel(IStructuredModel model) {
 		sash = new SashForm(form.getBody(), SWT.HORIZONTAL);
 		sash.setLayoutData(new GridData(GridData.FILL_BOTH));
 		sash.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-		
+
 		final Composite left = toolkit.createComposite(sash);
 		left.setLayoutData(new GridData(GridData.FILL_BOTH));
 		left.setLayout(new FillLayout());
-		
+
 		Section headerSection = toolkit.createSection(left, Section.TITLE_BAR);
 		headerSection.setText(ClickPlugin.getString("editor.clickXML.outline"));
-		
+
 		Composite detailComposite = toolkit.createComposite(sash);
 		detailComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
 		detailComposite.setLayout(new FillLayout());
-		
+
 		Section detailSection = toolkit.createSection(detailComposite, Section.TITLE_BAR);
 		detailSection.setText(ClickPlugin.getString("editor.clickXML.details"));
-		
+
 		final Composite right = toolkit.createComposite(detailSection);
 		right.setLayout(new FillLayout());
 		detailSection.setClient(right);
-		
+
 		Tree tree = toolkit.createTree(headerSection, SWT.NULL);
 		tree.setLayoutData(new GridData(GridData.FILL_BOTH));
 		headerSection.setClient(tree);
-		
+
 		List<String> acceptElements = new ArrayList<String>();
 		String[] acceptElementNames = getAcceptElementNames();
 		for(int i=0;i<acceptElementNames.length;i++){
 			acceptElements.add(acceptElementNames[i]);
 		}
-		
+
 		viewer = new TreeViewer(tree);
 		viewer.setContentProvider(new ClickTreeContentProvider(acceptElements));
 		viewer.setLabelProvider(new ClickTreeLabelProvider());
@@ -116,10 +116,10 @@ public abstract class AbstractMasterDeta
 				right.layout();
 			}
 		});
-		
+
 		viewer.setInput(model);
 		viewer.expandAll();
-		
+
 		menu = new MenuManager();
 		newMenu = new MenuManager(ClickPlugin.getString("action.new"));
 		menu.add(newMenu);
@@ -138,26 +138,26 @@ public abstract class AbstractMasterDeta
 				}
 			}
 		});
-		
+
 		toolkit.paintBordersFor(left);
 	}
-	
+
 	public void updateMenu(){
 		newMenu.removeAll();
-		
+
 		IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
 		Object obj = selection.getFirstElement();
-		
+
 		if(obj instanceof IDOMElement){
 			IDOMElement element = (IDOMElement)obj;
-			
+
 			if(element.getNodeName().equals(ClickPlugin.TAG_CLICK_APP)){
 				deleteAction.setEnabled(false);
 			} else {
 				deleteAction.setEnabled(true);
 				deleteAction.setElement(element);
 			}
-			
+
 			createMenu(element);
 		}
 	}
@@ -166,12 +166,12 @@ public abstract class AbstractMasterDeta
 		viewer.setSelection(null);
 		viewer.refresh();
 	}
-	
+
 	public void setFocus() {
 		form.setFocus();
 	}
-	
-	@SuppressWarnings("unchecked")
+
+	@SuppressWarnings("rawtypes")
 	public Object getAdapter(Class adapter) {
 		if(adapter.equals(TreeViewer.class)){
 			return this.viewer;

Modified: click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java
URL: http://svn.apache.org/viewvc/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java?rev=1086162&r1=1086161&r2=1086162&view=diff
==============================================================================
--- click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java (original)
+++ click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/wizard/NewClickPageWizardPage.java Mon Mar 28 09:29:13 2011
@@ -24,7 +24,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.StringTokenizer;
 
-
 import org.apache.click.eclipse.ClickPlugin;
 import org.apache.click.eclipse.ClickUtils;
 import org.apache.click.eclipse.preferences.Template;
@@ -92,12 +91,12 @@ import org.eclipse.ui.texteditor.ITextEd
  * <ul>
  *   <li>TODO Reload initial values when the project is selected.</li>
  * </ul>
- * 
+ *
  * @author Naoki Takezoe
  */
 public class NewClickPageWizardPage extends WizardPage {
-	
-	private List templates = Template.loadFromPreference();
+
+	private List<Template> templates = Template.loadFromPreference();
 	private Combo template;
 	private Text project;
 	private Button browseProject;
@@ -114,31 +113,31 @@ public class NewClickPageWizardPage exte
 	private Button browsePackage;
 	private Button browseSuperClass;
 	private Button addToClickXML;
-	
+
 	private Object selection;
 	private String initialClassName;
 	private String initialPageName;
 	private boolean insertClassName = true;
 	private TypeNameContentProposalProvider typeAssistProvider = null;
 	private PackageNameContentProposalProvider packageAssistProvider = null;
-	
-	public NewClickPageWizardPage(String pageName, Object selection, 
+
+	public NewClickPageWizardPage(String pageName, Object selection,
 			String initialClassName, String initialPageName) {
 		super(pageName);
-		
+
 		this.selection = selection;
 		this.initialClassName = initialClassName;
 		this.initialPageName = initialPageName;
-		
+
 		setTitle(ClickPlugin.getString("wizard.newPage.title"));
 		setDescription(ClickPlugin.getString("wizard.newPage.description"));
 	}
-	
+
 	public void createControl(Composite parent) {
-		IDialogSettings settings = 
+		IDialogSettings settings =
 			ClickPlugin.getDefault().getDialogSettings().getSection(
 					NewClickPageWizard.SECTION_NEW_CLICK_PAGE);
-		
+
 		String initClassName = this.initialClassName;
 		String initPackage = "";
 		if(this.initialClassName != null){
@@ -148,23 +147,23 @@ public class NewClickPageWizardPage exte
 				initClassName = this.initialClassName.substring(index + 1);
 			}
 		}
-		
+
 		Composite composite = new Composite(parent, SWT.NULL);
-		
+
 		composite.setLayoutData(new GridData(GridData.FILL_BOTH));
 		composite.setLayout(new GridLayout(1, false));
-		
+
 		Composite projectPanel = new Composite(composite, SWT.NULL);
 		GridLayout layout = new GridLayout(3, false);
 		projectPanel.setLayout(layout);
 		projectPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 		ClickUtils.createLabel(projectPanel, ClickPlugin.getString("wizard.newPage.project"));
-		
+
 		project = new Text(projectPanel, SWT.BORDER);
 		project.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		
+
 		IJavaProject initProject = null;
-		
+
 		if(selection!=null){
 			initProject = ClickUtils.getJavaProject(selection);
 			try {
@@ -186,10 +185,10 @@ public class NewClickPageWizardPage exte
 				validate();
 			}
 		});
-		
+
 		packageAssistProvider = new PackageNameContentProposalProvider(initProject);
 		typeAssistProvider = new TypeNameContentProposalProvider(initProject);
-		
+
 		ClickUtils.createLabel(projectPanel, ClickPlugin.getString("preferences.template") + ":");
 		template = new Combo(projectPanel, SWT.READ_ONLY);
 		for(int i=0;i<templates.size();i++){
@@ -198,12 +197,12 @@ public class NewClickPageWizardPage exte
 				template.setText(((Template)templates.get(i)).getName());
 			}
 		}
-		
+
 		Group htmlGroup = new Group(composite, SWT.NULL);
 		htmlGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 		htmlGroup.setLayout(new GridLayout(3, false));
 		htmlGroup.setText(ClickPlugin.getString("wizard.newPage.templateGroup"));
-		
+
 		createPageHTML = new Button(htmlGroup, SWT.CHECK);
 		createPageHTML.setText(ClickPlugin.getString("wizard.newPage.templateGroup.checkbox"));
 		createPageHTML.setLayoutData(createGridData(3));
@@ -214,7 +213,7 @@ public class NewClickPageWizardPage exte
 				validate();
 			}
 		});
-		
+
 		String initFolder = "";
 		String initPageName = this.initialPageName;
 		if(initPageName!=null){
@@ -227,7 +226,7 @@ public class NewClickPageWizardPage exte
 				}
 			}
 		}
-		
+
 		ClickUtils.createLabel(htmlGroup, ClickPlugin.getString("wizard.newPage.templateGroup.parentFolder"));
 		parentFolder = new Text(htmlGroup, SWT.BORDER);
 		parentFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -244,7 +243,7 @@ public class NewClickPageWizardPage exte
 				validate();
 			}
 		});
-		
+
 		browseParent = new Button(htmlGroup, SWT.PUSH);
 		browseParent.setText(ClickPlugin.getString("action.browse"));
 		browseParent.addSelectionListener(new SelectionAdapter(){
@@ -252,7 +251,7 @@ public class NewClickPageWizardPage exte
 				selectFolder();
 			}
 		});
-		
+
 		ClickUtils.createLabel(htmlGroup, ClickPlugin.getString("wizard.newPage.templateGroup.filename"));
 		pageName = new Text(htmlGroup, SWT.BORDER);
 		pageName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -287,12 +286,12 @@ public class NewClickPageWizardPage exte
 				insertClassName = className.getText().length()==0;
 			}
 		});
-		
+
 		Group classGroup = new Group(composite, SWT.NULL);
 		classGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 		classGroup.setLayout(new GridLayout(3, false));
 		classGroup.setText(ClickPlugin.getString("wizard.newPage.pageClassGroup"));
-		
+
 		createPageClass = new Button(classGroup, SWT.CHECK);
 		createPageClass.setText(ClickPlugin.getString("wizard.newPage.pageClassGroup.checkbox"));
 		createPageClass.setLayoutData(createGridData(3));
@@ -303,7 +302,7 @@ public class NewClickPageWizardPage exte
 				validate();
 			}
 		});
-		
+
 		ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.sourceFolder"));
 		Composite sourceField = FieldAssistUtils.createNullDecoratedPanel(classGroup, false);
 		sourceFolder = new Text(sourceField, SWT.BORDER);
@@ -330,7 +329,7 @@ public class NewClickPageWizardPage exte
 				validate();
 			}
 		});
-		
+
 		browseSource = new Button(classGroup, SWT.PUSH);
 		browseSource.setText(ClickPlugin.getString("action.browse"));
 		browseSource.addSelectionListener(new SelectionAdapter(){
@@ -338,14 +337,14 @@ public class NewClickPageWizardPage exte
 				selectSourceFolder();
 			}
 		});
-		
+
 		ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.package"));
 		ContentAssistField packageField = new ContentAssistField(classGroup, SWT.BORDER,
 				new TextControlCreator(), new TextContentAdapter(), packageAssistProvider,
 				ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0]);
 		packageName = (Text)packageField.getControl();
 		packageField.getLayoutControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-		
+
 		if(selection instanceof IPackageFragment){
 			packageName.setText(((IPackageFragment)selection).getElementName());
 		} else if(initPackage!=null && initPackage.length()!=0){
@@ -361,24 +360,24 @@ public class NewClickPageWizardPage exte
 				validate();
 			}
 		});
-		
+
 		browsePackage = new Button(classGroup, SWT.PUSH);
 		browsePackage.setText(ClickPlugin.getString("action.browse"));
 		browsePackage.addSelectionListener(new SelectionAdapter(){
 			public void widgetSelected(SelectionEvent evt){
 				IRunnableContext context= new BusyIndicatorRunnableContext();
-				int style = PackageSelectionDialog.F_REMOVE_DUPLICATES | 
-				            PackageSelectionDialog.F_SHOW_PARENTS | 
+				int style = PackageSelectionDialog.F_REMOVE_DUPLICATES |
+				            PackageSelectionDialog.F_SHOW_PARENTS |
 				            PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE;
-				
+
 				JavaSearchScope scope = new JavaSearchScope();
 				try {
 					IJavaProject project = JavaCore.create(getProject());
-					scope.add((JavaProject)project, JavaSearchScope.SOURCES, new HashSet(2, 1));
+					scope.add((JavaProject)project, JavaSearchScope.SOURCES, new HashSet<Integer>(2, 1));
 				} catch(Exception ex){
 					ClickPlugin.log(ex);
 				}
-				
+
 				PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, style, scope);
 				dialog.setMultipleSelection(false);
 				if(dialog.open()==PackageSelectionDialog.OK){
@@ -390,7 +389,7 @@ public class NewClickPageWizardPage exte
 				}
 			}
 		});
-		
+
 		ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.classname"));
 		Composite classField = FieldAssistUtils.createNullDecoratedPanel(classGroup, false);
 		className = new Text(classField, SWT.BORDER);
@@ -404,9 +403,9 @@ public class NewClickPageWizardPage exte
 				validate();
 			}
 		});
-		
+
 		ClickUtils.createLabel(classGroup, "");
-		
+
 		ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.superclass"));
 		ContentAssistField superClassField = new ContentAssistField(classGroup, SWT.BORDER,
 				new TextControlCreator(), new TextContentAdapter(), typeAssistProvider,
@@ -426,12 +425,12 @@ public class NewClickPageWizardPage exte
 				Shell shell = getShell();
 				try {
 					IJavaProject project = JavaCore.create(getProject());
-					
+
 					SelectionDialog dialog = JavaUI.createTypeDialog(
 							shell, new ProgressMonitorDialog(shell),
 							SearchEngine.createJavaSearchScope(new IJavaElement[]{project}),
 							IJavaElementSearchConstants.CONSIDER_CLASSES,false);
-					
+
 					if(dialog.open()==SelectionDialog.OK){
 						Object[] result = dialog.getResult();
 						superClass.setText(((IType)result[0]).getFullyQualifiedName());
@@ -441,28 +440,28 @@ public class NewClickPageWizardPage exte
 				}
 			}
 		});
-		
+
 		ClickUtils.createLabel(composite, "");
-		
+
 		addToClickXML = new Button(composite, SWT.CHECK);
 		addToClickXML.setText(ClickPlugin.getString("wizard.newPage.addMapping"));
 		addToClickXML.setSelection(settings.getBoolean(NewClickPageWizard.SHOULD_ADD_TO_CLICK_XML));
 		if(getProject()!=null && ClickUtils.getAutoMapping(getProject())){
 			addToClickXML.setSelection(false);
 		}
-		
+
 		updateHTMLGroup();
 		updateClassGroup();
 		validate();
 		setControl(composite);
 	}
-	
+
 	private void updateHTMLGroup(){
 		parentFolder.setEnabled(createPageHTML.getSelection());
 		browseParent.setEnabled(createPageHTML.getSelection());
 		pageName.setEnabled(createPageHTML.getSelection());
 	}
-	
+
 	private void updateClassGroup(){
 		sourceFolder.setEnabled(createPageClass.getSelection());
 		browseSource.setEnabled(createPageClass.getSelection());
@@ -472,7 +471,7 @@ public class NewClickPageWizardPage exte
 		superClass.setEnabled(createPageClass.getSelection());
 		browseSuperClass.setEnabled(createPageClass.getSelection());
 	}
-	
+
 	private void validate(){
 		IProject project = getProject();
 		if(project!=null){
@@ -487,8 +486,7 @@ public class NewClickPageWizardPage exte
 			return;
 		} else if(!ClickUtils.isClickProject(getProject())){
 			setMessage(MessageFormat.format(
-					ClickPlugin.getString("wizard.newPage.error.notClickProject"), 
-					new String[]{ getProject().getName() }), ERROR);
+					ClickPlugin.getString("wizard.newPage.error.notClickProject"), getProject().getName()), ERROR);
 			setPageComplete(false);
 			browsePackage.setEnabled(false);
 			browseParent.setEnabled(false);
@@ -499,7 +497,7 @@ public class NewClickPageWizardPage exte
 			browseParent.setEnabled(createPageClass.getSelection());
 			browseSource.setEnabled(createPageHTML.getSelection());
 		}
-		
+
 		if(createPageHTML.getSelection() || createPageClass.getSelection()){
 			if(template.getText().length()==0){
 				setMessage(ClickPlugin.getString("wizard.newPage.error.noTemplate"), ERROR);
@@ -507,13 +505,12 @@ public class NewClickPageWizardPage exte
 				return;
 			}
 		}
-		
+
 		// for the HTML file part
 		if(createPageHTML.getSelection()){
 			if(!existsFolder(parentFolder.getText())){
 				setMessage(MessageFormat.format(
-						ClickPlugin.getString("wizard.newPage.error.folderDoesNotExist"),
-						new String[]{ parentFolder.getText() }), ERROR);
+						ClickPlugin.getString("wizard.newPage.error.folderDoesNotExist"), parentFolder.getText()), ERROR);
 				setPageComplete(false);
 				return;
 			} else if(pageName.getText().equals("")){
@@ -526,19 +523,17 @@ public class NewClickPageWizardPage exte
 				return;
 			}
 		}
-		
+
 		// for the page class part
 		if(createPageClass.getSelection()){
 			if(!existsFolder(sourceFolder.getText())){
 				setMessage(MessageFormat.format(
-						ClickPlugin.getString("wizard.newPage.error.folderDoesNotExist"),
-						new String[]{ sourceFolder.getText() }), ERROR);
+						ClickPlugin.getString("wizard.newPage.error.folderDoesNotExist"), sourceFolder.getText()), ERROR);
 				setPageComplete(false);
 				return;
 			} else if(!isValidPackageName(packageName.getText())){
 				setMessage(MessageFormat.format(
-						ClickPlugin.getString("wizard.newPage.error.packageIsInvalid1"), 
-						new Object[]{ packageName.getText() }), ERROR);
+						ClickPlugin.getString("wizard.newPage.error.packageIsInvalid1"), packageName.getText()), ERROR);
 				setPageComplete(false);
 				return;
 			} else if(packageName.getText().endsWith(".")){
@@ -551,7 +546,7 @@ public class NewClickPageWizardPage exte
 				return;
 			} else if(!isValidTypeName(className.getText())){
 				setMessage(MessageFormat.format(
-						ClickPlugin.getString("wizard.newPage.error.typeIsInvalid"), 
+						ClickPlugin.getString("wizard.newPage.error.typeIsInvalid"),
 						new Object[]{ className.getText() }), ERROR);
 				setPageComplete(false);
 				return;
@@ -565,12 +560,12 @@ public class NewClickPageWizardPage exte
 				return;
 			}
 		}
-		
+
 		// all valid
 		setMessage(null);
 		setPageComplete(true);
 	}
-	
+
 	private boolean isValidPackageName(String packageName){
 		for(int i=0;i<packageName.length();i++){
 			char c = packageName.charAt(i);
@@ -588,7 +583,7 @@ public class NewClickPageWizardPage exte
 		}
 		return true;
 	}
-	
+
 	private boolean isValidTypeName(String className){
 		for(int i=0;i<className.length();i++){
 			char c = className.charAt(i);
@@ -604,16 +599,16 @@ public class NewClickPageWizardPage exte
 		}
 		return true;
 	}
-	
+
 	private boolean existsFolder(String folder){
 		if(folder.equals("")){
 			return true; // TODO ??
 		}
-		
+
 		IProject project = getProject();
 		return project.getFolder(folder).exists();
 	}
-	
+
 	private boolean existsFile(String parentFolder, String fileName){
 		IProject project = getProject();
 		IFile file = null;
@@ -624,7 +619,7 @@ public class NewClickPageWizardPage exte
 		}
 		return file.exists();
 	}
-	
+
 	private boolean existsClass(String sourceFolder, String packageName, String className){
 		try {
 			IProject project = getProject();
@@ -632,37 +627,37 @@ public class NewClickPageWizardPage exte
 			if(!sourceFolder.equals("")){
 				resource = project.getFolder(sourceFolder);
 			}
-			
+
 			IJavaProject javaProject = JavaCore.create(project);
 			IPackageFragmentRoot root = javaProject.getPackageFragmentRoot(resource);
 			IPackageFragment fragment = root.getPackageFragment(packageName);
 			if(!fragment.exists()){
 				return false;
 			}
-			
+
 			ICompilationUnit unit = fragment.getCompilationUnit(className + ".java");
 			return unit.exists();
-			
+
 		} catch(Exception ex){
 			ex.printStackTrace();
 			return false;
 		}
 	}
-	
+
 	private GridData createGridData(int colspan){
 		GridData gd = new GridData();
 		gd.horizontalSpan = colspan;
 		return gd;
 	}
-	
+
 	private void selectProject(){
 		IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
-		
+
 		// required validator
 		ISelectionStatusValidator validator = new ISelectionStatusValidator(){
 			private IStatus fgErrorStatus= new StatusInfo(IStatus.ERROR, ""); //$NON-NLS-1$
 			private IStatus fgOKStatus= new StatusInfo();
-			
+
 			public IStatus validate(Object[] selection){
 				if(selection==null || selection.length != 1){
 					return fgErrorStatus;
@@ -670,7 +665,7 @@ public class NewClickPageWizardPage exte
 				return fgOKStatus;
 			}
 		};
-		
+
 		// select only IJavaProject
 		ViewerFilter filter = new ViewerFilter(){
 		    public boolean select(Viewer viewer, Object parentElement, Object element){
@@ -684,12 +679,12 @@ public class NewClickPageWizardPage exte
 		    	return false;
 		    }
 		};
-		
+
 		FolderSelectionDialog dialog = new FolderSelectionDialog(
 				getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
-		
+
 		dialog.setTitle(ClickPlugin.getString("wizard.newPage.dialog.selectProject"));
-		
+
 		dialog.setInput(wsroot);
 		dialog.setValidator(validator);
 		dialog.addFilter(filter);
@@ -698,7 +693,7 @@ public class NewClickPageWizardPage exte
 			project.setText(((IProject)dialog.getFirstResult()).getName());
 		}
 	}
-	
+
 	private void selectFolder() {
 		try {
 			IProject currProject = getProject();
@@ -710,23 +705,23 @@ public class NewClickPageWizardPage exte
 					init = null;
 				}
 			}
-			Class[] acceptedClasses = new Class[] { IProject.class, IFolder.class };
+			Class<?>[] acceptedClasses = new Class<?>[] { IProject.class, IFolder.class };
 			ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
 			IProject[] allProjects = wsroot.getProjects();
-			ArrayList rejectedElements = new ArrayList(allProjects.length);
+			List<IProject> rejectedElements = new ArrayList<IProject>(allProjects.length);
 			for (int i = 0; i < allProjects.length; i++) {
 				if (!allProjects[i].equals(currProject)) {
 					rejectedElements.add(allProjects[i]);
 				}
 			}
 			ViewerFilter filter = new TypedViewerFilter(acceptedClasses, rejectedElements.toArray());
-			
+
 			FolderSelectionDialog dialog = new FolderSelectionDialog(
 					getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
-			
+
 			dialog.setTitle(ClickPlugin.getString("wizard.newPage.dialog.selectFolder"));
 			//dialog.setMessage(HTMLPlugin.getResourceString("HTMLProjectPropertyPage.WebRoot"));
-			
+
 			dialog.setInput(wsroot);
 			dialog.setValidator(validator);
 			dialog.addFilter(filter);
@@ -734,22 +729,22 @@ public class NewClickPageWizardPage exte
 			if (dialog.open() == FolderSelectionDialog.OK) {
 				parentFolder.setText(((IFolder)dialog.getFirstResult()).getProjectRelativePath().toString());
 			}
-			
+
 		} catch (Throwable t) {
 			ClickPlugin.log(t);
 		}
 	}
-	
+
 	private void selectSourceFolder() {
 		try {
-			Class[] acceptedClasses = new Class[] { IJavaModel.class, IJavaProject.class, IPackageFragmentRoot.class };
+			Class<?>[] acceptedClasses = new Class<?>[] { IJavaModel.class, IJavaProject.class, IPackageFragmentRoot.class };
 			ISelectionStatusValidator validator = new TypedElementSelectionValidator(acceptedClasses, false);
-			
+
 			IPackageFragmentRoot init = null;
 			IJavaProject project = JavaCore.create(getProject());
-			
+
 			IPackageFragmentRoot[] roots = project.getPackageFragmentRoots();
-			ArrayList rejectedElements = new ArrayList();
+			List<IJavaElement> rejectedElements = new ArrayList<IJavaElement>();
 			for (int i = 0; i < roots.length; i++) {
 				if (roots[i] instanceof JarPackageFragmentRoot) {
 					rejectedElements.add(roots[i]);
@@ -770,15 +765,15 @@ public class NewClickPageWizardPage exte
 					rejectedElements.add(projects[i]);
 				}
 			}
-			
+
 			ViewerFilter filter = new TypedViewerFilter(acceptedClasses, rejectedElements.toArray());
-			
+
 			FolderSelectionDialog dialog = new FolderSelectionDialog(
 					getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
-			
+
 			dialog.setTitle(ClickPlugin.getString("wizard.newPage.dialog.selectSourceFolder"));
 			//dialog.setMessage(HTMLPlugin.getResourceString("HTMLProjectPropertyPage.WebRoot"));
-			
+
 			dialog.setInput(model);
 			dialog.setValidator(validator);
 			dialog.addFilter(filter);
@@ -786,12 +781,12 @@ public class NewClickPageWizardPage exte
 			if (dialog.open() == FolderSelectionDialog.OK) {
 				sourceFolder.setText(((IPackageFragmentRoot)dialog.getFirstResult()).getElementName());
 			}
-			
+
 		} catch (Throwable t) {
 			ClickPlugin.log(t);
 		}
 	}
-	
+
 	/**
 	 * Returns the wizard should create a HTML file or not.
 	 * @return
@@ -799,7 +794,7 @@ public class NewClickPageWizardPage exte
 	public boolean shouldCreateHTML(){
 		return createPageHTML.getSelection();
 	}
-	
+
 	/**
 	 * Returns the project relative path of the parent folder of the HTML file.
 	 * @return the project relative path of the parent folder
@@ -807,7 +802,7 @@ public class NewClickPageWizardPage exte
 	public String getParentFolder(){
 		return parentFolder.getText();
 	}
-	
+
 	/**
 	 * Returns the HTML filename.
 	 * @return the HTML filename
@@ -815,11 +810,11 @@ public class NewClickPageWizardPage exte
 	public String getFilename(){
 		return pageName.getText();
 	}
-	
+
 	public boolean shouldCreateClass(){
 		return createPageClass.getSelection();
 	}
-	
+
 	/**
 	 * Returns the project relative path of the source folder of the page class.
 	 * @return the project relative path of the source folder
@@ -827,7 +822,7 @@ public class NewClickPageWizardPage exte
 	public String getSourceFolder(){
 		return sourceFolder.getText();
 	}
-	
+
 	/**
 	 * Returns the package name of the page class.
 	 * @return the package name
@@ -835,7 +830,7 @@ public class NewClickPageWizardPage exte
 	public String getPackageName(){
 		return packageName.getText();
 	}
-	
+
 	/**
 	 * Returns the class name of the page class.
 	 * @return the class name
@@ -843,7 +838,7 @@ public class NewClickPageWizardPage exte
 	public String getClassName(){
 		return className.getText();
 	}
-	
+
 	/**
 	 * Returns the wizard should add the page mapping to click.xml or not.
 	 * @return
@@ -851,15 +846,15 @@ public class NewClickPageWizardPage exte
 	public boolean shouldAddToClickXML(){
 		return addToClickXML.getSelection();
 	}
-	
+
 	public String getSuperClass(){
 		return superClass.getText();
 	}
-	
+
 	public Template getTemplate(){
 		return (Template)templates.get(template.getSelectionIndex());
 	}
-	
+
 	public IProject getProject(){
 		try {
 			IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();



Mime
View raw message