Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ACTION_ARRANGE_ALL: how to execute it from custom Action?
ACTION_ARRANGE_ALL: how to execute it from custom Action? [message #521920] Fri, 19 March 2010 10:05 Go to next message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi,

I need to execute an 'ARRANGE ALL' action on a diagram, called by a own custom action (essentially an Open Diagram Action); this is the code:

ArrangeAction arrangeAction = ArrangeAction.createArrangeAllAction(page);

arrangeAction.run();

but I got a NullPointerException. Maybe I'm calling and executing the Action in a wrong way?

Thanks for any help, regards

Giovanni.
Re: ACTION_ARRANGE_ALL: how to execute it from custom Action? [message #521942 is a reply to message #521920] Fri, 19 March 2010 12:05 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Giovanni wrote:
> Hi,
>
> I need to execute an 'ARRANGE ALL' action on a diagram, called by a own
> custom action (essentially an Open Diagram Action); this is the code:
>
> ArrangeAction arrangeAction = ArrangeAction.createArrangeAllAction(page);
>
> arrangeAction.run();
>
> but I got a NullPointerException. Maybe I'm calling and executing the
> Action in a wrong way?

You'll have to debug into your arrangeAction to find out what the NPE
is. For example, are you passing in a null page?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: ACTION_ARRANGE_ALL: how to execute it from custom Action? [message #521983 is a reply to message #521942] Fri, 19 March 2010 14:40 Go to previous message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Paul,

no, I'm sure the page I'm passing it's not null, I retrieve it with the following code:

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();

I have debugged the code, but I'm unable to find the NPE source.

Any suggestion?

Thanks,
Giovanni.
Previous Topic:Decorator performance
Next Topic:Extension Point and Class Loading Error
Goto Forum:
  


Current Time: Fri Apr 26 13:40:41 GMT 2024

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

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

Back to the top