JidePopup with JList

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.

JidePopup with JList

Postby jitun » Tue Aug 27, 2013 3:51 am

As JList is not editable, I am trying to provide a popup by using right click button press which has a JTextArea which I expected to be editable..
I know the whole line (Jlist) can be copy pasted.. but I just want to provide copy paste certain words in the line.

Image

but the popup/JTextArea is non editable, you you can see.. when I type something in.. it gets reflected in the JList below..

Image

Code: Select all
final JList<String> list = new JList<String>(LogReader.ReadLog(FilePath +File.separator+ FileName, FilePath +File.separator+ FileName1, FilePath +File.separator+ FileName2, null, null));
       list.setFont(new Font("HP Simplified", Font.PLAIN, Integer.parseInt(PropertyFile.DefaultFontSize)));
       SearchableUtils.installSearchable(list);
       list.setSelectionForeground(null);

       list.addMouseListener(new MouseAdapter()
        {
            public void mouseReleased(MouseEvent e)
            {
                if(e.getButton() == MouseEvent.BUTTON3)
                {
                   
                   System.out.println("list.getSelectedValue()" + list.getSelectedValue());
                   JidePopup _popup = new JidePopup();
                   _popup.setResizable(true);
                    _popup.setMovable(true);
                    _popup.setEnabled(true);
                    _popup.setFocusable(true);
                   
                   
                    JTextArea view = new JTextArea();
                    view.setRows(10);
                    view.setColumns(100);
                    view.setLineWrap(true);
                    view.setText(list.getSelectedValue());
                    view.setEditable(true);
                    view.setFocusable(true);
                    _popup.setContentPane(view);
                    _popup.setDefaultFocusComponent(view);
                   
                    if (_popup.isPopupVisible()) {
                        _popup.hidePopup();
                    }
                    else {
                        _popup.showPopup();
                    }
                }
            }

        });

list.setCellRenderer(new StyledListCellRenderer() {...
}

jitun
 
Posts: 3
Joined: Thu Jan 24, 2013 10:34 pm

Re: JidePopup with JList

Postby JIDE Support » Tue Aug 27, 2013 11:14 am

JidePopup by default is not focusable. Please try to invoke JidePopup#setFocusable(true) and check if it could work for you.

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

Re: JidePopup with JList

Postby jitun » Tue Aug 27, 2013 11:25 am

The pasted code already has
_popup.setFocusable(true);
view.setFocusable(true);

As you can see i am able to search by typing on the keyboard..
So instead of focus on the popup.. the focus still is with the Jlist.

I have tried to list.setFocusable(false).. but that disables the focus from the JList.. but does not still give it to the popup.

You can try jide popup on B13.AutoCompletion or B7.SearchableComponents
jitun
 
Posts: 3
Joined: Thu Jan 24, 2013 10:34 pm

Re: JidePopup with JList

Postby JIDE Support » Wed Aug 28, 2013 11:17 am

Could you please give JIDE PopupDemo a try? In that demo, you could see an editable JTextArea inside the JidePopup and it works quite well. If there is still any issue, please share with us a stand-alone test case to investigate further.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36466
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: No registered users and 4 guests