本文整理汇总了Java中javafx.util.Builder类的典型用法代码示例。如果您正苦于以下问题:Java Builder类的具体用法?Java Builder怎么用?Java Builder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Builder类属于javafx.util包,在下文中一共展示了Builder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBuilder
import javafx.util.Builder; //导入依赖的package包/类
@Override
public Builder<?> getBuilder(Class<?> type) {
Builder<?> builder = null;
if (deligator != null) {
Builder<?> userBuilder = deligator.getBuilder(type);
if (userBuilder != null) {
return userBuilder;
}
}
if (type == Button.class) {
builder = new GargoyleButtonBuilder();
} else if (type == TableView.class) {
builder = new GargoyleTableViewBuilder();
}
return builder;
}
示例2: getBuilder
import javafx.util.Builder; //导入依赖的package包/类
@Override
public Builder<?> getBuilder(Class<?> type) {
if(type == ImageGrid.class) {
return new ImageGridBuilder(imageViewFactory, fileUtils);
}
return new JavaFXBuilderFactory().getBuilder(type);
}
示例3: getBuilder
import javafx.util.Builder; //导入依赖的package包/类
@Override
public Builder<?> getBuilder(Class<?> type) {
Builder<?> builder = null;
if (type == Button.class) {
builder = new GargoyleButtonBuilder();
}
return builder;
}
示例4: getBuilder
import javafx.util.Builder; //导入依赖的package包/类
@Override
public Builder<?> getBuilder(Class<?> type) {
if(packages.stream().anyMatch(p -> type.getPackage().getName().indexOf(p) == 0)) {
try {
Object bean = applicationContext.getBean(type);
return () -> bean;
} catch(NoSuchBeanDefinitionException ex) {
return null;
}
}
return null;
}
示例5: getBuilder
import javafx.util.Builder; //导入依赖的package包/类
@Override
public Builder<?> getBuilder(Class<?> type) {
Builder<?> builder = builders.computeIfAbsent(type, t -> {
Map<String, ?> beansOfType = beanFactory.getBeansOfType(type, true, false);
if (beansOfType.isEmpty()) {
return NULL_BUILDER;
}
return () -> beanFactory.getBean(type);
});
return builder == NULL_BUILDER ? null : builder;
}
示例6: CdiFXMLLoader
import javafx.util.Builder; //导入依赖的package包/类
/**
* Default constructor.
*/
CdiFXMLLoader() {
super();
// Uses the currently loaded CDI implementation to look up controller classes
// that have been specified via "fx:controller='...'" in our FXML files.
this.setControllerFactory((aClass) -> CDI.current().select(aClass));
// Initializes the default JavaFX builder factory to be used for non CDI-aware beans.
this.defaultBuilderFactory = new JavaFXBuilderFactory();
this.setBuilderFactory((aClass) -> {
// Uses the default builder factory to retrieve builders where applicable.
final Builder<?> defaultBuilder = defaultBuilderFactory.getBuilder(aClass);
if (defaultBuilder != null) {
return defaultBuilder;
}
// Make sure that we use a "null" builder for components that are 'blacklisted'.
final String packageName = aClass.getPackage().getName();
for (final String blacklisted : CDI_BLACKLIST) {
if (packageName.startsWith(blacklisted)) {
return null;
}
}
return new CdiFXMLComponentBuilder(aClass);
});
}