Package org.apache.struts.util

Examples of org.apache.struts.util.LabelValueBean


            key = "resource.hub.filter.AllServiceTypes";
            break;
        }
        }

        LabelValueBean menuLabel = new LabelValueBean(messages.getMessage(key), "");
        return menuLabel;
    }
View Full Code Here


     * @return a list of group types from the list
     */
    private static List<LabelValueBean> buildResourceTypes() {
        List<LabelValueBean> resourceCategoryTypes = new ArrayList<LabelValueBean>();

        resourceCategoryTypes.add(new LabelValueBean(CATEGORY_ALL, CATEGORY_ALL));

        for (ResourceCategory category : ResourceCategory.values()) {
            resourceCategoryTypes.add(new LabelValueBean(category.toString(), category.name()));
        }

        return resourceCategoryTypes;
    }   
View Full Code Here

                    found = true;
                } else if (getRn() < RN_OPTS[i]) {
                    // the selected rn is between two of the preset
                    // options
                    v = getRn().toString();
                    items.add(new LabelValueBean(v, v));
                    found = true;
                }
            }

            v = Integer.toString(RN_OPTS[i]);
            items.add(new LabelValueBean(v, v));
        }

        // one final check to see if the selected rn is bigger than
        // any of the preset options
        if (!found && (getRn() != null)) {
            v = getRn().toString();
            items.add(new LabelValueBean(v, v));
        }

        return items;
    }
View Full Code Here

    @SuppressWarnings("deprecation")
    private List<LabelValueBean> getBaselineList(MeasurementSchedule schedule) {
        List<LabelValueBean> list = new ArrayList<LabelValueBean>(3);
        String minLabel = MeasurementFormatter.getBaselineText(MeasurementConstants.BASELINE_OPT_MIN, schedule);
        list.add(new LabelValueBean(minLabel, MeasurementConstants.BASELINE_OPT_MIN));

        String meanLabel = MeasurementFormatter.getBaselineText(MeasurementConstants.BASELINE_OPT_MEAN, schedule);
        list.add(new LabelValueBean(meanLabel, MeasurementConstants.BASELINE_OPT_MEAN));

        String maxLabel = MeasurementFormatter.getBaselineText(MeasurementConstants.BASELINE_OPT_MAX, schedule);
        list.add(new LabelValueBean(maxLabel, MeasurementConstants.BASELINE_OPT_MAX));

        return list;
    }
View Full Code Here

        }

        Integer underValue = new Integer(MonitorUtils.THRESHOLD_UNDER_VALUE);
        Integer overValue = new Integer(MonitorUtils.THRESHOLD_OVER_VALUE);

        items.add(new LabelValueBean(underLabel, underValue.toString()));
        items.add(new LabelValueBean(overLabel, overValue.toString()));

        return items;
    }
View Full Code Here

            hubForm.addPlugin(createMenuLabel(request, "resource.hub.filter.AllPlugins", ""));
            List<Plugin> plugins = LookupUtil.getPluginManager().getPluginsByResourceTypeAndCategory(
                resourceTypeName, resourceCategory);
            for (Plugin plugin : plugins) {
                hubForm.addPlugin(new LabelValueBean(plugin.getDisplayName(), encode(plugin.getName())));
            }
        }
    }
View Full Code Here

        }
    }

    public void addResourceTypeMenuItems(HubForm form, Set<String> typeNames, String headerLabel, String headerValue) {
        if (!typeNames.isEmpty()) {
            form.addType(new LabelValueBean("", ""));
            form.addType(new LabelValueBean(headerLabel, headerValue));
            for (String resourceTypeName : typeNames) {
                form.addType(new LabelValueBean(resourceTypeName, encode(resourceTypeName)));
            }
        }
    }
View Full Code Here

        }
    }

    protected LabelValueBean createMenuLabel(HttpServletRequest req, String key, String value) {
        MessageResources messages = getResources(req);
        return new LabelValueBean(messages.getMessage(key), value);
    }
View Full Code Here

            while (it.hasNext()) {
                Object next = it.next();
                String value = null;
                String key = null;
                if (next instanceof LabelValueBean) {
                    LabelValueBean bean = (LabelValueBean) next;
                    value = bean.getValue();
                    key = baseKey + '.' + bean.getLabel();
                } else {
                    value = String.valueOf(next);
                    key = baseKey + '.' + value;
                }
View Full Code Here

        List<LabelValueBean> items = new ArrayList<LabelValueBean>();
        String label = null, value = null;

        label = MonitorUtils.THRESHOLD_BASELINE_LABEL;
        value = String.valueOf(MonitorUtils.THRESHOLD_BASELINE_VALUE);
        items.add(new LabelValueBean(label, value));

        label = MonitorUtils.THRESHOLD_HIGH_RANGE_LABEL;
        value = String.valueOf(MonitorUtils.THRESHOLD_HIGH_RANGE_VALUE);
        items.add(new LabelValueBean(label, value));

        label = MonitorUtils.THRESHOLD_LOW_RANGE_LABEL;
        value = String.valueOf(MonitorUtils.THRESHOLD_LOW_RANGE_VALUE);
        items.add(new LabelValueBean(label, value));

        return items;
    }
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.