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 156865 - Add CSS template file to New File -> JavaFX
Summary: Add CSS template file to New File -> JavaFX
Status: RESOLVED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Karol Harezlak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-15 10:59 UTC by Alexandr Scherbatiy
Modified: 2011-10-19 12:05 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-01-15 10:59:58 UTC
Add support for the fx CSS files: *.css

For Example:
------------  my.css  -----------------------
"javafx.scene.shape.Rectangle" {
    fill:yellow ;
}
---------------------------------------------


------------  Main.fx  ---------
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.shape.Rectangle;


Stage {
    title: "CSS aplication"
    scene: Scene {
        width: 200
        height: 200
        content: [
            Rectangle {
                x: 10,
                y: 10
                width: 140,
                height: 90
            }
        ]
        stylesheets: ["{__DIR__}my.css"]
    }
}
---------------------------------------------
Comment 1 Alexandr Scherbatiy 2009-01-15 11:00:35 UTC
See http://forums.sun.com/thread.jspa?threadID=5357325
Comment 2 Alexandr Scherbatiy 2009-01-19 11:04:17 UTC
A template for the JavaFX CSS files should be added to the JavaFX File Types. 
Comment 3 Alexandr Scherbatiy 2010-04-19 13:36:35 UTC
The template could look like:

----------  controlStyle.css -------------------
.button {
    -fx-text-fill: rgb(228, 243, 252);
    -fx-font: 20pt "Comic Sans MS Bold";
    -fx-padding: 10;
    -fx-color: rgb(45, 75, 142);
}

.button:hover{
    -fx-color: rgb(57, 91, 174);
}
------------------------------------------------
Comment 4 Alexandr Scherbatiy 2010-05-13 08:31:53 UTC
From a user comment:
http://javafx.com/docs/articles/UIControls/theming.jsp

"In Project/New I have no found a possibility to choose a '*.css'- file. Only '*.xsl' is avaialable. Is an 'Empty File' the correct choice?"
Comment 5 Lukas Hasik 2010-05-13 09:05:39 UTC
it's there - New File > Other >  Cascading Style Sheet  --> WORKSFORME
Comment 6 Alexandr Scherbatiy 2010-05-13 09:34:33 UTC
It seems no because users who read the Applying CSS to UI Controls tutorial expect that css template is listed in the  New File > JavaFX.
Comment 7 Karol Harezlak 2010-05-13 16:27:11 UTC
fixed, new Java FX CSS template with some basics .scene javafx css values

 http://hg.netbeans.org/javafx/rev/df1d551e201c
Comment 8 Karol Harezlak 2010-05-14 08:06:46 UTC
Late changes requested by:

http://jupiter.czech.sun.com/wiki/view/Nbdoc/NB69LateUIChanges
Comment 9 David Strupl 2011-10-19 12:05:46 UTC
Cleaning bugzilla categories ....