use of org.openlca.core.model.RootEntity in project olca-app by GreenDelta.
the class InfoSection method link.
static void link(Composite comp, String label, Object entity) {
new Label(comp, SWT.NONE).setText(label);
var link = new ImageHyperlink(comp, SWT.TOP);
link.setForeground(Colors.linkBlue());
if (entity instanceof RootDescriptor) {
var d = (RootDescriptor) entity;
link.setText(Labels.name(d));
link.setImage(Images.get(d));
Controls.onClick(link, e -> App.open(d));
} else if (entity instanceof RootEntity) {
var ce = (RootEntity) entity;
link.setText(Labels.name(ce));
link.setImage(Images.get(ce));
Controls.onClick(link, e -> App.open(ce));
}
}
use of org.openlca.core.model.RootEntity in project olca-modules by GreenDelta.
the class VersionChangeTest method testUpdate.
@Test
public void testUpdate() throws Exception {
for (Class<?> clazz : classes) {
RootEntity entity = (RootEntity) clazz.newInstance();
testUpdate(entity);
}
}
use of org.openlca.core.model.RootEntity in project olca-modules by GreenDelta.
the class ExchangeUseSearchTest method tearDown.
@After
public void tearDown() {
while (!modelStack.isEmpty()) {
RootEntity entity = modelStack.pop();
@SuppressWarnings("unchecked") BaseDao<RootEntity> dao = (BaseDao<RootEntity>) Daos.base(db, entity.getClass());
dao.delete(entity);
}
}
use of org.openlca.core.model.RootEntity in project olca-app by GreenDelta.
the class CopyPaste method copy.
private static void copy(ModelElement element, INavigationElement<?> categoryElement) {
RootEntity copy = copy(element);
if (copy == null)
return;
copy.category = getCategory(categoryElement);
insert(copy);
}
Aggregations