01: /*--------------------------------------------------------------------------*
02: | Copyright (C) 2006 Christopher Kohlhaas |
03: | |
04: | This program is free software; you can redistribute it and/or modify |
05: | it under the terms of the GNU General Public License as published by the |
06: | Free Software Foundation. A copy of the license has been included with |
07: | these distribution in the COPYING file, if not go to www.fsf.org |
08: | |
09: | As a special exception, you are granted the permissions to link this |
10: | program with every library, which license fulfills the Open Source |
11: | Definition as published by the Open Source Initiative (OSI). |
12: *--------------------------------------------------------------------------*/
13: package org.rapla.plugin.tableview;
14:
15: import javax.swing.Icon;
16:
17: import org.rapla.facade.RaplaComponent;
18: import org.rapla.framework.RaplaContext;
19: import org.rapla.framework.RaplaException;
20: import org.rapla.gui.CalendarModel;
21: import org.rapla.gui.SwingCalendarView;
22: import org.rapla.gui.ViewFactory;
23: import org.rapla.gui.images.Images;
24: import org.rapla.servletpages.RaplaPageGenerator;
25:
26: public class TableViewFactory extends RaplaComponent implements
27: ViewFactory {
28: public TableViewFactory(RaplaContext context) throws RaplaException {
29: super (context);
30: }
31:
32: public final static String TABLE_VIEW = "table";
33:
34: public SwingCalendarView createSwingView(RaplaContext context,
35: CalendarModel model, boolean editable)
36: throws RaplaException {
37: return new SwingTableView(context, model, editable);
38: }
39:
40: public RaplaPageGenerator createHTMLView(RaplaContext context,
41: CalendarModel model) throws RaplaException {
42: return null;
43: }
44:
45: public String getViewId() {
46: return TABLE_VIEW;
47: }
48:
49: public String getName() {
50: return getString("table");
51: }
52:
53: Icon icon;
54:
55: public Icon getIcon() {
56: if (icon == null) {
57: icon = Images
58: .getIcon("/org/rapla/plugin/tableview/images/table.png");
59: }
60: return icon;
61: }
62:
63: public String getMenuSortKey() {
64: return "0";
65: }
66:
67: }
|