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 175655 - Code formatting does not properly format brackets indentation in an object literal
Summary: Code formatting does not properly format brackets indentation in an object li...
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Anton Chechel
URL:
Keywords:
: 175585 175664 175672 176487 176660 (view as bug list)
Depends on:
Blocks: 173487
  Show dependency tree
 
Reported: 2009-10-29 13:37 UTC by Alexandr Scherbatiy
Modified: 2009-11-16 04:24 UTC (History)
0 users

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 Alexandr Scherbatiy 2009-10-29 13:37:56 UTC
Product Version         = NetBeans IDE Dev (Build 200910271401) (#32576b20b4bb)
  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.


Steps to reproduce:
- Copy the code to the editor:
---------------------------------------------------------------
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Button;


Stage {
    title: "MyApp"
    scene: Scene {
        width: 200
        height: 200
        content: Button {
            text: "Button"
            action: function() {
            }
        }
    }
}
---------------------------------------------------------------

- Format the code
The result is
---------------------------------------------------------------
Stage {
    title : "MyApp"
    scene : Scene {
        width : 200
        height : 200
        content : Button {
            text : "Button"
            action : function() {
            }

}                // <- Bracket is not properly formatted
    }
}
---------------------------------------------------------------
Comment 1 Anton Chechel 2009-11-11 12:44:51 UTC
*** Bug 175585 has been marked as a duplicate of this bug. ***
Comment 2 Anton Chechel 2009-11-11 12:45:10 UTC
*** Bug 175664 has been marked as a duplicate of this bug. ***
Comment 3 Anton Chechel 2009-11-11 12:49:40 UTC
*** Bug 175672 has been marked as a duplicate of this bug. ***
Comment 4 Anton Chechel 2009-11-12 05:41:39 UTC
*** Bug 176660 has been marked as a duplicate of this bug. ***
Comment 5 Alexandr Scherbatiy 2009-11-12 05:56:37 UTC
According to the tutorial Building GUI Applications With JavaFX
http://java.sun.com/javafx/1/tutorials/ui/syntax/index.html

the correct code indentation for the object literals should be:
--------------------------------------------------------
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle; 
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;

Stage {
    title: "Declaring Is Easy!"
    scene: Scene {
        width: 300
        height: 250
        content: [
            Circle {
                centerX: 150  centerY: 120 radius: 80
                fill: Color.MAROON
                stroke: Color.INDIANRED
                strokeWidth: 10.0

            }, //Circle
            Rectangle {
                x: 25, y: 80 width: 250, height: 80
                arcWidth: 20 arcHeight: 20
                fill: Color.web("#6699ff")
                stroke: Color.web("#003399")
                strokeWidth: 5.0
            } //Rectangle
        ] //Content
    } //Scene
} //Stage 
--------------------------------------------------------
Comment 6 Anton Chechel 2009-11-13 04:26:45 UTC
*** Bug 176487 has been marked as a duplicate of this bug. ***
Comment 7 Anton Chechel 2009-11-13 10:33:04 UTC
fixed
http://hg.netbeans.org/javafx/rev/640723a1ece5
Comment 8 Alexandr Scherbatiy 2009-11-16 04:24:44 UTC
verified in Build 200911160201