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


Java LayerConfigPanel类代码示例

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


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

示例1: addLayerTab

import org.netbeans.jcode.stack.config.panel.LayerConfigPanel; //导入依赖的package包/类
private void addLayerTab(TechContext techContext) {
    Technology tech = techContext.getTechnology();
    if (tech.panel() != LayerConfigPanel.class) {
        String title = tech.label();
        int index = tech.tabIndex() - 1;
        if (index < 0) {
            configPane.addTab(title, null, techContext.getPanel(), tech.description());
        } else {
            configPane.insertTab(title, null, techContext.getPanel(), tech.description(), index);
        }
        techContext.getSiblingTechContext()
                .stream()
                .filter(tc -> isCompleteApplication() ? true : tc.getTechnology().entityGenerator())
                .forEach(context -> this.addLayerTab(context));
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:17,代码来源:GenerateCodeDialog.java

示例2: createPanel

import org.netbeans.jcode.stack.config.panel.LayerConfigPanel; //导入依赖的package包/类
public LayerConfigPanel createPanel(Project project, SourceGroup sourceGroup, String _package) {
    if (panel == null) {
        if (isValid()) {
            try {
                panel = getTechnology().panel().newInstance();
            } catch (InstantiationException | IllegalAccessException ex) {
                Exceptions.printStackTrace(ex);
            }
        } else {
            panel = new DefaultConfigPanel();
        }
        
        Class<LayerConfigData> configDataClass = panel.getConfigDataClass();
        panel.setConfigData(PreferenceUtils.get(project, configDataClass));
        
        Map<Class<? extends LayerConfigPanel>, LayerConfigPanel> siblingData = new HashMap<>();
        Map<Class<? extends LayerConfigPanel>, LayerConfigPanel> cacheSiblingData = new HashMap<>();
        for(TechContext siblingContext : getSiblingTechContext()){
           LayerConfigPanel siblingPanel = siblingContext.createPanel(project, sourceGroup, _package);
           siblingData.put(siblingPanel.getClass(), siblingPanel);
        }
        
        cacheSiblingData.putAll(siblingData);
        cacheSiblingData.put(panel.getClass(), panel);
        Iterator<Entry<Class<? extends LayerConfigPanel>, LayerConfigPanel>> iterator = siblingData.entrySet().iterator();
        while(iterator.hasNext()){
            Entry<Class<? extends LayerConfigPanel>, LayerConfigPanel> entry = iterator.next();
            LayerConfigPanel instance = entry.getValue();
            List<Field> fields = Arrays.asList(instance.getClass().getDeclaredFields());
            for (Field field : fields) {
                if (field.isAnnotationPresent(ConfigData.class)) {
                    field.setAccessible(true);
                    try {
                        if (LayerConfigPanel.class.isAssignableFrom(field.getType())) {
                            field.set(instance, cacheSiblingData.get(field.getType()));
                        }
                    } catch (IllegalArgumentException | IllegalAccessException e) {
                        e.printStackTrace();
                    }
                }
            }
            instance.init(_package, project, sourceGroup);
            instance.read();
        }
           
        if (parentTechContext == null) { //if sibling context then first inject field and then init
            panel.init(_package, project, sourceGroup);
            panel.read();
        }
    }
    return panel;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:53,代码来源:TechContext.java

示例3: getPanel

import org.netbeans.jcode.stack.config.panel.LayerConfigPanel; //导入依赖的package包/类
public LayerConfigPanel getPanel() {
    return panel;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:4,代码来源:TechContext.java

示例4: isValid

import org.netbeans.jcode.stack.config.panel.LayerConfigPanel; //导入依赖的package包/类
public boolean isValid() {
    return getTechnology().panel() != null && getTechnology().panel() != LayerConfigPanel.class;
}
 
开发者ID:jeddict,项目名称:jCode,代码行数:4,代码来源:TechContext.java

示例5: setTechPanel

import org.netbeans.jcode.stack.config.panel.LayerConfigPanel; //导入依赖的package包/类
private void setTechPanel(TechContext techContext) {
    if ((isMicroservice() || isGateway())
            && techContext.getTechnology().type() == VIEWER
            && techContext.getTechnology().microservice()) {
        techContext.createPanel(gatewayProjectInfo.getProject(), gatewayProjectInfo.getSourceGroup(), getGatewayPackage());
    } else {
        techContext.createPanel(targetProjectInfo.getProject(), targetProjectInfo.getSourceGroup(), getTargetPackage());
    }
    configPane.removeAll();
    configPane.setVisible(false);
    boolean nonePanel = techContext.getTechnology().panel() == LayerConfigPanel.class;
    switch (techContext.getTechnology().type()) {
        case BUSINESS:
            getConfigData().setBussinesTechContext(techContext);
            addLayerTab(getConfigData().getBussinesTechContext());
            getConfigData().setControllerTechContext(null);
            getConfigData().setViewerTechContext(null);
            if (nonePanel) {
                getConfigData().setBussinesTechContext(null);
            }
            break;
        case CONTROLLER:
            getConfigData().setControllerTechContext(techContext);
            addLayerTab(getConfigData().getBussinesTechContext());
            addLayerTab(getConfigData().getControllerTechContext());
            getConfigData().setViewerTechContext(null);
            if (nonePanel) {
                getConfigData().setControllerTechContext(null);
            }
            break;
        case VIEWER:
            getConfigData().setViewerTechContext(techContext);
            addLayerTab(getConfigData().getBussinesTechContext());
            addLayerTab(getConfigData().getControllerTechContext());
            addLayerTab(getConfigData().getViewerTechContext());
            if (nonePanel) {
                getConfigData().setViewerTechContext(null);
            }
            break;
        default:
            break;
    }

    if (configPane.getComponentCount() >= 1) {
        if (!nonePanel) {
            configPane.setSelectedComponent(techContext.getPanel());
        }
        configPane.setVisible(true);
    }
    this.pack();
    setVisible(true);
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:53,代码来源:GenerateCodeDialog.java

示例6: businessLayerComboItemStateChanged

import org.netbeans.jcode.stack.config.panel.LayerConfigPanel; //导入依赖的package包/类
private void businessLayerComboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_businessLayerComboItemStateChanged
    if (evt.getStateChange() == ItemEvent.SELECTED) {
        setCompleteApplicationCompVisibility(getBusinessLayer().getTechnology().panel() != LayerConfigPanel.class);
        changeBusinessLayer(getBusinessLayer());
    }
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:7,代码来源:GenerateCodeDialog.java


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