Changeset 8653
- Timestamp:
- 2004-11-24T15:12:01+13:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/util/Utility.java
r8652 r8653 131 131 static public ImageIcon ERROR_ICON = null; 132 132 static public ImageIcon HELP_ICON = null; 133 /** The image for a toggle button whose state is 'on'. */134 static public ImageIcon ON_ICON = null;135 /** The image for a toggle button whose state is 'off'. */136 static public ImageIcon OFF_ICON = null;137 133 138 134 … … 847 843 ERROR_ICON = new ImageIcon(base.getResource("/images/error.gif")); 848 844 HELP_ICON = new ImageIcon(base.getResource("/images/help.gif")); 849 ON_ICON = new ImageIcon(base.getResource("/images/check.gif"));850 OFF_ICON = new ImageIcon(base.getResource("/images/cross.gif"));851 845 } 852 846 … … 890 884 * @return A <strong>String</strong> made from appending space characters with the string until it has a length equal to length. 891 885 */ 892 public static String pad(String str, int length) {893 return pad(str, length, ' ', true);894 }895 886 public static String pad(String str_raw, int length, char fill, boolean end) { 896 887 StringBuffer str = new StringBuffer(str_raw); … … 999 990 return stripped_string; 1000 991 } 1001 1002 1003 static public String trimCenter(String text, int length) {1004 if(text.length() > length) {1005 int half = (length - 3) / 2;1006 StringBuffer temp = new StringBuffer(text.substring(0, half));1007 temp.append("...");1008 temp.append(text.substring(text.length() - half));1009 text = temp.toString();1010 }1011 return text;1012 }1013 992 }
Note:
See TracChangeset
for help on using the changeset viewer.