01: /*
02: * Created on Mar 24, 2003
03: *
04: * Dbmjui is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU General Public License version 2 as
06: * published by the Free Software Foundation.
07: *
08: * Dbmjui is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * General Public License for more details.
12: *
13: * You should have received a copy of the GNU General Public
14: * License along with dbmjui; see the file COPYING. If not,
15: * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16: * Boston, MA 02111-1307, USA.
17: *
18: */
19: package fr.aliacom.dbmjui.components.information;
20:
21: import java.util.ArrayList;
22: import java.util.prefs.Preferences;
23:
24: import fr.aliacom.dbmjui.*;
25: import fr.aliacom.dbmjui.HistoryLine;
26: import fr.aliacom.dbmjui.beans.BooleanPreference;
27: import fr.aliacom.dbmjui.driver.*;
28:
29: /**
30: * @author tom
31: *
32: * (c) 2001, 2003 Thomas Cataldo
33: */
34: public class HistoryHelper implements IHistoryHelper {
35:
36: private static final String[][] AVAILABLE_COLUMNS = {
37: { "Label", "label" }, { "Action", "action" },
38: { "Beginning", "start" }, { "End", "end" },
39: { "Result", "result" }, { "Media Name", "mediaName" },
40: { "Log Required", "logRequired" },
41: { "Size (KB)", "sizeKB" }, { "Size (Pages)", "sizePages" },
42: { "Volumes", "volumes" },
43: { "Next Log Page", "nextLogPage" },
44: { "From Page", "fromPage" }, { "To Page", "toPage" },
45: { "Last Savepoint", "lastSavePoint" },
46: { "First Commit", "firstCommit" },
47: { "Last Commit", "lastCommit" }, { "SysKey", "key" } };
48:
49: public HistoryHelper() {
50: }
51:
52: /**
53: * This method returns a list of BooleanPreference suitable to
54: * customize the columns displayed in the backup history.
55: *
56: * @return an ArrayList<BooleanPreference>
57: */
58: public ArrayList getAvailableColumns(DbInstance dbi) {
59: ArrayList ret = new ArrayList(AVAILABLE_COLUMNS.length);
60: Preferences prefs = Preferences
61: .userNodeForPackage(HistoryLine.class);
62: for (int i = 0; i < AVAILABLE_COLUMNS.length; i++) {
63: ret.add(new BooleanPreference(prefs,
64: AVAILABLE_COLUMNS[i][0], "HistoryLine."
65: + AVAILABLE_COLUMNS[i][1]));
66: }
67: return ret;
68: }
69:
70: }
|