sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/ui/actions/ActivateMainView.java
changeset 1 1050670c6980
child 6 f65f740e69f9
equal deleted inserted replaced
0:5ad7ad99af01 1:1050670c6980
       
     1 /*
       
     2  * Copyright (c) 2008-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:  Definitions for the class ActivateMainView
       
    15  *
       
    16  */
       
    17 
       
    18 package com.nokia.s60tools.analyzetool.ui.actions;
       
    19 
       
    20 import org.eclipse.jface.action.IAction;
       
    21 import org.eclipse.jface.viewers.ISelection;
       
    22 import org.eclipse.ui.IWorkbenchPage;
       
    23 import org.eclipse.ui.IWorkbenchWindow;
       
    24 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
       
    25 
       
    26 import com.nokia.s60tools.analyzetool.global.Constants;
       
    27 
       
    28 /**
       
    29  * Entry point for main view when selecting AnalyzeTool in Carbide menu.
       
    30  *
       
    31  * @author kihe
       
    32  *
       
    33  */
       
    34 public class ActivateMainView implements IWorkbenchWindowActionDelegate {
       
    35 
       
    36 	/**Active workbench window.*/
       
    37 	private IWorkbenchWindow window;
       
    38 
       
    39 	/**
       
    40 	 * The constructor.
       
    41 	 */
       
    42 	public ActivateMainView() {
       
    43 		// ConstructorDeclaration[@Private='false'][count(BlockStatement) = 0
       
    44 		// and ($ignoreExplicitConstructorInvocation = 'true' or
       
    45 		// not(ExplicitConstructorInvocation)) and @containsComment = 'false']
       
    46 	}
       
    47 
       
    48 	/**
       
    49 	 * @see IWorkbenchWindowActionDelegate#dispose
       
    50 	 */
       
    51 	public void dispose() {
       
    52 		// MethodDeclaration/Block[count(BlockStatement) = 0 and
       
    53 		// @containsComment = 'false']
       
    54 	}
       
    55 
       
    56 	/**
       
    57 	 * @see IWorkbenchWindowActionDelegate#init
       
    58 	 *
       
    59 	 * @param windowRef Workbench Window
       
    60 	 */
       
    61 	public void init(IWorkbenchWindow windowRef) {
       
    62 		this.window = windowRef;
       
    63 	}
       
    64 
       
    65 	/**
       
    66 	 * @see IWorkbenchWindowActionDelegate#run(IAction)
       
    67 	 *
       
    68 	 * @param action User selected action
       
    69 	 */
       
    70 	public void run(IAction action) {
       
    71 
       
    72 		try {
       
    73 			IWorkbenchPage page = window.getActivePage();
       
    74 
       
    75 			// display main view
       
    76 			page.showView(Constants.ANALYZE_TOOL_VIEW_ID);
       
    77 
       
    78 		} catch (Exception e) {
       
    79 			e.printStackTrace();
       
    80 		}
       
    81 
       
    82 	}
       
    83 
       
    84 	/**
       
    85 	 * @see IWorkbenchWindowActionDelegate#selectionChanged(IAction action, ISelection selection)
       
    86 	 *
       
    87 	 * @param action User selected action
       
    88 	 *
       
    89 	 * @param selection User selection
       
    90 	 */
       
    91 	public void selectionChanged(IAction action, ISelection selection) {
       
    92 		// MethodDeclaration/Block[count(BlockStatement) = 0 and
       
    93 		// @containsComment = 'false']
       
    94 	}
       
    95 }