CheckBoxListComboBox

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.

CheckBoxListComboBox

Postby sarikap08 » Thu Nov 29, 2012 11:28 am

CheckBoxListComboBox is ComboBox which we can choose a value from a drop-down CheckBoxList.

By default after opening the list we are getting option to select OK and CANCLE Button. I want to add Select All and Select None Button.

How I can do it.Please suggest the solution.
sarikap08
 
Posts: 4
Joined: Mon Jun 27, 2011 4:25 am

Re: CheckBoxListComboBox

Postby JIDE Support » Thu Nov 29, 2012 11:54 am

Please give the following code a try. You will have to implement the action listener of these two buttons. B.T.W., I will move this thread to the "Pre-sale Support" forum since this component is not in the common layer project.
Code: Select all
    static class CustomizeCheckBoxListComboBox extends CheckBoxListComboBox {
        public CustomizeCheckBoxListComboBox() {
            super();
        }

        public CustomizeCheckBoxListComboBox(Object[] objects) {
            super(objects);
        }

        public CustomizeCheckBoxListComboBox(Vector<?> objects) {
            super(objects);
        }

        public CustomizeCheckBoxListComboBox(ComboBoxModel model) {
            super(model);
        }

        public CustomizeCheckBoxListComboBox(Object[] objects, Class<?> clazz) {
            super(objects, clazz);
        }

        public CustomizeCheckBoxListComboBox(Vector<?> objects, Class<?> clazz) {
            super(objects, clazz);
        }

        public CustomizeCheckBoxListComboBox(ComboBoxModel model, Class<?> clazz) {
            super(model, clazz);
        }

        @Override
        protected MultiSelectListChooserPanel createListChooserPanel(ComboBoxModel dataModel, Class<?> clazz, ConverterContext converterContext) {
            return new CheckBoxListChooserPanel(dataModel, clazz, converterContext,
                    getDialogOKAction(), getDialogCancelAction()) {
                @Override
                protected void setupList(final JList list) {
                    super.setupList(list);
                    CustomizeCheckBoxListComboBox.this.setupList(list);
                }

                @Override
                public Component createButtonPanel(int alignment) {
                    Component buttonPanel = super.createButtonPanel(alignment);
                    if (buttonPanel instanceof ButtonPanel) {
                        ((ButtonPanel) buttonPanel).addButton(new JButton("Select All"));
                        ((ButtonPanel) buttonPanel).addButton(new JButton("Deselect All"));
                    }
                    return buttonPanel;
                }
            };
        }
    }

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 3 guests