public class TopcatWindowAction<W extends JFrame> extends BasicAction implements TopcatToolAction
Component
argument;
such a constructor must therefore exist.
This parent component is just used to position the window,
it's permissible, though not encouraged, to just ignore that argument.changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
TopcatWindowAction(String name,
Icon icon,
String shortdesc,
Class<? extends W> winClazz)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt)
Performs the action.
|
protected W |
createWindow()
Creates an instance of the window class used by this action.
|
void |
setParent(Component parent)
Sets the parent component to use for initialising windows
created by this action.
|
create, getEventWindow
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public TopcatWindowAction(String name, Icon icon, String shortdesc, Class<? extends W> winClazz)
name
- action nameicon
- action iconshortdesc
- action short descriptionwinClazz
- class of window to instantiate;
must have a constructor that takes a
java.awt.Component giving the window parentprotected W createWindow()
public void actionPerformed(ActionEvent evt)
createWindow()
and sets it visible. This may be overridden.actionPerformed
in interface ActionListener
public void setParent(Component parent)
setParent
in interface TopcatToolAction
parent
- parent componentCopyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.