source: trunk/gli/src/org/greenstone/gatherer/Configuration.java@ 4366

Last change on this file since 4366 was 4363, checked in by kjdon, 21 years ago

re-tabbed the code for java

  • Property svn:keywords set to Author Date Id Revision
File size: 26.1 KB
Line 
1package org.greenstone.gatherer;
2/**
3 *#########################################################################
4 *
5 * A component of the Gatherer application, part of the Greenstone digital
6 * library suite from the New Zealand Digital Library Project at the
7 * University of Waikato, New Zealand.
8 *
9 * <BR><BR>
10 *
11 * Author: John Thompson, Greenstone Digital Library, University of Waikato
12 *
13 * <BR><BR>
14 *
15 * Copyright (C) 1999 New Zealand Digital Library Project
16 *
17 * <BR><BR>
18 *
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
23 *
24 * <BR><BR>
25 *
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
30 *
31 * <BR><BR>
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
36 *########################################################################
37 */
38import java.awt.*;
39import java.io.*;
40import java.lang.ref.*;
41import java.net.*;
42import java.util.*;
43import javax.swing.*;
44import javax.swing.plaf.*;
45import org.greenstone.gatherer.Message;
46import org.greenstone.gatherer.gui.Coloring;
47import org.greenstone.gatherer.msm.MSMUtils;
48import org.greenstone.gatherer.util.GURL;
49import org.greenstone.gatherer.util.Utility;
50import org.w3c.dom.*;
51/** This class stores the various configurable settings inside the Gatherer, both during a session, and between sessions in the form of XML. However not all data members are retained during xml serialization. To further improve efficiency, the property-name -> DOM Element pairs are stored in a SoftReferenced Hashtable.
52 * @author John Thompson, Greenstone Digital Library, University of Waikato
53 * @version 2.3
54 */
55public class Configuration
56 extends Hashtable {
57 public File exec_file;
58 /** The path (or url) to the webserver which is serving the Greenstone collection. */
59 public String exec_path = null;
60 /** The path to the Greenstone Suite installation directory. */
61 public String gsdl_path = "";
62 /** The path to the PERL executable, up to and including Perl.exe. */
63 public String perl_path = "";
64 /** The password for the proxy server indicated above. */
65 public String proxy_pass = null;
66 /** The username for the proxy server indicated above. */
67 public String proxy_user = null;
68 /** The screen size of the desktop the Gatherer will be displayed on. */
69 public Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize();
70 /** Collection level configuration (which in some cases overrides general configuration. */
71 private Document collection_config;
72 /** The general configuration settings. */
73 private Document general_config;
74 private int cache_hit = 0;
75 private int cache_miss = 0;
76 public URL exec_address = null;
77 /** The string identifying an argument's name attribute. */
78 static final private String ARGUMENT_NAME = "name";
79 /** The name of the general Gatherer configuration file. */
80 static final private String CONFIG_XML = "config.xml";
81 /** The name of the root element of the subtree containing gatherer configuration options. This is required as the document itself may contain several other subtrees of settings (such as in the case of a '.col' file). */
82 static final private String GATHERER_CONFIG = "GathererConfig";
83 /** The string identifying an argument element. */
84 static final private String GATHERER_CONFIG_ARGUMENT = "Argument";
85 /** The name of a Name Element. */
86 static final private String NAME = "Name";
87 /** The name of the other arguments element. */
88 static final private String OTHER = "Other";
89 /** The name of an information Element within the Other subtree. */
90 static final private String OTHER_INFO = "Info";
91 /** The name of the general Gatherer configuration template. */
92 static final private String TEMPLATE_CONFIG_XML = "xml/config.xml";
93 /** The first of two patterns used during tokenization, this pattern handles a comma separated list. */
94 static final private String TOKENIZER_PATTERN1 = " ,\n\t";
95 /** The second of two patterns used during tokenization, this pattern handles an underscore separated list. */
96 static final private String TOKENIZER_PATTERN2 = "_\n\t";
97 /** Constructor.
98 * @param gsdl_path The path to the Greenstone directory as a <strong>String</strong>.
99 * @param exec_path A <strong>String</strong> containing the path or url to the webserver serving the greenstone collections.
100 * @param perl_path The path to the PERL executable, as a <strong>String</strong>.
101 */
102 public Configuration(String gsdl_path, String exec_path, String perl_path) {
103 super();
104 this.gsdl_path = gsdl_path;
105 this.exec_path = exec_path;
106 // The exec_path may contain an url address, in which case we blindly use that and leave it up to the user to worry about settings and resetting.
107 System.err.println("EXEC_PATH = " + exec_path);
108 if(exec_path != null && exec_path.length() > 0) {
109 try {
110 exec_address = new URL(exec_path);
111 }
112 catch (MalformedURLException error) {
113 ///ystem.err.println("Not an address.");
114 }
115 }
116 // If the above failed, then its up to us to try and figure out what to do.
117 if(exec_address == null) {
118 // Try building a file from the given exec_path
119 try {
120 File local_file = new File(exec_path);
121 if(local_file.exists()) {
122 // All good. I hope.
123 exec_file = local_file;
124 }
125 else {
126 ///ystem.err.println("No local library at given file path.");
127 }
128 }
129 // All sorts of errors might be thrown by a bogus file path.
130 catch (Exception error) {
131 System.err.println("Not a valid file.");
132 }
133 // We can generate the path to where the local library should be and use that if it is there.
134 if(exec_file == null) {
135 File server_exe = new File(gsdl_path + Utility.SERVER_EXE);
136 if(server_exe.exists()) {
137 exec_file = server_exe;
138 }
139 else {
140 ///ystem.err.println("No local library.");
141 }
142 }
143 // If we get to here with no exec_address nor an exec_file its just plain not going to work.
144 }
145 else {
146 ///ystem.err.println("exec_address != null -> " + exec_address);
147 }
148 ///ystem.err.println("Perl path.");
149 this.perl_path = perl_path;
150 // Ensure the perl path includes exe under windoze
151 if(Utility.isWindows() && !perl_path.toLowerCase().endsWith(".exe")) {
152 if(!perl_path.endsWith(File.separator)) {
153 perl_path = perl_path + File.separator;
154 }
155 perl_path = perl_path + "perl.exe";
156 }
157 // Try to reload the configuration.
158 File config_xml = new File(CONFIG_XML);
159 if(config_xml.exists()) {
160 general_config = Utility.parse(CONFIG_XML, false);
161 }
162 // If that fails retrieve the default configuration file from our xml library, which I'll personally guarantee to work.
163 if(general_config == null) {
164 general_config = Utility.parse(TEMPLATE_CONFIG_XML, true);
165 Gatherer.println("Loaded default Gatherer configuration template.");
166 }
167 else {
168 Gatherer.println("Loaded current Gatherer configuration.");
169 }
170 // Re-establish the color settings.
171 updateUI();
172
173 System.err.println("EXEC_FILE = " + exec_file);
174 System.err.println("EXEC_ADDRESS = " + exec_address);
175 }
176
177 /** The default get action retrieves the named property from the desired configuration, and returns a true or false. */
178 public boolean get(String property, boolean general) {
179 String raw = getString(property, general);
180 return (raw != null && raw.equalsIgnoreCase("true"));
181 }
182
183 /** Retrieve all of the configuration preferences which match a certain string. They are returned as a hash map of property names to String objects. */
184 public HashMap getAll(String property_pattern, boolean general) {
185 HashMap properties = new HashMap();
186 try {
187 // Locate the appropriate element
188 Element document_element = null;
189 if(general) {
190 document_element = general_config.getDocumentElement();
191 }
192 else if(collection_config != null) {
193 document_element = collection_config.getDocumentElement();
194 }
195 if(document_element != null) {
196 // Retrieve the Gatherer element
197 Element gatherer_element = (Element) MSMUtils.getNodeFromNamed(document_element, GATHERER_CONFIG);
198 NodeList arguments = gatherer_element.getElementsByTagName(GATHERER_CONFIG_ARGUMENT);
199 for(int i = 0; i < arguments.getLength(); i++) {
200 Element argument_element = (Element) arguments.item(i);
201 if(argument_element.getAttribute(ARGUMENT_NAME).matches(property_pattern)) {
202 String result = MSMUtils.getValue(argument_element);
203 // Store a mapping in the cache. Sometimes we will overwrite an existing value (say for collection and general level workflow options) but the processing overhead of detecting these clashes far exceeds any savings.
204 put(argument_element.getAttribute(ARGUMENT_NAME) + general, new SoftReference(argument_element));
205 // Add mapping to the properties we're going to return
206 properties.put(argument_element.getAttribute(ARGUMENT_NAME), result);
207 }
208 }
209 }
210 }
211 catch(Exception error) {
212 }
213 return properties;
214 }
215
216 /** Retrieve the information subtree containing the arguments for the desired external program. If the program has marked superclasses append their arguments as well. */
217 public Element getArguments(String filename) {
218 Element argument_element = null;
219 try {
220 // Retrieve the other information subtree.
221 Element document_element = general_config.getDocumentElement();
222 Element other_element = (Element) MSMUtils.getNodeFromNamed(document_element, OTHER);
223 NodeList argument_elements = other_element.getElementsByTagName(OTHER_INFO);
224 for(int i = 0; argument_element == null && i < argument_elements.getLength(); i++) {
225 Element possible_element = (Element) argument_elements.item(i);
226 Element possible_name_element = (Element) MSMUtils.getNodeFromNamed(possible_element, NAME);
227 String possible_name = MSMUtils.getValue(possible_name_element);
228 ///ystem.err.println("Does " + possible_name + " equal " + filename);
229 if(possible_name.equalsIgnoreCase(filename)) {
230 argument_element = possible_element;
231 }
232 possible_name = null;
233 possible_name_element = null;
234 possible_element = null;
235 }
236 argument_elements = null;
237 other_element = null;
238 document_element = null;
239 }
240 catch(Exception error) {
241 }
242 return argument_element;
243 }
244
245 /** Retrieve the value of the named property as a Color. */
246 public Color getColor(String property, boolean general) {
247 Color result = Color.white; // Default
248 try {
249 String raw = getString(property, general);
250 // Color is a RGB triplet list, comma separated (also remove whitespace)
251 StringTokenizer tokenizer = new StringTokenizer(raw, TOKENIZER_PATTERN1);
252 int red = Integer.parseInt(tokenizer.nextToken());
253 int green = Integer.parseInt(tokenizer.nextToken());
254 int blue = Integer.parseInt(tokenizer.nextToken());
255 result = new Color(red, green, blue);
256 }
257 catch(Exception error) {
258 Gatherer.printStackTrace(error);
259 }
260 return result;
261 }
262
263 /** Retrieve the value of the named property as a Dimension. */
264 public Dimension getDimension(String property, boolean general) {
265 Dimension result = new Dimension(100, 100); // Default
266 try {
267 String raw = getString(property, general);
268 // Dimension is a width by height pair, comma separated (also remove whitespace)
269 StringTokenizer tokenizer = new StringTokenizer(raw, TOKENIZER_PATTERN1);
270 int width = Integer.parseInt(tokenizer.nextToken());
271 int height = Integer.parseInt(tokenizer.nextToken());
272 result = new Dimension(width, height);
273 }
274 catch(Exception error) {
275 Gatherer.printStackTrace(error);
276 }
277 return result;
278 }
279
280 /** Retrieve the value of the named property as a FontUIResource. */
281 public FontUIResource getFont(String property, boolean general) {
282 FontUIResource result = new FontUIResource("Times New Roman", Font.PLAIN, 10);
283 try {
284 String raw = getString(property, general);
285 // Font is a face, style, size triplet.
286 StringTokenizer tokenizer = new StringTokenizer(raw, TOKENIZER_PATTERN1);
287 String face = tokenizer.nextToken();
288 int style = Font.PLAIN;
289 String temp = tokenizer.nextToken().toUpperCase();
290 if(temp.equals("BOLD")) {
291 style = Font.BOLD;
292 }
293 else if(temp.equals("ITALIC")) {
294 style = Font.ITALIC;
295 }
296 int size = Integer.parseInt(tokenizer.nextToken());
297 result = new FontUIResource(face, style, size);
298 }
299 catch(Exception error) {
300 Gatherer.printStackTrace(error);
301 }
302 return result;
303 }
304
305 /** Retrieve the value of the named property as an integer. */
306 public int getInt(String property, boolean general) {
307 int result = -1;
308 try {
309 String raw = getString(property, general);
310 result = Integer.parseInt(raw);
311 }
312 catch(Exception error) {
313 Gatherer.printStackTrace(error);
314 }
315 return result;
316 }
317
318 /** Retrieve the value of the named property as a Locale. */
319 public Locale getLocale(String property, boolean general) {
320 Locale result = Locale.getDefault();
321 try {
322 String raw = getString(property, general);
323 // Locale is a underscore separated code.
324 StringTokenizer tokenizer = new StringTokenizer(raw, TOKENIZER_PATTERN2);
325 String language = tokenizer.nextToken();
326 String country = tokenizer.nextToken();
327 result = new Locale(language, country);
328 }
329 catch(Exception error) {
330 Gatherer.printStackTrace(error);
331 }
332 return result;
333 }
334
335 /** Retrieve the value of the named property, and noting whether we consult the general or collection specific configuration. */
336 public String getString(String property, boolean general) {
337 // Its up to this method to find the appropriate node and retrieve the data itself.
338 String result = "";
339 try {
340 // First of all we look in the cache to see if we have a match.
341 SoftReference reference = (SoftReference) get(property + general);
342 if(reference != null) {
343 Element argument_element = (Element) reference.get();
344 if(argument_element != null) {
345 cache_hit++;
346 result = MSMUtils.getValue(argument_element);
347 }
348 }
349 // We may have missed in the cache, or the reference may have been consumed.
350 if(result.length() == 0) {
351 cache_miss++;
352 // Locate the appropriate element
353 Element document_element = null;
354 if(general) {
355 document_element = general_config.getDocumentElement();
356 }
357 else if(collection_config != null) {
358 document_element = collection_config.getDocumentElement();
359 }
360 if(document_element != null) {
361 // Retrieve the Gatherer element
362 Element gatherer_element = (Element) MSMUtils.getNodeFromNamed(document_element, GATHERER_CONFIG);
363 NodeList arguments = gatherer_element.getElementsByTagName(GATHERER_CONFIG_ARGUMENT);
364 for(int i = 0; result.length() == 0 && i < arguments.getLength(); i++) {
365 Element argument_element = (Element) arguments.item(i);
366 if(argument_element.getAttribute(ARGUMENT_NAME).equalsIgnoreCase(property)) {
367 result = MSMUtils.getValue(argument_element);
368 // Store a mapping in the cache. Sometimes we will overwrite an existing value (say for collection and general level workflow options) but the processing overhead of detecting these clashes far exceeds any savings.
369 put(property + general, new SoftReference(argument_element));
370 }
371 }
372 }
373 }
374 }
375 catch (Exception error) {
376 Gatherer.printStackTrace(error);
377 }
378 // If we still have no result, and the search was made in the collection configuration, retrieve the general one instead.
379 if(result.length() == 0 && !general) {
380 result = getString(property, true);
381 }
382 return result;
383 }
384
385 /** Retrieve the path to the PERL scripts within the Greenstone directory.
386 * @return A <strong>String</strong> containing the path.
387 */
388 public String getScriptPath() {
389 return gsdl_path + "bin" + File.separator + "script" + File.separator;
390 }
391
392 /** Export the general configuration to file. */
393 public void save() {
394 ///ystem.err.println("Hits " + cache_hit + " vs Misses " + cache_miss);
395 Utility.export(general_config, Utility.BASE_DIR + CONFIG_XML);
396 }
397
398 /** Set the named property, from the specified configuration, using the given boolean value. */
399 public void set(String property, boolean general, boolean value) {
400 setString(property, general, (value ? "true" : "false"));
401 }
402
403 /** Add a subtree of argument information to the other arguments part of the general configuration. This overwrites any such existing subtree. */
404 public void setArguments(Element arguments_element) {
405 try {
406 Element document_element = general_config.getDocumentElement();
407 Element other_element = (Element) MSMUtils.getNodeFromNamed(document_element, OTHER);
408 // Retrieve the name of the information
409 Element arguments_name_element = (Element)MSMUtils.getNodeFromNamed(arguments_element, NAME);
410 String filename = MSMUtils.getValue(arguments_element);
411 // Find any argument information subtree starting with the same name
412 Element obsolete_arguments_element = getArguments(filename);
413 // Create a copy of the arguments_element within our tree (import).
414 Element our_arguments_element = (Element) general_config.importNode(arguments_element, true);
415 // Now we insert this new node into the tree. If a previous node exists we replace it instead.
416 if(obsolete_arguments_element == null) {
417 other_element.appendChild(our_arguments_element);
418 }
419 else {
420 other_element.replaceChild(our_arguments_element, obsolete_arguments_element);
421 }
422 our_arguments_element = null;
423 obsolete_arguments_element = null;
424 filename = null;
425 arguments_name_element = null;
426 other_element = null;
427 document_element = null;
428 }
429 catch (Exception error) {
430 Gatherer.println("Error in Configuration.setArguments(): " + error);
431 Gatherer.printStackTrace(error);
432 }
433 }
434
435 /** Set the collection configuration. */
436 public void setCollectionConfiguration(Document collection_config) {
437 this.collection_config = collection_config;
438 updateUI();
439 ///atherer.println("Collection configuration set.");
440 }
441
442 /** Set the named property, from the specified configuration, using the given Color value. */
443 public void setColor(String property, boolean general, Color value) {
444 StringBuffer text = new StringBuffer("");
445 text.append(value.getRed());
446 text.append(", ");
447 text.append(value.getGreen());
448 text.append(", ");
449 text.append(value.getBlue());
450 setString(property, general, text.toString());
451 }
452
453 /** Set the named property, from the specified configuration, using the given Dimension value. */
454 public void setDimension(String property, boolean general, Dimension value) {
455 StringBuffer text = new StringBuffer("");
456 text.append(value.width);
457 text.append(", ");
458 text.append(value.height);
459 setString(property, general, text.toString());
460 }
461
462 /** Set the named property, from the specified configuration, using the given Font value. */
463 public void setFont(String property, boolean general, Font value) {
464 StringBuffer text = new StringBuffer("");
465 text.append(value.getName());
466 text.append(", ");
467 switch(value.getStyle()) {
468 case Font.BOLD:
469 text.append("BOLD");
470 break;
471 case Font.ITALIC:
472 text.append("ITALIC");
473 break;
474 default:
475 text.append("PLAIN");
476 }
477 text.append(", ");
478 text.append(value.getSize());
479 setString(property, general, text.toString());
480 }
481
482 /** Set the named property, from the specified configuration, using the given integer value. */
483 public void setInt(String property, boolean general, int value) {
484 setString(property, general, String.valueOf(value));
485 }
486
487 /** Set the named property, from the specified configuration, using the given Locale value. */
488 public void setLocale(String property, boolean general, Locale value) {
489 StringBuffer text = new StringBuffer("");
490 text.append(value.getLanguage());
491 text.append("_");
492 text.append(value.getCountry());
493 setString(property, general, text.toString());
494 }
495
496 /** Sets the value of the named property argument using the given string. */
497 public void setString(String property, boolean general, String value) {
498 ///atherer.println("Set configuration property: " + property + " = " + value + (general ? "" : " [Collection]"));
499 try {
500 Document document = null;
501 if(general) {
502 document = general_config;
503 }
504 else if(collection_config != null) {
505 document = collection_config;
506 }
507 if(document != null) {
508 Element argument_element = null;
509 // Try to retrieve from cache
510 SoftReference reference = (SoftReference) get(property + general);
511 if(reference != null) {
512 argument_element = (Element) reference.get();
513 }
514 if(argument_element == null) {
515 Element document_element = document.getDocumentElement();
516 Element gatherer_element = (Element) MSMUtils.getNodeFromNamed(document_element, GATHERER_CONFIG);
517 NodeList arguments = document_element.getElementsByTagName(GATHERER_CONFIG_ARGUMENT);
518 boolean found = false;
519 for(int i = 0; argument_element == null && i < arguments.getLength(); i++) {
520 Element possible_element = (Element) arguments.item(i);
521 if(possible_element.getAttribute(ARGUMENT_NAME).equalsIgnoreCase(property)) {
522 argument_element = possible_element;
523 }
524 }
525 // If argument element is still null, create it in the target document.
526 if(argument_element == null) {
527 argument_element = document.createElement(GATHERER_CONFIG_ARGUMENT);
528 argument_element.setAttribute(ARGUMENT_NAME, property);
529 gatherer_element.appendChild(argument_element);
530 }
531 // Update cache
532 put(property + general, new SoftReference(argument_element));
533
534 }
535 if(value == null) {
536 value = "";
537 }
538 // Now remove any current text node children.
539 NodeList children = argument_element.getChildNodes();
540 for(int i = 0; i < children.getLength(); i++) {
541 argument_element.removeChild(children.item(i));
542 }
543 // Add a new text node child with the new value
544 argument_element.appendChild(document.createTextNode(value));
545 }
546 }
547 catch (Exception error) {
548 }
549 }
550
551 private void updateUI() {
552 // Buttons
553 UIManager.put("Button.select", new ColorUIResource(getColor("coloring.button_selected_background", false)));
554 UIManager.put("Button.background", new ColorUIResource(getColor("coloring.button_background", false)));
555 UIManager.put("Button.foreground", new ColorUIResource(getColor("coloring.button_foreground", false)));
556 UIManager.put("ToggleButton.background", new ColorUIResource(getColor("coloring.button_background", false)));
557 UIManager.put("ToggleButton.foreground", new ColorUIResource(getColor("coloring.button_foreground", false)));
558 UIManager.put("ToggleButton.select", new ColorUIResource(getColor("coloring.button_selected_background", false)));
559
560 // All the things with a lovely Collection green background
561 UIManager.put("OptionPane.background", new ColorUIResource(getColor("coloring.collection_heading_background", false)));
562 UIManager.put("Panel.background", new ColorUIResource(getColor("coloring.collection_heading_background", false)));
563 UIManager.put("Label.background", new ColorUIResource(getColor("coloring.collection_heading_background", false)));
564 UIManager.put("TabbedPane.background", new ColorUIResource(getColor("coloring.collection_heading_background", false)));
565 UIManager.put("SplitPane.background", new ColorUIResource(getColor("coloring.collection_heading_background", false)));
566 UIManager.put("CheckBox.background", new ColorUIResource(getColor("coloring.collection_heading_background", false)));
567
568 // Editable coloring
569 UIManager.put("ComboBox.background", new ColorUIResource(getColor("coloring.button_background", false))); // Indicate clickable
570 UIManager.put("Tree.background", new ColorUIResource(getColor("coloring.collection_tree_background", false)));
571 UIManager.put("Tree.textBackground", new ColorUIResource(getColor("coloring.collection_tree_background", false)));
572 UIManager.put("ProgressBar.background", new ColorUIResource(getColor("coloring.collection_tree_background", false)));
573 UIManager.put("TextArea.background", new ColorUIResource(getColor("coloring.collection_tree_background", false)));
574 UIManager.put("TextField.background", new ColorUIResource(getColor("coloring.collection_tree_background", false)));
575 UIManager.put("Table.background", new ColorUIResource(getColor("coloring.collection_tree_background", false)));
576
577 // Selection color
578 UIManager.put("TabbedPane.selected", new ColorUIResource(getColor("coloring.collection_selection_background", false)));
579 UIManager.put("Tree.selectionBackground", new ColorUIResource(getColor("coloring.collection_selection_background", false)));
580 UIManager.put("ComboBox.selectionBackground", new ColorUIResource(getColor("coloring.collection_selection_background", false)));
581 UIManager.put("ProgressBar.selectionBackground", new ColorUIResource(getColor("coloring.collection_selection_background", false)));
582 UIManager.put("TextArea.selectionBackground", new ColorUIResource(getColor("coloring.collection_selection_background", false)));
583 UIManager.put("TextField.selectionBackground", new ColorUIResource(getColor("coloring.collection_selection_background", false)));
584
585 // Scroll bar stuff
586 UIManager.put("ScrollBar.background", new ColorUIResource(getColor("coloring.scrollbar_background", false)));
587 UIManager.put("ScrollBar.thumb", new ColorUIResource(getColor("coloring.scrollbar_foreground", false)));
588 if(Gatherer.g_man != null) {
589 JPanel pane = (JPanel) Gatherer.g_man.getContentPane();
590 pane.updateUI();
591 // Also update all of the tabs according to workflow.
592 Gatherer.g_man.workflowUpdate("Browser", get("workflow.browse", false));
593 Gatherer.g_man.workflowUpdate("Mirroring", get("workflow.mirror", false));
594 Gatherer.g_man.workflowUpdate("Collection", get("workflow.gather", false));
595 Gatherer.g_man.workflowUpdate("MetaEdit", get("workflow.enrich", false));
596 Gatherer.g_man.workflowUpdate("Build", get("workflow.design", false));
597 Gatherer.g_man.workflowUpdate("Export", get("workflow.export", false));
598 Gatherer.g_man.workflowUpdate("Create", get("workflow.create", false));
599 Gatherer.g_man.workflowUpdate("Preview", get("workflow.preview", false));
600 }
601 }
602}
Note: See TracBrowser for help on using the repository browser.