Right click doesn't work in plugin.xml - eclipse-plugin

I am following this tutorial http://www.vogella.com/tutorials/EclipsePlugin/article.html#exercise-adding-e4view-based-parts-to-3-x-based-applications . When I'm trying to right click in extension tab to add a new e4View as shown in a tutorial, nothing happens, the popup menu doesn't appear. Is it possible to create this view in different way?

You can always edit the plugin.xml directly by clicking on the 'plugin.xml' tab.
A basic e4view would look something like:
<extension
point="org.eclipse.ui.views">
<e4view
class="testview.E4view1"
id="TestView.e4view1"
name="name"
restorable="true">
</e4view>
</extension>

Related

how to add Wizards created in New->File->others into popup menus when right click in project explorer

I have created a category in File->New->Others say "Enterprise".With some Wizards in it lets say "Instance","Component", etc.
Now what i want ,when i right click in Project Explorerand go in New those wizards should be seen their itself. Basically trying to make popup menu of those wizards.
So i created popup menus as:
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="true"
locationURI="popup:common.new.menu?before=additions">
<command
commandId="CommandComponent"
label="Component"
style="push">
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
id="CommandComponent"
name="Component">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="CommandComponent">
</handler>
</extension>
Now how could I give the same class to the handler which I gave to Wizard Component?
Or do I have to write a new class with the same functionality but as per handler format (if it is possible)?
You use the org.eclipse.ui.perspectiveExtensions extension point to define the New Wizards which are show at the top level of the New menu using the newWizardShortcut element.
Something like:
<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<newWizardShortcut
id="org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizard">
</newWizardShortcut>
</perspectiveExtension>
(which is the New JUnit Test Case shortcut).
You may need to Reset the Perspective or use Customize Perspective to make the item visible as the user has control over which of these shortcuts is shown.
More info in the help
This is what I did, in order to achieve what I was asking for.
A popup menu when I right click in project explorer it shows New -> Component Wizard. Which I have added in File -> New -> Others.
<extension point="org.eclipse.ui.menus">
<menuContribution allPopups="false" locationURI="popup:common.new.menu?after=new">
<command commandId=" org.eclipse.ui.newWizard" style="push">
<visibleWhen checkEnabled="false">
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="org.eclipse.ui.resourcePerspective"></equals>
</with>
</visibleWhen>
<parameter name="newWizardId" value="Component"></parameter>
</command>
</menuContribution>
</extension>
Just like greg-449 mentioned, use the "org.eclipse.ui.perspectiveExtensions" extension point to contribute your elements to the perspective that you want.
When you right click on the project explorer or package explorer and click on New, the projects shown there are dependent on the perspective you are in. If you are in a Java perspective, you will find Java Project. If you are in the PDE perspective, you will find Plugin project. So it's good to contribute your Project type in the perspective you want it.

Location URI's for action sets

I want to add menu and toolbar item in the eclispe using the commands.
I want to add menu item after the Run -> External Tools menu item and toolbar action also after the External Tools action.
I have used below Location URI's but they are not helping.
for the Menu Item : menu:org.eclipse.debug.ui.launchActionSet?after=org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar
for the toolbar action : toolbar:org.eclipse.debug.ui.launchActionSet?after=org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar
My plug-in.xml snippet appears as shown below.
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="toolbar:org.eclipse.debug.ui.launchActionSet?after=org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar">
<command
commandId="com.sample.uvextensions.commands.sampleCommand"
icon="icons/sample.gif"
id="com.sample.uvextensions.toolbars.sampleCommand"
label="Debug UV Project"
style="push"
tooltip="launches keil&apos;s debug session for selected project">
</command>
</menuContribution>
<menuContribution
locationURI="menu:org.eclipse.debug.ui.launchActionSet">
<command
commandId="com.sample.uvextensions.commands.sampleCommand"
icon="icons/sample.gif"
id="com.sample.uvextensions.menus.sampleCommand"
label="Debug UV Project"
style="push"
tooltip="launches keil&apos;s debug session for selected project">
</command>
</menuContribution>
Any pointers will be greatly helpfull for me.
Thanks in Advance.
Menu contributions can't refer to action sets because actions sets are processed after menu contributions and are not visible for the former.
You can declare your own action set and add actions with the same menubarPath ("org.eclipse.ui.run/ExternalToolsGroup") and toolbarPath ("org.eclipse.debug.ui.launchActionSet/debug") as those in the external tools plugin. To get your actions placed after those from the other plugin, make sure your action set ID is greater than "org.eclipse.ui.externaltools.ExternalToolsSet".

some of the toolbar menus are not seen in eclipse rcp application

When I launch rcp application some of the custom toolbar menus doesnot appear in my rcp application,if I change perspective then they appears.Any idea?
That's hard to say with no additional information. How do you create those toolbar items? Using some contributor class or in plugin.xml, using menu contributions? With the second option, check, that you have defined them in the proper plugin.xml (the one, which defines your perspective, in which you want to actually see them).
Ensure, that there are handlers for your commands/actions in your perspective.
If you are using associations, ensure, that those are correct:
<extension point="org.eclipse.ui.actionSetPartAssociations">
<actionSetPartAssociation targetID="YouractionSetId">
<part id="YourPartId"/>
</actionSetPartAssociation>

How to create Eclipse like Welcome page

I want to create my own Welcome page like eclipse.I have search for but it shows for RCP Application but i want to create it inside Eclipse IDE So that when i click on menu, it should open Intro(help) page.
eclipse.ui.intro extension point
All you need to do is to extend org.eclipse.ui.intro.configExtension and provide your implementation.
<extension point="org.eclipse.ui.intro.configExtension">
<configExtension configId="org.eclipse.ui.intro.universalConfig"
content="intro/eclipse-tips.xml" />
</extension>
You have the whole tutorial here
http://eclipse.dzone.com/articles/short-tutorial-introwelcome

How to make contributions to JSDT Template Proposals

I've created an eclipse plugin which extends JSDT. When editing a JavaScript file, pressing Ctrl-Space shows "Default Proposals", consisting of general JavaScript Suggestions. Pressing Ctrl-Space again shows "Template Proposals", but the list is empty. How do I add content to the "Template Proposals" list?
You can use the org.eclipse.ui.editors.templates extension point for this. Something like this:
<extension
point="org.eclipse.ui.editors.templates">
<template
autoinsert="true"
contextTypeId="javaScript"
description="Do something"
id="com.foo.mytemplate"
name="A silly template">
<pattern>
fafdsds fafdsda fdadsa
</pattern>
</template>
</extension>