Changeset 5529
- Timestamp:
- 2003-09-24T16:09:13+12:00 (21 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/Configuration.java
r5164 r5529 660 660 JPanel pane = (JPanel) Gatherer.g_man.getContentPane(); 661 661 pane.updateUI(); 662 663 Gatherer.g_man.workflowUpdate(" Browser", get("workflow.browse", false));664 Gatherer.g_man.workflowUpdate("Mirror ing", get("workflow.mirror", false));665 Gatherer.g_man.workflowUpdate(" Collection", get("workflow.gather", false));666 Gatherer.g_man.workflowUpdate(" MetaEdit", get("workflow.enrich", false));667 Gatherer.g_man.workflowUpdate(" Build", get("workflow.design", false));662 // Also update all of the tabs according to workflow. 663 Gatherer.g_man.workflowUpdate("Hunt", get("workflow.browse", false)); 664 Gatherer.g_man.workflowUpdate("Mirror", get("workflow.mirror", false)); 665 Gatherer.g_man.workflowUpdate("Gather", get("workflow.gather", false)); 666 Gatherer.g_man.workflowUpdate("Enrich", get("workflow.enrich", false)); 667 Gatherer.g_man.workflowUpdate("Design", get("workflow.design", false)); 668 668 Gatherer.g_man.workflowUpdate("Export", get("workflow.export", false)); 669 669 Gatherer.g_man.workflowUpdate("Create", get("workflow.create", false)); -
trunk/gli/src/org/greenstone/gatherer/Dictionary.java
r5527 r5529 36 36 *######################################################################## 37 37 */ 38 import java.awt.Component; 38 39 import java.io.*; 39 40 import java.util.*; … … 42 43 import javax.swing.text.*; 43 44 import javax.swing.tree.*; 45 import org.greenstone.gatherer.gui.GComboBox; 44 46 import org.greenstone.gatherer.gui.border.TitledBorder; 45 47 import org.greenstone.gatherer.util.DictionaryTreeNode; … … 192 194 } 193 195 196 197 static public String newget(String key) 198 { 199 return self.get(key); 200 } 201 202 203 static public String newget(String key, String[] args) 204 { 205 return self.get(key, args); 206 } 207 208 194 209 /** Overloaded to call get with both a key and an empty argument array. 195 196 197 210 * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle. 211 * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call. 212 */ 198 213 public String get(String key) { 199 214 return get(key, (String[])null); … … 219 234 try { 220 235 String initial = dictionary.getString(key); 221 236 // If the string contains arguments we have to insert them. 222 237 String complete = ""; 223 238 // While we still have initial string left. 224 239 while(initial.length() > 0 && initial.indexOf('{') != -1 && initial.indexOf('}') != -1) { 225 240 // Remove preamble … … 261 276 } 262 277 } 278 263 279 /** Retrieve the two letter code of the current language we are using, according to the stored locale. 264 265 280 * @return A <strong>String</strong> containing the two letter ISO639 language code. 281 */ 266 282 public String getLanguage() { 267 283 return locale.getLanguage(); 268 284 } 269 /** Register an abstract button component. */ 270 public void register(AbstractButton component, String[] args, boolean already_registered) { 285 286 287 static public void setBoth(Component component, String text_key, String tooltip_key) 288 { 289 self.oldSetBoth(component, text_key, null, tooltip_key); 290 } 291 292 293 static public void setText(Component component, String text_key) 294 { 295 self.oldSetText(component, text_key, null); 296 } 297 298 299 static public void setText(Component component, String text_key, String[] args) 300 { 301 self.oldSetText(component, text_key, args); 302 } 303 304 305 static public void setTooltip(Component component, String tooltip_key) 306 { 307 self.oldSetTooltip(component, tooltip_key); 308 } 309 310 311 private void oldSetBoth(Component component, String text_key, String[] args, String tooltip_key) 312 { 313 oldSetText(component, text_key, args); 314 oldSetTooltip(component, tooltip_key); 315 } 316 317 318 private void oldSetText(Component component, String text_key, String[] args) 319 { 320 if (component != null) { 321 // Update the component's details 322 ComponentDetails details = (ComponentDetails) remove(component); 323 if (details == null) { 324 details = new ComponentDetails(true, text_key, args, false, null); 325 } 326 else { 327 details.has_text = true; 328 details.text_key = text_key; 329 details.text_args = args; 330 } 331 put(component, details); 332 333 // Update the component using the AWTEvent queue 334 RegisteredComponentUpdateTask task = new RegisteredComponentUpdateTask(component); 335 SwingUtilities.invokeLater(task); 336 } 337 } 338 339 340 private void oldSetTooltip(Component component, String tooltip_key) 341 { 342 if (component != null) { 343 // Update the component's details 344 ComponentDetails details = (ComponentDetails) remove(component); 345 if (details == null) { 346 details = new ComponentDetails(false, null, null, true, tooltip_key); 347 } 348 else { 349 details.has_tooltip = true; 350 details.tooltip_key = tooltip_key; 351 } 352 put(component, details); 353 354 // Update the component using the AWTEvent queue 355 RegisteredComponentUpdateTask task = new RegisteredComponentUpdateTask(component); 356 SwingUtilities.invokeLater(task); 357 } 358 } 359 360 361 private class ComponentDetails 362 { 363 public boolean has_text; 364 public String text_key; 365 public String[] text_args; 366 public boolean has_tooltip; 367 public String tooltip_key; 368 369 public ComponentDetails(boolean has_text, String text_key, String[] text_args, 370 boolean has_tooltip, String tooltip_key) 371 { 372 this.has_text = has_text; 373 this.text_key = text_key; 374 this.text_args = text_args; 375 this.has_tooltip = has_tooltip; 376 this.tooltip_key = tooltip_key; 377 } 378 } 379 380 381 private class RegisteredComponentUpdateTask 382 implements Runnable { 383 384 private Component component; 385 private ComponentDetails details; 386 private String text = null; 387 private String tooltip = null; 388 389 public RegisteredComponentUpdateTask(Component component) 390 { 391 this.component = component; 392 this.details = (ComponentDetails) get(component); 393 394 if (details.has_text) { 395 text = get(details.text_key, details.text_args); 396 } 397 if (details.has_tooltip) { 398 tooltip = get(details.tooltip_key, (String[]) null); 399 } 400 } 401 402 403 public void run() 404 { 405 // If the component has text 406 if (text != null) { 407 if (component instanceof AbstractButton) { 408 ((AbstractButton) component).setText(text); 409 } 410 else if (component instanceof JDialog) { 411 ((JDialog) component).setTitle(text); 412 } 413 else if (component instanceof JLabel) { 414 ((JLabel) component).setText(text); 415 } 416 else if (component instanceof JTextComponent) { 417 ((JTextComponent) component).setText(text); 418 } 419 else { 420 System.err.println("Unhandled component: " + component.getClass()); 421 } 422 } 423 424 // If the component has a tooltip 425 if (tooltip != null) { 426 if (component instanceof JComponent) { 427 ((JComponent) component).setToolTipText(tooltip); 428 } 429 } 430 } 431 } 432 433 434 /** 435 * @deprecated 436 * Register an abstract button component */ 437 public void register(AbstractButton component, String[] args, boolean already_registered) 438 { 271 439 if(component != null) { 272 440 // Determine the key … … 290 458 } 291 459 } 292 /** Register a combobox component. */ 460 461 /** 462 * @deprecated 463 * Register a JCheckBox component */ 464 public void register(JCheckBox component, String[] args, boolean already_registered) 465 { 466 } 467 468 /** 469 * @deprecated 470 * Register a combobox component. */ 293 471 public void register(JComboBox component, String[] args, boolean already_registered) { 294 472 if(component != null) { … … 317 495 } 318 496 } 319 /** Register a dialog component. */ 497 498 /** 499 * @deprecated 500 * Register a dialog component. */ 320 501 public void register(JDialog component, String[] args, boolean already_registered) { 321 502 if(component != null) { … … 339 520 } 340 521 } 341 /** Register a frame component. */ 522 523 /** 524 * @deprecated 525 * Register a frame component. */ 342 526 public void register(JFrame component, String[] args, boolean already_registered) { 343 527 if(component != null) { … … 361 545 } 362 546 } 363 /** Register a label component. */ 547 548 /** 549 * @deprecated 550 * Register a label component. */ 364 551 public void register(JLabel component, String[] args, boolean already_registered) { 365 552 if(component != null) { … … 383 570 } 384 571 } 385 /** Register a tab pane component. */ 572 573 /** 574 * @deprecated 575 * Register a tab pane component. */ 386 576 public void register(JTabbedPane component, String[] args, boolean already_registered) { 387 577 if(component != null) { … … 407 597 } 408 598 409 /** Register a text component. */ 599 /** 600 * @deprecated 601 * Register a text component. */ 410 602 public void register(JTextComponent component, String[] args, boolean already_registered) 411 603 { … … 433 625 } 434 626 435 /** Register a tree component. */ 627 /** 628 * @deprecated 629 * Register a tree component. */ 436 630 public void register(JTree component, String[] args, boolean already_registered) { 437 631 if(component != null) { … … 457 651 } 458 652 } 459 /** Register a titled border component. */ 653 654 /** 655 * @deprecated 656 * Register a titled border component. */ 460 657 public void register(TitledBorder component, String[] args, boolean already_registered) { 461 658 if(component != null) { … … 479 676 } 480 677 } 678 481 679 /** A get method called internally by components that have been previously been registered, which means that arg[index] is the original key value. Index is usually the last entry in the array, however this is not true for comboboxes, tabbed panes and trees. */ 482 680 private String get(String[] args, int index) { 483 681 return get(args[index], args); 484 682 } 683 485 684 486 685 private abstract class ChangeTask … … 495 694 } 496 695 } 696 497 697 /** Update the text and tooltip for this button. */ 498 698 private class AbstractButtonChangeTask … … 507 707 public void run() { 508 708 component.setText(value); 509 if(!tooltip.equals(key+"_Tooltip")) {510 511 }512 else {513 514 }709 // if(!tooltip.equals(key+"_Tooltip")) { 710 component.setToolTipText(tooltip); 711 // } 712 // else { 713 // component.setToolTipText(null); 714 // } 515 715 } 516 716 } … … 568 768 } 569 769 } 770 570 771 /** Update the text of this label. */ 571 772 private class JLabelChangeTask 572 773 extends ChangeTask { 573 774 private JLabel component; 775 574 776 public JLabelChangeTask(JLabel component, String key, String value) { 575 777 super(key, value); 576 778 this.component = component; 577 779 } 780 578 781 public void run() { 579 782 component.setText(value); 580 783 } 581 784 } 785 582 786 /** Updates a tabbed panes tab title and tooltip. */ 583 787 private class JTabbedPaneChangeTask … … 666 870 } 667 871 } 668 669 670 671 -
trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java
r5357 r5529 25 25 *######################################################################## 26 26 */ 27 27 28 package org.greenstone.gatherer.cdm; 29 28 30 import java.awt.*; 29 31 import java.awt.event.*; … … 70 72 // Creation 71 73 JPanel tree_pane = new JPanel(); 72 JLabel title = new JLabel(get("CDM.GUI.Design_Topics")); 74 JLabel title = new JLabel(); 75 Gatherer.dictionary.setText(title, "CDM.GUI.Design_Topics", null); 73 76 tree = new DesignTree(); 74 77 view = controls; … … 106 109 /** Refresh the values on our controls that could be stale due to changes in other components. */ 107 110 public void gainFocus() { 108 if (view != null) {111 if (view != null) { 109 112 view.gainFocus(); 110 113 } … … 113 116 /** Saves the state of the controls in the current view. */ 114 117 public void loseFocus() { 115 if (view != null) {118 if (view != null) { 116 119 view.loseFocus(); 117 120 } 118 }119 120 /** Overloaded to call get with both a key and an empty argument array.121 * @param key a String which is mapped to a key within the dictionary122 * @return a String which has been referenced by the key and that either contains no argument fields, or has had the argument fields automatically populated with arguments provided in the get call123 */124 private String get(String key) {125 return get(key, null);126 }127 128 /** Used to retrieve a property value from the Locale specific ResourceBundle, based upon the key and arguments supplied. If the key cannot be found or if some other part of the call fails a default (English) error message is returned. <BR>129 * Here the get recieves a second argument which is an array of Strings used to populate argument fields, denoted {<I>n</I>}, within the value String returned. Note that argument numbers greater than or equal to 32 are automatically mapped to the formatting String named Farg<I>n</I>.130 * @param key A <strong>String</strong> which is mapped to a initial String within the ResourceBundle.131 * @param args A <strong>String[]</strong> used to populate argument fields within the complete String.132 * @return A <strong>String</strong> which has been referenced by the key String and that either contains no argument fields, or has had the argument fields automatiically populated with formatting Strings of with argument String provided in the get call.133 * @see org.greenstone.gatherer.Gatherer134 * @see org.greenstone.gatherer.Dictionary135 */136 private String get(String key, String args[]) {137 if(key.indexOf('.') == -1) {138 key = "CDM.GUI." + key;139 }140 return Gatherer.dictionary.get(key, args);141 121 } 142 122 … … 191 171 beta_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getBeta()); 192 172 public_collectionmeta = new CollectionMeta(CollectionDesignManager.collect_config.getPublic()); 193 173 194 174 // Creation 195 175 JPanel instruction_panel = new JPanel(); 196 title_label = new JLabel( "CDM.General.Title");176 title_label = new JLabel(); 197 177 title_label.setHorizontalAlignment(JLabel.CENTER); 198 instructions_textarea = new JTextArea("CDM.General.Instructions"); 178 Gatherer.dictionary.setText(title_label, "CDM.General.Title", null); 179 180 instructions_textarea = new JTextArea(); 199 181 instructions_textarea.setCaretPosition(0); 200 182 instructions_textarea.setEditable(false); … … 202 184 instructions_textarea.setRows(6); 203 185 instructions_textarea.setWrapStyleWord(true); 186 Gatherer.dictionary.setText(instructions_textarea, "CDM.General.Instructions", null); 204 187 205 188 JPanel all_details_panel = new JPanel(); 206 189 JPanel details_panel = new JPanel(); 207 190 JPanel creator_panel = new JPanel(); 208 creator_label = new JLabel( "CDM.General.Email.Creator");191 creator_label = new JLabel(); 209 192 creator_label.setPreferredSize(LABEL_SIZE); 193 Gatherer.dictionary.setText(creator_label, "CDM.General.Email.Creator", null); 194 210 195 creator_emailfield = new EmailField(Gatherer.config.getColor("coloring.error_background", false)); 196 Gatherer.dictionary.setTooltip(creator_emailfield, "CDM.General.Email.Creator_Tooltip"); 197 211 198 JPanel maintainer_panel = new JPanel(); 212 maintainer_label = new JLabel( "CDM.General.Email.Maintainer");199 maintainer_label = new JLabel(); 213 200 maintainer_label.setPreferredSize(LABEL_SIZE); 201 Gatherer.dictionary.setText(maintainer_label, "CDM.General.Email.Maintainer", null); 202 214 203 maintainer_emailfield = new EmailField(Gatherer.config.getColor("coloring.error_background", false)); 215 public_checkbox = new JCheckBox("CDM.General.Access", public_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR)); 216 beta_checkbox = new JCheckBox("CDM.General.Beta", beta_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR)); 204 Gatherer.dictionary.setTooltip(maintainer_emailfield, "CDM.General.Email.Maintainer_Tooltip"); 205 public_checkbox = new JCheckBox("", public_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR)); 206 Gatherer.dictionary.setText(public_checkbox, "CDM.General.Access", null); 207 beta_checkbox = new JCheckBox("", beta_collectionmeta.getValue(CollectionMeta.TEXT).equals(CollectionConfiguration.TRUE_STR)); 208 Gatherer.dictionary.setText(beta_checkbox, "CDM.General.Beta", null); 217 209 JPanel name_panel = new JPanel(); 218 name_label = new JLabel( "CDM.General.Collection_Name");210 name_label = new JLabel(); 219 211 name_label.setPreferredSize(LABEL_SIZE); 220 name_textfield = new JTextField(); 212 Gatherer.dictionary.setText(name_label, "CDM.General.Collection_Name", null); 213 name_textfield = new JTextField("CDM.General.Collection_Name"); 214 Gatherer.dictionary.setTooltip(name_textfield, "CDM.General.Collection_Name_Tooltip"); 221 215 JPanel icon_panel = new JPanel(); 222 icon_label = new JLabel( "CDM.General.Icon_Collection");216 icon_label = new JLabel(); 223 217 icon_label.setPreferredSize(LABEL_SIZE); 224 icon_textfield = new JTextField(); 218 Gatherer.dictionary.setText(icon_label, "CDM.General.Icon_Collection", null); 219 icon_textfield = new JTextField("CDM.General.Icon_Collection"); 220 Gatherer.dictionary.setTooltip(icon_textfield, "CDM.General.Icon_Collection_Tooltip"); 225 221 JPanel small_icon_panel = new JPanel(); 226 222 small_icon_label = new JLabel("CDM.General.Icon_Collection_Small"); 227 223 small_icon_label.setPreferredSize(LABEL_SIZE); 228 small_icon_textfield = new JTextField(); 224 Gatherer.dictionary.setText(small_icon_label, "CDM.General.Icon_Collection_Small", null); 225 small_icon_textfield = new JTextField("CDM.General.Icon_Collection_Small"); 226 Gatherer.dictionary.setTooltip(small_icon_textfield, "CDM.General.Icon_Collection_Small_Tooltip"); 229 227 JPanel description_panel = new JPanel(); 230 description_label = new JLabel( "CDM.General.Collection_Extra");228 description_label = new JLabel(); 231 229 description_label.setPreferredSize(LABEL_SIZE); 230 Gatherer.dictionary.setText(description_label, "CDM.General.Collection_Extra", null); 232 231 description_textarea = new JTextArea(); 233 232 description_textarea.setBackground(Gatherer.config.getColor("coloring.editable_background", false)); 233 Gatherer.dictionary.setTooltip(description_textarea, "CDM.General.Collection_Extra_Tooltip"); 234 234 // Connection 235 235 beta_checkbox.addActionListener(CollectionDesignManager.change_listener); … … 241 241 name_textfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener); 242 242 small_icon_textfield.getDocument().addDocumentListener(CollectionDesignManager.change_listener); 243 Gatherer.dictionary.register(beta_checkbox, null, false); 244 Gatherer.dictionary.register(creator_label, null, false); 245 Gatherer.dictionary.register(description_label, null, false); 246 Gatherer.dictionary.register(icon_label, null, false); 247 Gatherer.dictionary.register(instructions_textarea, null, false); 248 Gatherer.dictionary.register(maintainer_label, null, false); 249 Gatherer.dictionary.register(name_label, null, false); 250 Gatherer.dictionary.register(public_checkbox, null, false); 251 Gatherer.dictionary.register(small_icon_label, null, false); 252 Gatherer.dictionary.register(title_label, null, false); 243 253 244 // Layout 254 245 instruction_panel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); … … 299 290 add(all_details_panel, BorderLayout.CENTER); 300 291 } 292 301 293 /** Destructor. */ 302 294 public void destroy() { 303 Gatherer.dictionary.deregister(beta_checkbox); 304 Gatherer.dictionary.deregister(creator_label); 305 Gatherer.dictionary.deregister(description_label); 306 Gatherer.dictionary.deregister(icon_label); 307 Gatherer.dictionary.deregister(instructions_textarea); 308 Gatherer.dictionary.deregister(maintainer_label); 309 Gatherer.dictionary.deregister(name_label); 310 Gatherer.dictionary.deregister(public_checkbox); 311 Gatherer.dictionary.deregister(small_icon_label); 312 Gatherer.dictionary.deregister(title_label); 313 } 295 } 296 314 297 /** Called to refresh the components. */ 315 298 public void gainFocus() { … … 361 344 public DesignTree() { 362 345 super(); 363 root = new DesignNode(" CDM.GUI.Root");346 root = new DesignNode("Root"); 364 347 this.setModel(new DefaultTreeModel(root)); 365 348 // Now add the design categories. … … 390 373 /** Constructor. 391 374 * @param object The <strong>Object</strong> assigned to this node. 392 375 */ 393 376 public DesignNode(String object) { 394 377 super(object); … … 398 381 */ 399 382 public String toString() { 400 return get((String)getUserObject());383 return Gatherer.dictionary.get("CDM.GUI." + (String)getUserObject()); 401 384 } 402 385 } -
trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java
r5342 r5529 145 145 } 146 146 if(plugin.getName().equals(StaticStrings.ARCPLUG_STR) || plugin.getName().equals(StaticStrings.RECPLUG_STR)) { 147 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.Fixed"),get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);147 JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.Move.Fixed"), Gatherer.dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE); 148 148 return; 149 149 } … … 182 182 if(index < 0) { 183 183 String args[] = new String[2]; 184 args[0] = get("CDM.PlugInManager.PlugIn_Str");184 args[0] = Gatherer.dictionary.get("CDM.PlugInManager.PlugIn_Str"); 185 185 args[1] = plugin.getName(); 186 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.At_Top", args),get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);186 JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.Move.At_Top", args), Gatherer.dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE); 187 187 return; 188 188 } … … 197 197 String args[] = new String[1]; 198 198 args[0] = plugin.getName(); 199 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.Move.Cannot", args),get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE);199 JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.Move.Cannot", args), Gatherer.dictionary.get("CDM.Move.Title"), JOptionPane.ERROR_MESSAGE); 200 200 // Still not going to move RecPlug or ArcPlug. 201 201 return; … … 279 279 } 280 280 281 /* Retrieve a phrase from the dictionary based on a certain key.282 * @param key The search <strong>String</strong>.283 * @return The matching phrase from the Dictionary.284 */285 private String get(String key) {286 return get(key, (String[])null);287 }288 289 private String get(String key, String arg) {290 String args[] = new String[1];291 args[0] = arg;292 return get(key, args);293 }294 295 /* Retrieve a phrase from the dictionary based on a certain key and arguments.296 * @param key The search <strong>String</strong>.297 * @param args A <strong>String[]</strong> of arguments used to complete and format the choosen phrase.298 * @return The matching phrase from the Dictionary.299 */300 private String get(String key, String args[]) {301 if(key.indexOf(".") == -1) {302 key = "CDM.PlugInManager." + key;303 }304 return Gatherer.dictionary.get(key, args);305 }306 281 307 282 /** Retrieve a list of those plugins that are in library but not in the assigned plugins. */ … … 398 373 String plugin_name = getPlugInName(plugin); 399 374 //Gatherer.println("Zero length argument xml detected for: " + plugin_name); 400 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin_name),get("General.Error"), JOptionPane.ERROR_MESSAGE);375 JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.PlugInManager.PlugIn_XML_Parse_Failed", plugin_name), Gatherer.dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 401 376 } 402 377 } … … 435 410 if(files != null) { 436 411 // Create a progress indicator. 437 ParsingProgress progress = new ParsingProgress( get("CDM.PlugInManager.Parsing.Title"),get("CDM.PlugInManager.Parsing.Message"), files.length);412 ParsingProgress progress = new ParsingProgress(Gatherer.dictionary.get("CDM.PlugInManager.Parsing.Title"), Gatherer.dictionary.get("CDM.PlugInManager.Parsing.Message"), files.length); 438 413 for(int i = 0; i < files.length; i++) { 439 414 // We only want to check Perl Modules. … … 565 540 /** The area where the add, configure and remove buttons are placed. */ 566 541 private JPanel button_pane = null; 567 /** The region which divides the central portion of the view into list and controls .*/542 /** The region which divides the central portion of the view into list and controls */ 568 543 private JPanel central_pane = null; 569 544 /** The area where title label and instructions sit. */ … … 577 552 /** The text area containing instructions on the use of this control. */ 578 553 private JTextArea instructions = null; 554 579 555 /** Constructor. 580 556 */ 581 557 public PlugInControl() { 582 558 // Create 583 add = new JButton( get("CDM.PlugInManager.Add"));559 add = new JButton(); 584 560 add.setMnemonic(KeyEvent.VK_A); 561 Gatherer.dictionary.setBoth(add, "CDM.PlugInManager.Add", "CDM.PlugInManager.Add_Tooltip"); 562 585 563 button_pane = new JPanel(); 586 564 central_pane = new JPanel(); 587 configure = new JButton(get("CDM.PlugInManager.Configure")); 565 566 configure = new JButton(); 588 567 configure.setEnabled(false); 589 568 configure.setMnemonic(KeyEvent.VK_C); 569 Gatherer.dictionary.setBoth(configure, "CDM.PlugInManager.Configure", "CDM.PlugInManager.Configure_Tooltip"); 570 590 571 header_pane = new JPanel(); 591 instructions = new JTextArea(get("CDM.PlugInManager.Instructions")); 572 573 instructions = new JTextArea(); 592 574 instructions.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 593 575 instructions.setEditable(false); … … 595 577 instructions.setRows(6); 596 578 instructions.setWrapStyleWord(true); 597 598 move_top_button = new DoubleImageButton(get("CDM.Move.Move_Top"), Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif")); 579 Gatherer.dictionary.setText(instructions, "CDM.PlugInManager.Instructions", null); 580 581 move_top_button = new DoubleImageButton("", Utility.getImage("arrow-top.gif"), Utility.getImage("arrow-top-disabled.gif")); 599 582 move_top_button.setEnabled(false); 600 583 move_top_button.setMnemonic(KeyEvent.VK_T); 601 move_top_button.setDisplayedMnemonicIndex(8); // !! English-centric hack584 // move_top_button.setDisplayedMnemonicIndex(8); // !! English-centric hack 602 585 move_top_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 603 604 move_up_button = new DoubleImageButton(get("CDM.Move.Move_Up"), Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif")); 586 Gatherer.dictionary.setBoth(move_top_button, "CDM.Move.Move_Top", "CDM.Move.Move_Top_Tooltip"); 587 588 move_up_button = new DoubleImageButton("", Utility.getImage("arrow-up.gif"), Utility.getImage("arrow-up-disabled.gif")); 605 589 move_up_button.setEnabled(false); 606 590 move_up_button.setMnemonic(KeyEvent.VK_U); 607 591 move_up_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 608 609 move_down_button = new DoubleImageButton(get("CDM.Move.Move_Down"), Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif")); 592 Gatherer.dictionary.setBoth(move_up_button, "CDM.Move.Move_Up", "CDM.Move.Move_Up_Tooltip"); 593 594 move_down_button = new DoubleImageButton("", Utility.getImage("arrow-down.gif"), Utility.getImage("arrow-down-disabled.gif")); 610 595 move_down_button.setEnabled(false); 611 596 move_down_button.setMnemonic(KeyEvent.VK_D); 612 597 move_down_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 613 614 move_bottom_button = new DoubleImageButton(get("CDM.Move.Move_Bottom"), Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif")); 598 Gatherer.dictionary.setBoth(move_down_button, "CDM.Move.Move_Down", "CDM.Move.Move_Down_Tooltip"); 599 600 move_bottom_button = new DoubleImageButton("", Utility.getImage("arrow-bottom.gif"), Utility.getImage("arrow-bottom-disabled.gif")); 615 601 move_bottom_button.setEnabled(false); 616 602 move_bottom_button.setMnemonic(KeyEvent.VK_B); 617 603 move_bottom_button.setPreferredSize(Utility.DOUBLE_IMAGE_BUTTON_SIZE); 604 Gatherer.dictionary.setBoth(move_bottom_button, "CDM.Move.Move_Bottom", "CDM.Move.Move_Bottom_Tooltip"); 618 605 619 606 movement_pane = new JPanel(); … … 626 613 plugin.setTextNonSelectionColor(Gatherer.config.getColor("coloring.workspace_tree_foreground", false)); 627 614 plugin.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false)); 628 629 plugin_label = new JLabel(get("CDM.PlugInManager.PlugIn")); 615 Gatherer.dictionary.setTooltip(plugin, "CDM.PlugInManager.PlugIn_Tooltip"); 616 617 plugin_label = new JLabel(); 618 Gatherer.dictionary.setText(plugin_label, "CDM.PlugInManager.PlugIn", null); 619 630 620 plugin_list = new JList(model); 631 621 plugin_list.setCellRenderer(new ListRenderer()); 632 622 plugin_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 633 plugin_list_label = new JLabel( get("CDM.PlugInManager.Assigned"));623 plugin_list_label = new JLabel(); 634 624 plugin_list_label.setHorizontalAlignment(JLabel.CENTER); 635 625 plugin_list_label.setOpaque(true); 626 Gatherer.dictionary.setText(plugin_list_label, "CDM.PlugInManager.Assigned", null); 627 636 628 plugin_list_pane = new JPanel(); 637 629 plugin_pane = new JPanel(); 638 remove = new JButton(get("CDM.PlugInManager.Remove")); 630 631 remove = new JButton(); 639 632 remove.setEnabled(false); 640 633 remove.setMnemonic(KeyEvent.VK_R); 641 title = new JLabel(get("CDM.PlugInManager.Title")); 634 Gatherer.dictionary.setBoth(remove, "CDM.PlugInManager.Remove", "CDM.PlugInManager.Remove_Tooltip"); 635 636 title = new JLabel(); 642 637 title.setHorizontalAlignment(JLabel.CENTER); 643 638 title.setOpaque(true); 639 Gatherer.dictionary.setText(title, "CDM.PlugInManager.Title", null); 640 644 641 // Listeners 645 642 add.addActionListener(new AddListener()); … … 653 650 plugin_list.addMouseListener(new ClickListener()); 654 651 plugin_list.addListSelectionListener(new ListListener()); 652 655 653 // Layout 656 654 title.setBorder(BorderFactory.createEmptyBorder(0,0,2,0)); … … 683 681 plugin_pane.add(plugin); 684 682 683 button_pane.setLayout(new GridLayout(1,3)); 684 button_pane.add(add); 685 button_pane.add(configure); 686 button_pane.add(remove); 687 685 688 // Scope these mad bordering skillz. 689 // !! TO DO: Dictionary registration !! 686 690 JPanel temp = new JPanel(new BorderLayout()); 687 691 temp.setBorder … … 689 693 (BorderFactory.createEmptyBorder(5,0,5,0), 690 694 BorderFactory.createCompoundBorder 691 (BorderFactory.createTitledBorder( get("CDM.PlugInManager.Controls")),695 (BorderFactory.createTitledBorder(Gatherer.dictionary.get("CDM.PlugInManager.Controls")), 692 696 BorderFactory.createEmptyBorder(2,2,2,2)))); 693 697 … … 698 702 central_pane.add(plugin_list_pane, BorderLayout.CENTER); 699 703 central_pane.add(temp, BorderLayout.SOUTH); 700 701 button_pane.setLayout(new GridLayout(1,3));702 button_pane.add(add);703 button_pane.add(configure);704 button_pane.add(remove);705 704 706 705 setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); … … 708 707 add(header_pane, BorderLayout.NORTH); 709 708 add(central_pane, BorderLayout.CENTER); 710 //add(button_pane, BorderLayout.SOUTH);711 } 709 } 710 712 711 /** Method which acts like a destructor, tidying up references to persistant objects. 713 712 */ … … 725 724 726 725 public void loseFocus() { 727 728 726 } 729 727 … … 770 768 } 771 769 else { 772 JOptionPane.showMessageDialog(Gatherer.g_man, get("CDM.PlugInManager.PlugIn_Exists"),get("General.Error"), JOptionPane.ERROR_MESSAGE);770 JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("CDM.PlugInManager.PlugIn_Exists"), Gatherer.dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 773 771 } 774 772 base_plugin = null; … … 930 928 */ 931 929 static private JPanel getSeparator() { 932 // we put the separator inside a panel to control 933 // its appearance 930 // We put the separator inside a panel to control its appearance 934 931 JPanel _sepPanel = new JPanel(); 935 932 _sepPanel.setOpaque(false); -
trunk/gli/src/org/greenstone/gatherer/gui/BrowsingPane.java
r5347 r5529 42 42 import java.net.*; 43 43 import javax.swing.*; 44 import org.greenstone.gatherer.Dictionary; 44 45 import org.greenstone.gatherer.Gatherer; 45 46 import org.greenstone.gatherer.util.GURL; … … 69 70 private String args[] = null; 70 71 static final String BOOKMARKS_FILE = "bookmarks.txt"; 72 71 73 public BrowsingPane() { 72 74 super(); … … 80 82 preferences.setHomeURL((new GURL(Gatherer.config.getString("general.home_page", false))).getURL()); 81 83 // Creation 82 // 84 // Controls 83 85 JPanel button_pane = new JPanel(); 84 86 JPanel left_button_pane = new JPanel(); 85 back_button = new JButton("", Utility.getImage("back.gif")); 87 88 back_button = new JButton(Utility.getImage("back.gif")); 86 89 back_button.setEnabled(false); 87 back_button.setToolTipText(get("Browser.Back")); 88 refresh_button = new JButton("", Utility.getImage("reload.gif")); 89 refresh_button.setEnabled(false); 90 refresh_button.setToolTipText(get("Browser.Reload")); 91 bookmarks_button = new JButton("", Utility.getImage("bookmark.gif")); 90 Dictionary.setTooltip(back_button, "Browser.Back"); 91 92 // refresh_button = new JButton(Utility.getImage("reload.gif")); 93 // refresh_button.setEnabled(false); 94 // Dictionary.setTooltip(refresh_button, "Browser.Reload"); 95 96 bookmarks_button = new JButton(Utility.getImage("bookmark.gif")); 92 97 bookmarks_button.setEnabled(false); 93 bookmarks_button.setToolTipText(get("Browser.Bookmarks")); 94 home_button = new JButton("", Utility.getImage("home.gif")); 95 home_button.setToolTipText(get("Browser.Home")); 98 Dictionary.setTooltip(bookmarks_button, "Browser.Bookmarks"); 99 100 home_button = new JButton(Utility.getImage("home.gif")); 101 Dictionary.setTooltip(home_button, "Browser.Home"); 102 96 103 JPanel address_pane = new JPanel(); 97 104 address_field = new JTextField(Gatherer.config.getString("general.home_page", false)); 105 Dictionary.setTooltip(address_field, "Browser.Address_Tooltip"); 106 98 107 JPanel right_button_pane = new JPanel(); 99 go_button = new JButton("", Utility.getImage("go.gif")); 100 go_button.setToolTipText(get("Browser.Go")); 101 stop_button = new JButton("", Utility.getImage("stop.gif")); 108 go_button = new JButton(Utility.getImage("go.gif")); 109 Dictionary.setTooltip(go_button, "Browser.Go"); 110 111 stop_button = new JButton(Utility.getImage("stop.gif")); 102 112 stop_button.setEnabled(false); 103 stop_button.setToolTipText(get("Browser.Stop")); 104 forward_button = new JButton("", Utility.getImage("forward.gif")); 113 Dictionary.setTooltip(stop_button, "Browser.Stop"); 114 115 forward_button = new JButton(Utility.getImage("forward.gif")); 105 116 forward_button.setEnabled(false); 106 forward_button.setToolTipText(get("Browser.Forward")); 107 // Calpa Pane stuff 117 Dictionary.setTooltip(forward_button, "Browser.Forward"); 118 119 // Calpa Pane stuff 108 120 view_pane = new CalHTMLPane(preferences, observer, "VIEW_PANE"); 109 // Status bar 110 status_label = new JLabel(get("Browser.Ready")); 121 122 // Status bar 123 status_label = new JLabel(); 124 Dictionary.setText(status_label, "Browser.Ready"); 125 111 126 // Connection 112 127 address_field.addActionListener(new AddressFieldListener()); … … 116 131 go_button.addActionListener(new GoButtonListener()); 117 132 home_button.addActionListener(new HomeButtonListener()); 118 refresh_button.addActionListener(new RefreshButtonListener());133 // refresh_button.addActionListener(new RefreshButtonListener()); 119 134 stop_button.addActionListener(new StopButtonListener()); 135 120 136 // Layout 121 137 left_button_pane.setLayout(new GridLayout(1,3)); … … 144 160 add(status_label, BorderLayout.SOUTH); 145 161 } 162 146 163 /** Some actions, such as getting the HTML to render properly without throwing sixty bazillion NPE's, can only occur after the frame has been drawn to screen. To this end we have this method so we can action things -after- the frame draw. 147 164 */ … … 155 172 public void collectionChanged(boolean ready) { 156 173 // Reload the bookmarks associated with this collection. 157 if (ready) {174 if (ready) { 158 175 bookmarks.load(); 159 176 } … … 176 193 177 194 178 /** Retrieves a key from the Dictionary, using no extra arguments.179 * @param key A <strong>String</strong> which maps to a certain phrase from the Dictionary.180 * @return The <strong>String</strong> that matches the key or an error message if no match was found.181 */182 private String get(String key) {183 return get(key, null);184 }185 186 /** Retrieves a key from the Dictionary, providing extra arguments to be inserted using a String array.187 * @param key A <strong>String</strong> which maps to a certain phrase from the Dictionary.188 * @param args A <strong>String[]</strong> containing further arguments (such as formatting instructions and variable values) to be taken into account when Dictionary creates the return String.189 * @return The <strong>String</strong> that matches the key or an error message if no match was found.190 */191 private String get(String key, String args[]) {192 if(key.indexOf('.') == -1) {193 key = "Browser." + key;194 }195 return Gatherer.dictionary.get(key,args);196 }197 195 /** Called to validate the status of the controls. Disables those that are no longer applicable or restores those that have come back into scope of usage. 198 196 * @param update_address <i>true</i> if this pollControls call should update the address bar, <i>false</i> otherwise. … … 206 204 implements ActionListener { 207 205 public void actionPerformed(ActionEvent event) { 208 206 // Attempt to create a GURL 209 207 GURL url = new GURL(address_field.getText()); 210 208 address_field.setText(url.getURL().toString()); … … 357 355 args = new String[1]; 358 356 args[0] = url.toString(); 359 status_label.setText(get("Browser.Follow"));357 Dictionary.setText(status_label, "Browser.Follow"); 360 358 args = null; 361 359 } … … 377 375 args = new String[1]; 378 376 args[0] = url.toString(); 379 status_label.setText(get("Browser.Loading", args));377 Dictionary.setText(status_label, "Browser.Loading", args); 380 378 args = null; 381 379 break; … … 398 396 stop_button.setEnabled(false); 399 397 // Rendering complete. 400 status_label.setText(get("Browser.Ready"));398 Dictionary.setText(status_label, "Browser.Ready"); 401 399 go_button.setEnabled(true); 402 400 stop_button.setEnabled(false); 403 refresh_button.setEnabled(true);401 // refresh_button.setEnabled(true); 404 402 // Update mirror pane 405 403 Gatherer.g_man.mirror_pane.setURL(url.toString()); -
trunk/gli/src/org/greenstone/gatherer/gui/CollectionPane.java
r5452 r5529 43 43 import javax.swing.event.*; 44 44 import javax.swing.tree.*; 45 import org.greenstone.gatherer.Dictionary; 45 46 import org.greenstone.gatherer.Gatherer; 46 47 import org.greenstone.gatherer.file.FileNode; … … 134 135 135 136 // Create components. 136 stop_action = new JButton( get("Collection.Stop"));137 stop_action = new JButton(); 137 138 stop_action.addActionListener(this); 138 139 stop_action.setEnabled(false); 139 stop_action.setToolTipText(get("Collection.Stop_Tooltip"));140 140 Dictionary.setBoth(stop_action, "Collection.Stop", "Collection.Stop_Tooltip"); 141 141 142 new_folder = new JButton(Utility.getImage("folder.gif")); 142 143 new_folder.addActionListener(this); … … 144 145 new_folder.setMinimumSize(MIN_SIZE); 145 146 new_folder.setPreferredSize(MIN_SIZE); 146 new_folder.setToolTipText(get("Collection.New_Folder_Tooltip")); 147 } 147 Dictionary.setTooltip(new_folder, "Collection.New_Folder_Tooltip"); 148 } 149 148 150 /** Any implementation of ActionListener requires this method so that when an action is performed the appropriate effect can occur. In this case there are three valid possibilities. If the action occured on the recycle bin, then delete the current selection from the collection tree. If the action instead occured on the new folder button, then create a new folder under the current (single) selection in the collection tree. And finally if the cancel button was pressed, cancel the current, and remaining, jobs on the file queue. */ 149 151 public void actionPerformed(ActionEvent event) { … … 195 197 FileNode node = (FileNode) collection_tree.getModel().getRoot(); 196 198 Gatherer.f_man.newFolder(collection_tree, node); 197 //JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("FileActions.No_Parent_For_New_Folder"), Gatherer.dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE);199 //JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.get("FileActions.No_Parent_For_New_Folder"), Dictionary.get("General.Error"), JOptionPane.ERROR_MESSAGE); 198 200 } 199 201 } … … 203 205 } 204 206 /** Called whenever a significant change occurs in the current collections state, such as a new collection being loaded or the current one being closed. Several actions must occur in the GUI to indicate this change to the user, such as en/disabling the collection tree. 205 206 207 208 209 210 211 212 207 * @param ready <i>true</i> if a collection is loaded and ready to be modified, <i>false</i> otherwise. 208 * @see org.greenstone.gatherer.Configuration 209 * @see org.greenstone.gatherer.Gatherer 210 * @see org.greenstone.gatherer.collection.CollectionManager 211 * @see org.greenstone.gatherer.gui.Coloring 212 * @see org.greenstone.gatherer.gui.Filter 213 * @see org.greenstone.gatherer.util.TreeSynchronizer 214 */ 213 215 public void collectionChanged(boolean ready) { 214 216 // Try to retrieve the collections record set. … … 217 219 args = new String[1]; 218 220 args[0] = Gatherer.c_man.getCollection().getName(); 219 collection_label.setText(get("Collection", args));221 Dictionary.setText(collection_label, "Collection.Collection", args); 220 222 collection_tree.setModel(collection); 221 223 collection_tree.repaint(); … … 224 226 else { 225 227 String args[] = new String[1]; 226 args[0] = get("Collection.No_Collection");227 collection_label.setText(get("Collection", args));228 args[0] = Dictionary.newget("Collection.No_Collection"); 229 Dictionary.setText(collection_label, "Collection.Collection", args); 228 230 args = null; 229 231 collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error"))); … … 232 234 collection_tree.setEnabled(ready); 233 235 collection_filter.setEnabled(ready); 236 Dictionary.setTooltip(collection_filter.getComboBox(), "Collection.Filter_Tooltip"); 234 237 235 238 // Change the label at the top of collection tree. … … 258 261 workspace_pane.setSize(TREE_SIZE); 259 262 260 workspace_label = new JLabel( get("Collection.Workspace"));263 workspace_label = new JLabel(); 261 264 workspace_label.setOpaque(true); 262 265 workspace_label.setBackground(Gatherer.config.getColor("coloring.workspace_heading_background", false)); 263 266 workspace_label.setForeground(Gatherer.config.getColor("coloring.workspace_heading_foreground", false)); 267 Dictionary.setText(workspace_label, "Collection.Workspace"); 264 268 265 269 workspace = Gatherer.c_man.getWorkspace(); … … 289 293 fcb.setBackgroundSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false)); 290 294 fcb.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false)); 295 Dictionary.setTooltip(fcb, "Collection.Filter_Tooltip"); 291 296 fcb = null; 292 297 … … 298 303 299 304 args = new String[1]; 300 args[0] = get("Collection.No_Collection");301 collection_label = new JLabel( get("Collection", args));305 args[0] = Dictionary.newget("Collection.No_Collection"); 306 collection_label = new JLabel(); 302 307 collection_label.setOpaque(true); 308 Dictionary.setText(collection_label, "Collection.Collection", args); 303 309 304 310 collection = Gatherer.c_man.getRecordSet(); … … 369 375 bin_button.setMinimumSize(MIN_SIZE); 370 376 bin_button.setPreferredSize(MIN_SIZE); 371 bin_button.setToolTipText(get("Collection.Delete_Tooltip"));377 Dictionary.setTooltip(bin_button, "Collection.Delete_Tooltip"); 372 378 group.add(bin_button); 373 379 … … 498 504 } 499 505 500 /** Retrieve a phrase from the dictionary based on the key. 501 * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved. 502 */ 503 private String get(String key) { 504 return get(key, null); 505 } 506 /** Retrieve a phrase from the dictionary based on the key, and filled in using text fragments from an arguments array. 507 * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved. 508 * @param args A <strong>String[]</strong> used as parameters to be inserted in the phrase retrieved. 509 * @see org.greenstone.gatherer.Dictionary 510 * @see org.greenstone.gatherer.Gatherer 511 */ 512 private String get(String key, String args[]) { 513 if(key.indexOf('.') == -1) { 514 key = "Collection." + key; 515 } 516 return Gatherer.dictionary.get(key, args); 517 } 506 518 507 /** Used to set the enabled state, and hence the colouring, of the two tree labels. 519 508 * @param label The <strong>JLabel</strong> to be affected. … … 563 552 // Set Options based on selection and tree 564 553 if(tree.getSelectionCount() != 0 && tree == collection_tree) { 565 show_metaaudit = new JMenuItem(get("Menu.Metadata_View") + " " + collection_tree.getSelectionDetails(), KeyEvent.VK_V); 554 String[] args = new String[1]; 555 args[0] = collection_tree.getSelectionDetails(); 556 show_metaaudit = new JMenuItem(Dictionary.newget("Menu.Metadata_View", args), KeyEvent.VK_V); 566 557 show_metaaudit.addActionListener(this); 567 558 add(show_metaaudit); 568 559 } 569 560 if(tree == collection_tree && node != null && node.getFile() != null && node.getFile().isDirectory() && !node.isReadOnly()) { 570 new_folder = new JMenuItem( get("CollectionPopupMenu.New_Folder"), KeyEvent.VK_N);561 new_folder = new JMenuItem(Dictionary.newget("CollectionPopupMenu.New_Folder"), KeyEvent.VK_N); 571 562 new_folder.addActionListener(this); 572 563 add(new_folder); … … 574 565 } 575 566 if(node == null || (node != null && !node.isReadOnly())) { 576 delete = new JMenuItem( get("CollectionPopupMenu.Delete"), KeyEvent.VK_D);567 delete = new JMenuItem(Dictionary.newget("CollectionPopupMenu.Delete"), KeyEvent.VK_D); 577 568 delete.addActionListener(this); 578 569 add(delete); … … 581 572 String node_name = node.toString(); 582 573 FileNode root = (FileNode) tree.getModel().getRoot(); 583 if(!node_name.equals( get("Tree.World")) && !node_name.equals(get("Tree.Root")) && !node_name.equals(get("Tree.Public")) && !node_name.equals(get("Tree.Private"))) {574 if(!node_name.equals(Dictionary.newget("Tree.World")) && !node_name.equals(Dictionary.newget("Tree.Root")) && !node_name.equals(Dictionary.newget("Tree.Public")) && !node_name.equals(Dictionary.newget("Tree.Private"))) { 584 575 // You can unmap 1st level nodes. 585 576 if(root.getIndex(node) != -1) { 586 unmap = new JMenuItem( get("MappingPrompt.Unmap"), KeyEvent.VK_U);577 unmap = new JMenuItem(Dictionary.newget("MappingPrompt.Unmap"), KeyEvent.VK_U); 587 578 unmap.addActionListener(this); 588 579 add(unmap); … … 590 581 // Or map any other level directories. 591 582 else { 592 map = new JMenuItem( get("MappingPrompt.Map"), KeyEvent.VK_M);583 map = new JMenuItem(Dictionary.newget("MappingPrompt.Map"), KeyEvent.VK_M); 593 584 map.addActionListener(this); 594 585 add(map); … … 639 630 } 640 631 } 641 /** Retrieve a phrase from the dictionary based on the key. 642 * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved. 643 */ 644 private String get(String key) { 645 return get(key, null); 646 } 647 /** Retrieve a phrase from the dictionary based on the key, and filled in using text fragments from an arguments array. 648 * @param key A <strong>String</strong> used to uniquely identify the phrase to be retrieved. 649 * @param args A <strong>String[]</strong> used as parameters to be inserted in the phrase retrieved. 650 * @see org.greenstone.gatherer.Dictionary 651 * @see org.greenstone.gatherer.Gatherer 652 */ 653 private String get(String key, String args[]) { 654 if(key.indexOf('.') == -1) { 655 key = "CollectionPopupMenu." + key; 656 } 657 return Gatherer.dictionary.get(key, args); 658 } 659 } 632 } 633 660 634 /** This class listens for certain key presses, such as [Enter] or [Delete], and responds appropriately. */ 661 635 private class KeyListenerImpl … … 715 689 setModal(true); 716 690 setSize(DIALOG_SIZE); 717 setTitle(get("MappingPrompt.Title")); 718 // Creation 691 Dictionary.setText(this, "MappingPrompt.Title"); 692 693 // Creation 719 694 JPanel content_pane = (JPanel) getContentPane(); 720 695 JPanel center_pane = new JPanel(); 721 696 JPanel file_pane = new JPanel(); 722 JLabel file_label = new JLabel( get("MappingPrompt.File"));697 JLabel file_label = new JLabel(); 723 698 file_label.setPreferredSize(LABEL_SIZE); 699 Dictionary.setText(file_label, "MappingPrompt.File"); 724 700 JLabel file_field = new JLabel(file.getAbsolutePath()); 725 701 JPanel name_pane = new JPanel(); 726 JLabel name_label = new JLabel( get("MappingPrompt.Name"));702 JLabel name_label = new JLabel(); 727 703 name_label.setPreferredSize(LABEL_SIZE); 704 Dictionary.setText(name_label, "MappingPrompt.Name"); 728 705 name_field = new JTextField(file.getName()); 729 706 JPanel button_pane = new JPanel(); 730 ok_button = new JButton( get("General.OK"));707 ok_button = new JButton(); 731 708 ok_button.setEnabled(name_field.getText().length() > 0); 732 cancel_button = new JButton(get("General.Cancel")); 733 // Connection 709 Dictionary.setBoth(ok_button, "General.OK", "General.OK_Tooltip"); 710 cancel_button = new JButton(); 711 Dictionary.setBoth(cancel_button, "General.Cancel", "General.Cancel_Tooltip"); 712 713 // Connection 734 714 cancel_button.addActionListener(this); 735 715 ok_button.addActionListener(this); 736 716 name_field.addKeyListener(this); 737 717 // Layout 738 718 file_pane.setLayout(new BorderLayout()); 739 719 file_pane.add(file_label, BorderLayout.WEST); … … 757 737 content_pane.add(center_pane, BorderLayout.CENTER); 758 738 content_pane.add(button_pane, BorderLayout.SOUTH); 759 739 // Display 760 740 Dimension screen_size = Gatherer.config.screen_size; 761 741 setLocation((screen_size.width - DIALOG_SIZE.width) / 2, (screen_size.height - DIALOG_SIZE.height) / 2); 762 742 show(); 763 743 // If not cancelled create mapping. 764 744 if(!cancelled) { 765 745 Gatherer.c_man.addDirectoryMapping(name_field.getText(), file); -
trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java
r5527 r5529 75 75 import org.greenstone.gatherer.msm.ElementWrapper; 76 76 import org.greenstone.gatherer.msm.Metadata; 77 import org.greenstone.gatherer.sarm.SearchAndReplace;77 // import org.greenstone.gatherer.sarm.SearchAndReplace; 78 78 import org.greenstone.gatherer.shell.GShell; 79 79 import org.greenstone.gatherer.util.TreeSynchronizer; … … 124 124 private JTabbedPane tab_pane = null; 125 125 /** A reference to any existing search and replace module/dialog. */ 126 private SearchAndReplace sar = null;126 // private SearchAndReplace sar = null; 127 127 /** A threaded tab changer to try and avoid NPE on exit. */ 128 128 private TabUpdater tab_updater = null; … … 251 251 } 252 252 } 253 else if(esrc == menu_bar.edit_search) {254 if(sar != null) {255 sar.dispose();256 }257 sar = new SearchAndReplace(false);258 }259 else if(esrc == menu_bar.edit_replace) {260 if(sar != null) {261 sar.dispose();262 }263 sar = new SearchAndReplace(true);264 }253 // else if(esrc == menu_bar.edit_search) { 254 // if(sar != null) { 255 // sar.dispose(); 256 // } 257 // sar = new SearchAndReplace(false); 258 // } 259 // else if(esrc == menu_bar.edit_replace) { 260 // if(sar != null) { 261 // sar.dispose(); 262 // } 263 // sar = new SearchAndReplace(true); 264 // } 265 265 // ************* 266 266 // Tools Options. -
trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPane.java
r5527 r5529 45 45 import javax.swing.table.*; 46 46 import javax.swing.tree.*; 47 import org.greenstone.gatherer.Dictionary; 47 48 import org.greenstone.gatherer.Gatherer; 48 49 import org.greenstone.gatherer.file.FileNode; … … 138 139 this.tree_sync = tree_sync; 139 140 140 add = new JButton( "MetaEdit.Accumulate");141 add = new JButton(); 141 142 add.addActionListener(this); 142 143 add.setEnabled(false); 143 144 add.setMnemonic(KeyEvent.VK_A); 144 145 add.setPreferredSize(BUTTON_SIZE); 145 146 update = new JButton("MetaEdit.Overwrite"); 146 Dictionary.setBoth(add, "MetaEdit.Accumulate", "MetaEdit.Accumulate_Tooltip"); 147 148 update = new JButton(); 147 149 update.addActionListener(this); 148 150 update.setEnabled(false); 149 151 update.setMnemonic(KeyEvent.VK_P); 150 152 update.setPreferredSize(BUTTON_SIZE); 151 152 remove = new JButton("MetaEdit.Remove"); 153 Dictionary.setBoth(update, "MetaEdit.Overwrite", "MetaEdit.Overwrite_Tooltip"); 154 155 remove = new JButton(); 153 156 remove.addActionListener(this); 154 157 remove.setEnabled(false); 155 158 remove.setMnemonic(KeyEvent.VK_R); 156 159 remove.setPreferredSize(BUTTON_SIZE); 157 158 expand = new JButton("MetaEdit.Expand"); 160 Dictionary.setBoth(remove, "MetaEdit.Remove", "MetaEdit.Remove_Tooltip"); 161 162 expand = new JButton(); 159 163 expand.addActionListener(this); 160 164 expand.setEnabled(true); 161 165 expand.setMnemonic(KeyEvent.VK_E); 162 166 expand.setPreferredSize(new Dimension(25, 25)); 167 Dictionary.setBoth(expand, "MetaEdit.Expand", "MetaEdit.Expand_Tooltip"); 163 168 164 169 tree = new GValueTree(CONTROL_SIZE.width, CONTROL_SIZE.height); 165 166 // Dictionary registration167 Gatherer.dictionary.register(add, null, false);168 Gatherer.dictionary.register(update, null, false);169 Gatherer.dictionary.register(remove, null, false);170 Gatherer.dictionary.register(expand, null, false);171 170 } 172 171 … … 302 301 String[] args = new String[1]; 303 302 args[0] = Gatherer.c_man.getCollection().getName(); 304 collection_label.setText(get("Collection.Collection", args));303 Dictionary.setText(collection_label, "Collection.Collection", args); 305 304 // Update label coloring. 306 305 collection_label.setBackground(Gatherer.config.getColor("coloring.collection_heading_background", false)); … … 321 320 } 322 321 else { 323 collection_label.setText(get("Collection.No_Collection"));322 Dictionary.setText(collection_label, "Collection.No_Collection"); 324 323 collection_label.setBackground(Color.lightGray); 325 324 collection_label.setForeground(Color.black); 326 collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode( get("Collection.No_Collection"))));325 collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode(Dictionary.newget("Collection.No_Collection")))); 327 326 } 328 327 … … 353 352 354 353 ///atherer.println("\tCreating collection_label"); 355 collection_label = new JLabel(get("Collection.Collection")); 354 collection_label = new JLabel(); 355 Dictionary.setText(collection_label, "Collection.Collection"); 356 356 collection_label.setOpaque(true); 357 358 357 359 358 DragGroup group = new DragGroup(); … … 385 384 fcb.setBackgroundSelectionColor(Gatherer.config.getColor("coloring.collection_selection_background", false)); 386 385 fcb.setTextSelectionColor(Gatherer.config.getColor("coloring.collection_selection_foreground", false)); 386 Dictionary.setTooltip(fcb, "Collection.Filter_Tooltip"); 387 387 fcb = null; 388 388 … … 416 416 JPanel table_title_pane = new JPanel(); 417 417 418 table_label = new JTextField( "MetaEdit.No_File");418 table_label = new JTextField(); 419 419 table_label.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 420 420 table_label.setEditable(false); 421 Dictionary.setText(table_label, "MetaEdit.No_File"); 421 422 422 423 card_layout = new CardLayout(); … … 430 431 table_pane_two.setOpaque(false); 431 432 432 JLabel no_file_message = new JLabel( "MetaEdit.No_File");433 JLabel no_file_message = new JLabel(); 433 434 no_file_message.setHorizontalAlignment(JLabel.CENTER); 434 435 no_file_message.setOpaque(false); 435 436 no_file_message.setVerticalAlignment(JLabel.CENTER); 436 437 JLabel no_metadata_message = new JLabel("MetaEdit.No_Metadata"); 437 Dictionary.setText(no_file_message, "MetaEdit.No_File"); 438 439 JLabel no_metadata_message = new JLabel(); 438 440 no_metadata_message.setHorizontalAlignment(JLabel.CENTER); 439 441 no_metadata_message.setOpaque(false); 440 442 no_metadata_message.setVerticalAlignment(JLabel.CENTER); 443 Dictionary.setText(no_metadata_message, "MetaEdit.No_Metadata"); 441 444 442 445 JPanel table_pane_one = new JPanel(); … … 483 486 JPanel tools_off_pane = new JPanel(); 484 487 485 JLabel tools_off_label = new JLabel( "MetaEdit.No_Metadata_Element");488 JLabel tools_off_label = new JLabel(); 486 489 tools_off_label.setHorizontalAlignment(JLabel.CENTER); 487 490 tools_off_label.setOpaque(false); 488 491 tools_off_label.setVerticalAlignment(JLabel.CENTER); 492 Dictionary.setText(tools_off_label, "MetaEdit.No_Metadata_Element"); 489 493 490 494 JPanel tools_on_pane = new JPanel(); … … 538 542 this.setLayout(new BorderLayout()); 539 543 this.add(external_split, BorderLayout.CENTER); 540 541 // Dictionary registration542 Gatherer.dictionary.register(table_label, null, false);543 Gatherer.dictionary.register(no_file_message, null, false);544 Gatherer.dictionary.register(no_metadata_message, null, false);545 Gatherer.dictionary.register(tools_off_label, null, false);546 544 } 547 545 … … 742 740 else { 743 741 records = null; 744 table_label.setText(get("MetaEdit.No_File")); 742 Dictionary.setText(table_label, "MetaEdit.No_File"); 743 745 744 // Remove old model from msm 746 745 if(Gatherer.c_man.ready()) { … … 771 770 table.doLayout(); 772 771 validateControls(); 773 }774 775 776 /** Retrieve a phrase from the Dictionary based on the given key.777 * @param key The <strong>String</strong> which maps to the phrase to retrieve.778 * @return The desired phrase as a <strong>String</strong>, or possibly an error message if no such phrase exists.779 */780 private String get(String key) {781 return get(key, null);782 }783 /** Retrieve a phrase from the Dictionary based on the given key and filled in with the given arguments.784 * @param key The <strong>String</strong> which maps to the phrase to retrieve.785 * @param args A <strong>String[]</strong> of arguments to be inserted in the phrase.786 * @return The desired phrase as a <strong>String</strong>, or possibly an error message if no such phrase exists.787 * @see org.greenstone.gatherer.Dictionary788 * @see org.greenstone.gatherer.Gatherer789 */790 private String get(String key, String args[]) {791 if(key.indexOf('.') == -1) {792 key = "MetaEdit." + key;793 }794 return Gatherer.dictionary.get(key,args);795 772 } 796 773 … … 950 927 super(); 951 928 // Creation 952 JMenuItem show_metaaudit = new JMenuItem(get("Menu.Metadata_View") + " " + collection_tree.getSelectionDetails(), KeyEvent.VK_V); 929 String[] args = new String[1]; 930 args[0] = collection_tree.getSelectionDetails(); 931 JMenuItem show_metaaudit = new JMenuItem(Dictionary.newget("Menu.Metadata_View", args), KeyEvent.VK_V); 953 932 show_metaaudit.addActionListener(this); 954 933 add(show_metaaudit); … … 1096 1075 this.add(extracted_pane, NONE); 1097 1076 card_showing = TREE; 1098 1099 // Dictionary registration1100 Gatherer.dictionary.register(value_label, null, false);1101 Gatherer.dictionary.register(value, null, false);1102 Gatherer.dictionary.register(tree_label, null, false);1103 1077 } 1104 1078 … … 1154 1128 String[] args = new String[1]; 1155 1129 args[0] = selected_metadata_element.toString(); 1156 extracted_message.setText(get("MetaEdit.AutoMessage", args));1130 Dictionary.setText(extracted_message, "MetaEdit.AutoMessage", args); 1157 1131 card_layout.show(this, NONE); 1158 1132 card_showing = NONE; … … 1189 1163 manual_text_edit_event = true; 1190 1164 } 1191 }1192 1193 1194 private String get(String key, String args[]) {1195 return Gatherer.dictionary.get(key, args);1196 1165 } 1197 1166 -
trunk/gli/src/org/greenstone/gatherer/gui/MetaEditPrompt.java
r5527 r5529 52 52 private JButton update; 53 53 private JButton update_all; 54 54 55 static private Dimension LABEL_SIZE = new Dimension(100, 25); 55 56 static private Dimension SIZE = new Dimension(712, 250); … … 117 118 JPanel buttons_pane = new JPanel(); 118 119 119 accumulate = new JButton("MetaEdit Prompt.Accumulate");120 accumulate = new JButton("MetaEdit.Accumulate"); 120 121 accumulate.setEnabled(type == ADD_PROMPT); 121 122 accumulate.setMnemonic(KeyEvent.VK_A); … … 125 126 accumulate_all.setMnemonic(KeyEvent.VK_L); 126 127 127 overwrite = new JButton("MetaEdit Prompt.Overwrite");128 overwrite = new JButton("MetaEdit.Overwrite"); 128 129 overwrite.setEnabled(type == UPDATE_PROMPT); 129 130 overwrite.setMnemonic(KeyEvent.VK_R); … … 133 134 overwrite_all.setMnemonic(KeyEvent.VK_P); 134 135 135 remove = new JButton("MetaEdit Prompt.Remove");136 remove = new JButton("MetaEdit.Remove"); 136 137 remove.setEnabled(type == REMOVE_PROMPT); 137 138 remove.setMnemonic(KeyEvent.VK_R); … … 145 146 skip.setMnemonic(KeyEvent.VK_S); 146 147 147 cancel = new JButton(" MetaEditPrompt.Cancel");148 cancel = new JButton("General.Cancel"); 148 149 cancel.setMnemonic(KeyEvent.VK_C); 149 150 … … 185 186 186 187 buttons_pane.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); 187 buttons_pane.setLayout(new GridLayout(2,4,0,0)); 188 buttons_pane.add(accumulate); 189 buttons_pane.add(overwrite); 190 buttons_pane.add(remove); 191 buttons_pane.add(skip); 192 buttons_pane.add(accumulate_all); 193 buttons_pane.add(overwrite_all); 194 buttons_pane.add(remove_all); 195 buttons_pane.add(cancel); 188 buttons_pane.setLayout(new GridLayout(1,4,0,0)); 189 190 if (type.equals(ADD_PROMPT)) { 191 buttons_pane.add(accumulate); 192 buttons_pane.add(accumulate_all); 193 } 194 else if (type.equals(UPDATE_PROMPT)) { 195 buttons_pane.add(overwrite); 196 buttons_pane.add(overwrite_all); 197 } 198 else if (type.equals(REMOVE_PROMPT)) { 199 buttons_pane.add(remove); 200 buttons_pane.add(remove_all); 201 } 202 buttons_pane.add(skip); 203 buttons_pane.add(cancel); 196 204 197 205 content_pane.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); -
trunk/gli/src/org/greenstone/gatherer/gui/MirrorPane.java
r5329 r5529 43 43 import javax.swing.event.*; 44 44 import javax.swing.tree.*; 45 import org.greenstone.gatherer.Dictionary; 45 46 import org.greenstone.gatherer.Gatherer; 46 import org.greenstone.gatherer.Message;47 47 import org.greenstone.gatherer.WGet; 48 import org.greenstone.gatherer.file.FileSystemModel;49 import org.greenstone.gatherer.gui.Filter;50 import org.greenstone.gatherer.gui.GComboBox;51 import org.greenstone.gatherer.gui.tree.DragTree;52 import org.greenstone.gatherer.util.DragGroup;53 import org.greenstone.gatherer.util.GURL;54 import org.greenstone.gatherer.util.TreeSynchronizer;55 48 import org.greenstone.gatherer.util.Utility; 56 49 /** … … 72 65 private JTextField url_textfield = null; 73 66 private WGet getter = null; 67 74 68 public MirrorPane() { 75 69 super(); … … 85 79 86 80 JPanel url_pane = new JPanel(); 87 JLabel url_label = new JLabel( Gatherer.dictionary.get("Mirroring.Source_URL"));81 JLabel url_label = new JLabel(); 88 82 url_label.setPreferredSize(Utility.LABEL_SIZE); 83 Dictionary.setText(url_label, "Mirroring.Source_URL"); 89 84 url_textfield = new JTextField(); 85 Dictionary.setTooltip(url_textfield, "Mirroring.Source_URL_Tooltip"); 90 86 91 87 JPanel depth_pane = new JPanel(); 92 JLabel depth_label = new JLabel(Gatherer.dictionary.get("Mirroring.Download_Depth")); 88 JLabel depth_label = new JLabel(); 89 Dictionary.setText(depth_label, "Mirroring.Download_Depth"); 93 90 depth_spinner = new JSpinner(); 91 Dictionary.setTooltip(depth_spinner, "Mirroring.Download_Depth_Tooltip"); 94 92 95 93 JPanel destination_pane = new JPanel(); 96 JLabel destination_label = new JLabel(Gatherer.dictionary.get("Mirroring.Destination_Folder")); 94 JLabel destination_label = new JLabel(); 95 Dictionary.setText(destination_label, "Mirroring.Destination_Folder"); 97 96 ButtonGroup group = new ButtonGroup(); 98 public_radiobutton = new JRadioButton(Gatherer.dictionary.get("Tree.Public")); 99 private_radiobutton = new JRadioButton(Gatherer.dictionary.get("Tree.Private")); 97 public_radiobutton = new JRadioButton(); 98 public_radiobutton.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 99 public_radiobutton.setOpaque(false); 100 Dictionary.setText(public_radiobutton, "Tree.Public"); 101 private_radiobutton = new JRadioButton(); 102 private_radiobutton.setBackground(Gatherer.config.getColor("coloring.collection_tree_background", false)); 103 private_radiobutton.setOpaque(false); 104 Dictionary.setText(private_radiobutton, "Tree.Private"); 100 105 group.add(public_radiobutton); 101 106 group.add(private_radiobutton); … … 103 108 104 109 JPanel first_pane = new JPanel(); 105 automatic_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Download_Hidden")); 106 overwrite_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Overwrite_Existing")); 110 automatic_checkbox = new JCheckBox(); 111 Dictionary.setText(automatic_checkbox, "Mirroring.Download_Hidden"); 112 overwrite_checkbox = new JCheckBox(); 113 Dictionary.setText(overwrite_checkbox, "Mirroring.Overwrite_Existing"); 107 114 108 115 JPanel second_pane = new JPanel(); 109 higher_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Higher_Directories")); 110 same_host_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Same_Host")); 111 112 remove_failed_checkbox = new JCheckBox(Gatherer.dictionary.get("Mirroring.Remove_Failed")); 113 JLabel further_label = new JLabel(Gatherer.dictionary.get("Mirroring.Further_Options")); 114 116 higher_checkbox = new JCheckBox(); 117 Dictionary.setText(higher_checkbox, "Mirroring.Higher_Directories"); 118 same_host_checkbox = new JCheckBox(); 119 Dictionary.setText(same_host_checkbox, "Mirroring.Same_Host"); 120 121 remove_failed_checkbox = new JCheckBox(); 122 Dictionary.setText(remove_failed_checkbox, "Mirroring.Remove_Failed"); 123 124 JLabel further_label = new JLabel(); 125 Dictionary.setText(further_label, "Mirroring.Further_Options"); 126 115 127 JPanel button_pane = new JPanel(); 116 download_button = new JButton(Gatherer.dictionary.get("Mirroring.Download")); 128 download_button = new JButton(); 129 Dictionary.setBoth(download_button, "Mirroring.Download", "Mirroring.Download_Tooltip"); 117 130 118 131 // Connect … … 156 169 button_pane.add(download_button); 157 170 158 edit_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2,0,0,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder( Gatherer.dictionary.get("Mirroring.Download_Controls")), BorderFactory.createEmptyBorder(2,2,2,2))));171 edit_pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(2,0,0,0), BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(Dictionary.newget("Mirroring.Download_Controls")), BorderFactory.createEmptyBorder(2,2,2,2)))); 159 172 edit_pane.setLayout(new BorderLayout()); 160 173 edit_pane.add(details_pane, BorderLayout.CENTER); … … 182 195 183 196 public void actionPerformed(ActionEvent event) { 184 // Retrieve the current url and confirm it s valid197 // Retrieve the current url and confirm it is valid 185 198 String url_str = url_textfield.getText(); 186 199 URL url = null; … … 189 202 } 190 203 catch(MalformedURLException error) { 191 JOptionPane.showMessageDialog(Gatherer.g_man, Gatherer.dictionary.get("Mirroring.Invalid_URL"), Gatherer.dictionary.get("Mirroring.Invalid_URL__Title"), JOptionPane.ERROR_MESSAGE);204 JOptionPane.showMessageDialog(Gatherer.g_man, Dictionary.newget("Mirroring.Invalid_URL"), Dictionary.newget("Mirroring.Invalid_URL__Title"), JOptionPane.ERROR_MESSAGE); 192 205 } 193 206 if(url != null) {
Note:
See TracChangeset
for help on using the changeset viewer.