use of org.openlca.app.editors.SimpleEditorInput in project olca-app by GreenDelta.
the class BigParameterTable method show.
public static void show() {
if (Database.get() == null) {
MsgBox.info(M.NoDatabaseOpened, M.NeedOpenDatabase);
return;
}
String id = "BigParameterTable";
Editors.open(new SimpleEditorInput(id, M.Parameters), id);
}
use of org.openlca.app.editors.SimpleEditorInput in project olca-app by GreenDelta.
the class LibraryInfoPage method init.
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
try {
var inp = (SimpleEditorInput) input;
library = Workspace.getLibraryDir().getLibrary(inp.id).orElseThrow();
info = library.getInfo();
var db = Database.get();
if (db != null && db.getLibraries().contains(library.id())) {
this.db = db;
}
} catch (Exception e) {
throw new PartInitException("failed to init library page", e);
}
}
use of org.openlca.app.editors.SimpleEditorInput in project olca-app by GreenDelta.
the class MappingTool method open.
public static void open(FlowMap mapping) {
if (mapping == null)
return;
String uid = mapping.refId;
if (uid == null) {
uid = UUID.randomUUID().toString();
mapping.refId = uid;
}
AppCache cache = Cache.getAppCache();
var cacheID = uid + " /mapping";
cache.put(cacheID, mapping);
Editors.open(new SimpleEditorInput(cacheID, "Flow mapping"), "MappingTool");
}
use of org.openlca.app.editors.SimpleEditorInput in project olca-app by GreenDelta.
the class MappingTool method open.
/**
* Open an existing mapping from the database.
*/
public static void open(MappingFile mapping) {
if (mapping == null)
return;
var uid = "db:mapping/" + mapping.id;
Cache.getAppCache().put(uid, mapping);
Editors.open(new SimpleEditorInput(uid, mapping.name), "MappingTool");
}
use of org.openlca.app.editors.SimpleEditorInput in project olca-app by GreenDelta.
the class ProjectResultEditor method init.
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
super.init(site, input);
var simpleInput = (SimpleEditorInput) input;
var obj = Cache.getAppCache().remove(simpleInput.id);
if (!(obj instanceof ProjectResultData))
throw new PartInitException("editor input must be a project result");
data = (ProjectResultData) obj;
setPartName("Result of: " + Labels.name(data.project()));
}
Aggregations