diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java')
-rw-r--r-- | plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java deleted file mode 100644 index 0122ba5e5..000000000 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/ForceClasspathUpdateAction.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c)2006 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 - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.actions; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater; -import org.eclipse.ui.IActionDelegate; - -public class ForceClasspathUpdateAction extends Action implements IActionDelegate{ - - private List projectsList = new ArrayList(); - - public void run() { - J2EEComponentClasspathUpdater.getInstance().forceUpdate(projectsList); - } - - public void run(IAction action) { - J2EEComponentClasspathUpdater.getInstance().forceUpdate(projectsList); - } - - public void selectionChanged(IAction action, ISelection selection) { - action.setEnabled(setSelection(selection)); - } - - private boolean setSelection(ISelection selection){ - projectsList.clear(); - if(selection != null && selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection)selection; - if (structuredSelection.size() > 0) { - Iterator iterator = structuredSelection.iterator(); - while(iterator.hasNext()){ - Object next = iterator.next(); - if (next instanceof IProject) { - projectsList.add(next); - } else { - projectsList.clear(); - return false; - } - } - } else { // empty selection - return false; - } - return true; - } - return false; - } - - - -} |