Author Topic: Method formatting  (Read 4748 times)

peternorman

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Method formatting
« on: April 01, 2009, 06:39:01 pm »
I know I'm able to format my (if, for, etc) with my particular brace style but I'm unable to find a way to do the same thing with methods, classes and interfaces. Is this an oversight on my part or is this just not possible?

I'm basically looking for se to format my method, classes, and interfaces like the following

public void foo ()
{
}

as opposed to
public void foo (){
}

Thanks in advance,
Peter

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Method formatting
« Reply #1 on: April 01, 2009, 07:00:44 pm »
I think what you are looking for is the Beautifier under Format > Beautify.  On the "Begin/end style" tab you want to choose "Style 2", and check "Apply to function braces".  When you Beautify your file you should get the brace style you desire on your methods and classes.

- Ryan

peternorman

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: Method formatting
« Reply #2 on: April 01, 2009, 07:09:58 pm »
Thank you for the response but I was hoping that it would automatically insert the braces after I type public void foo () just the same way it happens when you type if ().

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Method formatting
« Reply #3 on: April 01, 2009, 07:17:45 pm »
You should probably be making use of aliases for defining method/class templates.  Check out the Help at SlickEdit Core v3.4 for Eclipse > Editing Features > Aliases > Language-Specific Aliases.  You can define templates for your methods/classes which can prompt for modifiers, parameters, insert the braces exactly as you like, and leave the cursor exactly where you want it.

- Ryan