srcanaapps/depexplorer/com.nokia.s60tools.appdep/src/com/nokia/s60tools/appdep/ui/actions/ShowSourceFileImportFunctionMainViewAction.java
changeset 0 a02c979e8dfd
equal deleted inserted replaced
-1:000000000000 0:a02c979e8dfd
       
     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.appdep.ui.actions;
       
    19 
       
    20 import com.nokia.s60tools.appdep.core.model.ImportFunctionData;
       
    21 import com.nokia.s60tools.appdep.resources.Messages;
       
    22 import com.nokia.s60tools.appdep.ui.views.main.MainView;
       
    23 import com.nokia.s60tools.appdep.util.AppDepConsole;
       
    24 
       
    25 /**
       
    26  * public implementation for Imported functions view show source action. 
       
    27  * Real implementation is in abstract class {@link AbstractShowSourceFileAction}
       
    28  */
       
    29 public class ShowSourceFileImportFunctionMainViewAction extends
       
    30 		AbstractShowSourceFileAction {
       
    31 
       
    32 	/**
       
    33 	 * Constructor.
       
    34 	 * @param view Reference to main view.
       
    35 	 */
       
    36 	public ShowSourceFileImportFunctionMainViewAction(MainView view) {
       
    37 		super(view);
       
    38 	}
       
    39 	
       
    40 	/* (non-Javadoc)
       
    41 	 * @see com.nokia.s60tools.appdep.ui.actions.AbstractMainViewAction#run()
       
    42 	 */
       
    43 	public void run() {
       
    44 
       
    45 		//All we do here is found out method name and ordinal that user is selected
       
    46 		String methodName;
       
    47 		String ordinal;
       
    48 
       
    49 		Object functionObj = view.getSelectedImportFunction();
       
    50 		if (functionObj == null) {
       
    51 			// We might get null-selections when
       
    52 			// tree is expanded/collapsed.
       
    53 			// or when Go Into -action is runned.
       
    54 			AppDepConsole
       
    55 					.getInstance()
       
    56 					.println(
       
    57 							Messages
       
    58 									.getString("SourceFileFeatureCommonMessages.EmptySelection_ErrMsg"), AppDepConsole.MSG_WARNING); //$NON-NLS-1$
       
    59 
       
    60 			return;
       
    61 		}
       
    62 		ImportFunctionData efData = (ImportFunctionData) functionObj;
       
    63 		methodName = efData.getFunctionName();
       
    64 		ordinal = efData.getFunctionOrdinal();
       
    65 		
       
    66 		super.runImpl(methodName, ordinal);
       
    67 
       
    68 	}
       
    69 
       
    70 }