Ignore:
Timestamp:
2008-12-26T14:35:15+13:00 (15 years ago)
Author:
kjdon
Message:

interface updated to display right to left for rtl languages. This code is thanks to Amin Hejazi. It seems to be only partially complete. Amin was working with Greenstone 3 so might have missed some panels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/branches/rtl-gli/src/org/greenstone/gatherer/gui/ExportAsPrompt.java

    r14045 r18297  
    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");
     
    166166    details_textarea = new JTextArea(Dictionary.get("DeleteCollectionPrompt.No_Collection"));
    167167    details_textarea.setEditable(false);
    168    
     168    details_textarea.setComponentOrientation(Dictionary.getOrientation());
     169       
    169170    details_label = new JLabel(Dictionary.get("DeleteCollectionPrompt.Collection_Details"));
    170171   
     
    176177    instructions_textarea.setRows(4);
    177178    instructions_textarea.setWrapStyleWord(true);
    178    
     179    instructions_textarea.setComponentOrientation(Dictionary.getOrientation());
    179180             
    180181        // Save As
     
    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_field2 = new JTextField();
     227        convert_xml_field2.setComponentOrientation(Dictionary.getOrientation());
    222228    mapping_xml_field = new JTextField();
     229        mapping_xml_field.setComponentOrientation(Dictionary.getOrientation());
    223230
    224231        convert_xml_pane1 = new JPanel(new BorderLayout());
    225    
     232    convert_xml_pane1.setComponentOrientation(Dictionary.getOrientation());               
     233       
    226234    convert_xml_pane2 = new JPanel(new BorderLayout());
    227 
     235        convert_xml_pane2.setComponentOrientation(Dictionary.getOrientation());
     236       
    228237    mapping_xml_pane = new JPanel(new BorderLayout());
    229 
     238        mapping_xml_pane.setComponentOrientation(Dictionary.getOrientation());
     239       
    230240    convert_xml_pane = new JPanel(new GridLayout(3,1));
    231 
     241        convert_xml_pane.setComponentOrientation(Dictionary.getOrientation());
     242       
    232243    all_collections = new ArrayList();
    233244    list = new CheckList(true);
    234245    list_label = new JLabel(Dictionary.get("DeleteCollectionPrompt.Collection_List"));
    235    
     246    list_label.setComponentOrientation(Dictionary.getOrientation());
     247       
    236248    ok_button = new GLIButton(Dictionary.get("ExportAsPrompt.Export"), Dictionary.get("ExportAsPrompt.Export_Tooltip"));
    237249   
    238250    title_field = new JTextField();
     251        title_field.setComponentOrientation(Dictionary.getOrientation());
    239252    title_field.setToolTipText(Dictionary.get("ExportAsPrompt.Export_Name_Tooltip"));
    240253    title_label = new JLabel(Dictionary.get("ExportAsPrompt.Export_Name"));
    241 
     254        title_label.setComponentOrientation(Dictionary.getOrientation());
     255       
    242256        folder_button = new GLIButton(Dictionary.get("ExportAsPrompt.Browse"),Dictionary.get("ExportAsPrompt.Browse_Tooltip"));
    243257    folder_button.addActionListener(new FolderButtonListener());
     
    296310     * returns true if it has exported the collections that are currently selected */
    297311    public boolean display() {
     312        JScrollPane scrol_tmp;
    298313    // Top pane
    299314    instructions_pane = new JPanel(new BorderLayout());
    300     instructions_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,5));
    301     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);
    302320   
    303321    title_label.setBorder(BorderFactory.createEmptyBorder(0,5,0,15));
    304322
    305323    JPanel title_pane = new JPanel(new BorderLayout());
    306     title_pane.add(title_label, BorderLayout.WEST);
     324        title_pane.setComponentOrientation(Dictionary.getOrientation());
     325    title_pane.add(title_label, BorderLayout.LINE_START);
    307326    title_pane.add(title_field, BorderLayout.CENTER);
    308         title_pane.add(folder_button, BorderLayout.EAST);
     327        title_pane.add(folder_button, BorderLayout.LINE_END);
    309328        //apply xsl pane
    310329         
     
    314333    convert_xml_pane.removeAll();
    315334
    316     convert_xml_pane1.add(convert_xml_checkbox1, BorderLayout.WEST);
     335    convert_xml_pane1.add(convert_xml_checkbox1, BorderLayout.LINE_START);
    317336    convert_xml_pane1.add(convert_xml_field1, BorderLayout.CENTER);
    318     convert_xml_pane1.add(convert_xml_button1, BorderLayout.EAST);
    319 
    320     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);
    321340    convert_xml_pane2.add(convert_xml_field2, BorderLayout.CENTER);
    322     convert_xml_pane2.add(convert_xml_button2, BorderLayout.EAST);
     341    convert_xml_pane2.add(convert_xml_button2, BorderLayout.LINE_END);
    323342     
    324     mapping_xml_pane.add(mapping_xml_checkbox, BorderLayout.WEST);
     343    mapping_xml_pane.add(mapping_xml_checkbox, BorderLayout.LINE_START);
    325344    mapping_xml_pane.add(mapping_xml_field, BorderLayout.CENTER);
    326     mapping_xml_pane.add(convert_xml_button3, BorderLayout.EAST);
     345    mapping_xml_pane.add(convert_xml_button3, BorderLayout.LINE_END);
    327346
    328347    convert_xml_pane.add(convert_xml_pane1);
     
    343362        // Save as pane
    344363    JPanel saveas_pane = new JPanel(new BorderLayout());
     364        saveas_pane.setComponentOrientation(Dictionary.getOrientation());
    345365    saveas_label.setBorder(BorderFactory.createEmptyBorder(0,5,0,15));
    346     saveas_pane.add(saveas_label, BorderLayout.WEST);
     366    saveas_pane.add(saveas_label, BorderLayout.LINE_START);
    347367    saveas_pane.add(saveas_combobox, BorderLayout.CENTER);
    348368
    349369        JPanel tmp_pane = new JPanel(new BorderLayout());
     370        tmp_pane.setComponentOrientation(Dictionary.getOrientation());
    350371        tmp_pane.add(saveas_pane, BorderLayout.NORTH);
    351372    tmp_pane.add(title_pane, BorderLayout.CENTER);
     
    357378    // Central pane
    358379    JPanel list_pane = new JPanel(new BorderLayout());
     380        list_pane.setComponentOrientation(Dictionary.getOrientation());
    359381    list_pane.add(list_label, BorderLayout.NORTH);
    360     list_pane.add(new JScrollPane(list), BorderLayout.CENTER);
     382        scrol_tmp = new JScrollPane(list);
     383        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     384    list_pane.add(scrol_tmp, BorderLayout.CENTER);
    361385    list_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
    362386
    363387    JPanel details_pane = new JPanel(new BorderLayout());
     388        details_pane.setComponentOrientation(Dictionary.getOrientation());
    364389    details_pane.add(details_label, BorderLayout.NORTH);
    365     details_pane.add(new JScrollPane(details_textarea), BorderLayout.CENTER);
     390        scrol_tmp = new JScrollPane(details_textarea);
     391        scrol_tmp.setComponentOrientation(Dictionary.getOrientation());
     392    details_pane.add(scrol_tmp, BorderLayout.CENTER);
    366393    details_pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    367394
    368395    JPanel central_pane = new JPanel(new GridLayout(2, 1));
     396        central_pane.setComponentOrientation(Dictionary.getOrientation());
    369397    central_pane.add(list_pane);
    370398    central_pane.add(details_pane);
     
    373401    // Lower pane
    374402    JPanel button_pane = new JPanel(new GridLayout(1, 2));
     403        button_pane.setComponentOrientation(Dictionary.getOrientation());
    375404    button_pane.add(ok_button);
    376405    button_pane.add(cancel_button);
     
    378407
    379408    JPanel lower_pane = new JPanel(new BorderLayout());
     409        lower_pane.setComponentOrientation(Dictionary.getOrientation());
    380410    lower_pane.add(button_pane, BorderLayout.SOUTH);
    381411    lower_pane.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
     
    383413    // Final.
    384414    JPanel content_pane = (JPanel)this.getContentPane();
     415        content_pane.setComponentOrientation(Dictionary.getOrientation());
    385416    content_pane.setLayout(new BorderLayout());
    386417    content_pane.add(instructions_pane, BorderLayout.NORTH);
Note: See TracChangeset for help on using the changeset viewer.