How to address instance of anonymous class from inner anonymous class?
<p>I have a code that contains anonymous class in another anonymous class and I need to address instance of outer anonymous class from inner anonymous class. Here is the code:</p>

<pre><code>editTemplateButton.setAction(new AbstractAction("Edit...", GUIUtils.EDIT_ELEMENT_ICON)
        {
            {
                setEnabled(false); // disabled at start
                templatesList.addListSelectionListener(new ListSelectionListener()
                {
                    @Override
                    public void valueChanged(ListSelectionEvent e)
                    {
                        setEnabled(!templatesList.isSelectionEmpty()); // depends on selection
                    }
                });
            }

            @Override
            public void actionPerformed(ActionEvent e)
            {
                //todo
            }
        });
</code></pre>

<p>So, I call <code>setEnabled()</code> of implementation of <code>AbstractAction</code> inside implementation of <code>ListSelectionListener</code>. Now it's called ok. But I want to put implementation of <code>ListSelectionListener</code> to variable and use it twice for different actions. How can I call <code>setEnabled()</code> properly? Please don't forget that outer <code>JFrame</code> contains this code is also have <code>setEnabled()</code> method and I don't want to call it instead of right one.</p>

<p>Thanks in advance for your answer.</p>

<p><strong>UPDATE:</strong> I can't use construction like <code>AbstractAction.this.setEnabled(!templatesList.isSelectionEmpty());</code> because compiler reports error.</p>
