How to enable select all? [message #155225] |
Sat, 23 October 2004 00:15 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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.
>
|
|
|
Powered by
FUDForum. Page generated in 0.24013 seconds