Bug 77809 - [format] Line wrapping for enum constants
Summary: [format] Line wrapping for enum constants
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-04 05:25 EST by Martin Aeschlimann CLA
Modified: 2005-05-13 09:18 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2004-11-04 05:25:29 EST
20041104

I think it might make sense to be able to set the allignment of enum constants
as you might define them all on a line

enum MyColors {
  BLUE, RED, GREEN, YELLOW, BLACK
}
Comment 1 Olivier Thomann CLA 2005-03-29 14:42:56 EST
Do you need this for 3.1?
Comment 2 Olivier Thomann CLA 2005-03-29 15:01:55 EST
I can add this new API and do it after M6.
	/**
	 * <pre>
	 * FORMATTER / Option for alignment of enum constants
	 *     - option id:        
"org.eclipse.jdt.core.formatter.alignment_for_enum_constants"
	 *     - possible values:   values returned by
<code>createAlignmentValue(boolean, int, int)</code> call
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT,
INDENT_DEFAULT)
	 * </pre>
	 * @see #createAlignmentValue(boolean, int, int)
	 * @since 3.1
	 */
	public static final String FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT =
JavaCore.PLUGIN_ID + ".formatter.alignment_for_enum_constants";	 //$NON-NLS-1$
Comment 3 Olivier Thomann CLA 2005-03-29 15:27:28 EST
Default should be no wrapping.
I will add the API for M6 and implement it for M7.
Comment 4 Martin Aeschlimann CLA 2005-03-30 01:54:57 EST
ok, great
Comment 5 Olivier Thomann CLA 2005-04-04 15:42:09 EDT
Fixed and released in HEAD.
Regression tests added in FormatterRegressionTests.test570/571.
Martin,
could you please add this option to the code formatter preference page?
Comment 6 Martin Aeschlimann CLA 2005-04-05 04:15:17 EDT
UI added > 20050405
Comment 7 Maxime Daniel CLA 2005-05-13 06:21:44 EDT
Verified for 3.1 M7 using build I20050512-2035 + jdt.core HEAD.