01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software 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: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.client.gui.composed;
19:
20: import java.util.List;
21: import java.util.Vector;
22:
23: import de.finix.contelligent.client.gui.AbstractGUIWithCommonRendererAndEditor;
24: import de.finix.contelligent.client.gui.ComponentEditor;
25: import de.finix.contelligent.client.i18n.Resources;
26: import de.finix.contelligent.client.util.TextUtil;
27:
28: public class MixedTableGUI extends
29: AbstractGUIWithCommonRendererAndEditor {
30:
31: protected ComponentEditor createEditor(boolean editable) {
32:
33: MixedTableEditor editor = new MixedTableEditor();
34: editor.setComponent(getComponent());
35: editor.setGUI(this );
36: editor.setView(getView());
37: editor.setEditable(editable);
38:
39: List rows = new Vector();
40: // FIXME what to do here
41: // rows.add(editor.getResourceAsText());
42: editor.setRows(rows);
43:
44: editor.setMode(MixedTableModel.TABLE);
45: editor.init();
46:
47: return editor;
48: }
49:
50: public boolean isSupported(int type) {
51: return (type == DEFAULT);
52: }
53:
54: public boolean hidesSubcomponents() {
55: return true;
56: }
57:
58: public String getName() {
59: if (getComponent().getName().length() > 0) {
60: return TextUtil.toUpper(getComponent().getName());
61: } else {
62: return "[" + Resources.getLocalString("no_name") + "]";
63: }
64: }
65: }
|