How to specify enclosing class name in Live template

I want to create a live template that print a line like the following

and I define the live template -


When I insert this live template in line 14 in the code below, it prints -


But I wanted -


My question is how can I define a variable in live template code so it prints top class name (MyFrame in this case) without inner class name. I use idea build 998

1 comment
Comment actions Permalink

There is currently no macro for this, then intention of CLASS_NAME macro was
for debugging purposes solely, thus inner class prefix.
You should submit an SCR though for additional parameter to the macro.

Eugene.

"Mohammed Rahman" <no_mail@jetbrains.com> wrote in message
news:13121762.1072049536628.JavaMail.itn@is.intellij.net...

I want to create a live template that print a line like the following

>


and I define the live template -


>

When I insert this live template in line 14 in the code below, it prints -


>

But I wanted -


>

 {
>     JButton button = new JButton("OK")
>     public MyFrame()
>     {
>        getContentPane().add(button);
>        button.addActionListener(new MyListener());
>     }
>
>     class MyListener implements ActionListener
>     {
>        public void actionPerformed(ActionEvent e)
>        {
>           JOptionPane.showMessageDialog(MyFrame.this, "OK button
pressed"); // line 14
>        }
>     }
> }]]>

>

My question is how can I define a variable in live template code so it

prints top class name (MyFrame in this case) without inner class name. I use
idea build 998
>
>


0

Please sign in to leave a comment.