Search in sources :

Example 1 with ImportModifier

use of org.whole.lang.java.model.ImportModifier in project whole by wholeplatform.

the class ImportDeclarationPart method refreshVisuals.

protected void refreshVisuals() {
    ImportDeclaration entity = getModelEntity();
    ImportModifier m1 = entity.getStatic();
    if (DataTypeUtils.getDataKind(m1).isBoolean())
        getImportDeclarationFigure().setStaticModifier(m1.wBooleanValue());
    else
        getImportDeclarationFigure().setStaticModifier(false);
    ImportModifier m2 = entity.getOnDemand();
    if (DataTypeUtils.getDataKind(m2).isBoolean())
        getImportDeclarationFigure().setOnDemandModifier(m2.wBooleanValue());
    else
        getImportDeclarationFigure().setOnDemandModifier(false);
}
Also used : ImportModifier(org.whole.lang.java.model.ImportModifier) ImportDeclaration(org.whole.lang.java.model.ImportDeclaration)

Example 2 with ImportModifier

use of org.whole.lang.java.model.ImportModifier in project whole by wholeplatform.

the class IteratorFactoryTest method testFragmentRootIterator.

@Test
public void testFragmentRootIterator() throws Exception {
    IEntity e = XmlBuilderPersistenceKit.instance().readModel(new ClasspathPersistenceProvider("org/whole/lang/templates/codebase/TemplateManagerArtifactsTemplates.xwl"));
    CompilationUnit cu = Matcher.find(JavaEntityDescriptorEnum.CompilationUnit, e, false);
    ImportModifier im = Matcher.find(JavaEntityDescriptorEnum.ImportModifier, e, false);
    IEntityIterator<IEntity> i1 = IteratorFactory.rootIterator();
    i1.reset(im);
    assertTrue(i1.hasNext());
    assertSame(e, i1.next());
    IEntityIterator<IEntity> i2 = IteratorFactory.fragmentRootIterator();
    i2.reset(im);
    assertTrue(i2.hasNext());
    assertSame(cu, i2.next());
}
Also used : CompilationUnit(org.whole.lang.java.model.CompilationUnit) IEntity(org.whole.lang.model.IEntity) ImportModifier(org.whole.lang.java.model.ImportModifier) ClasspathPersistenceProvider(org.whole.lang.codebase.ClasspathPersistenceProvider) Test(org.junit.Test)

Aggregations

ImportModifier (org.whole.lang.java.model.ImportModifier)2 Test (org.junit.Test)1 ClasspathPersistenceProvider (org.whole.lang.codebase.ClasspathPersistenceProvider)1 CompilationUnit (org.whole.lang.java.model.CompilationUnit)1 ImportDeclaration (org.whole.lang.java.model.ImportDeclaration)1 IEntity (org.whole.lang.model.IEntity)1