KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ui > synchronize > actions > OpenFileInSystemEditorAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ui.synchronize.actions;
12
13 import java.util.Arrays JavaDoc;
14 import java.util.Collections JavaDoc;
15 import java.util.List JavaDoc;
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 JavaDoc 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 JavaDoc getSelectedNonResources() {
42         return Collections.EMPTY_LIST;
43     }
44 }
45
Popular Tags