Skip to content
Browse files

quick fixes

  • Loading branch information...
1 parent d08102a commit 076f557acaf83981a6c0c1ce3e34fc1a60e3c150 @denuno denuno committed Nov 16, 2012
Showing with 77 additions and 159 deletions.
  1. +2 −2 org.cfeclipse.cfml.frameworks/META-INF/MANIFEST.MF
  2. +1 −3 org.cfeclipse.cfml.frameworks/plugin.xml
  3. +8 −9 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/FrameworkManager.java
  4. +7 −8 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/ActionManager.java
  5. +0 −7 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/AddChild.java
  6. +3 −4 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/BaseAction.java
  7. +3 −12 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/GoToFile.java
  8. +1 −0 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/IBaseAction.java
  9. +0 −1 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/InsertText.java
  10. +2 −8 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/decorators/ConfigFileDecorator.java
  11. +0 −5 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/dialogs/EditActionDialog.java
  12. +0 −4 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/dialogs/SetResourceAsFramework.java
  13. +2 −4 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/dialogs/ViewXMLDialog.java
  14. +3 −3 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/parsers/BaseParser.java
  15. +9 −19 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/parsers/GenericFrameworkParser.java
  16. +1 −1 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/popup/actions/SetAsConfigFolder.java
  17. +1 −3 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/popup/actions/SetFrameworkFile.java
  18. +2 −4 ...feclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/preferences/ActionsPreferencePage.java
  19. +2 −2 ...lipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/preferences/FrameworksPreferencePage.java
  20. +1 −3 ...cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/properties/ModelGluePropertyPage.java
  21. +0 −2 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/util/FWXImages.java
  22. +0 −3 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/EditorEventListener.java
  23. +6 −6 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/FrameworksContentProvider.java
  24. +2 −18 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/FrameworksView.java
  25. +13 −13 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/ProjectParser.java
  26. +1 −1 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/TreeNode.java
  27. +3 −3 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/TreeParentNode.java
  28. +4 −11 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/ViewLabelProvider.java
View
4 org.cfeclipse.cfml.frameworks/META-INF/MANIFEST.MF
@@ -12,7 +12,6 @@ Bundle-ClassPath: lib/saxpath.jar,
library.jar
Bundle-Activator: org.cfeclipse.cfml.frameworks.Activator
Bundle-Vendor: CFEclipse Project
-Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
@@ -21,4 +20,5 @@ Require-Bundle: org.eclipse.ui,
org.cfeclipse.cfml,
org.eclipse.jface.text,
org.eclipse.ui.workbench.texteditor
-Eclipse-LazyStart: true
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
View
4 org.cfeclipse.cfml.frameworks/plugin.xml
@@ -168,10 +168,8 @@
Provides decoration for resources that are used as CF Framework configuration files or folders
</description>
<enablement>
- <and>
<objectClass name="org.eclipse.core.resources.IResource"/>
- </and>
- </enablement>
+ </enablement>
</decorator>
</extension>
</plugin>
View
17 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/FrameworkManager.java
@@ -24,7 +24,6 @@
*/
package org.cfeclipse.cfml.frameworks;
-import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -112,11 +111,11 @@ public String getAltSuppFrameworkFile(String frameworkType){
public FrameworkType[] getAllFrameworks(){
- ArrayList aFrameworks = new ArrayList();
+ ArrayList<FrameworkType> aFrameworks = new ArrayList<FrameworkType>();
Element rootElement = this.frameworksDoc.getRootElement();
- List frameworkNodes = rootElement.getChildren();
- for (Iterator iter = frameworkNodes.iterator(); iter.hasNext();) {
+ List<?> frameworkNodes = rootElement.getChildren();
+ for (Iterator<?> iter = frameworkNodes.iterator(); iter.hasNext();) {
Element element = (Element) iter.next();
if(element.getName().equalsIgnoreCase("framework")){
FrameworkType type = new FrameworkType(element.getAttributeValue("id"), element.getAttributeValue("name"));
@@ -183,9 +182,9 @@ public String getFrameworkType(IResource resource){
try {
x = XPath.newInstance("//framework/files/file");
- List list = x.selectNodes(frameworksDoc);
+ List<?> list = x.selectNodes(frameworksDoc);
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Element element = (Element) iter.next();
if(resource.getName().equalsIgnoreCase(element.getText())){
//Get the id of the parent
@@ -225,13 +224,13 @@ else if(frameworkType.equals(MACHII)){
public IResource[] getDefaultFrameworkDirectories(IProject project){
- ArrayList resources = new ArrayList();
+ ArrayList<IResource> resources = new ArrayList<IResource>();
try {
XPath x = XPath.newInstance("/frameworks/config/folders/folder");
- List list = x.selectNodes(frameworksDoc);
+ List<?> list = x.selectNodes(frameworksDoc);
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Element configFolder = (Element) iter.next();
IResource resource = project.findMember(configFolder.getText());
View
15 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/ActionManager.java
@@ -35,10 +35,8 @@
import org.apache.commons.logging.LogFactory;
import org.cfeclipse.cfml.frameworks.Activator;
import org.cfeclipse.cfml.frameworks.views.TreeNode;
-import org.cfeclipse.cfml.util.FileLocator;
import org.eclipse.core.internal.resources.Project;
import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.action.Action;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
@@ -49,6 +47,7 @@
* @author markdrew
* Gets the actions for an Tree element
*/
+@SuppressWarnings("restriction")
public class ActionManager {
private Document actionDefinitions;
@@ -112,14 +111,14 @@ public ActionManager() {
private Object[] getActionsForNode(TreeNode node, IProject currentProject, String action, Document virtualDocument) {
this.project = (Project) currentProject;
- ArrayList actions = new ArrayList();
+ ArrayList<IBaseAction> actions = new ArrayList<IBaseAction>();
XPath x;
try {
x = XPath.newInstance("/actions/action[@framework='" + node.getFrameworkType() + "' and @node='"+ node.getName().toLowerCase() +"' and @type='"+ action + "']");
- List list = x.selectNodes(actionDefinitions);
+ List<?> list = x.selectNodes(actionDefinitions);
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Element element = (Element) iter.next();
String insertSnippet = element.getText().trim();
@@ -155,7 +154,7 @@ public ActionManager() {
private Object createAction(Element element, TreeNode node){
try {
ClassLoader classLoader = this.getClass().getClassLoader();
- Class name = classLoader.loadClass(element.getAttributeValue("class"));
+ Class<?> name = classLoader.loadClass(element.getAttributeValue("class"));
logger.debug("created: " + name);
Object object = name.newInstance();
//Method setNode = name.getMethod("setNode", TreeNode.class);
@@ -176,12 +175,12 @@ public Document getActions(){
return actionDefinitions;
}
- public List getActionNodes(){
+ public List<?> getActionNodes(){
XPath x;
try {
x = XPath.newInstance("/actions/action");
- List list = x.selectNodes(actionDefinitions);
+ List<?> list = x.selectNodes(actionDefinitions);
return list;
} catch (JDOMException e) {
View
7 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/AddChild.java
@@ -6,15 +6,11 @@
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.StringReader;
-import java.io.StringWriter;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cfeclipse.cfml.views.snips.SnipSmartDialog;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPart;
import org.jdom.Content;
@@ -24,9 +20,6 @@
import org.jdom.input.SAXBuilder;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
-import org.xml.sax.SAXException;
-
-import com.sun.org.apache.xerces.internal.parsers.SAXParser;
/**
* @author markdrew
View
7 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/BaseAction.java
@@ -32,7 +32,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cfeclipse.cfml.frameworks.views.TreeNode;
-import org.cfeclipse.cfml.views.snips.SnipSmartDialog;
import org.eclipse.core.internal.resources.Project;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.Action;
@@ -43,12 +42,12 @@
import org.jdom.JDOMException;
import org.jdom.Text;
import org.jdom.xpath.XPath;
-import sun.misc.Regexp;
/**
* @author markdrew
*
*/
+@SuppressWarnings("restriction")
public class BaseAction extends Action implements IBaseAction{
private String insertSnippet;
@@ -221,8 +220,8 @@ private String doXPath(String xpath, String delimiter){
try {
XPath x = XPath.newInstance(xpath);
- List list = x.selectNodes(this.virtualDocument.getRootElement());
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ List<?> list = x.selectNodes(this.virtualDocument.getRootElement());
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Object listItem = (Object)iter.next();
if (listItem instanceof Attribute) {
Attribute attrib = (Attribute) listItem;
View
15 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/GoToFile.java
@@ -29,32 +29,22 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cfeclipse.cfml.frameworks.Activator;
-import org.cfeclipse.cfml.frameworks.views.TreeNode;
import org.cfeclipse.cfml.mappings.MappedPathException;
import org.cfeclipse.cfml.mappings.MappingManager;
-import org.cfeclipse.cfml.util.ResourceUtils;
-import org.eclipse.core.internal.resources.Project;
import org.eclipse.core.internal.resources.Resource;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.ResourceUtil;
-import org.eclipse.ui.part.FileEditorInput;
import org.jdom.Element;
+@SuppressWarnings("restriction")
public class GoToFile extends BaseAction implements IBaseAction{
private Log logger = LogFactory.getLog(GoToFile.class);
@@ -103,14 +93,15 @@ public void run() {
/**
*
*/
+ @SuppressWarnings("rawtypes")
private void openFile(IFile file, int lineNumber) {
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = win.getActivePage();
try {
- HashMap map = new HashMap();
+ HashMap<String, Comparable> map = new HashMap<String, Comparable>();
map.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
map.put(IDE.EDITOR_ID_ATTR, IDE.getDefaultEditor(file).getId());
IMarker marker = file.createMarker(IMarker.TEXT);
View
1 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/IBaseAction.java
@@ -5,6 +5,7 @@
import org.jdom.Document;
import org.jdom.Element;
+@SuppressWarnings("restriction")
public interface IBaseAction {
public abstract void setElement(Element actionElement);
View
1 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/actions/InsertText.java
@@ -1,6 +1,5 @@
package org.cfeclipse.cfml.frameworks.actions;
-import org.cfeclipse.cfml.frameworks.util.SnippetParser;
import org.cfeclipse.cfml.frameworks.views.TreeNode;
import org.cfeclipse.cfml.views.snips.SnipSmartDialog;
import org.eclipse.jface.action.IAction;
View
10 ...pse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/decorators/ConfigFileDecorator.java
@@ -6,29 +6,23 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cfeclipse.cfml.CFMLPlugin;
-import org.cfeclipse.cfml.editors.decoration.URLDecorator;
import org.cfeclipse.cfml.frameworks.Activator;
import org.cfeclipse.cfml.frameworks.util.FWXImages;
-import org.cfeclipse.cfml.preferences.CFMLPreferenceConstants;
-import org.cfeclipse.cfml.util.CFPluginImages;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IDecoration;
-import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IDecoratorManager;
public class ConfigFileDecorator extends LabelProvider implements
ILightweightLabelDecorator {
- private final List listeners = new ArrayList();
+ private final List<ILabelProviderListener> listeners = new ArrayList<ILabelProviderListener>();
public final static String ID = "org.cfeclipse.cfml.frameworks.decorator";
private Log logger = LogFactory.getLog(ConfigFileDecorator.class);
@@ -91,7 +85,7 @@ public void removeListener(ILabelProviderListener listener) {
public void refresh() {
logger.debug("Being called to refrehs, I shall do my duty!");
ConfigFileDecorator decorator = getConfigFileDecorator();
- Iterator iterator = listeners.iterator();
+ Iterator<ILabelProviderListener> iterator = listeners.iterator();
while (iterator.hasNext()) {
ILabelProviderListener listener = (ILabelProviderListener) iterator.next();
listener.labelProviderChanged(new LabelProviderChangedEvent(decorator));
View
5 ...cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/dialogs/EditActionDialog.java
@@ -24,12 +24,8 @@
*/
package org.cfeclipse.cfml.frameworks.dialogs;
-import java.util.Iterator;
-import java.util.List;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
@@ -41,7 +37,6 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-import org.jdom.Attribute;
import org.jdom.Element;
/**
View
4 ...pse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/dialogs/SetResourceAsFramework.java
@@ -1,13 +1,9 @@
package org.cfeclipse.cfml.frameworks.dialogs;
-import java.util.ArrayList;
-import java.util.Iterator;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.cfeclipse.cfml.frameworks.FrameworkType;
import org.cfeclipse.cfml.frameworks.FrameworkManager;
-import org.cfeclipse.cfml.frameworks.popup.actions.SetFrameworkFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
View
6 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/dialogs/ViewXMLDialog.java
@@ -7,8 +7,6 @@
import java.util.List;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
@@ -137,8 +135,8 @@ private void fillResults() {
try {
XPath x = XPath.newInstance(xpathExpression);
- List l = x.selectNodes(this.dspXML);
- for (Iterator iter = l.iterator(); iter.hasNext();) {
+ List<?> l = x.selectNodes(this.dspXML);
+ for (Iterator<?> iter = l.iterator(); iter.hasNext();) {
Object element = (Object) iter.next();
buff.append(element.toString() + "\n");
View
6 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/parsers/BaseParser.java
@@ -66,7 +66,7 @@ public void parse(String path, TreeParentNode parentnode) {
try {
Document document = builder.build(path);
Element rootElement = document.getRootElement();
- List elemList = rootElement.getChildren();
+ List<?> elemList = rootElement.getChildren();
parse2(elemList, parentnode);
@@ -82,11 +82,11 @@ public void parse(String path, TreeParentNode parentnode) {
}
- private void parse2(List elements, TreeParentNode parentnode){
+ private void parse2(List<?> elements, TreeParentNode parentnode){
- for (Iterator iter = elements.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = elements.iterator(); iter.hasNext();) {
Object iterElement = iter.next();
if (iterElement instanceof LineNumberElement) {
View
28 ...pse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/parsers/GenericFrameworkParser.java
@@ -4,27 +4,19 @@
package org.cfeclipse.cfml.frameworks.parsers;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cfeclipse.cfml.frameworks.Activator;
import org.cfeclipse.cfml.frameworks.ConfigLoader;
import org.cfeclipse.cfml.frameworks.views.FrameworkFile;
import org.cfeclipse.cfml.frameworks.views.TreeParentNode;
-import org.cfeclipse.cfml.properties.MappingsPropertyPage;
import org.cfeclipse.cfml.util.CFMappings;
-import org.cfeclipse.cfml.util.ResourceUtils;
-import org.cfeclipse.cfml.util.WorkspaceUtils;
-import org.eclipse.core.internal.resources.Resource;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IPathVariableManager;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -34,11 +26,9 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.ide.ResourceUtil;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
@@ -62,7 +52,7 @@
//Mappings assigned to this project (to figure out paths)
private CFMappings projectMappings;
- private HashMap problemMarkerMap = new HashMap();
+ private HashMap<String, Long> problemMarkerMap = new HashMap<String, Long>();
private Log logger = LogFactory.getLog(GenericFrameworkParser.class);
@@ -192,8 +182,8 @@ private void parse2(Element element, TreeParentNode parentNode, FrameworkFile fw
}
//recurse
- List children = element.getChildren();
- for (Iterator iter = children.iterator(); iter.hasNext();) {
+ List<?> children = element.getChildren();
+ for (Iterator<?> iter = children.iterator(); iter.hasNext();) {
Element childElement = (Element) iter.next();
if(isIgnore(element) && doIgnores){
parse2(childElement,parentNode, fworkFile, doIncludes, doIgnores);
@@ -295,12 +285,12 @@ private IFile findIncludeFile(Element element) throws JDOMException, CoreExcepti
if(resource!=null && resource.exists() && resource instanceof IFolder){
IFolder childFolder = (IFolder)resource;
IResource[] itemSuggestsions = childFolder.members();
- List includeFileNames = includeDef.getChildren("file");
+ List<?> includeFileNames = includeDef.getChildren("file");
for (int i = 0; i < itemSuggestsions.length; i++) {
if (itemSuggestsions[i] instanceof IFile) {
IFile suggFile = (IFile) itemSuggestsions[i];
- for (Iterator iter = includeFileNames.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = includeFileNames.iterator(); iter.hasNext();) {
Element incFileNameNode = (Element) iter.next();
if(suggFile.getName().equalsIgnoreCase(incFileNameNode.getText()))
@@ -369,8 +359,8 @@ private boolean isInclude(Element element) {
//Check the items name and parent
try {
XPath x = XPath.newInstance("//framework[@id='"+ this.fwfile.getFrameworkType()+"']/include");
- List list = x.selectNodes(this.frameworkDefinitionDocument);
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ List<?> list = x.selectNodes(this.frameworkDefinitionDocument);
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Element includeElement = (Element) iter.next();
//Definition variables;
@@ -404,9 +394,9 @@ private boolean isIgnore(Element element){
try {
XPath x = XPath.newInstance("//framework[@id='"+ this.fwfile.getFrameworkType()+"']/ignore");
- List list = x.selectNodes(this.frameworkDefinitionDocument);
+ List<?> list = x.selectNodes(this.frameworkDefinitionDocument);
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Element ignoreElement = (Element) iter.next();
if(ignoreElement.getAttributeValue("node").equalsIgnoreCase(element.getName())){
return true;
View
2 ...se.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/popup/actions/SetAsConfigFolder.java
@@ -142,7 +142,7 @@ else if (this.resource instanceof IFolder){
public void selectionChanged(IAction action, ISelection selection) {
- Iterator selectionIter = ((StructuredSelection)selection).iterator();
+ Iterator<?> selectionIter = ((StructuredSelection)selection).iterator();
while(selectionIter.hasNext()){
this.resource = (IResource)selectionIter.next();
}
View
4 ...pse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/popup/actions/SetFrameworkFile.java
@@ -28,7 +28,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cfeclipse.cfml.editors.decoration.URLDecorator;
import org.cfeclipse.cfml.frameworks.decorators.ConfigFileDecorator;
import org.cfeclipse.cfml.frameworks.dialogs.SetResourceAsFramework;
import org.cfeclipse.cfml.frameworks.views.FrameworksView;
@@ -47,7 +46,6 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
public class SetFrameworkFile implements IObjectActionDelegate {
@@ -119,7 +117,7 @@ public void run(IAction action) {
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
- Iterator selectionIter = ((StructuredSelection)selection).iterator();
+ Iterator<?> selectionIter = ((StructuredSelection)selection).iterator();
while(selectionIter.hasNext()){
this.resource = (IResource)selectionIter.next();
}
View
6 ....cfml.frameworks/src/org/cfeclipse/cfml/frameworks/preferences/ActionsPreferencePage.java
@@ -19,12 +19,10 @@
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.internal.util.Util;
import org.jdom.Document;
import org.jdom.Element;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cfeclipse.cfml.frameworks.Activator;
import org.cfeclipse.cfml.frameworks.actions.ActionManager;
import org.cfeclipse.cfml.frameworks.dialogs.EditActionDialog;
import org.cfeclipse.cfml.frameworks.views.TreeParentNode;
@@ -173,9 +171,9 @@ public void widgetSelected(SelectionEvent e) {
*/
private void updateActionList() {
//Load the XML
- List actionNodes = actionManager.getActionNodes();
+ List<?> actionNodes = actionManager.getActionNodes();
- for (Iterator iter = actionNodes.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = actionNodes.iterator(); iter.hasNext();) {
Element actionElement = (Element) iter.next();
if(filterElement != null && filterElement.getElement() != null &&
actionElement.getAttributeValue("node").equalsIgnoreCase(filterElement.getElement().getName())
View
4 ...ml.frameworks/src/org/cfeclipse/cfml/frameworks/preferences/FrameworksPreferencePage.java
@@ -161,9 +161,9 @@ private void fillTable() {
try {
XPath x = XPath.newInstance("//framework");
- List list = x.selectNodes(document);
+ List<?> list = x.selectNodes(document);
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Object element = (Object) iter.next();
if (element instanceof Element) {
Element frameworkElement = (Element) element;
View
4 ...e.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/properties/ModelGluePropertyPage.java
@@ -24,12 +24,9 @@
*/
package org.cfeclipse.cfml.frameworks.properties;
-import org.eclipse.core.internal.resources.Container;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -46,6 +43,7 @@
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.dialogs.PropertyPage;
+@SuppressWarnings("restriction")
public class ModelGluePropertyPage extends PropertyPage {
private static final String PATH_TITLE = "Path:";
View
2 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/util/FWXImages.java
@@ -35,8 +35,6 @@
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
-import sun.java2d.pipe.DrawImage;
-
public class FWXImages {
protected static URL iconBaseURL;
protected static final ImageRegistry IMAGE_REGISTRY = Activator.getDefault().getImageRegistry();
View
3 ...feclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/EditorEventListener.java
@@ -29,10 +29,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.part.EditorPart;
public class EditorEventListener implements IPartListener {
View
12 ...se.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/FrameworksContentProvider.java
@@ -58,7 +58,7 @@
ITreeContentProvider {
private MGCoreFilesListener savelistener = new MGCoreFilesListener();
- private HashMap xmlDocments = new HashMap();
+ private HashMap<String, Document> xmlDocments = new HashMap<String, Document>();
private Log logger = LogFactory.getLog(FrameworksContentProvider.class);
private IViewSite viewSite;
private IProject project;
@@ -165,12 +165,12 @@ public boolean hasChildren(Object parent) {
return false;
}
- private void clearProblemMarkers(ArrayList frameworkFiles) {
- final ArrayList ffiles = frameworkFiles;
+ private void clearProblemMarkers(ArrayList<?> frameworkFiles) {
+ final ArrayList<?> ffiles = frameworkFiles;
Job job = new Job("Make Files") {
public IStatus run(IProgressMonitor monitor) {
try {
- for (Iterator iter = ffiles.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = ffiles.iterator(); iter.hasNext();) {
FrameworkFile ffile = (FrameworkFile) iter.next();
monitor.beginTask("Create some files", 100);
ffile.getFile()
@@ -210,7 +210,7 @@ private void initialize() {
// logger.debug("Starting the parse of the project");
ProjectParser pp = new ProjectParser(project);
- ArrayList frameworkFiles = pp.getFrameworkFiles();
+ ArrayList<?> frameworkFiles = pp.getFrameworkFiles();
clearProblemMarkers(frameworkFiles);
// Quickly check if there are no folders or files to parse
@@ -234,7 +234,7 @@ private void initialize() {
// loop through the files that need to be parsed, we shall create a root
// node for each and then parse the actual document
- for (Iterator iter = frameworkFiles.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = frameworkFiles.iterator(); iter.hasNext();) {
FrameworkFile ffile = (FrameworkFile) iter.next();
TreeParentNode ffNode = new TreeParentNode(ffile.getFile()
View
20 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/FrameworksView.java
@@ -25,37 +25,26 @@
package org.cfeclipse.cfml.frameworks.views;
import java.io.BufferedInputStream;
-import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
-import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarInputStream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cfeclipse.cfml.frameworks.Activator;
import org.cfeclipse.cfml.frameworks.FrameworkManager;
import org.cfeclipse.cfml.frameworks.actions.ActionManager;
import org.cfeclipse.cfml.frameworks.actions.IBaseAction;
import org.cfeclipse.cfml.frameworks.dialogs.CSAddBeanDialog;
import org.cfeclipse.cfml.frameworks.dialogs.ViewXMLDialog;
import org.cfeclipse.cfml.frameworks.preferences.ActionsPreferencePage;
import org.cfeclipse.cfml.frameworks.util.FWXImages;
-import org.cfeclipse.cfml.frameworks.views.FrameworksView.TreeFilter;
-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.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.ide.ResourceUtil;
import org.eclipse.ui.part.*;
import org.eclipse.jface.preference.IPreferenceNode;
-import org.eclipse.jface.preference.IPreferencePage;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.preference.PreferenceNode;
@@ -68,8 +57,6 @@
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.jface.action.*;
@@ -78,11 +65,8 @@
import org.eclipse.ui.*;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.SWT;
-import org.eclipse.core.internal.resources.Project;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Path;
import org.jdom.Attribute;
import org.jdom.Document;
@@ -272,7 +256,7 @@ private Boolean childrenContainString(TreeParentNode item, String searchStringRe
return true;
}
if(item.getElement() != null && item.getElement().getAttributes() != null) {
- Iterator attrs = item.getElement().getAttributes().iterator();
+ Iterator<?> attrs = item.getElement().getAttributes().iterator();
while(attrs.hasNext()) {
Attribute attr = (Attribute) attrs.next();
if(attr.getName().matches(searchStringRegex)) {
@@ -649,7 +633,7 @@ public void doubleClick(DoubleClickEvent event) {
//loop through selections maybe?
- Iterator nodeIterator = sel.iterator();
+ Iterator<?> nodeIterator = sel.iterator();
while (nodeIterator.hasNext()) {
Object element = (Object) nodeIterator.next();
if (element instanceof TreeParentNode) {
View
26 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/ProjectParser.java
@@ -22,9 +22,9 @@
public class ProjectParser {
private IProject project;
- private ArrayList filesToParse;
- private ArrayList foldersToParse;
- private ArrayList foldersToScan; //these are the folders we are going to check for items to add.
+ private ArrayList<FrameworkFile> filesToParse;
+ private ArrayList<IResource> foldersToParse;
+ private ArrayList<?> foldersToScan; //these are the folders we are going to check for items to add.
private Log logger = LogFactory.getLog(ProjectParser.class);
@@ -44,9 +44,9 @@ public ProjectParser(IProject project) {
frameworkManager = new FrameworkManager();
this.project = project;
- this.filesToParse = new ArrayList();
- this.foldersToParse = new ArrayList();
- this.foldersToScan = new ArrayList();
+ this.filesToParse = new ArrayList<FrameworkFile>();
+ this.foldersToParse = new ArrayList<IResource>();
+ this.foldersToScan = new ArrayList<Object>();
//STAGE 1
logger.debug("Stage 1 file parser" );
@@ -184,8 +184,8 @@ else if (projectOrFolder instanceof IFolder) {
*/
private void folderChecker() {
- ArrayList folderConsiderations = this.foldersToParse;
- for (Iterator iter = folderConsiderations.iterator(); iter.hasNext();) {
+ ArrayList<IResource> folderConsiderations = this.foldersToParse;
+ for (Iterator<IResource> iter = folderConsiderations.iterator(); iter.hasNext();) {
IResource element = (IResource) iter.next();
IResource[] resources = new IResource[]{};
@@ -217,7 +217,7 @@ else if(element instanceof IFolder){
if(!fileisMarked(fileConsideration) && frameworkType2 != null){
//we *should* add it here, but we need to check first
boolean found = false;
- for (Iterator iterator = this.filesToParse
+ for (Iterator<FrameworkFile> iterator = this.filesToParse
.iterator(); iterator.hasNext();) {
FrameworkFile fwFile = (FrameworkFile) iterator.next();
if(fwFile.getFile().equals(fileConsideration)){
@@ -389,7 +389,7 @@ private String getFileFramework(IFile file){
return null;
}
- public ArrayList getFrameworkFiles() {
+ public ArrayList<FrameworkFile> getFrameworkFiles() {
//markd: when this method is called we should have already parsed the project and got all the
//IFiles in an array, now we create a new array that we return with FrameworkFiles
@@ -473,11 +473,11 @@ else if (item instanceof IFolder) {
}
- public ArrayList getFilesToParse() {
+ public ArrayList<FrameworkFile> getFilesToParse() {
return filesToParse;
}
- public void setFilesToParse(ArrayList filesToParse) {
+ public void setFilesToParse(ArrayList<FrameworkFile> filesToParse) {
this.filesToParse = filesToParse;
}
@@ -492,7 +492,7 @@ public void setProject(IProject project) {
/**
* @return
*/
- public ArrayList getFoldersToParse() {
+ public ArrayList<IResource> getFoldersToParse() {
return this.foldersToParse;
}
View
2 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/TreeNode.java
@@ -27,7 +27,6 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Path;
import org.jdom.Element;
-import org.jdom.contrib.input.LineNumberElement;
/**
* This is the base tree object we want
@@ -155,6 +154,7 @@ public String toString() {
return frameworkType + "_" + this.getName();
}
+ @SuppressWarnings("rawtypes")
public Object getAdapter(Class key) {
return null;
}
View
6 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/TreeParentNode.java
@@ -32,20 +32,20 @@
public class TreeParentNode extends TreeNode {
- private ArrayList children;
+ private ArrayList<TreeParentNode> children;
private Document document;
private String CFCPath;
private Document virtualDocument;
public TreeParentNode(String name) {
super(name);
- children = new ArrayList();
+ children = new ArrayList<TreeParentNode>();
}
public TreeParentNode(Element element, String type) {
super(element, type);
- children = new ArrayList();
+ children = new ArrayList<TreeParentNode>();
}
public void addChild(TreeParentNode child) {
children.add(child);
View
15 org.cfeclipse.cfml.frameworks/src/org/cfeclipse/cfml/frameworks/views/ViewLabelProvider.java
@@ -27,20 +27,15 @@
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cfeclipse.cfml.CFMLPlugin;
import org.cfeclipse.cfml.frameworks.Activator;
import org.cfeclipse.cfml.frameworks.util.FWXImages;
-import org.cfeclipse.cfml.util.FileLocator;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
@@ -49,8 +44,6 @@
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
-import org.jdom.Parent;
-import org.jdom.contrib.input.LineNumberSAXBuilder;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
@@ -120,7 +113,7 @@ private String getLabelForNode(TreeNode node){
try {
XPath x = XPath.newInstance("//framework[@id='" + node.getFrameworkType() + "']/node[@name='"+ node.getName().toLowerCase() +"']");
- List list = x.selectNodes(labelDocument);
+ List<?> list = x.selectNodes(labelDocument);
//If there is no element, just return something
@@ -169,7 +162,7 @@ else if(textAttribute != null){
else{
//we have more than one node
logger.debug("we need to check all the nodes");*/
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Element labelDefElement = (Element) iter.next();
//the variables we are checking
String labelDefParent = labelDefElement.getAttributeValue("parent");
@@ -248,7 +241,7 @@ private Image getImageForNode(TreeNode node) {
//Use XPATH to find the right node
try {
XPath x = XPath.newInstance("//framework[@id='" + node.getFrameworkType().toLowerCase() + "']/node[@name='"+ node.getName().toLowerCase() +"']");
- List list = x.selectNodes(labelDocument);
+ List<?> list = x.selectNodes(labelDocument);
if(list.size() == 1){
Element label = (Element)list.get(0);
@@ -260,7 +253,7 @@ private Image getImageForNode(TreeNode node) {
}
else if(list.size() > 1){
- for (Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
Element labelDefElement = (Element) iter.next();
//the variables we are checking
String labelDefParent = labelDefElement.getAttributeValue("parent");

0 comments on commit 076f557

Please sign in to comment.
Something went wrong with that request. Please try again.