srcanaapps/depexplorer/com.nokia.s60tools.appdep/src/com/nokia/s60tools/appdep/ui/actions/ShowSourceFileAndCreateProjectExportFunctionMainViewAction.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.ExportFunctionData;
       
    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 Exported functions tab's show source file in project action. 
       
    27  * Real implementation is in abstract class {@link AbstractShowSourceFileAction}
       
    28  */
       
    29 public class ShowSourceFileAndCreateProjectExportFunctionMainViewAction extends
       
    30 	ShowSourceFileAndCreateProjectMainViewAction {
       
    31 
       
    32 	/**
       
    33 	 * Constructor.
       
    34 	 * @param view Reference to main view.
       
    35 	 */
       
    36 	public ShowSourceFileAndCreateProjectExportFunctionMainViewAction(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 		// If this is instance of export action
       
    50 
       
    51 		Object functionObj = view.getSelectedExportFunction();
       
    52 		if (functionObj == null) {
       
    53 			// We might get null-selections when
       
    54 			// tree is expanded/collapsed.
       
    55 			AppDepConsole
       
    56 					.getInstance()
       
    57 					.println(Messages.getString("ShowSourceFileAndCreateProjectMainViewAction.EmptySelection_ErrMsg"), //$NON-NLS-1$
       
    58 								AppDepConsole.MSG_WARNING);
       
    59 			return;
       
    60 		}
       
    61 		ExportFunctionData efData = (ExportFunctionData) functionObj;
       
    62 		methodName = efData.getFunctionName();
       
    63 		ordinal = efData.getFunctionOrdinal();
       
    64 		
       
    65 		super.runImpl(methodName, ordinal);
       
    66 
       
    67 	}
       
    68 
       
    69 }