use of org.alfresco.web.config.SidebarConfigElement.SidebarPluginConfig in project acs-community-packaging by Alfresco.
the class SidebarBean method getPlugins.
// ------------------------------------------------------------------------------
// Bean Getters and Setters
/**
* Returns a list of configured plugins
*
* @return List of UIListItem's representing the plugins available
*/
public List<UIListItem> getPlugins() {
if (this.plugins == null) {
FacesContext context = FacesContext.getCurrentInstance();
this.plugins = new ArrayList<UIListItem>();
// create a list entry for each configured plugin
for (String pluginId : this.sidebarConfig.getPlugins().keySet()) {
SidebarPluginConfig plugin = this.sidebarConfig.getPlugin(pluginId);
// resolve the label for the plugin
String label = plugin.getlabelId();
if (label != null) {
label = Application.getMessage(context, label);
}
if (label == null) {
label = plugin.getlabel();
}
if (label == null) {
label = plugin.getId();
}
// resolve the description (tooltip for the plugin)
String tooltip = plugin.getDescriptionId();
if (tooltip != null) {
tooltip = Application.getMessage(context, tooltip);
}
if (tooltip == null) {
tooltip = plugin.getDescription();
}
UIListItem item = new UIListItem();
item.setValue(plugin.getId());
item.setLabel(label);
if (tooltip != null) {
item.setTooltip(tooltip);
}
this.plugins.add(item);
}
}
return this.plugins;
}
use of org.alfresco.web.config.SidebarConfigElement.SidebarPluginConfig in project acs-community-packaging by Alfresco.
the class UISidebar method setupActionGroupId.
/**
* Sets up the corrent actions config group id on the given actions
* component.
*
* @param context Faces context
* @param actionsComponent The actions component to set the group id for
*/
protected void setupActionGroupId(FacesContext context, UIActions actionsComponent) {
String actionsGroupId = null;
SidebarConfigElement config = SidebarBean.getSidebarConfig(context);
if (config != null) {
SidebarPluginConfig plugin = config.getPlugin(getActivePlugin());
if (plugin != null) {
actionsGroupId = plugin.getActionsConfigId();
}
}
actionsComponent.setValue(actionsGroupId);
}
Aggregations