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


Java State类代码示例

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


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

示例1: init

import org.netbeans.modules.j2ee.persistence.util.MetadataModelReadHelper.State; //导入依赖的package包/类
@Override
public void init(WizardDescriptor wiz) {
    // get the table names for all entities in the project
    initProject = Templates.getProject(wiz);
    final MetadataModelReadHelper<EntityMappingsMetadata, Set<Entity>> readHelper;
    EntityClassScope entityClassScope = EntityClassScope.getEntityClassScope(initProject.getProjectDirectory());
    if (entityClassScope == null) {
        return;
    }

    MetadataModel<EntityMappingsMetadata> entityMappingsModel = entityClassScope.getEntityMappingsModel(true);
    readHelper = MetadataModelReadHelper.create(entityMappingsModel, new MetadataModelAction<EntityMappingsMetadata, Set<Entity>>() {

        @Override
        public Set<Entity> run(EntityMappingsMetadata metadata) {
            Set<Entity> result = new HashSet<Entity>();
            result.addAll(Arrays.asList(metadata.getRoot().getEntity()));
            return result;
        }
    });

    readHelper.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            if (readHelper.getState() == State.FINISHED) {
                try {
                    processEntities(readHelper.getResult());
                } catch (ExecutionException ex) {
                    Logger.getLogger(JavaPersistenceGenerator.class.getName()).log(Level.FINE, "Failed to get entity classes: ", ex); //NOI18N
                }
            }
        }
    });
    readHelper.start();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:JavaPersistenceGenerator.java

示例2: init

import org.netbeans.modules.j2ee.persistence.util.MetadataModelReadHelper.State; //导入依赖的package包/类
@Override
public void init(WizardDescriptor wiz) {
    // get the table names for all entities in the project
    initProject = Templates.getProject(wiz);
    final MetadataModelReadHelper<EntityMappingsMetadata, Set<Entity>> readHelper;
    EntityClassScope entityClassScope = EntityClassScope.getEntityClassScope(initProject.getProjectDirectory());
    if (entityClassScope == null) {
        return;
    }
    MetadataModel<EntityMappingsMetadata> entityMappingsModel = entityClassScope.getEntityMappingsModel(true);
    readHelper = MetadataModelReadHelper.create(entityMappingsModel, (EntityMappingsMetadata metadata) -> {
        Set<Entity> result1 = new HashSet<>();
        result1.addAll(Arrays.asList(metadata.getRoot().getEntity()));
        return result1;
    });

    readHelper.addChangeListener(e -> {
        if (readHelper.getState() == State.FINISHED) {
            try {
                processEntities(readHelper.getResult());
            } catch (ExecutionException ex) {
                Logger.getLogger(JavaPersistenceModelGenerator.class.getName()).log(Level.FINE, "Failed to get entity classes: ", ex); //NOI18N
            }
        }
    });
    readHelper.start();
}
 
开发者ID:jeddict,项目名称:jeddict,代码行数:28,代码来源:JavaPersistenceModelGenerator.java

示例3: init

import org.netbeans.modules.j2ee.persistence.util.MetadataModelReadHelper.State; //导入依赖的package包/类
@Override
public void init(WizardDescriptor wiz) {
    // get the table names for all entities in the project
    initProject = Templates.getProject(wiz);
    final MetadataModelReadHelper<EntityMappingsMetadata, Set<Entity>> readHelper;
    EntityClassScope entityClassScope = EntityClassScope.getEntityClassScope(initProject.getProjectDirectory());
    if (entityClassScope == null) {
        return;
    }
    MetadataModel<EntityMappingsMetadata> entityMappingsModel = entityClassScope.getEntityMappingsModel(true);
    readHelper = MetadataModelReadHelper.create(entityMappingsModel, new MetadataModelAction<EntityMappingsMetadata, Set<Entity>>() {
        @Override
        public Set<Entity> run(EntityMappingsMetadata metadata) {
            Set<Entity> result = new HashSet<Entity>();
            result.addAll(Arrays.asList(metadata.getRoot().getEntity()));
            return result;
        }
    });

    readHelper.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            if (readHelper.getState() == State.FINISHED) {
                try {
                    processEntities(readHelper.getResult());
                } catch (ExecutionException ex) {
                    Logger.getLogger(JavaPersistenceModelGenerator.class.getName()).log(Level.FINE, "Failed to get entity classes: ", ex); //NOI18N
                }
            }
        }
    });
    readHelper.start();
}
 
开发者ID:foxerfly,项目名称:Netbeans-JPA-Modeler,代码行数:35,代码来源:JavaPersistenceModelGenerator.java


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