sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi/src/com/nokia/carbide/cpp/internal/pi/actions/AnalysisInfoDelegate.java
changeset 2 b9ab3b238396
equal deleted inserted replaced
1:1050670c6980 2:b9ab3b238396
       
     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 the License "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.carbide.cpp.internal.pi.actions;
       
    19 
       
    20 import org.eclipse.jface.action.IAction;
       
    21 import org.eclipse.jface.viewers.ISelection;
       
    22 import org.eclipse.swt.layout.FillLayout;
       
    23 import org.eclipse.swt.widgets.Shell;
       
    24 import org.eclipse.ui.IWorkbenchWindow;
       
    25 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
       
    26 
       
    27 import com.nokia.carbide.cpp.internal.pi.analyser.NpiInstanceRepository;
       
    28 import com.nokia.carbide.cpp.internal.pi.test.AnalysisInfoHandler;
       
    29 import com.nokia.carbide.cpp.pi.editors.PIPageEditor;
       
    30 
       
    31 
       
    32 public class AnalysisInfoDelegate implements IWorkbenchWindowActionDelegate {
       
    33 
       
    34 	private IWorkbenchWindow window;
       
    35 	
       
    36 	public void dispose() {
       
    37 		window = null;
       
    38 	}
       
    39 
       
    40 	public void init(IWorkbenchWindow window) {
       
    41 		this.window = window;
       
    42 	}
       
    43 
       
    44 	public void run(IAction action) {
       
    45 		// get the active page
       
    46 		if (window == null)
       
    47 			return;
       
    48 
       
    49 		AnalysisInfoHandler analysisInfoHandler = NpiInstanceRepository.getInstance().activeUidGetAnalysisInfoHandler();
       
    50 		
       
    51 		if (analysisInfoHandler != null)
       
    52 		{
       
    53 			Shell shell = new Shell(PIPageEditor.currentPageEditor().getEditorSite().getShell().getDisplay());
       
    54 			analysisInfoHandler.getAnalysisInfoTable(shell);
       
    55 			shell.setLayout(new FillLayout());
       
    56 			shell.pack();
       
    57 			shell.open();
       
    58 		}
       
    59 	}
       
    60 
       
    61 	public void selectionChanged(IAction action, ISelection selection) {
       
    62 	}
       
    63 
       
    64 }