Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to enable select all?
How to enable select all? [message #155225] Sat, 23 October 2004 00:15 Go to next message
Eclipse UserFriend
Originally posted by: bo.fubar.majewski.com

Logic example allows to select all. Again, I am lost in the 121 classes
to find the line(s) of code that enable Edit/Select All functionality.
Where is the magic that does it hidden? Thanks in advance!
Re: How to enable select all? [message #155431 is a reply to message #155225] Mon, 25 October 2004 04:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It's not in any of those 121.
I would start with the class called SelectAllAction. Go to its constructor
and press CTRL+ALT+H.

"Bo Majewski" <bo@fubar.majewski.com> wrote in message
news:clc7g8$ip3$1@eclipse.org...
> Logic example allows to select all. Again, I am lost in the 121 classes
> to find the line(s) of code that enable Edit/Select All functionality.
> Where is the magic that does it hidden? Thanks in advance!
Re: How to enable select all? [message #155485 is a reply to message #155431] Mon, 25 October 2004 17:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bo.fubar.majewski.com

Randy Hudson wrote:
> It's not in any of those 121.
> I would start with the class called SelectAllAction. Go to its constructor
> and press CTRL+ALT+H.

Once again, an excellent tip. Thanks Randy. Just for those who have a
similar question in the future, here is how it is done. The LogicEditor
class overrides the protected method createActions. In it, however, the
parent's class version is called first:

protected void createActions() {
super.createActions();
...

If you take a look at the GraphicalEditor class you will see the code
where the action is created:

protected void createActions() {
ActionRegistry registry = getActionRegistry();
IAction action;
...
action = new SelectAllAction(this);
registry.registerAction(action);

In LogicActionBarContributor, which is a class registered as the
contributor to the editor class in plugin.xml, the select all action is
registered as a global action:

protected void declareGlobalActionKeys() {
addGlobalActionKey(IWorkbenchActionConstants.PRINT);
addGlobalActionKey(IWorkbenchActionConstants.SELECT_ALL);
addGlobalActionKey(IWorkbenchActionConstants.PASTE);
}

Note that the above uses deprecated constants and a better way would be
to do

addGlobalActionKey(ActionFactory.SELECT_ALL.getId())

for the select actions. Similar change can be performed for the paste
and print actions, though I have not tested it, yet.
Re: How to enable select all? [message #155635 is a reply to message #155485] Tue, 26 October 2004 14:52 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You may have overridden createActions() and not called super. I have
changed the JavaDoc to explicitly state that subclasses should *extend* this
method, which means that you need to call super.createAction(). Most places
we are using "override" and "extend" correctly, but not here apparently.

"Bo Majewski" <bo@fubar.majewski.com> wrote in message
news:cljcou$2vp$1@eclipse.org...
> Randy Hudson wrote:
> > It's not in any of those 121.
> > I would start with the class called SelectAllAction. Go to its
constructor
> > and press CTRL+ALT+H.
>
Previous Topic:GEF
Next Topic:Question Regarding ActivityDiagramPart in Flow Example
Goto Forum:
  


Current Time: Sat Oct 19 05:13:26 GMT 2024

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

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

Back to the top