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();
}
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;
}
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());
}
Aggregations