crashanalysis/crashanalyser/com.nokia.s60tools.crashanalyser/src/com/nokia/s60tools/crashanalyser/ui/actions/ToolbarShortcutAction.java
changeset 0 5ad7ad99af01
equal deleted inserted replaced
-1:000000000000 0:5ad7ad99af01
       
     1 /*
       
     2 * Copyright (c) 2008 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 package com.nokia.s60tools.crashanalyser.ui.actions;
       
    19 
       
    20 import org.eclipse.jface.action.IAction;
       
    21 import org.eclipse.jface.viewers.ISelection;
       
    22 import org.eclipse.ui.IWorkbenchWindow;
       
    23 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
       
    24 
       
    25 //import com.nokia.s60tools.util.console.IConsolePrintUtility;
       
    26 import com.nokia.s60tools.crashanalyser.ui.views.MainView;
       
    27 
       
    28 /**
       
    29  * Action for toolbar shortcut. Carbide > Crash Analyser
       
    30  * @see IWorkbenchWindowActionDelegate
       
    31  */
       
    32 public class ToolbarShortcutAction implements IWorkbenchWindowActionDelegate {
       
    33 
       
    34 	/**
       
    35 	 * The action has been activated. The argument of the
       
    36 	 * method represents the 'real' action sitting
       
    37 	 * in the workbench UI.
       
    38 	 * @see IWorkbenchWindowActionDelegate#run
       
    39 	 */
       
    40 	public void run(IAction action) {
       
    41 		MainView mv = MainView.showAndReturnYourself();
       
    42 		mv.showWizardIfNoFiles();
       
    43 	}
       
    44 
       
    45 	/**
       
    46 	 * Selection in the workbench has been changed. We 
       
    47 	 * can change the state of the 'real' action here
       
    48 	 * if we want, but this can only happen after 
       
    49 	 * the delegate has been created.
       
    50 	 * @see IWorkbenchWindowActionDelegate#selectionChanged
       
    51 	 */
       
    52 	public void selectionChanged(IAction action, ISelection selection) {
       
    53 		// nothing to be done
       
    54 	}
       
    55 
       
    56 	/**
       
    57 	 * We can use this method to dispose of any system
       
    58 	 * resources we previously allocated.
       
    59 	 * @see IWorkbenchWindowActionDelegate#dispose
       
    60 	 */
       
    61 	public void dispose() {
       
    62 		// nothing to be done
       
    63 	}
       
    64 
       
    65 	/**
       
    66 	 * We will cache window object in order to
       
    67 	 * be able to provide parent shell for the message dialog.
       
    68 	 * @see IWorkbenchWindowActionDelegate#init
       
    69 	 */
       
    70 	public void init(IWorkbenchWindow window) {
       
    71 		// nothing to be done
       
    72 	}
       
    73 }