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 182272 - [69cat] JavaFX Formatter Doesn't Take Context Into Acount
Summary: [69cat] JavaFX Formatter Doesn't Take Context Into Acount
Status: RESOLVED WONTFIX
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Adam Sotona
URL:
Keywords:
: 185669 (view as bug list)
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2010-03-18 04:46 UTC by rationalpi
Modified: 2011-05-16 13:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rationalpi 2010-03-18 04:46:38 UTC
[ JDK VERSION : 1.6.* ]

If you highlight only a portion of JavaFX source code (vice the entire file)
and select Source -> Format it assumes that the code that you have selected is
the only code in the file and aligns it all the way against the left margin.

For example, if you had this code:
package example;

public class Foo extends Bar {

    public override function show(): Void {
        var stage = Stage {
                    title: "Blah"
                    scene: ResizableScene {
                        width: 500
                        height: 500
                        fill: Color.PINK
                        content: MigLayout {
                            constraints: "fill"
                            content: [
                                    Group {
                                            content: [
                                Rectangle {
                                    width: 400
                                    height: 400
                                    fill: Color.BLACK
                                    layoutInfo: MigNodeLayoutInfo {
                                        constraints: "center"
                                    }
                                }]},
                                
                                Button {
                                    text: "Go"
                                    layoutInfo: MigNodeLayoutInfo {
                                        constraints: "south"
                                    }
                                }
                            ]
                        }
                    }
                }
    }

}

And you selected only the portion that is not indented correctly (the entire
Group...up to and including the close curly brace and comma. And then you
selected Source -> Format then you end up with the selection that you
highlighted against the left margin like this:

package example;

public class Foo extends Bar {

    public override function show(): Void {
        var stage = Stage {
                    title: "Blah"
                    scene: ResizableScene {
                        width: 500
                        height: 500
                        fill: Color.PINK
                        content: MigLayout {
                            constraints: "fill"
                            content: [
    Group {
        content: [
            Rectangle {
                width: 400
                height: 400
                fill: Color.BLACK
                layoutInfo: MigNodeLayoutInfo {
                    constraints: "center"
                }
            }] },
                                
                                Button {
                                    text: "Go"
                                    layoutInfo: MigNodeLayoutInfo {
                                        constraints: "south"
                                    }
                                }
                            ]
                        }
                    }
                }
    }

}


The format command should take into account the nested location of surrounding
code even if that code is not selected for formatting. This is the behavior of
the Java equivalent of the Source -> Format command.

Joshua Smith (josh@rationalpi.com)
Comment 1 Anton Chechel 2010-05-04 12:53:35 UTC
fixed
http://hg.netbeans.org/javafx/rev/6d6623c59dfe
Comment 2 Alexandr Scherbatiy 2010-05-12 11:48:06 UTC
The issue is reproduced as described in the 
netbeans-trunk-nightly-201005112200-javafx-full-windows.exe 

  Product Version         = NetBeans IDE Dev (Build 201005112200) (#26d237274be0)
  Operating System        = Windows XP version 5.1 running on x86
  Java; VM; Vendor        = 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02; Sun Microsystems Inc.
Comment 3 Anton Chechel 2010-06-08 13:28:48 UTC
*** Bug 185669 has been marked as a duplicate of this bug. ***
Comment 4 Martin Ryzl 2010-10-21 11:55:25 UTC
.
Comment 5 David Strupl 2011-05-16 13:51:06 UTC
Closing all bugs filed against JavaFX 1.x as wontfix. We will support JavaFX 2.0 - please keep opened only bugs against the new release. Thanks.