Search in sources :

Example 1 with UIListItem

use of org.alfresco.web.ui.common.component.UIListItem 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;
}
Also used : SidebarPluginConfig(org.alfresco.web.config.SidebarConfigElement.SidebarPluginConfig) FacesContext(javax.faces.context.FacesContext) UIListItem(org.alfresco.web.ui.common.component.UIListItem)

Example 2 with UIListItem

use of org.alfresco.web.ui.common.component.UIListItem in project acs-community-packaging by Alfresco.

the class UsersDialog method getViewItems.

public List<UIListItem> getViewItems() {
    FacesContext context = FacesContext.getCurrentInstance();
    List<UIListItem> items = new ArrayList<UIListItem>(1);
    UIListItem item1 = new UIListItem();
    item1.setValue(VIEW_DETAILS);
    item1.setLabel(Application.getMessage(context, LABEL_VIEW_DETAILS));
    items.add(item1);
    return items;
}
Also used : FacesContext(javax.faces.context.FacesContext) UIListItem(org.alfresco.web.ui.common.component.UIListItem) ArrayList(java.util.ArrayList)

Example 3 with UIListItem

use of org.alfresco.web.ui.common.component.UIListItem in project acs-community-packaging by Alfresco.

the class RulesDialog method getFilterItems.

public List<UIListItem> getFilterItems() {
    FacesContext context = FacesContext.getCurrentInstance();
    List<UIListItem> items = new ArrayList<UIListItem>(2);
    UIListItem item1 = new UIListItem();
    item1.setValue(INHERITED);
    item1.setLabel(Application.getMessage(context, INHERITED));
    items.add(item1);
    UIListItem item2 = new UIListItem();
    item2.setValue(LOCAL);
    item2.setLabel(Application.getMessage(context, LOCAL));
    items.add(item2);
    return items;
}
Also used : FacesContext(javax.faces.context.FacesContext) UIListItem(org.alfresco.web.ui.common.component.UIListItem) ArrayList(java.util.ArrayList)

Example 4 with UIListItem

use of org.alfresco.web.ui.common.component.UIListItem in project acs-community-packaging by Alfresco.

the class UserMembersBean method getFilterItems.

/**
 * @see org.alfresco.web.bean.dialog.FilterViewSupport#getFilterItems()
 */
public List<UIListItem> getFilterItems() {
    FacesContext context = FacesContext.getCurrentInstance();
    List<UIListItem> items = new ArrayList<UIListItem>(2);
    UIListItem item1 = new UIListItem();
    item1.setValue(INHERITED);
    item1.setLabel(Application.getMessage(context, INHERITED));
    items.add(item1);
    UIListItem item2 = new UIListItem();
    item2.setValue(LOCAL);
    item2.setLabel(Application.getMessage(context, LOCAL));
    items.add(item2);
    return items;
}
Also used : FacesContext(javax.faces.context.FacesContext) UIListItem(org.alfresco.web.ui.common.component.UIListItem) ArrayList(java.util.ArrayList)

Example 5 with UIListItem

use of org.alfresco.web.ui.common.component.UIListItem in project acs-community-packaging by Alfresco.

the class GroupsDialog method getViewItems.

// ------------------------------------------------------------------------------
// ChangeViewSupport implementation
public List<UIListItem> getViewItems() {
    FacesContext context = FacesContext.getCurrentInstance();
    List<UIListItem> items = new ArrayList<UIListItem>(2);
    UIListItem item1 = new UIListItem();
    item1.setValue(VIEW_ICONS);
    item1.setLabel(Application.getMessage(context, LABEL_VIEW_ICONS));
    items.add(item1);
    UIListItem item2 = new UIListItem();
    item2.setValue(VIEW_DETAILS);
    item2.setLabel(Application.getMessage(context, LABEL_VIEW_DETAILS));
    items.add(item2);
    return items;
}
Also used : FacesContext(javax.faces.context.FacesContext) UIListItem(org.alfresco.web.ui.common.component.UIListItem) ArrayList(java.util.ArrayList)

Aggregations

UIListItem (org.alfresco.web.ui.common.component.UIListItem)15 ArrayList (java.util.ArrayList)9 FacesContext (javax.faces.context.FacesContext)9 Collection (java.util.Collection)3 Iterator (java.util.Iterator)3 UIComponent (javax.faces.component.UIComponent)3 ResponseWriter (javax.faces.context.ResponseWriter)3 UIListItems (org.alfresco.web.ui.common.component.UIListItems)3 Config (org.springframework.extensions.config.Config)3 ConfigElement (org.springframework.extensions.config.ConfigElement)3 Map (java.util.Map)2 QName (org.alfresco.service.namespace.QName)2 UIModeList (org.alfresco.web.ui.common.component.UIModeList)2 UIDescription (org.alfresco.web.ui.common.component.description.UIDescription)2 ResourceBundle (java.util.ResourceBundle)1 PropertyNotFoundException (javax.faces.el.PropertyNotFoundException)1 TypeDefinition (org.alfresco.service.cmr.dictionary.TypeDefinition)1 DashboardsConfigElement (org.alfresco.web.config.DashboardsConfigElement)1 LayoutDefinition (org.alfresco.web.config.DashboardsConfigElement.LayoutDefinition)1 SidebarPluginConfig (org.alfresco.web.config.SidebarConfigElement.SidebarPluginConfig)1