1 /*******************************************************************************2 * Copyright (c) 2000, 2006 IBM Corporation and others.3 * All rights reserved. This program and the accompanying materials4 * are made available under the terms of the Eclipse Public License v1.05 * which accompanies this distribution, and is available at6 * http://www.eclipse.org/legal/epl-v10.html7 *8 * Contributors:9 * IBM Corporation - initial API and implementation10 *******************************************************************************/11 package org.eclipse.team.internal.ui.synchronize.actions;12 13 import java.util.Arrays ;14 import java.util.Collections ;15 import java.util.List ;16 17 import org.eclipse.core.resources.IResource;18 import org.eclipse.jface.viewers.IStructuredSelection;19 import org.eclipse.team.internal.ui.Utils;20 import org.eclipse.ui.IWorkbenchPage;21 import org.eclipse.ui.actions.OpenFileAction;22 23 public class OpenFileInSystemEditorAction extends OpenFileAction {24 25 public OpenFileInSystemEditorAction(IWorkbenchPage page) {26 super(page);27 }28 29 /* (non-Javadoc)30 * @see org.eclipse.ui.actions.SelectionListenerAction#getSelectedResources()31 */32 protected List getSelectedResources() {33 IStructuredSelection selection = getStructuredSelection();34 IResource[] resources = Utils.getResources(selection.toArray());35 return Arrays.asList(resources);36 }37 38 /* (non-Javadoc)39 * @see org.eclipse.ui.actions.SelectionListenerAction#getSelectedNonResources()40 */41 protected List getSelectedNonResources() { 42 return Collections.EMPTY_LIST;43 }44 }45