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.editors;
22:
23: import net.charabia.jsmoothgen.skeleton.*;
24: import net.charabia.jsmoothgen.application.*;
25: import net.charabia.jsmoothgen.application.gui.*;
26: import net.charabia.jsmoothgen.application.gui.util.*;
27: import javax.swing.*;
28: import java.awt.*;
29: import java.util.*;
30: import java.io.File;
31: import java.util.jar.*;
32:
33: public class JVMSearchSequence extends Editor {
34: private SortedEditableList m_vmSearch = new SortedEditableList();
35:
36: public JVMSearchSequence() {
37: m_vmSearch.setEditableItems(false);
38:
39: setLayout(new BorderLayout());
40: add(BorderLayout.CENTER, m_vmSearch);
41: }
42:
43: public void dataChanged() {
44: if (m_model.getJVMSearchPath() == null) {
45: m_vmSearch.setData(JVMSearchElement.Elements);
46: } else {
47: Vector v = new Vector();
48: String[] els = m_model.getJVMSearchPath();
49: for (int i = 0; i < els.length; i++) {
50: JVMSearchElement el = JVMSearchElement
51: .getStandardElement(els[i]);
52: if (el != null)
53: v.add(el);
54: }
55: m_vmSearch.setData(v.toArray());
56: }
57: }
58:
59: public void updateModel() {
60: String[] ids = new String[m_vmSearch.dataSize()];
61: Object[] data = m_vmSearch.getData();
62: for (int i = 0; i < ids.length; i++) {
63: ids[i] = ((JVMSearchElement) data[i]).getId();
64: }
65: m_model.setJVMSearchPath(ids);
66: }
67:
68: public String getLabel() {
69: return "JVMSEARCH_LABEL";
70: }
71:
72: public String getDescription() {
73: return "JVMSEARCH_HELP";
74: }
75:
76: public boolean needsBigSpace() {
77: return true;
78: }
79:
80: }
|