01: /**
02: * $Id: Preferences.java,v 1.1 2005/10/06 11:20:16 pa157442 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.monitoring.preferences;
14:
15: //
16: // This class provides functionality for table preferences.
17: //
18: public class Preferences {
19: private String preference = null; // Rows preference.
20: private int rows = 5; // Rows per page.
21:
22: // Default constructor. //
23: public Preferences() {
24: }
25:
26: // Table preferences event. //
27: public void applyPreferences() {
28: try {
29: int rows = Integer.parseInt(preference);
30: if (rows > 0) {
31: this .rows = rows;
32: }
33: } catch (NumberFormatException e) {
34: }
35: }
36:
37: // Get rows per page. //
38: public int getRows() {
39: return rows;
40: }
41:
42: // Get preference. //
43: public String getPreference() {
44: return Integer.toString(rows);
45: }
46:
47: // Set preference. //
48: public void setPreference(String value) {
49: preference = value;
50: }
51: }
|