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.property;
19:
20: import java.awt.BorderLayout;
21: import java.awt.Color;
22: import java.awt.Font;
23: import java.awt.event.FocusAdapter;
24: import java.awt.event.FocusEvent;
25: import java.util.logging.Logger;
26:
27: import javax.swing.JScrollPane;
28: import javax.swing.JTextArea;
29: import javax.swing.JTextPane;
30:
31: import de.finix.contelligent.client.event.ContelligentEvent;
32: import de.finix.contelligent.client.gui.AbstractComponentEditor;
33:
34: public class DescriptionEditor extends AbstractComponentEditor {
35:
36: private static Logger logger = Logger
37: .getLogger(DescriptionEditor.class.getName());
38:
39: private static final Font textFont = Font.getFont("Arial-PLAIN-9"); // Default font
40:
41: private JTextPane textArea;
42:
43: public void init() {
44: textArea = new JTextPane();
45: textArea.setFont(textFont);
46:
47: update();
48:
49: textArea.setEditable(false);
50:
51: JScrollPane scrollPane = new JScrollPane(textArea);
52:
53: add(scrollPane, BorderLayout.CENTER);
54: }
55:
56: public void update() {
57: textArea.setText(getComponent().getDescripion());
58: }
59:
60: public void setEditable(boolean editable) {
61: super .setEditable(editable);
62: }
63:
64: protected void updateComponent() {
65: // This GUI is currently for display purposes only
66: }
67:
68: protected void componentChanged(ContelligentEvent event) {
69: update();
70: }
71:
72: protected void childComponentAdded(ContelligentEvent event) {
73: }
74:
75: protected void childComponentRemoved(ContelligentEvent event) {
76: }
77:
78: protected void childComponentChanged(ContelligentEvent event) {
79: }
80:
81: protected void descendentComponentChanged(ContelligentEvent event) {
82: }
83: }
|