當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。