01: /**
02: * $Id: PortalInstancesDropDownOptionsBean.java,v 1.3 2005/07/26 09:00:14 dg154973 Exp $
03: * Copyright 2005 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.admin.console.logging.bean;
14:
15: import com.sun.portal.admin.console.logging.data.LoggingResourceBundle;
16: import com.sun.portal.admin.console.logging.data.PortalViewUtility;
17: import com.sun.web.ui.model.Option;
18:
19: import java.util.List;
20:
21: /**
22: * has request scope, gets instances for a portal
23: */
24: public class PortalInstancesDropDownOptionsBean {
25:
26: private Option[] instances = null;
27: private PortalViewUtility portalInstances = new PortalViewUtility();
28: public static final String INSTANCE_SELECT_OPTION = "common.instances.select.option";
29:
30: public Option[] getInstances() {
31: List portalInstancesList = portalInstances.getInstanceNames();
32: instances = new Option[portalInstancesList.size() + 1];
33: instances[0] = new Option(LoggingResourceBundle
34: .getProperty(INSTANCE_SELECT_OPTION),
35: LoggingResourceBundle
36: .getProperty(INSTANCE_SELECT_OPTION));
37: for (int i = 0; i < portalInstancesList.size(); i++) {
38: instances[i + 1] = new Option((String) portalInstancesList
39: .get(i), (String) portalInstancesList.get(i));
40: }
41: return instances;
42: }
43: }
|