com.alveole.studio.web.managers
Class Struts2PackageExtensionManager

java.lang.Object
  extended by com.alveole.studio.web.managers.Struts2PackageExtensionManager
All Implemented Interfaces:
PackageExtensionManager

public class Struts2PackageExtensionManager
extends java.lang.Object
implements PackageExtensionManager

This class implements a package extension manager for struts2. It gives ability to select a default Struts2 package in tree packages. It also defines some static methods that helps linking between struts2 specific tags, and our Alveole Plugin (getting all NodeAction from a struts2 package for example...).

Author:
sylvain

Constructor Summary
Struts2PackageExtensionManager()
           
 
Method Summary
 boolean dirty()
          Check if edition is dirty.
static java.util.ArrayList<NodeAction> getAllActionsInStruts2Package(ProjectContext ctx, java.lang.String name)
          Get all Struts2 actions that are currently linked to the given Struts2 package.
 void getControls(ProjectContext project, NodePackage current, org.eclipse.swt.widgets.Control[] controls, org.eclipse.swt.widgets.Composite parent)
          Make a panel for choosing package.
static java.lang.String getDefaultActionStruts2Package(NodeAction action)
          Gets the default struts2 package for the given action.
static java.lang.String getSelectedStruts2Package(NodePackage current)
          Gets selected package name for the given package.
 java.lang.String[] getTitles(ProjectContext project, NodePackage current)
          Gets tabs titles.
 void onOk(NodePackage current)
          Validates selection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Struts2PackageExtensionManager

public Struts2PackageExtensionManager()
Method Detail

getControls

public void getControls(ProjectContext project,
                        NodePackage current,
                        org.eclipse.swt.widgets.Control[] controls,
                        org.eclipse.swt.widgets.Composite parent)
Make a panel for choosing package.

Specified by:
getControls in interface PackageExtensionManager
Parameters:
project - The current project.
current - The current selected package. If null, consider instanciating a new package.
controls - The array to fill.
parent - Parent control.

getTitles

public java.lang.String[] getTitles(ProjectContext project,
                                    NodePackage current)
Gets tabs titles.

Specified by:
getTitles in interface PackageExtensionManager

onOk

public void onOk(NodePackage current)
Validates selection.

Specified by:
onOk in interface PackageExtensionManager

dirty

public boolean dirty()
Check if edition is dirty.

Specified by:
dirty in interface PackageExtensionManager

getSelectedStruts2Package

public static java.lang.String getSelectedStruts2Package(NodePackage current)
Gets selected package name for the given package.


getDefaultActionStruts2Package

public static java.lang.String getDefaultActionStruts2Package(NodeAction action)
Gets the default struts2 package for the given action.


getAllActionsInStruts2Package

public static java.util.ArrayList<NodeAction> getAllActionsInStruts2Package(ProjectContext ctx,
                                                                            java.lang.String name)
Get all Struts2 actions that are currently linked to the given Struts2 package.