jadex.base.gui.filetree.RefreshAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-tools-base-swing Show documentation
Show all versions of jadex-tools-base-swing Show documentation
GUI-dependent classes for jadex-tools-base.
package jadex.base.gui.filetree;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Icon;
import javax.swing.JTree;
import javax.swing.UIDefaults;
import javax.swing.tree.TreePath;
import jadex.base.gui.asynctree.ISwingTreeNode;
import jadex.commons.gui.SGUI;
/**
* The refresh action.
*/
public class RefreshAction extends AbstractAction
{
//-------- constants --------
/** The image icons. */
protected static final UIDefaults icons = new UIDefaults(new Object[]
{
"refresh", SGUI.makeIcon(FileTreePanel.class, "/jadex/base/gui/images/refresh_component.png"),
});
//-------- attributes --------
/** The tree. */
protected JTree tree;
//-------- constructors --------
/**
* Create a new action.
*/
public RefreshAction(JTree tree)
{
this(getName(), icons.getIcon("refresh"), tree);
}
/**
* Create a new action.
*/
public RefreshAction(String name, Icon icon, JTree tree)
{
super(name, icon);
this.tree = tree;
}
//-------- methods --------
/**
* Called when the action is performed.
*/
public void actionPerformed(ActionEvent e)
{
TreePath[] paths = tree.getSelectionPaths();
for(int i=0; paths!=null && i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy