当前位置: 首页>>代码示例>>Java>>正文


Java Factory类代码示例

本文整理汇总了Java中groovy.util.Factory的典型用法代码示例。如果您正苦于以下问题:Java Factory类的具体用法?Java Factory怎么用?Java Factory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Factory类属于groovy.util包,在下文中一共展示了Factory类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SwingBuilderCustomizer

import groovy.util.Factory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public SwingBuilderCustomizer() {
    SwingBuilder builder = new SwingBuilder();

    Map<String, Factory> factories = new LinkedHashMap<>(builder.getFactories());
    factories.put("application", new ApplicationFactory());
    setFactories(factories);
    setVariables(builder.getVariables());
    setMethods(builder.getExplicitMethods());
    setProps(builder.getExplicitProperties());
    setAttributeDelegates(builder.getAttributeDelegates());
    setPreInstantiateDelegates(builder.getPreInstantiateDelegates());
    setPostInstantiateDelegates(builder.getPostInstantiateDelegates());
    setPostNodeCompletionDelegates(builder.getPostNodeCompletionDelegates());
    // setDisposalClosures(builder.getDisposalClosures());
    setMethodMissingDelegate(builder.getMethodMissingDelegate());
    setPropertyMissingDelegate(builder.getPropertyMissingDelegate());
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:19,代码来源:SwingBuilderCustomizer.java

示例2: FatcowIconsSwingBuilderCustomizer

import groovy.util.Factory; //导入依赖的package包/类
public FatcowIconsSwingBuilderCustomizer() {
    Map<String, Factory> factories = new LinkedHashMap<>();
    factories.put("fatcowIcon", new FatcowIconFactory());
    setFactories(factories);
}
 
开发者ID:griffon-plugins,项目名称:griffon-fatcowicons-plugin,代码行数:6,代码来源:FatcowIconsSwingBuilderCustomizer.java

示例3: FatcowIconsJavaFXBuilderCustomizer

import groovy.util.Factory; //导入依赖的package包/类
public FatcowIconsJavaFXBuilderCustomizer() {
    Map<String, Factory> factories = new LinkedHashMap<>();
    factories.put("fatcowIcon", new FatcowIconFactory());
    setFactories(factories);
}
 
开发者ID:griffon-plugins,项目名称:griffon-fatcowicons-plugin,代码行数:6,代码来源:FatcowIconsJavaFXBuilderCustomizer.java

示例4: FontAwesomeSwingBuilderCustomizer

import groovy.util.Factory; //导入依赖的package包/类
public FontAwesomeSwingBuilderCustomizer() {
    Map<String, Factory> factories = new LinkedHashMap<>();
    factories.put("fontAwesomeIcon", new FontAwesomeIconFactory());
    setFactories(factories);
}
 
开发者ID:griffon-plugins,项目名称:griffon-fontawesome-plugin,代码行数:6,代码来源:FontAwesomeSwingBuilderCustomizer.java

示例5: FontAwesomeJavaFXBuilderCustomizer

import groovy.util.Factory; //导入依赖的package包/类
public FontAwesomeJavaFXBuilderCustomizer() {
    Map<String, Factory> factories = new LinkedHashMap<>();
    factories.put("fontAwesomeIcon", new FontAwesomeIconFactory());
    setFactories(factories);
}
 
开发者ID:griffon-plugins,项目名称:griffon-fontawesome-plugin,代码行数:6,代码来源:FontAwesomeJavaFXBuilderCustomizer.java

示例6: getFactories

import groovy.util.Factory; //导入依赖的package包/类
@Nonnull
public Map<String, Factory> getFactories() {
    return unmodifiableMap(factories);
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:5,代码来源:AbstractBuilderCustomizer.java

示例7: setFactories

import groovy.util.Factory; //导入依赖的package包/类
public void setFactories(@Nonnull Map<String, Factory> factories) {
    requireNonNull(factories, "Argument 'factories' cannot be null");
    this.factories.clear();
    this.factories.putAll(factories);
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:AbstractBuilderCustomizer.java

示例8: doRegisterFactories

import groovy.util.Factory; //导入依赖的package包/类
private void doRegisterFactories(@Nonnull BuilderCustomizer customizer) {
    for (Map.Entry<String, Factory> entry : customizer.getFactories().entrySet()) {
        registerFactory(entry.getKey(), entry.getValue());
    }
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:6,代码来源:CompositeBuilder.java

示例9: getFactories

import groovy.util.Factory; //导入依赖的package包/类
@Nonnull
Map<String, Factory> getFactories();
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:3,代码来源:BuilderCustomizer.java

示例10: CoreBuilderCustomizer

import groovy.util.Factory; //导入依赖的package包/类
public CoreBuilderCustomizer() {
    Map<String, Factory> factories = new LinkedHashMap<>();
    factories.put("root", new RootFactory());
    factories.put("metaComponent", new MetaComponentFactory());
    setFactories(factories);
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:7,代码来源:CoreBuilderCustomizer.java

示例11: JavafxBuilderCustomizer

import groovy.util.Factory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public JavafxBuilderCustomizer() {
    SceneGraphBuilder builder = new SceneGraphBuilder();

    Map<String, Factory> factories = new LinkedHashMap<>(builder.getFactories());
    factories.put("application", new ApplicationFactory());
    factories.remove("fxaction");
    factories.put("action", new ActionFactory());

    factories.put("menuBar", new MenuFactory(MenuBar.class));
    factories.put("contextMenu", new MenuFactory(ContextMenu.class));
    factories.put("menuButton", new MenuFactory(MenuButton.class));
    factories.put("splitMenuButton", new MenuFactory(SplitMenuButton.class));

    factories.put("menu", new MenuItemFactory(Menu.class));
    factories.put("menuItem", new MenuItemFactory(MenuItem.class));
    factories.put("checkMenuItem", new MenuItemFactory(CheckMenuItem.class));
    factories.put("customMenuItem", new MenuItemFactory(CustomMenuItem.class));
    factories.put("separatorMenuItem", new MenuItemFactory(SeparatorMenuItem.class));
    factories.put("radioMenuItem", new MenuItemFactory(RadioMenuItem.class));

    factories.put("button", new LabeledFactory(Button.class));
    factories.put("checkBox", new LabeledFactory(CheckBox.class));
    factories.put("label", new LabeledFactory(Label.class));
    factories.put("choiceBox", new LabeledFactory(ChoiceBox.class));
    factories.put("hyperlink", new LabeledFactory(Hyperlink.class));
    factories.put("tooltip", new LabeledFactory(Tooltip.class));
    factories.put("radioButton", new LabeledFactory(RadioButton.class));
    factories.put("toggleButton", new LabeledFactory(ToggleButton.class));

    setFactories(factories);
    setVariables(builder.getVariables());
    setMethods(builder.getExplicitMethods());
    setProps(builder.getExplicitProperties());
    setAttributeDelegates(builder.getAttributeDelegates());
    setPreInstantiateDelegates(builder.getPreInstantiateDelegates());
    setPostInstantiateDelegates(builder.getPostInstantiateDelegates());
    setPostNodeCompletionDelegates(builder.getPostNodeCompletionDelegates());
    // setDisposalClosures(builder.getDisposalClosures());
    setMethodMissingDelegate(builder.getMethodMissingDelegate());
    setPropertyMissingDelegate(builder.getPropertyMissingDelegate());
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:43,代码来源:JavafxBuilderCustomizer.java

示例12: registerFactory

import groovy.util.Factory; //导入依赖的package包/类
private void registerFactory(String name, Factory factory) {
    factories.put(name, factory);
}
 
开发者ID:aalmiray,项目名称:griffon2,代码行数:4,代码来源:PivotBuilderCustomizer.java


注:本文中的groovy.util.Factory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。