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

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

New code for "incremental" building, by Matthew Whyte.

I've only had time to look at this briefly; I've fixed a few obvious problems but I imagine this will be pretty flaky for a while.

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