Skip to content
Snippets Groups Projects
Commit 2cf3826b authored by Raphael GIRARDOT's avatar Raphael GIRARDOT Committed by Patrick MADELA
Browse files

DockingUtils moved from Fusion to DockingCore

parent 9bae52d5
No related branches found
No related tags found
No related merge requests found
package fr.soleil.docking.util;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import fr.soleil.docking.view.IView;
/**
* A class that gives some common useful methods about docking
*
* @author girardot
*/
public class DockingUtils {
/**
* Generates an {@link AbstractAction} that can be used to display a given {@link IView}
*
* @param view The concerned {@link IView}
* @return An {@link AbstractAction}
*/
public static AbstractAction generateShowViewAction(final IView view) {
AbstractAction action = new AbstractAction(view.getTitle()) {
private static final long serialVersionUID = 7366344574285043141L;
@Override
public void actionPerformed(ActionEvent e) {
view.setVisible(true);
}
};
action.putValue(AbstractAction.SMALL_ICON, view.getIcon());
return action;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment