我从 http://hg.openjdk下载了JavaFx源代码.java / openjfx / 2.2 / master / rt / summary 。
zip文件中文件夹的名称是 re-e71070b0e0c0 。
The name of the folder in the zip file is re-e71070b0e0c0.
我解压缩了这个并在Idea中添加了项目结构 - 全局库下的文件夹,但它不起作用。当我尝试打开一个类时,它只显示字段名称和 / *编译代码* / 。我在手册中找不到任何内容。
I unzipped this and added the folder under Project Structure - Global Libraries in Idea, however it doesn't work. When I try to open a class it just shows field names and /* compiled code */. I couldn't find anything in the manual.
推荐答案这些指令仅对JavaFX 2.x分支是必需的,并且在JDK 8发布后将被废弃。
下载源zip并解压后,打开Idea并按照以下说明操作:
After you have downloaded the source zip and extracted it, open Idea and follow these instructions:
修改1.7 SDK的源结构:
Modify the source structure for your 1.7 SDK:
文件|项目结构| SDKs | Sourcepath
对于解压缩的zip中的每个子项目,输入 Alt + Insert 并添加相应的源目录。例如 rt-e71070b0e0c0 \ _javafx-ui-charts \ src , rt-e71070b0e0c0 \ javafx-ui-common\src 等。并非所有JavaFX 2.x源代码目前都是开源的,所以这只会添加开源部分。
For each sub-project in the extracted zip, type Alt+Insert and add the respective source directory. For example rt-e71070b0e0c0\javafx-ui-charts\src, rt-e71070b0e0c0\javafx-ui-common\src, etc. Not all JavaFX 2.x source code is currently open sourced, so this will only add the open sourced portions.
设置文档查找路径:
文件|项目结构| SDKs |文档路径
为文档指定URL Alt + S :docs.oracle/javafx/2/api/
Specify a url Alt+S for the documentation: docs.oracle/javafx/2/api/
在JavaFX应用程序源代码中,将光标放在JavaFX类用法上,例如LineChart:
In your JavaFX application source, place your cursor over a JavaFX class usage, for instance LineChart:
2013年10月16日更新
JDK 8 现在包含JavaFX源文件。
JDK 8 now includes JavaFX source files.
告诉Idea JavaFX源的位置:
To tell Idea where JavaFX sources are:
修改1.8 SDK的源结构:
Modify the source structure for your 1.8 SDK:
文件|项目结构| SDKs | Sourcepath
按 Alt + S 添加文件 javafx-src.zip ,它位于JDK 8发行版的根目录中。
Press Alt+S to add the file javafx-src.zip, which is located in the root directory of the JDK 8 distribution.
设置文档查找路径:
文件|项目结构| SDKs |文档路径
为文档指定URL Alt + S :download.java/jdk8/jfxdocs 。
Specify a url Alt+S for the documentation: download.java/jdk8/jfxdocs.
JDK 8 JavaFX文档网址当JDK 8达到一般可用性发布阶段时,可能会发生变化。
The JDK 8 JavaFX documentation url will likely change when JDK 8 reaches General Availability release stage.
上面的步骤3提供了快速访问JavaFX的键盘快捷键来自项目的资源和文档。
Step 3 above provides keyboard shortcuts to quickly access the JavaFX sources and documentation from your project.
更多推荐
JavaFX源代码没有显示
发布评论