trace/traceanalyser/com.nokia.s60tools.traceanalyser/src/com/nokia/s60tools/traceanalyser/ui/actions/ToolbarShortcutAction.java
changeset 9 14dc2103a631
equal deleted inserted replaced
8:15296fd0af4a 9:14dc2103a631
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 package com.nokia.s60tools.traceanalyser.ui.actions;
       
    21 
       
    22 import org.eclipse.jface.action.IAction;
       
    23 import org.eclipse.jface.viewers.ISelection;
       
    24 import org.eclipse.ui.IWorkbenchWindow;
       
    25 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
       
    26 
       
    27 import com.nokia.s60tools.traceanalyser.ui.views.MainView;
       
    28 
       
    29 
       
    30 /**
       
    31  * Action for toolbar and import shortcuts that launch Trace Analyser
       
    32  * @see IWorkbenchWindowActionDelegate
       
    33  */
       
    34 public class ToolbarShortcutAction implements IWorkbenchWindowActionDelegate {
       
    35 
       
    36 	/**
       
    37 	 * The action has been activated. The argument of the
       
    38 	 * method represents the 'real' action sitting
       
    39 	 * in the workbench UI.
       
    40 	 * @see IWorkbenchWindowActionDelegate#run
       
    41 	 */
       
    42 	public void run(IAction action) {
       
    43 		// Open Trace Analyser Main View
       
    44 		MainView.showAndReturnYourself();
       
    45 		
       
    46 	}
       
    47 
       
    48 	/**
       
    49 	 * Selection in the workbench has been changed. We 
       
    50 	 * can change the state of the 'real' action here
       
    51 	 * if we want, but this can only happen after 
       
    52 	 * the delegate has been created.
       
    53 	 * @see IWorkbenchWindowActionDelegate#selectionChanged
       
    54 	 */
       
    55 	public void selectionChanged(IAction action, ISelection selection) {
       
    56 		// nothing to be done		
       
    57 	}
       
    58 
       
    59 	/**
       
    60 	 * We can use this method to dispose of any system
       
    61 	 * resources we previously allocated.
       
    62 	 * @see IWorkbenchWindowActionDelegate#dispose
       
    63 	 */
       
    64 	public void dispose() {
       
    65 		// nothing to be done	
       
    66 	}
       
    67 
       
    68 	/**
       
    69 	 * We will cache window object in order to
       
    70 	 * be able to provide parent shell for the message dialog.
       
    71 	 * @see IWorkbenchWindowActionDelegate#init
       
    72 	 */
       
    73 	public void init(IWorkbenchWindow window) {
       
    74 		// nothing to be done
       
    75 	}
       
    76 }