srcanaapps/depexplorer/com.nokia.s60tools.appdep/src/com/nokia/s60tools/appdep/ui/actions/ShowSourceFileImportFunctionMainViewAction.java
author noe\swadi
Sat, 09 Jan 2010 10:04:11 +0530
changeset 0 a02c979e8dfd
permissions -rw-r--r--
1. Copyrights changed to EPL 2. Feature updates mentioned in release notes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     1
/*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     3
* All rights reserved.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     4
* This component and the accompanying materials are made available
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     6
* which accompanies this distribution, and is available
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     8
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
     9
* Initial Contributors:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    11
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    12
* Contributors:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    13
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    14
* Description:
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    15
*
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    16
*/
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    17
 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    18
package com.nokia.s60tools.appdep.ui.actions;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    19
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    20
import com.nokia.s60tools.appdep.core.model.ImportFunctionData;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    21
import com.nokia.s60tools.appdep.resources.Messages;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    22
import com.nokia.s60tools.appdep.ui.views.main.MainView;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    23
import com.nokia.s60tools.appdep.util.AppDepConsole;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    24
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    25
/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    26
 * public implementation for Imported functions view show source action. 
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    27
 * Real implementation is in abstract class {@link AbstractShowSourceFileAction}
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    28
 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    29
public class ShowSourceFileImportFunctionMainViewAction extends
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    30
		AbstractShowSourceFileAction {
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    31
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    32
	/**
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    33
	 * Constructor.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    34
	 * @param view Reference to main view.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    35
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    36
	public ShowSourceFileImportFunctionMainViewAction(MainView view) {
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    37
		super(view);
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    38
	}
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    39
	
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    40
	/* (non-Javadoc)
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    41
	 * @see com.nokia.s60tools.appdep.ui.actions.AbstractMainViewAction#run()
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    42
	 */
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    43
	public void run() {
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    44
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    45
		//All we do here is found out method name and ordinal that user is selected
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    46
		String methodName;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    47
		String ordinal;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    48
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    49
		Object functionObj = view.getSelectedImportFunction();
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    50
		if (functionObj == null) {
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    51
			// We might get null-selections when
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    52
			// tree is expanded/collapsed.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    53
			// or when Go Into -action is runned.
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    54
			AppDepConsole
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    55
					.getInstance()
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    56
					.println(
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    57
							Messages
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    58
									.getString("SourceFileFeatureCommonMessages.EmptySelection_ErrMsg"), AppDepConsole.MSG_WARNING); //$NON-NLS-1$
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    59
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    60
			return;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    61
		}
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    62
		ImportFunctionData efData = (ImportFunctionData) functionObj;
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    63
		methodName = efData.getFunctionName();
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    64
		ordinal = efData.getFunctionOrdinal();
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    65
		
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    66
		super.runImpl(methodName, ordinal);
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    67
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    68
	}
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    69
a02c979e8dfd 1. Copyrights changed to EPL
noe\swadi
parents:
diff changeset
    70
}