use of org.openlca.app.viewers.combo.LocationViewer in project olca-app by GreenDelta.
the class FlowInfoPage method createLocationViewer.
private void createLocationViewer(Composite comp) {
new Label(comp, SWT.NONE).setText(M.Location);
var viewer = new LocationViewer(comp);
viewer.setNullable(true);
viewer.setInput(Database.get());
getBinding().onModel(this::getModel, "location", viewer);
viewer.setEnabled(isEditable());
new CommentControl(comp, getToolkit(), "location", getComments());
}
use of org.openlca.app.viewers.combo.LocationViewer in project olca-app by GreenDelta.
the class InfoPage method createGeographySection.
private void createGeographySection(Composite body, FormToolkit tk) {
Composite comp = UI.formSection(body, tk, M.Geography, 3);
tk.createLabel(comp, M.Location);
LocationViewer combo = new LocationViewer(comp);
combo.setNullable(true);
combo.setInput(Database.get());
getBinding().onModel(this::getModel, "location", combo);
combo.setEnabled(isEditable());
combo.addSelectionChangedListener(loc -> {
String linkText = loc != null && loc.geodata != null ? "open in map" : "no data";
geoLink.setText(linkText);
geoLink.getParent().pack();
});
new CommentControl(comp, getToolkit(), "location", getComments());
createGeoLink(comp, tk);
multiText(comp, M.Description, "documentation.geography", 40);
}
Aggregations