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 06:05 Go to next message
Giovanni De Sossi is currently offline Giovanni De Sossi
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 08:05 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6857
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 10:40 Go to previous message
Giovanni De Sossi is currently offline Giovanni De Sossi
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: Wed Jul 23 01:55:54 EDT 2014

Powered by FUDForum. Page generated in 0.03483 seconds