RTL issues in some components

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

RTL issues in some components

Postby Reyada Wolak » Wed Aug 08, 2012 3:27 am

Using jide_demo,

- the orientation of the label (and icons) of JideSplitButton in RTL is not reversed. it is correctly handled by JideButton but not JideSplitButton.
- the text/numbers inside SimpleScrollPane cells are not reversed in RTL. it is actually the case for all components with tables/cells.
- AutoCompletionComboBox popup menu is not reversed (the text). for example it is correctly handled by OverlayComboBox
Reyada Wolak
 
Posts: 10
Joined: Tue May 26, 2009 9:03 pm

Re: RTL issues in some components

Postby JIDE Support » Wed Aug 08, 2012 4:53 pm

Thanks for the bug report. Will fix the issues on JideSplitButton and AutoCompletionComboBox in next regular release. Regarding of SimpleScrollPane, it will work if a JideTable was used instead of JTable.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: RTL issues in some components

Postby JIDE Support » Fri Aug 10, 2012 2:12 pm

Regarding of AutoCompletionComboBox, I am afraid you have to do it yourself.
AutoCompletionComboBox extends JComboBox directly. Hence ComboBoxEditor was used when it is set to be editable. And ComboBoxEditor did not support right-to-left orientation. We recommend to use ListExComboBox with an AutoCompletion installed. A demo is posted below FYI.

Code: Select all
/*
 * @(#)AutoCompletionDemo.java 6/24/2005
 *
 * Copyright 2002 - 2005 JIDE Software Inc. All rights reserved.
 */

import com.jidesoft.combobox.ExComboBox;
import com.jidesoft.combobox.ListExComboBox;
import com.jidesoft.combobox.PopupPanel;
import com.jidesoft.plaf.LookAndFeelFactory;
import com.jidesoft.plaf.basic.ExComboBoxEditor;
import com.jidesoft.swing.*;
import com.sun.java.swing.plaf.windows.WindowsComboBoxUI;

import javax.swing.*;
import java.awt.*;
import java.util.Arrays;
import java.util.List;

/**
 * Demoed Component: {@link com.jidesoft.swing.AutoCompletion}, {@link com.jidesoft.swing.AutoCompletionComboBox}. <br>
 * Required jar files: jide-common.jar, jide-grids.jar <br> Required L&F: Jide L&F extension required
 */
public class AutoCompletionDemo {
    private static final long serialVersionUID = -3703831246278663243L;

    protected String[] _fontNames;
    protected List<String> _fontList;

    public AutoCompletionDemo() {
    }

    public String getName() {
        return "AutoCompletion Demo";
    }

    public Component getDemoPanel() {
        _fontNames = DemoData.getFontNames();
        _fontList = Arrays.asList(_fontNames);

        JPanel panel1 = createPanel1();
        JPanel panel2 = createPanel2();

        JPanel panel = new JPanel(new BorderLayout(6, 6));
        panel.add(panel1, BorderLayout.BEFORE_FIRST_LINE);
        panel.add(panel2);
        return panel;
    }

    private JPanel createPanel1() {
        JPanel panel = new JPanel();
        panel.setLayout(new JideBoxLayout(panel, JideBoxLayout.Y_AXIS));
        panel.setBorder(BorderFactory.createCompoundBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "AutoCompletion combo box and text field", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP),
                BorderFactory.createEmptyBorder(0, 0, 0, 0)));

        ExComboBox autoCompletionComboBox = new ListExComboBox(_fontNames, String.class);
        autoCompletionComboBox.setName("AutoCompletion JComboBox (Strict)");
        autoCompletionComboBox.setToolTipText("AutoCompletion JComboBox (Strict)");
        panel.add(new JLabel("AutoCompletion JComboBox (Strict)"));
        panel.add(Box.createVerticalStrut(3), JideBoxLayout.FIX);
        panel.add(autoCompletionComboBox);
        panel.add(Box.createVerticalStrut(12), JideBoxLayout.FIX);

        ListExComboBox autoCompletionComboBoxNotStrict = new ListExComboBox(_fontNames, String.class);
        autoCompletionComboBoxNotStrict.setEditable(true);
        final JList fontNameList = new JList(_fontNames);
        new AutoCompletion((JTextField)(autoCompletionComboBoxNotStrict.getEditor().getEditorComponent()), new ListSearchable(fontNameList));

        autoCompletionComboBoxNotStrict.setName("AutoCompletion JComboBox (Not strict)");
        autoCompletionComboBoxNotStrict.setToolTipText("AutoCompletion JComboBox (Not strict)");
        panel.add(new JLabel("AutoCompletion JComboBox (Not strict)"));
        panel.add(Box.createVerticalStrut(3), JideBoxLayout.FIX);
        panel.add(autoCompletionComboBoxNotStrict);
        panel.add(Box.createVerticalStrut(12), JideBoxLayout.FIX);

        // create tree combobox
        final JTextField textField = new JTextField();
        textField.setName("AutoCompletion JTextField with a hidden data");
        SelectAllUtils.install(textField);
        new AutoCompletion(textField, _fontList);
        panel.add(new JLabel("AutoCompletion JTextField with a hidden data"));
        panel.add(Box.createVerticalStrut(3), JideBoxLayout.FIX);
        panel.add(textField);
        panel.add(Box.createVerticalStrut(12), JideBoxLayout.FIX);

        return panel;
    }

    private JPanel createPanel2() {
        JPanel panel = new JPanel();
        panel.setLayout(new JideBoxLayout(panel, JideBoxLayout.Y_AXIS));
        panel.setBorder(BorderFactory.createCompoundBorder(new JideTitledBorder(new PartialEtchedBorder(PartialEtchedBorder.LOWERED, PartialSide.NORTH), "AutoCompletion with list and tree", JideTitledBorder.LEADING, JideTitledBorder.ABOVE_TOP),
                BorderFactory.createEmptyBorder(0, 0, 0, 0)));

        // create tree combobox
        final JTextField treeTextField = new JTextField();
        treeTextField.setName("AutoCompletion JTextField with JTree");
        SelectAllUtils.install(treeTextField);
        final JTree tree = new JTree();
        tree.setVisibleRowCount(10);
        final TreeSearchable searchable = new TreeSearchable(tree);
        searchable.setRecursive(true);
        new AutoCompletion(treeTextField, searchable);
        panel.add(new JLabel("AutoCompletion JTextField with JTree"));
        panel.add(Box.createVerticalStrut(3), JideBoxLayout.FIX);
        panel.add(treeTextField);
        panel.add(Box.createVerticalStrut(2), JideBoxLayout.FIX);
        panel.add(new JScrollPane(tree));
        panel.add(Box.createVerticalStrut(12), JideBoxLayout.FIX);

        // create font name combobox
        final JTextField fontNameTextField = new JTextField();
        fontNameTextField.setName("AutoCompletion JTextField with JList");
        SelectAllUtils.install(fontNameTextField);
        final JList fontNameList = new JList(_fontNames);
        fontNameList.setVisibleRowCount(10);
        new AutoCompletion(fontNameTextField, new ListSearchable(fontNameList));
        panel.add(new JLabel("AutoCompletion JTextField with JList"));
        panel.add(Box.createVerticalStrut(3), JideBoxLayout.FIX);
        panel.add(fontNameTextField);
        panel.add(Box.createVerticalStrut(2), JideBoxLayout.FIX);
        panel.add(new JScrollPane(fontNameList));
        panel.add(Box.createVerticalStrut(12), JideBoxLayout.FIX);

        return panel;
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
                AutoCompletionDemo demo = new AutoCompletionDemo();
                JFrame frame = new JFrame();
                frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                frame.getContentPane().add(demo.getDemoPanel());
                frame.pack();
                frame.setVisible(true);

                JideSwingUtilities.toggleRTLnLTR(frame);
                JideSwingUtilities.invalidateRecursively(frame);
            }
        });
    }
}


Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: RTL issues in some components

Postby JIDE Support » Mon Aug 20, 2012 6:15 pm

Just so you know, this is fixed in 3.4.5 just released.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: Google [Bot] and 12 guests

cron