0
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 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 |
|
|
19 |
package com.nokia.s60tools.appdep.ui.actions;
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
import com.nokia.s60tools.appdep.core.data.ComponentNode;
|
|
24 |
import com.nokia.s60tools.appdep.core.model.ExportFunctionData;
|
|
25 |
import com.nokia.s60tools.appdep.resources.ImageKeys;
|
|
26 |
import com.nokia.s60tools.appdep.resources.ImageResourceManager;
|
|
27 |
import com.nokia.s60tools.appdep.resources.Messages;
|
|
28 |
import com.nokia.s60tools.appdep.ui.views.main.MainView;
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Starts query for components that use certain export function.
|
|
32 |
*/
|
|
33 |
public class FunctionIsUsedByExportFunctionMainViewAction extends FunctionIsUsedByMainViewAction{
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Constructor.
|
|
37 |
* @param view Reference to the view.
|
|
38 |
*/
|
|
39 |
public FunctionIsUsedByExportFunctionMainViewAction(MainView view){
|
|
40 |
super(view);
|
|
41 |
|
|
42 |
setText(Messages.getString("FunctionIsUsedByExportFunctionMainViewAction.IsUsedByExportFunction_Action_Text")); //$NON-NLS-1$
|
|
43 |
setToolTipText(Messages.getString("FunctionIsUsedByExportFunctionMainViewAction.IsUsedByExportFunction_Action_Tooltip")); //$NON-NLS-1$
|
|
44 |
|
|
45 |
|
|
46 |
/*******************************************************************************
|
|
47 |
* This piece of the graphic is taken/modified from a graphic that is made
|
|
48 |
* available under the terms of the Eclipse Public License v1.0.
|
|
49 |
*
|
|
50 |
* See 'com.nokia.s60tools.appdep.resources.ImageResourceManager'
|
|
51 |
* for detailed information about the original graphic.
|
|
52 |
*
|
|
53 |
*******************************************************************************/
|
|
54 |
setImageDescriptor(ImageResourceManager.
|
|
55 |
getImageDescriptor(ImageKeys.IS_USED_BY_ACTION));
|
|
56 |
}
|
|
57 |
|
|
58 |
/* (non-Javadoc)
|
|
59 |
* @see org.eclipse.jface.action.IAction#run()
|
|
60 |
*/
|
|
61 |
public void run() {
|
|
62 |
Object exportFunctionObj = view.getSelectedExportFunction();
|
|
63 |
Object compNodeObj = view.getComponentTreeSelectedElement();
|
|
64 |
|
|
65 |
if(exportFunctionObj == null || compNodeObj == null){
|
|
66 |
// We might get null-selections when
|
|
67 |
// tree is expanded/collapsed.
|
|
68 |
// or when Go Into -action is run.
|
|
69 |
|
|
70 |
// Trying to check if we have valid selection cached
|
|
71 |
compNodeObj = view.getMostRecentlySelectedComponentNode();
|
|
72 |
if(exportFunctionObj == null || compNodeObj == null){
|
|
73 |
return;
|
|
74 |
}
|
|
75 |
}
|
|
76 |
|
|
77 |
// Casting and getting the needed information
|
|
78 |
ComponentNode node = (ComponentNode) compNodeObj;
|
|
79 |
String componentName = node.getName();
|
|
80 |
|
|
81 |
ExportFunctionData efData = (ExportFunctionData) exportFunctionObj;
|
|
82 |
String functionName = efData.getFunctionName();
|
|
83 |
String ordinalAsString = efData.getFunctionOrdinal();
|
|
84 |
|
|
85 |
super.startIsUsedDependencyQueryJob(componentName, functionName, ordinalAsString);
|
|
86 |
|
|
87 |
// Remember to always call AbstractMainViewAction
|
|
88 |
// base class implementation
|
|
89 |
super.run();
|
|
90 |
}
|
|
91 |
}
|