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


Java Generator类代码示例

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


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

示例1: inject

import org.netbeans.jcode.layer.Generator; //导入依赖的package包/类
private void inject(Generator instance, ApplicationConfigData applicationConfigData, Map<Class<? extends LayerConfigData>, LayerConfigData> layerConfigData, ProgressHandler handler) {
    List<Field> fields = getAllFields(new LinkedList<>(), instance.getClass());
    for (Field field : fields) {
        if (field.isAnnotationPresent(ConfigData.class)) {
            field.setAccessible(true);
            try {
                if (field.getGenericType() == ApplicationConfigData.class) {
                    field.set(instance, applicationConfigData);
                } else if (field.getGenericType() == EntityMappings.class) {
                    field.set(instance, applicationConfigData.getEntityMappings());
                } else if (field.getType().isAssignableFrom(handler.getClass())) {
                    field.set(instance, handler);
                } else if (LayerConfigData.class.isAssignableFrom(field.getType())) {
                    field.set(instance, layerConfigData.get(field.getType()));
                }
            } catch (IllegalArgumentException | IllegalAccessException e) {
                e.printStackTrace();
            }
        }
    }
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:22,代码来源:ApplicationGenerator.java

示例2: GenerateCodeDialog

import org.netbeans.jcode.layer.Generator; //导入依赖的package包/类
/**
 * Creates new form GenerateCodeDialog
 *
 * @param modelerFile
 */
public GenerateCodeDialog(ModelerFile modelerFile) {
    this.modelerFile = modelerFile;
    this.scene = (JPAModelerScene) modelerFile.getModelerScene();
    this.configData = new ApplicationConfigData();
    this.modelerFileObject = modelerFile.getFileObject();
    this.entityMappings = (EntityMappings) modelerFile.getDefinitionElement();
    this.technologyPref = NbPreferences.forModule(Generator.class);
    initUIComponents();
    setArchState();
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:16,代码来源:GenerateCodeDialog.java

示例3: initLayer

import org.netbeans.jcode.layer.Generator; //导入依赖的package包/类
private void initLayer() {
    setCompleteApplicationCompVisibility(false);

    configPane.removeAll();
    configPane.setVisible(false);

    infoLabel.setText("");
    businessLayerCombo.setModel(new DefaultComboBoxModel(Generator.getBusinessService(isMicroservice() || isGateway()).toArray()));
    controllerLayerCombo.setModel(new DefaultComboBoxModel(new Object[]{new TechContext(DefaultControllerLayer.class)}));
    viewerLayerCombo.setModel(new DefaultComboBoxModel(new Object[]{new TechContext(DefaultViewerLayer.class)}));
    businessLayerCombo.setEnabled(true);
    controllerLayerCombo.setEnabled(false);
    viewerLayerCombo.setEnabled(false);

    TechContext businessContext = Generator.get(
            technologyPref.get(BUSINESS.name(),
                    DefaultBusinessLayer.class.getSimpleName())
    );
    TechContext controllerContext = Generator.get(
            technologyPref.get(CONTROLLER.name(),
                    DefaultControllerLayer.class.getSimpleName())
    );
    TechContext viewerContext = Generator.get(
            technologyPref.get(VIEWER.name(),
                    DefaultViewerLayer.class.getSimpleName())
    );

    SwingUtilities.invokeLater(() -> {

        if (businessContext != null) {
            businessLayerCombo.getModel().setSelectedItem(businessContext);
            if (businessContext.isValid() && controllerContext != null) {
                controllerLayerCombo.getModel().setSelectedItem(controllerContext);
                if (controllerContext.isValid() && viewerContext != null) {
                    viewerLayerCombo.getModel().setSelectedItem(viewerContext);
                }
            }
        }
    });
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:41,代码来源:GenerateCodeDialog.java

示例4: changeBusinessLayer

import org.netbeans.jcode.layer.Generator; //导入依赖的package包/类
private void changeBusinessLayer(TechContext businessLayer) {
    controllerLayerCombo.setModel(new DefaultComboBoxModel(Generator.getController(businessLayer, isMicroservice() || isGateway()).toArray()));
    controllerLayerCombo.setEnabled(businessLayer.isValid());
    viewerLayerCombo.setModel(new DefaultComboBoxModel(new Object[]{new TechContext(DefaultViewerLayer.class)}));
    viewerLayerCombo.setEnabled(false);
    setTechPanel(businessLayer);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:8,代码来源:GenerateCodeDialog.java

示例5: changeControllerLayer

import org.netbeans.jcode.layer.Generator; //导入依赖的package包/类
private void changeControllerLayer(TechContext controllerLayer) {
    viewerLayerCombo.setModel(new DefaultComboBoxModel(Generator.getViewer(controllerLayer, isMicroservice() || isGateway()).toArray()));
    viewerLayerCombo.setEnabled(controllerLayer.isValid());
    setTechPanel(controllerLayer);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:6,代码来源:GenerateCodeDialog.java


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