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.eclipse.jface.action.Action; 24 import org.eclipse.ui.ISharedImages; 25 import org.un4gvn.editorviewer.internal.EditorViewerPlugin; 26 import org.un4gvn.editorviewer.internal.Messages; 27 import org.un4gvn.editorviewer.internal.ui.EditorViewer; 28 29 /*** 30 * Action to select all the leaf items in the view 31 * ( Note: only leaf items, IViewerElements which return true from isLeaf method, will be selected ) 32 * <p> 33 * @author Sean Ruff 34 */ 35 36 public class SelectAllAction extends Action { 37 38 private EditorViewer _viewer = null; 39 40 public SelectAllAction(EditorViewer viewer){ 41 _viewer = viewer; 42 EditorViewerPlugin plugin = EditorViewerPlugin.getInstance(); 43 setImageDescriptor(plugin.getImageDescriptor(ISharedImages.IMG_DEF_VIEW)); 44 setText(Messages.getString("SelectAllAction.0")); //$NON-NLS-1$ 45 setToolTipText(Messages.getString("SelectAllAction.1")); //$NON-NLS-1$ 46 setDescription(Messages.getString("SelectAllAction.2")); //$NON-NLS-1$ 47 } 48 49 /*** 50 * Select All 51 */ 52 public void run(){ 53 _viewer.selectAll(); 54 } 55 56 }

This page was automatically generated by Maven