1 /* 2 * Created on Jan 19, 2004 3 * 4 * Copyright (C) 2004 Sean Ruff 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 */ 20 21 package org.un4gvn.editorviewer.internal.action; 22 23 import org.un4gvn.editorviewer.internal.EditorViewerPlugin; 24 import org.un4gvn.editorviewer.internal.Messages; 25 import org.un4gvn.editorviewer.internal.element.IViewerElement; 26 import org.un4gvn.editorviewer.internal.ui.EditorViewer; 27 28 /*** 29 * Action to close all Editors listed in the view, not necessarily 30 * all open editors, in case a filter is applied to the view<p> 31 * <p> 32 * @author Sean Ruff 33 */ 34 35 public class CloseAllAction extends CloseAction { 36 37 /*** 38 * Constructor 39 * @param helper EditorViewer instance for callback method 40 */ 41 public CloseAllAction(EditorViewer viewer){ 42 super(viewer); 43 EditorViewerPlugin plugin = EditorViewerPlugin.getInstance(); 44 setImageDescriptor(plugin.getImageDescriptor(Messages.getString("CloseAllAction.0"))); //$NON-NLS-1$ 45 setToolTipText(Messages.getString("CloseAllAction.1")); //$NON-NLS-1$ 46 setText(Messages.getString("CloseAllAction.2")); //$NON-NLS-1$ 47 setDescription(Messages.getString("CloseAllAction.3")); //$NON-NLS-1$ 48 } 49 50 /*** 51 * Retreive the list of all editors shown in the view 52 */ 53 public IViewerElement[] getSelection(){ 54 //retreive the list by 55 //1) first select all the elements 56 //2) getting the selection from the view 57 // in case a filter is applied 58 _viewer.selectAll(); 59 return _viewer.getSelection(); 60 } 61 62 }

This page was automatically generated by Maven