Package org.apache.struts.util

Examples of org.apache.struts.util.LabelValueBean


                Collection<Permission> permissions = type.getPermissions();
                for (Permission permission : permissions) {
                    String permissionString = CoreUtil.getMessageResources(sessionInfo.getHttpSession(), permission.getBundle()).getMessage("permission." + permission.getId() + ".title").trim();
                    String resourceTypeString = CoreUtil.getMessageResources(sessionInfo.getHttpSession(), type.getBundle()).getMessage("resourceType." + type.getResourceTypeId() + ".title").trim();
                    String lableString = resourceTypeString + " " + permissionString;
                    l.add(new LabelValueBean(lableString, lableString));
                }
            }
        } catch (Exception e) {
        }
        return l;
View Full Code Here


                    if (pol.getResourceId() == checkPolicy.getResourceId()) {
                        ok = false;
                    }
                }
                if (ok) {
                    l.add(new LabelValueBean(pol.getResourceName(), String.valueOf(pol.getResourceId())));
                }
                ok = true;
            }
        } catch (Exception e) {
            log.error("Failed to list policies.", e);
View Full Code Here

        colorList.add("Violet");
        request.setAttribute("colorCollection", colorList);

        /* A Collection of LabelValue beans */
        ArrayList days = new ArrayList();
        days.add(new LabelValueBean("Monday", "1"));
        days.add(new LabelValueBean("Tuesday", "2"));
        days.add(new LabelValueBean("Wednesday", "3"));
        days.add(new LabelValueBean("Thursday", "4"));
        days.add(new LabelValueBean("Friday", "5"));
        days.add(new LabelValueBean("Saturday", "6"));
        days.add(new LabelValueBean("Sunday", "7"));
        request.setAttribute("days", days);

        /* Collection of custom beans */
        ArrayList books = new ArrayList();
        books.add(new BookBean("0596003285", "Programming Jakarta Struts"));
View Full Code Here

     */
    protected void setupCache(ActionServlet servlet, ModuleConfig config) {

        // Set up list of server types under "serverTypes"
        ArrayList serverTypes = new ArrayList();
        serverTypes.add(new LabelValueBean("IMAP Protocol", "imap"));
        serverTypes.add(new LabelValueBean("POP3 Protocol", "pop3"));
        servlet.getServletContext().setAttribute("serverTypes", serverTypes);

    }
View Full Code Here

    public Collection getBeanCollection() {
        if (beanCollection == null) {
            Vector entries = new Vector(10);

            entries.add(new LabelValueBean("Label 0", "Value 0"));
            entries.add(new LabelValueBean("Label 1", "Value 1"));
            entries.add(new LabelValueBean("Label 2", "Value 2"));
            entries.add(new LabelValueBean("Label 3", "Value 3"));
            entries.add(new LabelValueBean("Label 4", "Value 4"));
            entries.add(new LabelValueBean("Label 5", "Value 5"));
            entries.add(new LabelValueBean("Label 6", "Value 6"));
            entries.add(new LabelValueBean("Label 7", "Value 7"));
            entries.add(new LabelValueBean("Label 8", "Value 8"));
            entries.add(new LabelValueBean("Label 9", "Value 9"));

            beanCollection = entries;
        }

        return (beanCollection);
View Full Code Here

  public List<LabelValueBean> buildSearchOptions(String hasDormitory, Boolean adminMenu){
    AppProp appProp = AppProp.getInstance();
   
       // Admin Search Category
       List<LabelValueBean> searchCategory = new ArrayList<LabelValueBean>();
       searchCategory.add(new LabelValueBean(appProp.getValue("label.fullsearch"), BaseConstants.FULL_SEARCH));
      
       if (adminMenu){
         searchCategory.add(new LabelValueBean(appProp.getValue("label.username"), BaseConstants.USERNAME));
         searchCategory.add(new LabelValueBean(appProp.getValue("label.email"), BaseConstants.EMAIL));
       }
      
       searchCategory.add(new LabelValueBean(appProp.getValue("label.firstname"), BaseConstants.FIRST_NAME));
       searchCategory.add(new LabelValueBean(appProp.getValue("label.lastname"), BaseConstants.LAST_NAME));
       if (hasDormitory != null && hasDormitory.equalsIgnoreCase(BaseConstants.BOOLEAN_YES)){
         searchCategory.add(new LabelValueBean(appProp.getValue("label.dormitory"), BaseConstants.DORMITORY));
       }    
       searchCategory.add(new LabelValueBean(appProp.getValue("label.yearin"), BaseConstants.YEAR_IN));
       searchCategory.add(new LabelValueBean(appProp.getValue("label.yearout"), BaseConstants.YEAR_OUT));
       searchCategory.add(new LabelValueBean(appProp.getValue("label.nickname"), BaseConstants.NICK_NAME));
       searchCategory.add(new LabelValueBean(appProp.getValue("label.marriedname"), BaseConstants.MARRIED_NAME));
       searchCategory.add(new LabelValueBean(appProp.getValue("label.namebeforemarriage"), BaseConstants.MAIDEN_NAME));
       searchCategory.add(new LabelValueBean(appProp.getValue("label.gender"), BaseConstants.GENDER));
       searchCategory.add(new LabelValueBean(appProp.getValue("label.avatar"), BaseConstants.AVATAR));
      
       return searchCategory;
  }
View Full Code Here

    // --------------------------------------------------

    // Gender
    List<LabelValueBean> gender = new ArrayList<LabelValueBean>();
    gender.add(new LabelValueBean(appProp.getValue("label.male"),
        BaseConstants.GENDER_MALE));
    gender.add(new LabelValueBean(appProp.getValue("label.female"),
        BaseConstants.GENDER_FEMALE));
    gender.add(new LabelValueBean(appProp.getValue("label.unknown"),
        BaseConstants.GENDER_UNKNOWN));
    getServletContext().setAttribute(BaseConstants.LIST_OF_GENDER_OPTIONS,
        gender);

    // Search Category
    List<LabelValueBean> adminAction = new ArrayList<LabelValueBean>();
    adminAction.add(new LabelValueBean(BaseConstants.ADMIN_ACTION_DELETE,
        BaseConstants.ADMIN_ACTION_DELETE));
    adminAction.add(new LabelValueBean(BaseConstants.ADMIN_ACTION_ACTIVATE,
        BaseConstants.ADMIN_ACTION_ACTIVATE));
    adminAction.add(new LabelValueBean(BaseConstants.ADMIN_ACTION_MODIFY,
        BaseConstants.ADMIN_ACTION_MODIFY));
    adminAction.add(new LabelValueBean(
        BaseConstants.ADMIN_ACTION_DEACTIVATE,
        BaseConstants.ADMIN_ACTION_DEACTIVATE));
    adminAction.add(new LabelValueBean(BaseConstants.ADMIN_ACTION_LOCK,
        BaseConstants.ADMIN_ACTION_LOCK));
    getServletContext().setAttribute(BaseConstants.LIST_OF_ADMIN_OPTIONS,
        adminAction);

    // Approval Category
    List<LabelValueBean> approvalAction = new ArrayList<LabelValueBean>();
    approvalAction.add(new LabelValueBean(BaseConstants.MODIFY_IT,
        BaseConstants.MODIFY_IT));
    approvalAction.add(new LabelValueBean(BaseConstants.APPROVE_IT,
        BaseConstants.APPROVE_IT));
    approvalAction.add(new LabelValueBean(BaseConstants.DEACTIVATE_IT,
        BaseConstants.DEACTIVATE_IT));
    approvalAction.add(new LabelValueBean(BaseConstants.DECLINE_IT,
        BaseConstants.DECLINE_IT));
    approvalAction.add(new LabelValueBean(BaseConstants.DELETE_IT,
        BaseConstants.DELETE_IT));
    getServletContext().setAttribute(
        BaseConstants.LIST_OF_APPROVAL_OPTIONS, approvalAction);

    // Account Status
    List<LabelValueBean> accountStatus = new ArrayList<LabelValueBean>();
    accountStatus.add(new LabelValueBean(appProp
        .getValue("label.statusactive"), BaseConstants.ACCOUNT_ACTIVE));
    accountStatus.add(new LabelValueBean(appProp
        .getValue("label.accountdeactivated"),
        BaseConstants.ACCOUNT_DEACTIVATED));
    accountStatus
        .add(new LabelValueBean(
            appProp.getValue("label.accountlocked"),
            BaseConstants.ACCOUNT_LOCKED));
    accountStatus
        .add(new LabelValueBean(appProp.getValue("label.accountnew"),
            BaseConstants.ACCOUNT_UNAPPROVED));
    getServletContext().setAttribute(BaseConstants.LOOKUP_ACCOUNT_STATUS,
        accountStatus);

    // Status
    List<LabelValueBean> status = new ArrayList<LabelValueBean>();
    status.add(new LabelValueBean(appProp.getValue("label.statusactive"),
        BaseConstants.ACTIVE));
    status.add(new LabelValueBean(appProp.getValue("label.statusinactive"),
        BaseConstants.INACTIVE));
    getServletContext().setAttribute(BaseConstants.LOOKUP_STATUS, status);

    logger.debug("Other Cache loaded...");
  }
View Full Code Here

     */
    protected void setupCache(ActionServlet servlet, ModuleConfig config) {

        // Set up list of server types under "serverTypes"
        ArrayList serverTypes = new ArrayList();
        serverTypes.add(new LabelValueBean("IMAP Protocol", "imap"));
        serverTypes.add(new LabelValueBean("POP3 Protocol", "pop3"));
        servlet.getServletContext().setAttribute("serverTypes", serverTypes);

    }
View Full Code Here

     */
    protected void setupCache(ActionServlet servlet, ModuleConfig config) {

        // Set up list of server types under "serverTypes"
        ArrayList serverTypes = new ArrayList();
        serverTypes.add(new LabelValueBean("IMAP Protocol", "imap"));
        serverTypes.add(new LabelValueBean("POP3 Protocol", "pop3"));
        servlet.getServletContext().setAttribute("serverTypes", serverTypes);

    }
View Full Code Here

        log.debug("initFromBeans");

        // Initialize
        ArrayList satisfactionList = new ArrayList();
        satisfactionList.add(new LabelValueBean("Very Satisfied", "4"));
        satisfactionList.add(new LabelValueBean("Satisfied", "3"));
        satisfactionList.add(new LabelValueBean("Not Very Satisfied", "2"));
        satisfactionList.add(new LabelValueBean("Not Satisfied", "1"));
        request.setAttribute("satisfactionList", satisfactionList);

        ArrayList osTypes = new ArrayList();
        osTypes.add(new LabelValueBean("Mac OsX", "OsX"));
        osTypes.add(new LabelValueBean("Windows 95/98/Me", "Win32"));
        osTypes.add(new LabelValueBean("Windows NT/2000/XP/2003", "WinNT"));
        osTypes.add(new LabelValueBean("Linux", "Linux"));
        osTypes.add(new LabelValueBean("BSD NetBSD/FreeBSD/OpenBSD", "BSD"));
        request.setAttribute("osTypes", osTypes);

        ArrayList languageTypes = new ArrayList();
        languageTypes.add(new LabelValueBean("C++", "C++"));
        languageTypes.add(new LabelValueBean("C#", "C#"));
        languageTypes.add(new LabelValueBean("Java", "java"));
        languageTypes.add(new LabelValueBean("Smalltalk", "Smalltalk"));
        request.setAttribute("languageTypes", languageTypes);
    }
View Full Code Here

TOP

Related Classes of org.apache.struts.util.LabelValueBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.