This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208768 - Provide special indenting for JavaFX builders
Summary: Provide special indenting for JavaFX builders
Status: NEW
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.1
Hardware: PC Windows 7 x64
: P3 normal with 2 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-22 20:16 UTC by Alexander Kouznetsov
Modified: 2013-09-04 13:46 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2012-02-22 20:16:58 UTC
JavaFX has Fluent API that support creation of multiple objects as a chain of method calls. It is really needed to have NetBeans to automatically format these chains as in the following example:

            setGraphic(HBoxBuilder.create()
                    .children(
                        ImageViewBuilder.create()
                            .build(),
                        VBoxBuilder.create()
                            .children(
                                HBoxBuilder.create()
                                    .children(
                                        LabelBuilder.create()
                                            .text("Presentation Title")
                                            .build(),
                                        new PresentationListCell.Spacer(),
                                        LabelBuilder.create()
                                            .text("60:07")
                                            .build()
                                    )
                                    .build(),
                                LabelBuilder.create()
                                    .text("Presentation Description")
                                    .build(),
                                HBoxBuilder.create()
                                    .spacing(19)
                                    .id("presentation-labels")
                                    .children(
                                        LabelBuilder.create()
                                            .text("Presentation Authors")
                                            .build(),
                                        new PresentationListCell.Spacer(),
                                        new PresentationListCell.StarsSection(),
                                        LabelBuilder.create()
                                            .id("downloads-label")
                                            .text("76")
                                            .build(),
                                        LabelBuilder.create()
                                            .id("watches-label")
                                            .text("2119")
                                            .build(),
                                        LabelBuilder.create()
                                            .id("comments-label")
                                            .text("0")
                                            .build()
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .build());
Comment 1 Alexander Kouznetsov 2012-02-22 20:18:26 UTC
This affects JavaFX adoption.

Anton Chechel wrote previously:
In fact current NetBeans java language formatter already supports formatting of "chained method calls" (Menu-Tools-Options-Editor-Formatting-Java-Wrapping). So, answering your question, yes, I think we could support formatting of builder patter. Moreover it could be useful not even for FX code. We just need to determine some rules...