Intellij: Adding 'Interface' to my context menu in the Project Pane - java

Currently in IntelliJ, if I right-click a package in the Project pane, I can see things such as:
new > Java class
new > File
new > Package
I want to add some new menu items in the 'new' context menu such as Interface and Enum. Does anyone know how to do this?
I've been playing around in the Settings > Menus and Toolbars without any luck.
Edit: The funny thing is if I right click a package and choose New > Edit File Templates..., I can see the template for an Interface and in the description it actually says:
This is a built-in template used by IDEA each time you create a new Java interface, by selecting New | Interface from the popup menu in one of the project views.
Unless I need to look at a different pane other than Project, I can't seem to find any context menu that lets me choose New > Interface as suggested by the above description.

New | Java Class, Create New Class dialog appears, in this dialog you can choose Kind between one of the following:
Class
Interface
Enum
Annotation
(tested with IDEA 9.0.3)
If you want Interface directly in the New list, then you have to add new template in Settings | File Templates, name it something like Java Interface and copy the contents of the Interface template into this one.

Also you can create a shortcut to save some secs.
Alt+Ctr+S -> Keymap -> in search box type 'create new' and select Java class and then assign any shortcut like Ctrl+N.

It's under the New Java Class menu.

Yes its available in Class menu : New--> Java class --> Interface .

create a package and then select create new class from that select interface and give a name.
enter image description here
then; you need to import the references files.

Related

Change package name in Eclipse

I need to change the package to Eclipse.
Now my package looks like this:
test
java
helloword
But I want to change it on it:
java
helloword
How can I do that?
This is quite simple:
Select the package you want to change
Press F2
Enter the new package name
Select the package you want to rename.
Select Refactor.
Click on rename
Type new name.
There u go...

Netbeans Plugin development: #ActionReference paths reference

I am developing a Netbeans plugin which will verify a Web Project against some rules.
I am trying to add it a menu as a first item in the Projects context menu. From what I understand, this is done by specifing the path attribute in the #ActionReference annotation. Anyone knows where to find a complete reference for the possible paths?
This is what I have now, and my Menu item appears somewhere in the bottom of the Projects context menu, so I suspect I need something different than "Projects/Actions"
#ActionID(
category = "Tools",
id = "org.chain.war.WarVerifier")
#ActionRegistration(
displayName = "#CTL_WarVerifier")
#ActionReference(path = "Projects/Actions", position = 0)
public final class WarVerifier implements ActionListener
I am on Netbeans 7.2
Thanks,
Chris.
Right-click on one your package New > Other... and under Module Development choose XML Layer.
This XML Layer will show as a drop down containing 2 elements, choose this layer in context you will have the full hierarchy.

How to add "create on" comment in eclipse?

How to add "create on" comment in eclipse every time in create a new class file? I know the alt+shift+j option creates comments for adding name to the eclipse class file.
Window -> Preferences -> Java -> Code Style -> Code Templates
Expand Comments -> Types
Edit the template for comments created for new types. Use the ${date} token.

Using Wizard addon

Dear friends I'm new of vaadin and I would want to use wizard add-on in my vaadin application.
Now my trouble is that I don't have a fix number of steps. I try to explain in a better way, I have the following optionGroup
Then when i choose fixed size I don't have a problem because I can do this
// instantiate the Wizard
Wizard wizard = new Wizard();
// add some steps that implement the WizardStep interface
wizard.addStep(new FirstStep());
wizard.addStep(new SecondStep());
wizard.addStep(new ThirdStep());
wizard.addStep(new FourthStep());
while when i choose the dynamic size, I don't know the exact number of step, but is the user that while running the wizard can add additional step or not.
Is this possible with the wizard add-on?
Yes it is possible to add/remove steps while running the wizard.
wizard.addStep(...)
wizard.removeStep(...)
You can see here in this demo:
http://teemu.virtuallypreinstalled.com/wizards-for-vaadin/#intro
Source code:
https://github.com/tehapo/WizardsForVaadin/tree/master/wizards-for-vaadin-demo/src/main/java/org/vaadin/teemu/wizards

How to add navigation to a custom Magnolia CMS template?

I've managed to create a custom page template for Magnolia CMS pretty easily following this tutorial:
http://documentation.magnolia-cms.com/templates/introduction.html
However, I'm at the point where I'd like to insert the navigation into my template but I can't find a simple way to do so. It looks like other's have had this problem with no clear way to fix it. Does anyone know how to easily include the navigation? Thanks
If you're using Magnolia CE (Community Edition) 4.5.x, you need to know that basically every page template extends the one defined in /modules/standard-templating-kit/config/site/templates/prototype. There you have a node, /navigation. You can copy that node to your new custom template, and after that you can start playing with it's properties.
But before that, don't forget to include the navigation menu(s) somewhere in your main template file (.ftl) and make your template to use stk model class info.magnolia.module.templatingkit.templates.pages.STKPageModel (add an attribute to your template named modelClass, look at stkArticle (or stkSection), it's a good place to start)
Horizontal navigation:
[#if def.navigation.top]
[#include def.navigation.horizontal.template]
[/#if]
Vertical nav:
[#if def.navigation.top]
[#include def.navigation.vertical.template]
[/#if]
If you want to include your menu in another template included with a [#cms.area ...] tag,
you can use this code:
[#if model.root.def.navigation.top]
[#include model.root.def.navigation.vertical.template]
[/#if]

Categories