Display my custom project to be selected just after clicking NEW menu - eclipse-plugin

Currently when i want to select my Custom project, it is has to be selected by NEW->OTHER..->My-Custom-Project.
Is it possible to display my custom project under NEW menu.
NEW->My-Custom-Project.

Assuming you have written a New Wizard for your custom project use the org.eclipse.ui.perspectiveExtensions extension point to add a 'new wizard shortcut' to display the wizard directly on the New menu.
Something like:
<extension point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.ui.resourcePerspective">
<newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewProjectCreationWizard"/>
The shortcut is specific to the perspective.
You may have to do a Perspective Reset (or Customize Perspective) to get the new shortcut to show.

Related

Using file templates in IntelliJ

I'm quite confused when it comes to file templates in IntelliJ. Basically, when I right click anything and hover my mouse over to New, I can see the usual file templates like Java Class, HTML File and so on. I downloaded Scala plugin and I can see Scala templates (Scala Class, Scala Object, etc.) if I go to Edit File Templates, but I can't actually use/see them in the New menu. Is there a way to modify what I see in the New menu? I'd like to be able to create Scala classes.
Go to Settings -> Menus and Toolbars
There you will see many type of menus. You need edit the menu you want the files to be displayed. Most Probably "Project View Popup Menu".
Click on "Add After" button on right. There you choose the file form plug-ins or other category to be displayed.
I added "Show Bytecode" to meny well it does not make sense here. You can add files from scala plugin like that.
You can restore to Defaults if you mess up easily by clicking on
"Restore All Defaults" button.

Customize existing menu/toolbar Item

I am building a netbeans platform application. This application is project based. I need to customize existing menu/toolbar items.
For instance, when a java project is selected, the "New File" button on the toolbar brings a standard wizard. But when a custom project (my project type) is selected, I would like that same button to bring my own dialog/wizard.
How do I achieve this?
I have been struggling with this for quite some time, any pointer would be greatly appreciated.

How to add buttons linked to your external tool in IntelliJ IDEA

I created some batch work and integrated it as ExternalTool to the IntelliJ IDEA. as described here: Configure Intellij IDEA to run batch file
But how can I add buttons to my toolbar that will activate the batch that defined as external tool?
It is quite easy.
Assuming that you already have an External Tool configured just right click on the menu bar and choose Customize Menus and Toolbars...:
Next step is to mark the last item (whatever that is in your setup) in Main Toolbar and select Add After...:
Now you can select your external tool from the Choose Actions To Add window (here you can also select an icon to use):
Action has been added:
And your button has been added to the toolbar:

How to add a command to package explorer's "New" submenu within eclipse plugin?

I trying to write a eclipse plugin. The first thing i need is:
When right click on a java project within package explorer, a context menu displays.
There is a "New" sub context menu there.
I want my item added under this "New" sub context menu, just like "File", "Folder", "Class" item.
I tried with following code:
<extension point="org.eclipse.ui.menus">
<menuContribution allPopups="false" locationURI="menu:new?after=additions">
<command commandId="de.vogella.plugin.jsmodule" label="MCS Module" style="push">
</command>
</menuContribution>
</extension>
It's only appears when i choosing the File->New on menu bar.
I am newbie on this area, the question is how to add the item to where i want? Let's say, i want it to be under the popup menu-> New by right click the java project?
Do not do that using a menu contribution. Instead provide a newWizard implementation to contribute the code for creating some new element. The Eclipse UI will then automatically add that wizard at the right places.
The displayed entries for the sub menu depend on the current perspective (e.g. it makes no sense to have "New Java class" in non Java perspectives). That's why you want to create a newWizardShortcut extension for each perspective, where you want to see that context menu sub menu item.

Adding an entry in a submenu of a popup

I'm building a plugin, and adding an entry to the context menu (right-click on a folder in the project tree).
So far it works, following this tutorial:
http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html
The problem is that it's adding my entry in the root of the context menu. Since my entry refers to a "New XXX" wizard, I want it to go to the "New" submenu.
It seems like I would have to set the correct locationURI or menuPath in my plugin.xml. However I can't find the locationURI or menuPath corresponding to that submenu. How can I find that?
The new contributions are menu ID based, not menu path based. So it should be something like:
<menuContribution
locationURI="menu:file?after=additions" />
See this SO answer for an example of locationUri.
See Menu Extension for more. The exact id is either:
found in the existing plugin.xml from the menu or
determined with plugin Spy
See "How to add items in popup menu?" (from justinmreina) for more on adding an entry to a menu.
If you've created a plugin for a 'New XXX' wizard, you can add it inside the 'New' menu that you see when you right-click inside the Navigator by customizing the perspective.
Go to Window -> Customize Perspective and click on the Shortcuts tab. You should see 'New XXX'. Select it and you're good to go.