}
else if ( !Fragment.LAYOUT.equals(fragment.getType()) )
{
fragmentSupportsActions = true;
String fragmentId = fragment.getId();
PortletApplication pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getPortletApplicationDefinition();
String portletName = portlet.getUniqueName();
PortletMode currentMappedMode = pa.getMappedPortletMode(currentMode);
WindowState currentMappedState = pa.getMappedWindowState(currentState);
Object action;
PortletMode mappedMode;
PortletMode customMode;
WindowState mappedState;
WindowState customState;
ArrayList actionTemplates = new ArrayList();
DecoratorActionsFactory actionsAdapter = getDecoratorActionsAdapter(decoration);
List supportedActions = actionsAdapter.getSupportedActions(requestContext, pa, window, currentMappedMode, currentMappedState, decoration);
Iterator iter = supportedActions.iterator();
String currentModeAction = null;
String currentStateAction = null;
while ( iter.hasNext() )
{
action = iter.next();
if ( action instanceof PortletMode )
{
mappedMode = (PortletMode)action;
customMode = pa.getCustomPortletMode(mappedMode);
if ( customMode != null )
{
boolean equalsCurrentMode = customMode.equals(currentMode);
if ( equalsCurrentMode )
{
currentModeAction = mappedMode.toString();
}
if ( ! equalsCurrentMode || isAjaxRequest )
{
if ( (content.supportsPortletMode(customMode) || isAutoSwitchableCustomMode(content, customMode))
&& (!PortletMode.EDIT.equals(customMode) || pageActionAccess.isEditAllowed())
&& pageActionAccess.checkPortletMode(fragmentId, portletName, mappedMode)
)
{
actionTemplates.add(new DecoratorActionTemplate(mappedMode, customMode));
}
}
}
}
else if ( action instanceof WindowState )
{
mappedState = (WindowState)action;
customState = pa.getCustomWindowState(mappedState);
if ( customState != null )
{
boolean equalsCurrentState = customState.equals(currentState);
if ( equalsCurrentState )