Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349798 - [1.7][preferences][formatting] Line wrapping and indentation options for try with resources and multi-catch arguments
Summary: [1.7][preferences][formatting] Line wrapping and indentation options for try ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.7.1   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 350521 (view as bug list)
Depends on: 349396 350697
Blocks:
  Show dependency tree
 
Reported: 2011-06-20 06:08 EDT by Markus Keller CLA
Modified: 2011-08-02 05:45 EDT (History)
5 users (show)

See Also:
markus.kell.r: review+


Attachments
fix (13.94 KB, patch)
2011-06-29 05:22 EDT, Deepak Azad CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-06-20 06:08:21 EDT
+++ This bug was initially created as a clone of Bug #349396 +++

BETA_JAVA7

UI for the new options from bug 349396.
Comment 1 Markus Keller CLA 2011-06-20 06:10:58 EDT
Deepak, can you please have a look? In the preview, please add 2 resources to the existing try statement.
Comment 2 Deepak Azad CLA 2011-06-28 10:08:06 EDT
Multi catch: UI for the new options from bug 349314.
Comment 3 Deepak Azad CLA 2011-06-28 10:08:39 EDT
*** Bug 350521 has been marked as a duplicate of this bug. ***
Comment 4 Deepak Azad CLA 2011-06-29 05:22:19 EDT
Created attachment 198806 [details]
fix

The preview on 'Line Wrapping' page is not coming correctly, I am not sure why. Markus can you please take a look.
Comment 5 Deepak Azad CLA 2011-06-29 06:09:36 EDT
- The same snippet for try with resources is formatted correctly on 'While space' page which uses SnippetPreview whereas 'Line wrapping' page uses CompilationUnitPreview
- JavaPreview.JavaPreview(Map<String, String>, Composite) has references to JavaCore.VERSION_1_5. I changed these to JavaCore.VERSION_1_7 but this did not change anything.
Comment 6 Markus Keller CLA 2011-06-29 08:40:27 EDT
Fix looks good with these corrections in WhiteSpaceOptions:

- createTryStatementTree(Map<String, String>, InnerNode):
FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_TRY should be at the end (options are sorted in declaration order)

- formatting of TRY_PREVIEW could be aligned with all the other snippets

Fix for bug 350697 resolved the problems with the preview formatting.
Comment 7 Deepak Azad CLA 2011-06-29 09:33:32 EDT
Committed to BETA_JAVA7 with the changes from comment 6.
Comment 8 Jay Arthanareeswaran CLA 2011-07-20 02:14:39 EDT
Verified.