|
|
|
|
|
|
|
|
|
|
Re: CPP (C) Project not selected right click shows Build Project not enabled. (is Bug ?) [message #1775436 is a reply to message #1712263] |
Mon, 30 October 2017 08:50 |
hankin han Messages: 1 Registered: October 2017 |
Junior Member |
|
|
hi, ilke
I'm facing same issue with Eclipse CDT 9.2.1. refer to your solution, but it is not working for me.
public class ActionProvider extends CommonActionProvider {
@Override
public void setContext(ActionContext context) {
ICommandService commandService = (ICommandService) PlatformUI.getWorkbench()
.getService(ICommandService.class);
Command buildCommand = commandService
.getCommand("IWorkbenchCommandConstants.PROJECT_BUILD_PROJECT");
buildCommand.isEnabled();
}
}
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<actionProvider
class="com.templates.ActionProvider"
id="com.templates.ActionProvider">
<enablement>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
<or>
<instanceof
value="org.eclipse.core.resources.IProject">
</instanceof>
</or>
</enablement>
</actionProvider>
</extension>
<extension
point="org.eclipse.ui.navigator.viewer">
<viewerActionBinding
viewerId="org.eclipse.ui.navigator.ProjectExplorer">
<includes>
<actionExtension
pattern="com.templates.ActionProvider">
</actionExtension>
</includes>
</viewerActionBinding>
</extension>
The above is the implement of class and plugin.xml. Could you please help me to check code above?
[Updated on: Tue, 31 October 2017 07:30] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04028 seconds