Changeset 6154 for trunk


Ignore:
Timestamp:
2003-12-08T14:31:04+13:00 (20 years ago)
Author:
jmt12
Message:

Finished debugging the file association dialog - finally. However I still have to check that we've fixed the 'extra quotes under windows' bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/FileAssociationDialog.java

    r6034 r6154  
    5252import org.greenstone.gatherer.gui.OpenCollectionDialog;
    5353import org.greenstone.gatherer.gui.SimpleMenuBar;
     54import org.greenstone.gatherer.util.TableUtils;
    5455import org.greenstone.gatherer.util.Utility;
    5556import org.outerj.pollo.util.*;
     
    105106    JLabel existing_associations_label = new JLabel();
    106107    existing_associations_table = new JTable(file_association_manager);
     108    existing_associations_table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
    107109    existing_associations_table.setColumnSelectionAllowed(false);
    108110    existing_associations_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    109     TableColumnModel column_model = existing_associations_table.getColumnModel();
    110     TableColumn column = column_model.getColumn(0);
    111     column.setWidth(75);
    112111    JPanel lower_pane = new JPanel();
    113112    JPanel details_pane = new JPanel();
     
    223222    }
    224223
     224    protected void processWindowEvent(WindowEvent event) {
     225    if(event.getID() == WindowEvent.WINDOW_ACTIVATED) {
     226        TableUtils.fixColumnToPreferredWidth(existing_associations_table, 0);
     227    }
     228    else {
     229        super.processWindowEvent(event);
     230    }
     231    }
     232
    225233    private class AddButtonListener
    226234    implements ActionListener {
     
    303311        if(extension_str.equals(current_extension_str)) {
    304312            // If the extensions are the same then remove is enabled
    305             add_button.setEnabled(false);
    306313            remove_button.setEnabled(true);
    307314            // But if the command is different, then enable replace
    308             if(!command_str.equals(current_command_str)) {
     315            if(current_command_str.length() == 0) {
     316            add_button.setEnabled(true);
     317            replace_button.setEnabled(false);
     318            }
     319            else if(!command_str.equals(current_command_str)) {
     320            add_button.setEnabled(false);
    309321            replace_button.setEnabled(true);
    310322            }
    311323            else {
     324            add_button.setEnabled(false);
    312325            replace_button.setEnabled(false);
    313326            }
Note: See TracChangeset for help on using the changeset viewer.