mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8208531: -javafx mode should be on by default when JavaFX is available
Reviewed-by: jjg
This commit is contained in:
parent
8e53d1b5dc
commit
5cfc3bbdd4
2 changed files with 117 additions and 0 deletions
|
@ -399,6 +399,10 @@ public abstract class BaseConfiguration {
|
|||
// Utils needs docEnv, safe to init now.
|
||||
utils = new Utils(this);
|
||||
|
||||
if (!javafx) {
|
||||
javafx = isJavaFXMode();
|
||||
}
|
||||
|
||||
// Once docEnv and Utils have been initialized, others should be safe.
|
||||
cmtUtils = new CommentUtils(this);
|
||||
workArounds = new WorkArounds(this);
|
||||
|
@ -1347,4 +1351,19 @@ public abstract class BaseConfiguration {
|
|||
public synchronized VisibleMemberTable getVisibleMemberTable(TypeElement te) {
|
||||
return visibleMemberCache.getVisibleMemberTable(te);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if JavaFX is available in the compilation environment.
|
||||
* @return true if JavaFX is available
|
||||
*/
|
||||
public boolean isJavaFXMode() {
|
||||
TypeElement observable = utils.elementUtils.getTypeElement("javafx.beans.Observable");
|
||||
if (observable != null) {
|
||||
ModuleElement javafxModule = utils.elementUtils.getModuleOf(observable);
|
||||
if (javafxModule == null || javafxModule.isUnnamed() || javafxModule.getQualifiedName().contentEquals("javafx.base")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue