本文整理汇总了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();
}
}
}
}
示例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();
}
示例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);
}
}
}
});
}
示例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);
}
示例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);
}