info.magnolia.module.templatingcomponents.components
Class SingletonParagraphBar

java.lang.Object
  extended by info.magnolia.module.templatingcomponents.components.AbstractAuthoringUiComponent
      extended by info.magnolia.module.templatingcomponents.components.SingletonParagraphBar
All Implemented Interfaces:
AuthoringUiComponent

public class SingletonParagraphBar
extends AbstractAuthoringUiComponent

An hybrid between a new bar and an edit bar for non-moveable paragraphs: it's either added by the editor, edited, or removed. This is currently meant to be used in conjunction with the regular edit bar component: if the request content is present, wrappers should render their content (which should render said paragraph with an edit bar), and if not, this renders a "new bar".

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Constructor Summary
SingletonParagraphBar(ServerConfiguration server, AggregationState aggregationState)
           
 
Method Summary
protected  void doRender(java.lang.Appendable out)
           
static boolean isInSingleton()
          Utility method for other components to determine if they are being rendered inside a SingletonParagraphBar.
static SingletonParagraphBar make(ServerConfiguration serverCfg, AggregationState aggState, java.lang.String contentName, java.util.List<java.lang.String> allowedParagraphs, java.lang.String enableButtonLabel)
           
 void postRender()
          Override this method if you need to "do something" once the component is rendered, i.e cleanup the context.
 void setAllowedParagraphs(java.util.List<java.lang.String> allowedParagraphs)
           
 void setContentName(java.lang.String contentName)
           
 void setEnableButtonLabel(java.lang.String enableButtonLabel)
           
 
Methods inherited from class info.magnolia.module.templatingcomponents.components.AbstractAuthoringUiComponent
asString, currentContent, getAggregationState, getI18BasenameFor, getMessage, getMessage, getServer, render, shouldRender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonParagraphBar

public SingletonParagraphBar(ServerConfiguration server,
                             AggregationState aggregationState)
Method Detail

isInSingleton

public static boolean isInSingleton()
Utility method for other components to determine if they are being rendered inside a SingletonParagraphBar.


make

public static SingletonParagraphBar make(ServerConfiguration serverCfg,
                                         AggregationState aggState,
                                         java.lang.String contentName,
                                         java.util.List<java.lang.String> allowedParagraphs,
                                         java.lang.String enableButtonLabel)
Parameters:
serverCfg -
aggState -
contentName - the name of the node which contains (or will contain) the singleton paragraph; this is a child node of AbstractAuthoringUiComponent.currentContent().
allowedParagraphs - the list of paragraph definitions (their names) that are allow to be added by this component
enableButtonLabel - if null, default will be used

setContentName

public void setContentName(java.lang.String contentName)

setAllowedParagraphs

public void setAllowedParagraphs(java.util.List<java.lang.String> allowedParagraphs)

setEnableButtonLabel

public void setEnableButtonLabel(java.lang.String enableButtonLabel)

doRender

protected void doRender(java.lang.Appendable out)
                 throws java.io.IOException,
                        javax.jcr.RepositoryException
Specified by:
doRender in class AbstractAuthoringUiComponent
Throws:
java.io.IOException
javax.jcr.RepositoryException

postRender

public void postRender()
Description copied from class: AbstractAuthoringUiComponent
Override this method if you need to "do something" once the component is rendered, i.e cleanup the context.

Specified by:
postRender in interface AuthoringUiComponent
Overrides:
postRender in class AbstractAuthoringUiComponent


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.