Search in sources :

Example 11 with EntityDescriptorEnum

use of org.whole.lang.reflect.EntityDescriptorEnum in project whole by wholeplatform.

the class DefaultUITemplate method applyPalette.

public void applyPalette(IPaletteBuilder builder) {
    builder.Drawer_(languageKit.getName());
    EntityDescriptorEnum entityTypes = languageKit.getEntityDescriptorEnum();
    for (Iterator i = entityTypes.values().iterator(); i.hasNext(); ) {
        EntityDescriptor<?> ed = (EntityDescriptor<?>) i.next();
        if (ed.isAbstract())
            continue;
        if (contains(connectionDescriptors, ed))
            builder.Connection(ed);
        else
            builder.Template(ed);
    }
    builder._Drawer();
}
Also used : EntityDescriptor(org.whole.lang.reflect.EntityDescriptor) EntityDescriptorEnum(org.whole.lang.reflect.EntityDescriptorEnum) Iterator(java.util.Iterator)

Example 12 with EntityDescriptorEnum

use of org.whole.lang.reflect.EntityDescriptorEnum in project whole by wholeplatform.

the class TestsHelpers method splitDescription.

public static IEntity splitDescription(String description) {
    IEntity tuple = BindingManagerFactory.instance.createTuple();
    EntityDescriptorEnum edEnum = ReflectionFactory.getLanguageKit("http://lang.whole.org/Java", true, null).getEntityDescriptorEnum();
    for (String line : StringUtils.EOL_PATTERN.split(description)) tuple.wAdd(GenericEntityFactory.instance.create(edEnum.valueOf("TextElement"), line));
    return tuple;
}
Also used : EntityDescriptorEnum(org.whole.lang.reflect.EntityDescriptorEnum) IEntity(org.whole.lang.model.IEntity)

Example 13 with EntityDescriptorEnum

use of org.whole.lang.reflect.EntityDescriptorEnum in project whole by wholeplatform.

the class FactoriesTest method testDynamicFactory.

@Test
public void testDynamicFactory() {
    TypeRelations typeRelations = ModelsEntityFactory.instance.createTypeRelations();
    IEntityFactory ef = GenericEntityFactory.instance(RegistryConfigurations.CUSTOM);
    InterpreterOperation.interpret(new ModelsModel().create());
    ILanguageKit lk = ReflectionFactory.getLanguageKit("http://lang.whole.org/Models");
    EntityDescriptorEnum edEnum = lk.getEntityDescriptorEnum();
    typeRelations.wAdd(ef.create(edEnum.valueOf("TypeAliasOf")));
    // PrettyPrinterOperation.prettyPrint(typeRelations);
    Assert.assertFalse(typeRelations.wIsAdapter());
    ReflectionFactory.deploy(new ModelsLanguageDynamicTestDeployer());
    IEntity e1 = ef.create(ModelsEntityDescriptorEnum.TypeRelations, ef.create(ModelsEntityDescriptorEnum.TypeAliasOf), ef.create(ModelsEntityDescriptorEnum.SubtypesOf).wGetAdaptee(false));
    PrettyPrinterOperation.prettyPrint(e1);
    Assert.assertTrue(e1.wIsAdapter());
}
Also used : PropertiesEntityDescriptorEnum(org.whole.lang.properties.reflect.PropertiesEntityDescriptorEnum) ModelsEntityDescriptorEnum(org.whole.lang.models.reflect.ModelsEntityDescriptorEnum) TestEntitiesEntityDescriptorEnum(org.whole.lang.testentities.reflect.TestEntitiesEntityDescriptorEnum) JavaEntityDescriptorEnum(org.whole.lang.java.reflect.JavaEntityDescriptorEnum) EntityDescriptorEnum(org.whole.lang.reflect.EntityDescriptorEnum) IEntity(org.whole.lang.model.IEntity) TypeRelations(org.whole.lang.models.model.TypeRelations) ModelsModel(org.whole.lang.models.codebase.ModelsModel) ILanguageKit(org.whole.lang.reflect.ILanguageKit) Test(org.junit.Test)

Aggregations

EntityDescriptorEnum (org.whole.lang.reflect.EntityDescriptorEnum)13 ILanguageKit (org.whole.lang.reflect.ILanguageKit)8 IEntity (org.whole.lang.model.IEntity)6 EntityDescriptor (org.whole.lang.reflect.EntityDescriptor)5 ArrayList (java.util.ArrayList)3 Actions (org.whole.lang.actions.model.Actions)3 GroupAction (org.whole.lang.actions.model.GroupAction)3 ActionsUIEntityFactory (org.whole.lang.actions.ui.factories.ActionsUIEntityFactory)3 Test (org.junit.Test)2 NonTerminal (org.whole.lang.grammars.model.NonTerminal)2 Rule (org.whole.lang.grammars.model.Rule)2 GrammarsEntityDescriptorEnum (org.whole.lang.grammars.reflect.GrammarsEntityDescriptorEnum)2 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 DateTime (org.joda.time.DateTime)1 FramesEntityFactory (org.whole.lang.frames.factories.FramesEntityFactory)1 DataTerminal (org.whole.lang.grammars.model.DataTerminal)1 Production (org.whole.lang.grammars.model.Production)1 JavaEntityDescriptorEnum (org.whole.lang.java.reflect.JavaEntityDescriptorEnum)1 ModelsModel (org.whole.lang.models.codebase.ModelsModel)1