NetBeans: simplest plugin example “Restart IDE”

Only two lines of code. The other lines were generated.

package de.markiew.netbeans.plugin.restart;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Logger;
import org.openide.LifecycleManager;
import org.openide.awt.ActionRegistration;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionID;
import org.openide.util.NbBundle.Messages;

@ActionID(category = "File",
id = "de.markiew.netbeans.plugin.restart.RestartAction")
@ActionRegistration(displayName = "#CTL_RestartAction")
    @ActionReference(path = "Menu/File", position = 2550, separatorAfter = 2575)
@Messages("CTL_RestartAction=Restart IDE")
 * Restarts the IDE using the default LifecycleManager.
public final class RestartAction implements ActionListener {

    public void actionPerformed(ActionEvent e) {

The world easiest (and even useful) action…

Now it is published


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s