You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Peter Cheung <mc...@hotmail.com> on 2018/02/25 16:52:00 UTC

ActionReference has bug ?

Hi All

     Why "Menu/Navigate" will put my action into another Navigate menu rather than the existing one? Why i press the shortcut key, i only see the menu is blinking but the actionPerformed() hasn't run?


Thanks



package hk.quantr.netbeansquickoutline;


import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import org.openide.awt.ActionID;

import org.openide.awt.ActionReference;

import org.openide.awt.ActionReferences;

import org.openide.awt.ActionRegistration;

import org.openide.util.NbBundle.Messages;


@ActionID(

category = "Navigate",

id = "hk.quantr.netbeansquickoutline.SomeAction"

)

@ActionRegistration(

displayName = "#CTL_SomeAction"

)

@ActionReferences({

@ActionReference(path = "Menu/Navigate", position = 9999)

,

@ActionReference(path = "Shortcuts", name = "M-P")

})

@Messages("CTL_SomeAction=MyMenu")

public final class SomeAction implements ActionListener {


@Override

public void actionPerformed(ActionEvent e) {

JOptionPane.showMessageDialog(null, "hey");

}

}

Re: ActionReference has bug ?

Posted by Peter Cheung <mc...@hotmail.com>.
OK, thanks


Thanks
From Peter


________________________________
From: Geertjan Wielenga <ge...@googlemail.com>
Sent: Monday, February 26, 2018 1:13 AM
To: dev@netbeans.incubator.apache.org
Cc: dev@platform.netbeans.org
Subject: Re: ActionReference has bug ?

Programmatic name is probably not Navigate. Maybe it is GoTo.

Gj

On Sunday, February 25, 2018, Peter Cheung <mc...@hotmail.com> wrote:

> Hi All
>
>      Why "Menu/Navigate" will put my action into another Navigate menu
> rather than the existing one? Why i press the shortcut key, i only see the
> menu is blinking but the actionPerformed() hasn't run?
>
>
> Thanks
>
>
>
> package hk.quantr.netbeansquickoutline;
>
>
> import java.awt.event.ActionEvent;
>
> import java.awt.event.ActionListener;
>
> import javax.swing.JOptionPane;
>
> import org.openide.awt.ActionID;
>
> import org.openide.awt.ActionReference;
>
> import org.openide.awt.ActionReferences;
>
> import org.openide.awt.ActionRegistration;
>
> import org.openide.util.NbBundle.Messages;
>
>
> @ActionID(
>
> category = "Navigate",
>
> id = "hk.quantr.netbeansquickoutline.SomeAction"
>
> )
>
> @ActionRegistration(
>
> displayName = "#CTL_SomeAction"
>
> )
>
> @ActionReferences({
>
> @ActionReference(path = "Menu/Navigate", position = 9999)
>
> ,
>
> @ActionReference(path = "Shortcuts", name = "M-P")
>
> })
>
> @Messages("CTL_SomeAction=MyMenu")
>
> public final class SomeAction implements ActionListener {
>
>
> @Override
>
> public void actionPerformed(ActionEvent e) {
>
> JOptionPane.showMessageDialog(null, "hey");
>
> }
>
> }
>

Re: ActionReference has bug ?

Posted by Geertjan Wielenga <ge...@googlemail.com>.
Programmatic name is probably not Navigate. Maybe it is GoTo.

Gj

On Sunday, February 25, 2018, Peter Cheung <mc...@hotmail.com> wrote:

> Hi All
>
>      Why "Menu/Navigate" will put my action into another Navigate menu
> rather than the existing one? Why i press the shortcut key, i only see the
> menu is blinking but the actionPerformed() hasn't run?
>
>
> Thanks
>
>
>
> package hk.quantr.netbeansquickoutline;
>
>
> import java.awt.event.ActionEvent;
>
> import java.awt.event.ActionListener;
>
> import javax.swing.JOptionPane;
>
> import org.openide.awt.ActionID;
>
> import org.openide.awt.ActionReference;
>
> import org.openide.awt.ActionReferences;
>
> import org.openide.awt.ActionRegistration;
>
> import org.openide.util.NbBundle.Messages;
>
>
> @ActionID(
>
> category = "Navigate",
>
> id = "hk.quantr.netbeansquickoutline.SomeAction"
>
> )
>
> @ActionRegistration(
>
> displayName = "#CTL_SomeAction"
>
> )
>
> @ActionReferences({
>
> @ActionReference(path = "Menu/Navigate", position = 9999)
>
> ,
>
> @ActionReference(path = "Shortcuts", name = "M-P")
>
> })
>
> @Messages("CTL_SomeAction=MyMenu")
>
> public final class SomeAction implements ActionListener {
>
>
> @Override
>
> public void actionPerformed(ActionEvent e) {
>
> JOptionPane.showMessageDialog(null, "hey");
>
> }
>
> }
>

Re: ActionReference has bug ?

Posted by Peter Cheung <mc...@hotmail.com>.
This works when i press Ctrl-P

@ActionReference(path = "Shortcuts", name = "C-P")


This doesn't work when i press Command-P in mac, i only see menu is blinking

@ActionReference(path = "Shortcuts", name = "M-P")


Thanks
From Peter


________________________________
From: Peter Cheung <mc...@hotmail.com>
Sent: Monday, February 26, 2018 12:52 AM
To: dev@platform.netbeans.org
Cc: dev@netbeans.incubator.apache.org
Subject: ActionReference has bug ?

Hi All

     Why "Menu/Navigate" will put my action into another Navigate menu rather than the existing one? Why i press the shortcut key, i only see the menu is blinking but the actionPerformed() hasn't run?


Thanks



package hk.quantr.netbeansquickoutline;


import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import org.openide.awt.ActionID;

import org.openide.awt.ActionReference;

import org.openide.awt.ActionReferences;

import org.openide.awt.ActionRegistration;

import org.openide.util.NbBundle.Messages;


@ActionID(

category = "Navigate",

id = "hk.quantr.netbeansquickoutline.SomeAction"

)

@ActionRegistration(

displayName = "#CTL_SomeAction"

)

@ActionReferences({

@ActionReference(path = "Menu/Navigate", position = 9999)

,

@ActionReference(path = "Shortcuts", name = "M-P")

})

@Messages("CTL_SomeAction=MyMenu")

public final class SomeAction implements ActionListener {


@Override

public void actionPerformed(ActionEvent e) {

JOptionPane.showMessageDialog(null, "hey");

}

}