01: /*
02: JSmooth: a VM wrapper toolkit for Windows
03: Copyright (C) 2003 Rodrigo Reyes <reyes@charabia.net>
04:
05: This program is free software; you can redistribute it and/or modify
06: it under the terms of the GNU General Public License as published by
07: the Free Software Foundation; either version 2 of the License, or
08: (at your option) any later version.
09:
10: This program is distributed in the hope that it will be useful,
11: but WITHOUT ANY WARRANTY; without even the implied warranty of
12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: GNU General Public License for more details.
14:
15: You should have received a copy of the GNU General Public License
16: along with this program; if not, write to the Free Software
17: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18:
19: */
20:
21: package net.charabia.jsmoothgen.application.gui;
22:
23: import javax.swing.*;
24: import java.awt.event.*;
25: import java.awt.*;
26: import java.io.File;
27: import com.l2fprod.common.swing.*;
28: import net.charabia.jsmoothgen.application.*;
29:
30: public abstract class Editor extends JPanel {
31: protected JSmoothModelBean m_model;
32: protected java.io.File m_basedir;
33:
34: public void attach(JSmoothModelBean model, java.io.File basedir) {
35: m_model = model;
36: m_basedir = basedir;
37: }
38:
39: public void detach() {
40: m_model = null;
41: m_basedir = null;
42: }
43:
44: protected JSmoothModelBean getModel() {
45: return m_model;
46: }
47:
48: protected java.io.File getBaseDir() {
49: return m_basedir;
50: }
51:
52: abstract public void dataChanged();
53:
54: abstract public void updateModel();
55:
56: abstract public String getLabel();
57:
58: abstract public String getDescription();
59:
60: public boolean needsBigSpace() {
61: return false;
62: }
63:
64: public boolean needsFullSpace() {
65: return false;
66: }
67:
68: public boolean useDescription() {
69: return true;
70: }
71:
72: protected java.io.File getAbsolutePath(java.io.File f) {
73: if (f.isAbsolute())
74: return f;
75:
76: return new java.io.File(m_basedir.getAbsoluteFile(), f
77: .toString());
78: }
79: }
|