Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding button to ListSelectionDialog
Adding button to ListSelectionDialog [message #466331] Wed, 18 April 2007 00:53 Go to next message
Eclipse UserFriend
Originally posted by: jweeks.neuraldk.org

Hello,

I fear this is a trivial task, but I'm new to jface and Eclipse plugins and
I'm unable to add a new button to a ListSelectionDialog.

I'd like to subclass a ListSelectionDialog and add one extra button which
will pop up a new dialog and allow me to add new items to the list.
Ideally, that button would be next to the "Select All" and "Deselect All"
buttons, but I'm really not picky about location, I'm more concerned with
understanding the process involved in adding this new button and getting it
to interact with the existing dialog as described.

I've seen a bunch of tutorials about creating new dialogs, but I haven't
found one yet that seems to describe how to do what I need.  Could someone
please point me in the right direction?

Thanks,
Jeff
Re: Adding button to ListSelectionDialog [message #466568 is a reply to message #466331] Fri, 20 April 2007 23:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jweeks.neuraldk.org

After looking into the source code for the ListSelectionDialog I discovered
that, I believe, it's not possible to extend this dialog. The method
addSelectionButtons() creates the Composite and Button's, which I would
have liked to change, but the method cannot be overriden (private) and the
Composite is an inacessible local variable.

As such, my solution has been to, effectively, copy the ListSelectionDialog
source code, and tailor it to my own needs.

--Jeff


Jeff Weeks [ neuraldk ] wrote:

> Hello,
>
> I fear this is a trivial task, but I'm new to jface and Eclipse plugins
> and I'm unable to add a new button to a ListSelectionDialog.
>
> I'd like to subclass a ListSelectionDialog and add one extra button which
> will pop up a new dialog and allow me to add new items to the list.
> Ideally, that button would be next to the "Select All" and "Deselect All"
> buttons, but I'm really not picky about location, I'm more concerned with
> understanding the process involved in adding this new button and getting
> it to interact with the existing dialog as described.
>
> I've seen a bunch of tutorials about creating new dialogs, but I haven't
> found one yet that seems to describe how to do what I need.  Could someone
> please point me in the right direction?
>
> Thanks,
> Jeff
Re: Adding button to ListSelectionDialog [message #466600 is a reply to message #466568] Sun, 22 April 2007 18:08 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
If you are not really concerned about the location of the button, you can override the createButtonsForButtonBar method and place your buttons along with the OK/Cancel button.
Previous Topic:How to properly register context submenu
Next Topic:About custom widget and rcp
Goto Forum:
  


Current Time: Fri Apr 26 21:20:12 GMT 2024

Powered by FUDForum. Page generated in 0.02987 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top