info.magnolia.module.templatingcomponents.components
Class SingletonParagraphBar
java.lang.Object
info.magnolia.module.templatingcomponents.components.AbstractAuthoringUiComponent
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SingletonParagraphBar
public SingletonParagraphBar(ServerConfiguration server,
AggregationState aggregationState)
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 componentenableButtonLabel
- 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.