1 48 49 package com.caucho.portal.generic; 50 51 public class PortletPreference { 52 private String _name; 53 private String [] _values; 54 private boolean _isReadOnly; 55 56 public void setName(String name) 57 { 58 _name = name; 59 } 60 61 public String getName() 62 { 63 return _name; 64 } 65 66 public void addValue(String value) 67 { 68 int len = _values == null ? 0 : _values.length; 69 70 String [] values = new String [len + 1]; 71 72 int i = 0; 73 for (i = 0; i < len; i++) { 74 values[i] = _values[i]; 75 _values[i] = null; 76 } 77 values[i] = value; 78 79 _values = values; 80 } 81 82 public String [] getValues() 83 { 84 return _values; 85 } 86 87 public String getValue() 88 { 89 return _values == null || _values.length == 0 ? null : _values[0]; 90 } 91 92 public void setReadOnly(boolean isReadOnly) 93 { 94 _isReadOnly = isReadOnly; 95 } 96 97 public boolean isReadOnly() 98 { 99 return _isReadOnly; 100 } 101 } 102 103 104 105 | Popular Tags |