< prev index next >
modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java
Print this page
*** 80,89 ****
--- 80,90 ----
import com.sun.javafx.fxml.PropertyNotFoundException;
import com.sun.javafx.fxml.expression.Expression;
import com.sun.javafx.fxml.expression.ExpressionValue;
import com.sun.javafx.fxml.expression.KeyPath;
import static com.sun.javafx.FXPermissions.MODIFY_FXML_CLASS_LOADER_PERMISSION;
+ import com.sun.javafx.fxml.FXMLLoaderHelper;
import java.net.MalformedURLException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.EnumMap;
import java.util.Locale;
*** 304,314 ****
// and apply them after build() has been called
if (this.value instanceof Builder) {
throw constructLoadException("Cannot bind to builder property.");
}
! if (!impl_isStaticLoad()) {
value = value.substring(BINDING_EXPRESSION_PREFIX.length(),
value.length() - 1);
expression = Expression.valueOf(value);
// Create the binding
--- 305,315 ----
// and apply them after build() has been called
if (this.value instanceof Builder) {
throw constructLoadException("Cannot bind to builder property.");
}
! if (!isStaticLoad()) {
value = value.substring(BINDING_EXPRESSION_PREFIX.length(),
value.length() - 1);
expression = Expression.valueOf(value);
// Create the binding
*** 1141,1151 ****
"Including \"%s\" in \"%s\" created cyclic reference.",
fxmlLoader.location.toExternalForm(),
FXMLLoader.this.location.toExternalForm()));
}
fxmlLoader.setClassLoader(cl);
! fxmlLoader.impl_setStaticLoad(staticLoad);
Object value = fxmlLoader.loadImpl(callerClass);
if (fx_id != null) {
String id = this.fx_id + CONTROLLER_SUFFIX;
--- 1142,1152 ----
"Including \"%s\" in \"%s\" created cyclic reference.",
fxmlLoader.location.toExternalForm(),
FXMLLoader.this.location.toExternalForm()));
}
fxmlLoader.setClassLoader(cl);
! fxmlLoader.setStaticLoad(staticLoad);
Object value = fxmlLoader.loadImpl(callerClass);
if (fx_id != null) {
String id = this.fx_id + CONTROLLER_SUFFIX;
*** 2043,2052 ****
--- 2044,2060 ----
@Override
public String run() {
return System.getProperty("javafx.version");
}
});
+
+ FXMLLoaderHelper.setFXMLLoaderAccessor(new FXMLLoaderHelper.FXMLLoaderAccessor() {
+ @Override
+ public void setStaticLoad(FXMLLoader fxmlLoader, boolean staticLoad) {
+ fxmlLoader.setStaticLoad(staticLoad);
+ }
+ });
}
/**
* Creates a new FXMLLoader instance.
*/
*** 2351,2380 ****
this.classLoader = classLoader;
clearImports();
}
! /**
* Returns the static load flag.
- *
- * @treatAsPrivate
- * @deprecated
*/
! public boolean impl_isStaticLoad() {
// SB-dependency: RT-21226 has been filed to track this
return staticLoad;
}
! /**
* Sets the static load flag.
*
* @param staticLoad
- *
- * @treatAsPrivate
- * @deprecated
*/
! public void impl_setStaticLoad(boolean staticLoad) {
// SB-dependency: RT-21226 has been filed to track this
this.staticLoad = staticLoad;
}
/**
--- 2359,2382 ----
this.classLoader = classLoader;
clearImports();
}
! /*
* Returns the static load flag.
*/
! boolean isStaticLoad() {
// SB-dependency: RT-21226 has been filed to track this
return staticLoad;
}
! /*
* Sets the static load flag.
*
* @param staticLoad
*/
! void setStaticLoad(boolean staticLoad) {
// SB-dependency: RT-21226 has been filed to track this
this.staticLoad = staticLoad;
}
/**
*** 2611,2654 ****
for (FXMLLoader loader : loaders) {
messageBuilder.append(loader.location != null ? loader.location.getPath() : "unknown path");
if (loader.current != null) {
messageBuilder.append(":");
! messageBuilder.append(loader.impl_getLineNumber());
}
messageBuilder.append("\n");
}
return messageBuilder.toString();
}
/**
* Returns the current line number.
- *
- * @treatAsPrivate
- * @deprecated
- * @since JavaFX 2.2
*/
! public int impl_getLineNumber() {
return xmlStreamReader.getLocation().getLineNumber();
}
/**
* Returns the current parse trace.
- *
- * @treatAsPrivate
- * @deprecated
- * @since JavaFX 2.1
*/
! // SB-dependency: RT-21475 has been filed to track this
! public ParseTraceElement[] impl_getParseTrace() {
ParseTraceElement[] parseTrace = new ParseTraceElement[loaders.size()];
int i = 0;
for (FXMLLoader loader : loaders) {
parseTrace[i++] = new ParseTraceElement(loader.location, (loader.current != null) ?
! loader.impl_getLineNumber() : -1);
}
return parseTrace;
}
--- 2613,2647 ----
for (FXMLLoader loader : loaders) {
messageBuilder.append(loader.location != null ? loader.location.getPath() : "unknown path");
if (loader.current != null) {
messageBuilder.append(":");
! messageBuilder.append(loader.getLineNumber());
}
messageBuilder.append("\n");
}
return messageBuilder.toString();
}
/**
* Returns the current line number.
*/
! int getLineNumber() {
return xmlStreamReader.getLocation().getLineNumber();
}
/**
* Returns the current parse trace.
*/
! ParseTraceElement[] getParseTrace() {
ParseTraceElement[] parseTrace = new ParseTraceElement[loaders.size()];
int i = 0;
for (FXMLLoader loader : loaders) {
parseTrace[i++] = new ParseTraceElement(loader.location, (loader.current != null) ?
! loader.getLineNumber() : -1);
}
return parseTrace;
}
< prev index next >