Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Calling Format Programmatically
Calling Format Programmatically [message #218852] Mon, 04 August 2008 19:04 Go to next message
Philippe Sabourin is currently offline Philippe SabourinFriend
Messages: 28
Registered: July 2009
Junior Member
I have a multi-page editor that has a form page and a source page and I
would like to call the Format action on the source page when they switch
from the Form page to the Source after any changes, since adding elements
to it currently messes up the format. Is there any way to make that call
or do I need to use external tools to make it format properly?
Re: Calling Format Programmatically [message #219004 is a reply to message #218852] Wed, 06 August 2008 15:15 Go to previous message
Philippe Sabourin is currently offline Philippe SabourinFriend
Messages: 28
Registered: July 2009
Junior Member
Philippe Sabourin wrote:

> I have a multi-page editor that has a form page and a source page and I
> would like to call the Format action on the source page when they switch
> from the Form page to the Source after any changes, since adding elements
> to it currently messes up the format. Is there any way to make that call
> or do I need to use external tools to make it format properly?

I have found the solution to this:

ICommandService cmdService = (ICommandService)
getSite().getService(ICommandService.class);
Command format =
cmdService.getCommand("org.eclipse.wst.sse.ui.format.document ");
if (format.isDefined()) {
try {
format.executeWithChecks(new ExecutionEvent());
} catch ... exceptions ...}
Previous Topic:custom build.xml + jetty
Next Topic:XML Catalog question
Goto Forum:
  


Current Time: Fri Oct 20 12:37:30 GMT 2017

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

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