source: trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionManager.java@ 10345

Last change on this file since 10345 was 10345, checked in by mdewsnip, 19 years ago

Removed some more crap out of the Utility class.

  • Property svn:keywords set to Author Date Id Revision
File size: 23.9 KB
Line 
1/**
2 *#########################################################################
3 *
4 * A component of the Gatherer application, part of the Greenstone digital
5 * library suite from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * Author: John Thompson, Greenstone Digital Library, University of Waikato
9 *
10 * Copyright (C) 1999 New Zealand Digital Library Project
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 *########################################################################
26 */
27package org.greenstone.gatherer.cdm;
28
29
30import java.awt.*;
31import java.awt.event.*;
32import java.util.*;
33import javax.swing.*;
34import javax.swing.event.*;
35import org.greenstone.gatherer.Configuration;
36import org.greenstone.gatherer.DebugStream;
37import org.greenstone.gatherer.Dictionary;
38import org.greenstone.gatherer.Gatherer;
39import org.greenstone.gatherer.gui.GLIButton;
40import org.greenstone.gatherer.gui.NonWhitespaceField;
41import org.greenstone.gatherer.metadata.MetadataElement;
42import org.greenstone.gatherer.metadata.MetadataSetManager;
43import org.greenstone.gatherer.util.StaticStrings;
44import org.w3c.dom.*;
45
46/** This class maintains a list of subcollections within our collection.
47 * @author John Thompson, Greenstone Digital Library, University of Waikato
48 * @version 2.4
49 */
50public class SubcollectionManager
51 extends DOMProxyListModel {
52
53 static final private String DISABLED_CONTROLS = "Disabled";
54 static final private String ENABLED_CONTROLS = "Normal";
55 static final private String CLASS_DICTIONARY_NAME = "CDM.SubcollectionManager.";
56
57 /** The controls used to edit the settings of this manager. */
58 private Control controls = null;
59
60 private DOMProxyListModel model;
61
62 /** Constructor.
63 * @see org.greenstone.gatherer.Gatherer
64 * @see org.greenstone.gatherer.cdm.CollectionConfiguration
65 * @see org.greenstone.gatherer.cdm.CollectionDesignManager
66 * @see org.greenstone.gatherer.cdm.DOMProxyListModel
67 * @see org.greenstone.gatherer.cdm.Subcollection
68 */
69 public SubcollectionManager() {
70 super(CollectionDesignManager.collect_config.getDocumentElement(), StaticStrings.SUBCOLLECTION_ELEMENT, new Subcollection());
71 DebugStream.println("SubcollectionManager: " + getSize() + " subcollections parsed.");
72 this.model = this;
73 }
74
75 /** Method to add a new subcollection.
76 * @param subcollection the Subcollection to add
77 * @see org.greenstone.gatherer.Gatherer
78 * @see org.greenstone.gatherer.cdm.CollectionConfiguration
79 * @see org.greenstone.gatherer.cdm.DOMProxyListModel
80 * @see org.greenstone.gatherer.collection.CollectionManager
81 */
82 private void addSubcollection(Subcollection subcollection) {
83 if(!contains(subcollection)) {
84 Element element = subcollection.getElement();
85 // Locate where we should insert this new subcollection.
86 Node target_node = CollectionConfiguration.findInsertionPoint(element);
87 // Failing that we insert immediately after a language string
88 add(root, subcollection, target_node);
89 Gatherer.c_man.configurationChanged();
90 }
91 }
92
93 public void destroy() {
94 if(controls != null) {
95 controls.destroy();
96 controls = null;
97 }
98 }
99
100 /** Method to retrieve the controls for this manager.
101 * @return the Control used to edit the subcollection data
102 */
103 public Control getControls() {
104 if(controls == null) {
105 controls = new SubcollectionControl();
106 }
107 return controls;
108 }
109
110 /** Method to retrieve a certain subcollection by its name.
111 * @param name a String which is used as the key for finding the matching subcollection
112 * @return the requested Subcollection or null if no such subcollection exists.
113 */
114 private Subcollection getSubcollection(String name) {
115 Subcollection result = null;
116 int size = getSize();
117 for(int i = 0; i < size; i++) {
118 Subcollection subcollection = (Subcollection) getElementAt(i);
119 if(subcollection.getName().equals(name)) {
120 result = subcollection;
121 }
122 }
123 return result;
124 }
125
126
127 /** Called when the detail mode has changed which in turn may cause several design elements to be available/hidden
128 * @param mode the new mode as an int
129 */
130 public void modeChanged(int mode) {
131 if(controls != null) {
132 ((SubcollectionControl)controls).modeChanged(mode);
133 }
134 }
135
136 /** Method to remove the given subcollection.
137 * @param subcollection the Subcollection you want to remove
138 * @see org.greenstone.gatherer.Gatherer
139 * @see org.greenstone.gatherer.collection.CollectionManager
140 */
141 private void removeSubcollection(Subcollection subcollection) {
142 remove(subcollection);
143 Gatherer.c_man.configurationChanged();
144 }
145
146 private void updateSubcollection(Subcollection subcollection, String name, boolean include, String source, String pattern, String flags) {
147 subcollection.setFlags(flags);
148 subcollection.setInclusive(include);
149 subcollection.setName(name);
150 subcollection.setPattern(pattern);
151 subcollection.setSource(source);
152 refresh(subcollection);
153 Gatherer.c_man.configurationChanged();
154 }
155
156 /** This class creates a JPanel containing serveral more controls used for editing subcollection information. */
157 private class SubcollectionControl
158 extends JPanel
159 implements Control, ChangeListener
160 {
161 private CardLayout card_layout;
162 private JButton add_button;
163 private JButton remove_button;
164 private JButton update_button;
165 private JComboBox source_combobox;
166 private JList subcollection_list;
167 private JPanel border_pane;
168 private JTabbedPane tabbed_pane;
169 private JTextArea instructions_area;
170 private JTextField flags_field;
171 private JTextField match_field;
172 private JTextField name_field;
173 private JRadioButton exclude_button;
174 private JRadioButton include_button;
175
176 /** Constructor */
177 public SubcollectionControl() {
178 // Create
179 JPanel header_pane = new JPanel();
180 instructions_area = new JTextArea();
181 instructions_area.setEditable(false);
182 instructions_area.setLineWrap(true);
183 instructions_area.setRows(6);
184 instructions_area.setWrapStyleWord(true);
185 Dictionary.registerText(instructions_area, "CDM.SubcollectionManager.Instructions");
186
187 border_pane = new JPanel();
188 card_layout = new CardLayout();
189
190 tabbed_pane = new JTabbedPane();
191 tabbed_pane.addChangeListener(this);
192 JLabel title = new JLabel();
193 title.setHorizontalAlignment(JLabel.CENTER);
194 Dictionary.registerText(title, "CDM.SubcollectionManager.Title");
195
196 JPanel button_pane_3 = new JPanel();
197 add_button = new GLIButton();
198 add_button.setMnemonic(KeyEvent.VK_A);
199 add_button.setEnabled(false);
200 Dictionary.registerBoth(add_button, "CDM.SubcollectionManager.Add", "CDM.SubcollectionManager.Add_Tooltip");
201 remove_button = new GLIButton();
202 remove_button.setMnemonic(KeyEvent.VK_R);
203 remove_button.setEnabled(false);
204 Dictionary.registerBoth(remove_button, "CDM.SubcollectionManager.Remove", "CDM.SubcollectionManager.Remove_Tooltip");
205 update_button = new GLIButton();
206 update_button.setMnemonic(KeyEvent.VK_C);
207 update_button.setEnabled(false);
208 Dictionary.registerBoth(update_button, "CDM.SubcollectionManager.Replace", "CDM.SubcollectionManager.Replace_Tooltip");
209
210 JPanel button_pane = new JPanel();
211 JPanel button_pane_1 = new JPanel();
212 include_button = new JRadioButton();
213 include_button.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
214 include_button.setMnemonic(KeyEvent.VK_I);
215 include_button.setOpaque(false);
216 Dictionary.registerText(include_button, "CDM.SubcollectionManager.Include");
217 exclude_button = new JRadioButton();
218 exclude_button.setBackground(Configuration.getColor("coloring.collection_tree_background", false));
219 exclude_button.setMnemonic(KeyEvent.VK_X);
220 exclude_button.setOpaque(false);
221 Dictionary.registerText(exclude_button, "CDM.SubcollectionManager.Exclude");
222
223 JLabel flags_label = new JLabel();
224 Dictionary.registerText(flags_label, "CDM.SubcollectionManager.Flags");
225 flags_field = new NonWhitespaceField();
226 Dictionary.registerTooltip(flags_field, "CDM.SubcollectionManager.Flags_Tooltip");
227
228 JPanel inclusive_pane = new JPanel();
229 JLabel inclusive_label = new JLabel();
230 Dictionary.registerText(inclusive_label, "CDM.SubcollectionManager.Inclusive");
231
232 JLabel match_label = new JLabel();
233 Dictionary.registerText(match_label, "CDM.SubcollectionManager.Match");
234 match_field = new JTextField();
235 Dictionary.registerTooltip(match_field, "CDM.SubcollectionManager.Match_Tooltip");
236
237 JLabel name_label = new JLabel();
238 Dictionary.registerText(name_label, "CDM.SubcollectionManager.Name");
239 name_field = new NonWhitespaceField();
240 Dictionary.registerTooltip(name_field, "CDM.SubcollectionManager.Name_Tooltip");
241
242 JLabel source_label = new JLabel();
243 Dictionary.registerText(source_label, "CDM.SubcollectionManager.Source");
244 ArrayList every_metadata_set_element = MetadataSetManager.getEveryMetadataSetElement();
245 Vector source_model = new Vector(every_metadata_set_element);
246 source_model.add(0, StaticStrings.FILENAME_STR);
247 source_combobox = new JComboBox(source_model);
248 Dictionary.registerTooltip(source_combobox, "CDM.SubcollectionManager.Source_Tooltip");
249
250 subcollection_list = new JList(model);
251 subcollection_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
252 JPanel subcollection_pane = new JPanel();
253 ButtonGroup bg = new ButtonGroup();
254 bg.add(include_button);
255 bg.add(exclude_button);
256 include_button.setSelected(true);
257 JPanel subcollection_list_pane = new JPanel();
258 JLabel subcollection_list_label = new JLabel();
259 Dictionary.registerText(subcollection_list_label, "CDM.SubcollectionManager.Assigned");
260
261 // Create a message pane which explains why these controls are not currently active
262 JPanel message_pane = new JPanel();
263 String args[] = new String[3];
264 args[0] = Configuration.getModeAsString();
265 args[1] = Dictionary.get("Preferences.Mode.Systems");
266 args[2] = Dictionary.get("Preferences.Mode.Expert");
267 JTextArea message_textarea = new JTextArea();
268 Dictionary.registerText(message_textarea, "CDM.SubcollectionManager.Partitions_Disabled", args);
269 message_textarea.setEditable(false);
270 message_textarea.setHighlighter(null); // Prevent highlighting
271 message_textarea.setLineWrap(true);
272 message_textarea.setOpaque(false); // Make it transparent
273 message_textarea.setWrapStyleWord(true);
274
275 // Add listeners
276 SubCollectionChangeListener cl = new SubCollectionChangeListener();
277 add_button.addActionListener(new AddSubCollectionListener());
278 add_button.addActionListener(CollectionDesignManager.buildcol_change_listener);
279 remove_button.addActionListener(new RemoveSubCollectionListener());
280 remove_button.addActionListener(CollectionDesignManager.buildcol_change_listener);
281 update_button.addActionListener(new UpdateSubCollectionListener());
282 update_button.addActionListener(CollectionDesignManager.buildcol_change_listener);
283 exclude_button.addActionListener(cl);
284 include_button.addActionListener(cl);
285 source_combobox.addActionListener(cl);
286 flags_field.getDocument().addDocumentListener(cl);
287 match_field.getDocument().addDocumentListener(cl);
288 name_field.getDocument().addDocumentListener(cl);
289 subcollection_list.addListSelectionListener(new SubCollectionListListener());
290
291 // Layout
292 instructions_area.setBorder(BorderFactory.createEmptyBorder(2,5,2,5));
293
294 header_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
295 header_pane.setLayout(new BorderLayout());
296 header_pane.add(title, BorderLayout.NORTH);
297 header_pane.add(new JScrollPane(instructions_area), BorderLayout.CENTER);
298
299 inclusive_pane.setLayout(new GridLayout());
300 inclusive_pane.add(include_button);
301 inclusive_pane.add(exclude_button);
302
303 button_pane_1.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
304 button_pane_1.setLayout(new GridLayout(5, 2));
305 button_pane_1.add(name_label);
306 button_pane_1.add(name_field);
307 button_pane_1.add(source_label);
308 button_pane_1.add(source_combobox);
309 button_pane_1.add(match_label);
310 button_pane_1.add(match_field);
311 button_pane_1.add(inclusive_label);
312 button_pane_1.add(inclusive_pane);
313 button_pane_1.add(flags_label);
314 button_pane_1.add(flags_field);
315
316 button_pane_3.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
317 button_pane_3.setLayout(new GridLayout(1,3));
318 button_pane_3.add(add_button);
319 button_pane_3.add(update_button);
320 button_pane_3.add(remove_button);
321
322 button_pane.setLayout(new BorderLayout());
323 button_pane.add(button_pane_1, BorderLayout.CENTER);
324 button_pane.add(button_pane_3, BorderLayout.SOUTH);
325
326 subcollection_list_pane.setLayout(new BorderLayout());
327 subcollection_list_pane.add(subcollection_list_label, BorderLayout.NORTH);
328 subcollection_list_pane.add(new JScrollPane(subcollection_list), BorderLayout.CENTER);
329 subcollection_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
330 subcollection_pane.setLayout(new BorderLayout());
331 subcollection_pane.add(subcollection_list_pane, BorderLayout.CENTER);
332 subcollection_pane.add(button_pane, BorderLayout.SOUTH);
333
334 tabbed_pane.addTab(Dictionary.get("CDM.SubcollectionManager.Subcollection_Controls"), subcollection_pane);
335 tabbed_pane.addTab(Dictionary.get("CDM.SubcollectionManager.Subindex_Controls"), (JPanel) CollectionDesignManager.subcollectionindex_manager.getControls());
336 tabbed_pane.addTab(Dictionary.get("CDM.SubcollectionManager.Language_Controls"), (JPanel) CollectionDesignManager.language_manager.getControls());
337
338 message_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
339 message_pane.setLayout(new GridLayout(3,1,0,0));
340 message_pane.add(new JPanel());
341 message_pane.add(message_textarea);
342 message_pane.add(new JPanel());
343
344 border_pane.setBorder(BorderFactory.createEmptyBorder(0,5,5,5));
345 border_pane.setLayout(card_layout);
346 if(Configuration.getMode() > Configuration.LIBRARIAN_MODE) {
347 border_pane.add(tabbed_pane, ENABLED_CONTROLS);
348 border_pane.add(message_pane, DISABLED_CONTROLS);
349 }
350 else {
351 border_pane.add(message_pane, DISABLED_CONTROLS);
352 border_pane.add(tabbed_pane, ENABLED_CONTROLS);
353 }
354
355 setLayout(new BorderLayout());
356 add(header_pane, BorderLayout.NORTH);
357 add(border_pane, BorderLayout.CENTER);
358 }
359
360 /** Method to unregister any listeners to avoid memory leaks.
361 */
362 public void destroy() {
363 }
364
365 public void gainFocus() {
366 // Rebuild the sources combobox
367 ArrayList every_metadata_set_element = MetadataSetManager.getEveryMetadataSetElement();
368 Vector source_model = new Vector(every_metadata_set_element);
369 source_model.add(0, "Filename"); // Add filename as a possible source.
370 source_combobox.setModel(new DefaultComboBoxModel(source_model));
371 }
372
373 public void loseFocus() {
374 }
375
376 /** Called when the detail mode has changed which in turn controls if any of the partition controls are visible, or if they are instead replaced with a message explaining why they are not.
377 * @param mode the new mode as an int
378 */
379 public void modeChanged(int mode) {
380 if(mode > Configuration.LIBRARIAN_MODE) {
381 card_layout.show(border_pane, ENABLED_CONTROLS);
382 }
383 else {
384 card_layout.show(border_pane, DISABLED_CONTROLS);
385 }
386 }
387
388 public void stateChanged(ChangeEvent event)
389 {
390 if (tabbed_pane.getSelectedIndex() == 1) {
391 CollectionDesignManager.subcollectionindex_manager.getControls().gainFocus();
392 }
393 if (tabbed_pane.getSelectedIndex() == 2) {
394 CollectionDesignManager.language_manager.getControls().gainFocus();
395 }
396 }
397
398 /** Listens for actions apon the 'add' button in the SubcollectionManager controls, and if detected calls the addSubcollection method of the manager with a newly created subcollection. */
399 private class AddSubCollectionListener
400 implements ActionListener {
401 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we wish to retrieve information from the various edit controls, and if we have sufficient data to build a new subcollection do so.
402 * @param event An <strong>ActionEvent</strong> containing information about the event.
403 * @see org.greenstone.gatherer.cdm.Subcollection
404 */
405 public void actionPerformed(ActionEvent event) {
406 String name = name_field.getText();
407 String source = null;
408 Object object = source_combobox.getSelectedItem();
409 if (object instanceof MetadataElement) {
410 MetadataElement metadata_element = (MetadataElement) object;
411 source = metadata_element.getFullName();
412 }
413 else {
414 source = object.toString();
415 }
416 String pattern = match_field.getText();
417 String flags = flags_field.getText();
418 if(name.length() > 0 && (source == null || source.length() > 0) && pattern.length() > 0) {
419 Subcollection subcollection = new Subcollection(name, include_button.isSelected(), source, pattern, flags);
420 addSubcollection(subcollection);
421 // Change the selection to the new subcollection
422 subcollection_list.setSelectedValue(subcollection, true);
423 }
424 add_button.setEnabled(false);
425 }
426 }
427
428 /** This class listens for any key entry in a text field, selection change in a combobox or button click, and updates a subcollection as appropriate. Its also convenient to use this class to test if the add button should be active yet. */
429 private class SubCollectionChangeListener
430 implements DocumentListener, ActionListener {
431 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we want to record that somethings changed, then validate the controls.
432 * @param event An <strong>ActionEvent</strong> containing information about the event.
433 */
434 public void actionPerformed(ActionEvent event) {
435 validateAdd();
436 }
437
438 public void changedUpdate(DocumentEvent event) {
439 validateAdd();
440 }
441
442 public void insertUpdate(DocumentEvent event) {
443 validateAdd();
444
445 }
446
447 public void removeUpdate(DocumentEvent event) {
448 validateAdd();
449 }
450
451 /** Method to validate the current subcollection editor values, and enable or disable controls (add button) based on said values. */
452 private void validateAdd() {
453 if(name_field.getText().length() > 0 && match_field.getText().length() > 0) {
454 if (getSubcollection(name_field.getText()) == null) {
455 add_button.setEnabled(true);
456 } else {
457 add_button.setEnabled(false);
458 }
459 }
460 else {
461 add_button.setEnabled(false);
462 }
463 }
464 }
465
466 /** Listens for actions apon the 'remove' button in the SubcollectionManager controls, and if detected calls the remove method of the manager with the SubIndex selected for removal. */
467 private class RemoveSubCollectionListener
468 implements ActionListener {
469 /** Any implementation of ActionListener must include this method so we can be informed when an action has been performed on one of our target controls. In this case we want to check if they have a subcolleciton selected, and if so remove both it and any subindexes based on it.
470 * @param event An <strong>ActionEvent</strong> containing information about the event.
471 * @see org.greenstone.gatherer.cdm.Subcollection
472 */
473 public void actionPerformed(ActionEvent event) {
474 if(!subcollection_list.isSelectionEmpty()) {
475 Subcollection subcollection = (Subcollection)subcollection_list.getSelectedValue();
476 removeSubcollection(subcollection);
477 // And remove subcollection indexes dependant on this subcollection
478 CollectionDesignManager.subcollectionindex_manager.removeSubcollectionIndexes(subcollection);
479 }
480 remove_button.setEnabled(false);
481 }
482 }
483
484 private class UpdateSubCollectionListener
485 implements ActionListener {
486 public void actionPerformed(ActionEvent event) {
487 if(!subcollection_list.isSelectionEmpty()) {
488 Subcollection subcollection = (Subcollection)subcollection_list.getSelectedValue();
489 String name = name_field.getText();
490 String source = null;
491 Object object = source_combobox.getSelectedItem();
492 if (object instanceof MetadataElement) {
493 MetadataElement metadata_element = (MetadataElement) object;
494 source = metadata_element.getFullName();
495 }
496 else {
497 source = object.toString();
498 }
499 String pattern = match_field.getText();
500 String flags = flags_field.getText();
501 if(name.length() > 0 && (source == null || source.length() > 0) && pattern.length() > 0) {
502 updateSubcollection(subcollection, name, include_button.isSelected(), source, pattern, flags);
503 }
504 }
505 }
506 }
507
508 /** This class listens for selections in the list on the subcollections pane of the SubcollectionManager, and updates the controls as necessary to reflect selection. */
509 private class SubCollectionListListener
510 implements ListSelectionListener {
511 /** Any implementation of ListSelectionListener must include this method so we can be informed when the selection changes. In this case we want to execute any changes the users made to the entry, then update the controls with details of the new selection.
512 * @param event A <strong>ListSelectionEvent</strong> containing information related to this event.
513 * @see org.greenstone.gatherer.cdm.Subcollection
514 */
515 public void valueChanged(ListSelectionEvent event) {
516 // Wait until the event stabilises to avoid processing it multiple times
517 if (event.getValueIsAdjusting() == true) {
518 return;
519 }
520 // Now the entry
521 if(!subcollection_list.isSelectionEmpty()) {
522 Subcollection subcollection = (Subcollection) subcollection_list.getSelectedValue();
523 flags_field.setText(subcollection.getFlags());
524 include_button.setSelected(subcollection.isInclusive());
525 exclude_button.setSelected(!subcollection.isInclusive());
526 match_field.setText(subcollection.getPattern());
527 name_field.setText(subcollection.getName());
528 String s = subcollection.getSource();
529 int pos = 0;
530 Object value = source_combobox.getItemAt(pos);
531 //ystem.err.println("Search for: " + s);
532 while (value != null) {
533 if (value instanceof MetadataElement) {
534 MetadataElement metadata_element = (MetadataElement) value;
535 String metadata_element_name = metadata_element.getFullName();
536 //ystem.err.print("Compare to: " + e_name);
537 if (metadata_element_name.equals(s)) {
538 source_combobox.setSelectedIndex(pos);
539 value = null;
540 //ystem.err.println(" - Match");
541 }
542 else {
543 pos++;
544 value = source_combobox.getItemAt(pos);
545 //ystem.err.println(" - Fail");
546 }
547 }
548 else if(value.toString().equals(s)) {
549 source_combobox.setSelectedIndex(pos);
550 value = null;
551 }
552 else {
553 pos++;
554 value = source_combobox.getItemAt(pos);
555 }
556 }
557 // Can't add one thats already there.
558 add_button.setEnabled(false);
559 // You can update or remove it though...
560 remove_button.setEnabled(true);
561 update_button.setEnabled(true);
562 }
563 else {
564 flags_field.setText("");
565 include_button.setSelected(true);
566 match_field.setText("");
567 name_field.setText("");
568 source_combobox.setSelectedIndex(0);
569 remove_button.setEnabled(false);
570 update_button.setEnabled(false);
571 }
572 }
573 }
574 }
575}
Note: See TracBrowser for help on using the repository browser.