(resources.length);
for (int i= 0; i < resources.length; i++) {
IPath location= resources[i].getLocation();
if (location != null)
result.add(location.toOSString());
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java
deleted file mode 100644
index 52c2b034e0d..00000000000
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/SelectionUtil.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * QNX Software System
- *******************************************************************************/
-package org.eclipse.cdt.internal.ui.util;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Provides utilities for checking the validity of selections.
- *
- * This class provides static methods only; it is not intended to be instantiated
- * or subclassed.
- *
- */
-
-public class SelectionUtil {
-
- /**
- * Returns the first element of the given selection.
- * Returns null if the selection is empty or if
- * the given selection is not of type IStructuredSelection
.
- *
- * @param selection the selection
- * @return the selected elements
- *
- */
- public static Object getFirstElement (ISelection selection) {
- if (!(selection instanceof IStructuredSelection)) {
- return null;
- }
- return ((IStructuredSelection)selection).getFirstElement ();
- }
-
- public static Object getSingleElement (ISelection s) {
- if (!(s instanceof IStructuredSelection))
- return null;
- IStructuredSelection selection= (IStructuredSelection)s;
- if (selection.size () != 1)
- return null;
- return selection.getFirstElement ();
- }
-
- /**
- * Returns the elements of the given selection.
- * Returns an empty array if the selection is empty or if
- * the given selection is not of type IStructuredSelection
.
- *
- * @param selection the selection
- * @return the selected elements
- *
- */
-
- public static Object[] toArray(ISelection selection) {
- if (!(selection instanceof IStructuredSelection)) {
- return new Object[0];
- }
- return ((IStructuredSelection)selection).toArray();
- }
-
- public static List toList(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- return ((IStructuredSelection)selection).toList();
- }
- return null;
- }
-
- /**
- * Returns whether the types of the resources in the given selection are among
- * the specified resource types.
- *
- * @param selection the selection
- * @param resourceMask resource mask formed by bitwise OR of resource type
- * constants (defined on IResource
)
- * @return true
if all selected elements are resources of the right
- * type, and false
if at least one element is either a resource
- * of some other type or a non-resource
- * @see IResource#getType
- */
- public static boolean allResourcesAreOfType(IStructuredSelection selection, int resourceMask) {
- Iterator resources = selection.iterator();
- while (resources.hasNext()) {
- Object next = resources.next();
- if (!(next instanceof IResource))
- return false;
- if (!resourceIsType((IResource)next, resourceMask))
- return false;
- }
- return true;
- }
-
- /**
- * Returns whether the type of the given resource is among the specified
- * resource types.
- *
- * @param resource the resource
- * @param resourceMask resource mask formed by bitwise OR of resource type
- * constants (defined on IResource
)
- * @return true
if the resources has a matching type, and
- * false
otherwise
- * @see IResource#getType
- */
- public static boolean resourceIsType(IResource resource, int resourceMask) {
- return ((resource != null) && ((resource.getType() & resourceMask) != 0));
- }
-
- /* (non-Javadoc)
- * Private constructor to block instantiation.
- */
- private SelectionUtil(){
- }
-}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java
index 47656e7c1f2..2234fdf6141 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/StringMatcher.java
@@ -249,7 +249,7 @@ public class StringMatcher {
}
}
- Vector temp= new Vector();
+ Vector temp= new Vector();
int pos= 0;
StringBuffer buf= new StringBuffer();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java
index 46a10981557..04a2bf09b4e 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/util/TableLayoutComposite.java
@@ -34,7 +34,7 @@ import org.eclipse.jface.viewers.ColumnWeightData;
*/
public class TableLayoutComposite extends Composite {
- private List columns= new ArrayList();
+ private List columns= new ArrayList();
/**
* Creates a new TableLayoutComposite
.
@@ -76,7 +76,7 @@ public class TableLayoutComposite extends Composite {
int width= 0;
int size= columns.size();
for (int i= 0; i < size; ++i) {
- ColumnLayoutData layoutData= (ColumnLayoutData) columns.get(i);
+ ColumnLayoutData layoutData= columns.get(i);
if (layoutData instanceof ColumnPixelData) {
ColumnPixelData col= (ColumnPixelData) layoutData;
width += col.width;
@@ -109,7 +109,7 @@ public class TableLayoutComposite extends Composite {
// First calc space occupied by fixed columns
for (int i= 0; i < size; i++) {
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
+ ColumnLayoutData col= columns.get(i);
if (col instanceof ColumnPixelData) {
int pixels= ((ColumnPixelData) col).width;
widths[i]= pixels;
@@ -132,7 +132,7 @@ public class TableLayoutComposite extends Composite {
int rest= width - fixedWidth;
int totalDistributed= 0;
for (int i= 0; i < size; ++i) {
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
+ ColumnLayoutData col= columns.get(i);
if (col instanceof ColumnWeightData) {
ColumnWeightData cw= (ColumnWeightData) col;
// calculate weight as above
@@ -151,7 +151,7 @@ public class TableLayoutComposite extends Composite {
for (int i= 0; diff > 0; ++i) {
if (i == size)
i= 0;
- ColumnLayoutData col= (ColumnLayoutData) columns.get(i);
+ ColumnLayoutData col= columns.get(i);
if (col instanceof ColumnWeightData) {
++widths[i];
--diff;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java
index 9eb2e6e5e48..371a15e6c2e 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/AdaptingSelectionProvider.java
@@ -30,11 +30,11 @@ import org.eclipse.jface.viewers.StructuredSelection;
*/
public class AdaptingSelectionProvider implements ISelectionProvider, ISelectionChangedListener {
- private Class fTargetType;
+ private Class> fTargetType;
private ListenerList fListenerList;
private ISelectionProvider fProvider;
- public AdaptingSelectionProvider(Class targetType, ISelectionProvider provider) {
+ public AdaptingSelectionProvider(Class> targetType, ISelectionProvider provider) {
fProvider= provider;
fTargetType= targetType;
fListenerList= new ListenerList();
@@ -44,8 +44,8 @@ public class AdaptingSelectionProvider implements ISelectionProvider, ISelection
if (selection != null) {
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss= (IStructuredSelection) selection;
- ArrayList adapted= new ArrayList();
- for (Iterator iter = ss.iterator(); iter.hasNext(); ) {
+ ArrayList