Changeset 29011 for main/trunk/gli/src

Show
Ignore:
Timestamp:
30.04.2014 18:43:09 (6 years ago)
Author:
ak19
Message:

1. The top right dialog button that closes the dialog should behave as a cancel press, not an accept all press. 2. RemoteGS3 should not try to convert GS2 format statements, but does allow opening a collection containing the html-entity encoded GS2 format statements. 3. Added more tooltips

Files:
1 modified

Legend:

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

    r29009 r29011  
    4242// Help tooltips on buttons 
    4343// + Undo, Redo buttons 
    44 // Split class into dialog/widgets and data processing 
     44// X Split class into dialog/widgets and data processing? 
     45// http://www.java2s.com/Tutorial/Java/0240__Swing/SettingJOptionPanebuttonlabelstoFrench.htm 
    4546 
    4647public class FormatConversionDialog extends ModalDialog 
     
    9798    setSize(SIZE); 
    9899    setTitle(Dictionary.get(Dictionary.get("FormatConversionDialog.Title"))); 
     100    this.addWindowListener(new WindowClosingListener()); // the dialog's top right close button should behave as a Cancel press 
    99101    setDefaultCloseOperation(DISPOSE_ON_CLOSE); 
    100102     
     
    103105    midbutton_panel.setComponentOrientation(Dictionary.getOrientation()); 
    104106    JButton reconvert_button = new JButton(Dictionary.get("FormatConversionDialog.Reconvert")); 
     107    reconvert_button.setToolTipText(Dictionary.get("FormatConversionDialog.Reconvert_Tooltip")); 
    105108    midbutton_panel.add(reconvert_button); 
    106109    reconvert_button.addActionListener(new ReconvertListener()); 
     
    135138    next_button = new JButton(Dictionary.get("FormatConversionDialog.Next")); 
    136139    accept_all_button = new JButton(Dictionary.get("FormatConversionDialog.Accept_All")); 
     140    accept_all_button.setToolTipText(Dictionary.get("FormatConversionDialog.Accept_All_Tooltip")); 
    137141    cancel_button.addActionListener(new CancelButtonListener()); 
     142    cancel_button.setToolTipText(Dictionary.get("FormatConversionDialog.Cancel_Tooltip")); 
    138143    next_button.addActionListener(new NextButtonListener()); 
     144    next_button.setToolTipText(Dictionary.get("FormatConversionDialog.Next_Tooltip")); 
    139145    accept_all_button.addActionListener(new AcceptAllButtonListener()); 
    140146    button_panel.add(cancel_button); 
     
    158164    initTextArea(gs3_textarea); 
    159165    gs2_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS2_Text_Tooltip")); 
    160     gs3_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS2_Text_Tooltip")); 
     166    gs3_textarea.setToolTipText(Dictionary.get("FormatConversionDialog.GS3_Text_Tooltip")); 
    161167 
    162168 
     
    230236 
    231237    if(Gatherer.GS3 && collect_cfg_file.getAbsolutePath().endsWith(".xml")) { 
     238 
    232239        //System.err.println("*** Opening an xml config file"); 
    233240         
     
    259266        } 
    260267        System.err.println("*** Found GS2 format statements in config file to be converted to GS3."); 
     268 
     269         
     270        // if remote GS3, do we open the collection with the html-encoded GS2 format statements 
     271        // or do we not allow the remote user to open such a collection at all? 
     272        // For now we allow them to open it, but print a warning that conversions are not possible. 
     273         
     274        if(Gatherer.isGsdlRemote) { // remote GS3 
     275            System.err.println("*** Cannot convert GS2 collections from a remote GS3 server.");  
     276            return OpenCollectionDialog.OK_OPTION; 
     277        } 
    261278 
    262279        // If we get here, it means there were no CDataSections in the first (any) <gsf:gs2-format/> 
     
    788805    } 
    789806 
     807    // windowClosing() is called when the user presses the top-right close button the dialog 
     808    // this means the user wanted to cancel out of the entire Format Conversion Wizard. 
     809    private class WindowClosingListener extends WindowAdapter { 
     810    public void windowClosing(WindowEvent e) {       
     811        dlgResult = OpenCollectionDialog.CANCEL_OPTION; 
     812    } 
     813    } 
     814 
    790815    private class ReconvertListener implements ActionListener { 
    791816    public void actionPerformed(ActionEvent e) {