Ignore:
Timestamp:
2009-01-12T13:04:29+13:00 (15 years ago)
Author:
kjdon
Message:

committed code submitted by Amin Hedjazi for making the GLI right to left. I worked on this code on the rtl-gli branch, then merged the branch back to the trunk at revision 18368. The branch code was slightly different in a couple of places where it shouldn't have been. So don't use the branch code next time. Start a new branch.

File:
1 edited

Legend:

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

    r17252 r18370  
    155155    public ExportAsPrompt() {
    156156    super(Gatherer.g_man, true);
    157    
     157    this.setComponentOrientation(Dictionary.getOrientation());
    158158    plugoutMap.clear();         
    159159    plugoutMap.put("DSpace","dublin-core.xml");
     
    168168    details_textarea = new JTextArea(Dictionary.get("DeleteCollectionPrompt.No_Collection"));
    169169    details_textarea.setEditable(false);
    170    
     170    details_textarea.setComponentOrientation(Dictionary.getOrientation());
     171       
    171172    details_label = new JLabel(Dictionary.get("DeleteCollectionPrompt.Collection_Details"));
    172173   
     
    178179    instructions_textarea.setRows(4);
    179180    instructions_textarea.setWrapStyleWord(true);
    180    
     181    instructions_textarea.setComponentOrientation(Dictionary.getOrientation());
    181182             
    182183       
    183184        saveas_label = new JLabel(Dictionary.get("ExportAsPrompt.SaveAs")
    184185);
     186        saveas_label.setComponentOrientation(Dictionary.getOrientation());
    185187        //saveas_label.setPreferredSize(LABEL_SIZE);
    186188       
     
    188190    saveas_combobox.setOpaque(false);
    189191    saveas_combobox.setToolTipText(Dictionary.get("ExportAsPrompt.SaveAs_Tooltip"));
    190        
     192        saveas_combobox.setComponentOrientation(Dictionary.getOrientation());
    191193
    192194    // Add xml conversion feature
     
    203205        convert_xml_checkbox1.setText(Dictionary.get("ExportAsPrompt.ApplyXSL","doc.xml"));
    204206        convert_xml_checkbox1.setToolTipText(Dictionary.get("ExportAsPrompt.ApplyXSL_Tooltip"));
     207        convert_xml_checkbox1.setComponentOrientation(Dictionary.getOrientation());
    205208       
    206209    convert_xml_checkbox2 = new JCheckBox();
    207210        convert_xml_checkbox2.setToolTipText(Dictionary.get("ExportAsPrompt.ApplyXSL_Tooltip"));
    208 
    209 
     211        convert_xml_checkbox2.setComponentOrientation(Dictionary.getOrientation());
     212       
    210213        output_single_checkbox = new JCheckBox();
     214        output_single_checkbox.setComponentOrientation(Dictionary.getOrientation());
    211215    output_single_checkbox.setText(Dictionary.get("ExportAsPrompt.MARCXMLGroup"));
    212216        output_single_checkbox.setToolTipText(Dictionary.get("ExportAsPrompt.MARCXMLGroup_Tooltip"));
     
    214218
    215219        mapping_xml_checkbox = new JCheckBox();
     220        mapping_xml_checkbox.setComponentOrientation(Dictionary.getOrientation());
    216221    mapping_xml_checkbox.setText(Dictionary.get("ExportAsPrompt.MappingXML"));
    217222        mapping_xml_checkbox.setToolTipText(Dictionary.get("ExportAsPrompt.MappingXML_Tooltip"));
    218223
    219 
    220224        convert_xml_field1 = new JTextField();
     225        convert_xml_field1.setComponentOrientation(Dictionary.getOrientation());
    221226    convert_xml_field1.setEnabled(false);
     227
    222228    convert_xml_field2 = new JTextField();
     229        convert_xml_field2.setComponentOrientation(Dictionary.getOrientation());
    223230    convert_xml_field2.setEnabled(false);
     231
    224232    mapping_xml_field = new JTextField();
     233        mapping_xml_field.setComponentOrientation(Dictionary.getOrientation());
    225234    mapping_xml_field.setEnabled(false);
    226235
    227236        convert_xml_pane1 = new JPanel(new BorderLayout());
    228    
     237    convert_xml_pane1.setComponentOrientation(Dictionary.getOrientation());               
     238       
    229239    convert_xml_pane2 = new JPanel(new BorderLayout());
    230 
     240        convert_xml_pane2.setComponentOrientation(Dictionary.getOrientation());
     241       
    231242    mapping_xml_pane = new JPanel(new BorderLayout());
    232 
     243        mapping_xml_pane.setComponentOrientation(Dictionary.getOrientation());
     244       
    233245    convert_xml_pane = new JPanel(new GridLayout(3,1));
    234 
     246        convert_xml_pane.setComponentOrientation(Dictionary.getOrientation());
     247       
    235248    all_collections = new ArrayList();
    236249    //list = new CheckList(true);
    237250    list = new JList(getCollectionListModel());
    238251    list_label = new JLabel(Dictionary.get("DeleteCollectionPrompt.Collection_List"));
    239    
     252    list_label.setComponentOrientation(Dictionary.getOrientation());
     253       
    240254    ok_button = new GLIButton(Dictionary.get("ExportAsPrompt.Export"), Dictionary.get("ExportAsPrompt.Export_Tooltip"));
    241255   
    242256    title_field = new JTextField();
     257        title_field.setComponentOrientation(Dictionary.getOrientation());
    243258    title_field.setToolTipText(Dictionary.get("ExportAsPrompt.Export_Name_Tooltip"));
    244259    title_label = new JLabel(Dictionary.get("ExportAsPrompt.Export_Name"));
    245 
     260        title_label.setComponentOrientation(Dictionary.getOrientation());
     261       
    246262        folder_button = new GLIButton(Dictionary.get("ExportAsPrompt.Browse"),Dictionary.get("ExportAsPrompt.Browse_Tooltip"));
    247263    folder_button.addActionListener(new FolderButtonListener());
     
    294310     * returns true if it has exported the collections that are currently selected */
    295311    public boolean display() {
     312        JScrollPane scrol_tmp;
    296313    // Top pane
    297314    instructions_pane = new JPanel(new BorderLayout());
    298     instructions_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,5));
    299     instructions_pane.add(new JScrollPane(instructions_textarea), BorderLayout.CENTER);
     315        instructions_pane.setComponentOrientation(Dictionary.getOrientation());
     316        instructions_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,5));
     317        scrol_tmp = new JScrollPane(instructions_textarea);
     318        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     319        instructions_pane.add(scrol_tmp, BorderLayout.CENTER);
    300320   
    301321    title_label.setBorder(BorderFactory.createEmptyBorder(0,5,0,15));
    302322
    303323    JPanel title_pane = new JPanel(new BorderLayout());
    304     title_pane.add(title_label, BorderLayout.WEST);
     324        title_pane.setComponentOrientation(Dictionary.getOrientation());
     325    title_pane.add(title_label, BorderLayout.LINE_START);
    305326    title_pane.add(title_field, BorderLayout.CENTER);
    306         title_pane.add(folder_button, BorderLayout.EAST);
     327        title_pane.add(folder_button, BorderLayout.LINE_END);
    307328        //apply xsl pane
    308329         
     
    312333    convert_xml_pane.removeAll();
    313334
    314     convert_xml_pane1.add(convert_xml_checkbox1, BorderLayout.WEST);
     335    convert_xml_pane1.add(convert_xml_checkbox1, BorderLayout.LINE_START);
    315336    convert_xml_pane1.add(convert_xml_field1, BorderLayout.CENTER);
    316     convert_xml_pane1.add(convert_xml_button1, BorderLayout.EAST);
    317 
    318     convert_xml_pane2.add(convert_xml_checkbox2, BorderLayout.WEST);
     337    convert_xml_pane1.add(convert_xml_button1, BorderLayout.LINE_END);
     338
     339    convert_xml_pane2.add(convert_xml_checkbox2, BorderLayout.LINE_START);
    319340    convert_xml_pane2.add(convert_xml_field2, BorderLayout.CENTER);
    320     convert_xml_pane2.add(convert_xml_button2, BorderLayout.EAST);
     341    convert_xml_pane2.add(convert_xml_button2, BorderLayout.LINE_END);
    321342     
    322     mapping_xml_pane.add(mapping_xml_checkbox, BorderLayout.WEST);
     343    mapping_xml_pane.add(mapping_xml_checkbox, BorderLayout.LINE_START);
    323344    mapping_xml_pane.add(mapping_xml_field, BorderLayout.CENTER);
    324     mapping_xml_pane.add(convert_xml_button3, BorderLayout.EAST);
     345    mapping_xml_pane.add(convert_xml_button3, BorderLayout.LINE_END);
    325346
    326347    convert_xml_pane.add(convert_xml_pane1);
     
    332353        // Save as pane
    333354    JPanel saveas_pane = new JPanel(new BorderLayout());
     355        saveas_pane.setComponentOrientation(Dictionary.getOrientation());
    334356    saveas_label.setBorder(BorderFactory.createEmptyBorder(0,5,0,15));
    335     saveas_pane.add(saveas_label, BorderLayout.WEST);
     357    saveas_pane.add(saveas_label, BorderLayout.LINE_START);
    336358    saveas_pane.add(saveas_combobox, BorderLayout.CENTER);
    337359
    338360        JPanel tmp_pane = new JPanel(new BorderLayout());
     361        tmp_pane.setComponentOrientation(Dictionary.getOrientation());
    339362        tmp_pane.add(saveas_pane, BorderLayout.NORTH);
    340363    tmp_pane.add(title_pane, BorderLayout.CENTER);
     
    346369    // Central pane
    347370    JPanel list_pane = new JPanel(new BorderLayout());
     371        list_pane.setComponentOrientation(Dictionary.getOrientation());
    348372    list_pane.add(list_label, BorderLayout.NORTH);
    349     list_pane.add(new JScrollPane(list), BorderLayout.CENTER);
     373        scrol_tmp = new JScrollPane(list);
     374        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     375    list_pane.add(scrol_tmp, BorderLayout.CENTER);
    350376    list_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
    351377
    352378    JPanel details_pane = new JPanel(new BorderLayout());
     379        details_pane.setComponentOrientation(Dictionary.getOrientation());
    353380    details_pane.add(details_label, BorderLayout.NORTH);
    354     details_pane.add(new JScrollPane(details_textarea), BorderLayout.CENTER);
     381        scrol_tmp = new JScrollPane(details_textarea);
     382        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     383    details_pane.add(scrol_tmp, BorderLayout.CENTER);
    355384    details_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    356385
    357386    JPanel central_pane = new JPanel(new GridLayout(2, 1));
     387        central_pane.setComponentOrientation(Dictionary.getOrientation());
    358388    central_pane.add(list_pane);
    359389    central_pane.add(details_pane);
     
    362392    // Lower pane
    363393    JPanel button_pane = new JPanel(new GridLayout(1, 2));
     394        button_pane.setComponentOrientation(Dictionary.getOrientation());
    364395    button_pane.add(ok_button);
    365396    button_pane.add(cancel_button);
     
    367398
    368399    JPanel lower_pane = new JPanel(new BorderLayout());
     400        lower_pane.setComponentOrientation(Dictionary.getOrientation());
    369401    lower_pane.add(button_pane, BorderLayout.SOUTH);
    370402    lower_pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
     
    372404    // Final.
    373405    JPanel content_pane = (JPanel)this.getContentPane();
     406        content_pane.setComponentOrientation(Dictionary.getOrientation());
    374407    content_pane.setLayout(new BorderLayout());
    375408    content_pane.add(instructions_pane, BorderLayout.NORTH);
Note: See TracChangeset for help on using the changeset viewer.