Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Calling Format Programmatically
Calling Format Programmatically [message #218852] Mon, 04 August 2008 15:04 Go to next message
Philippe Sabourin is currently offline Philippe Sabourin
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 11:15 Go to previous message
Philippe Sabourin is currently offline Philippe Sabourin
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:XML Catalog question
Next Topic:Extension point
Goto Forum:
  


Current Time: Fri Aug 22 23:37:55 EDT 2014

Powered by FUDForum. Page generated in 0.02216 seconds