Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » Calling Format Programmatically
Calling Format Programmatically [message #218852] Mon, 04 August 2008 15:04 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
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: Sat Jun 07 17:29:40 EDT 2025

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

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

Back to the top