/*******************************************************************************
- * Copyright (c) 2012 Association for Decentralized Information Management in
+ * Copyright (c) 2012, 2017 Association for Decentralized Information Management in
* Industry THTH ry.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
*
* Contributors:
* VTT Technical Research Centre of Finland - initial API and implementation
+ * Semantum Oy - (#7066) introducing logger & refactoring
*******************************************************************************/
package org.simantics.document.ui.function;
import org.simantics.db.common.request.ReadRequest;
import org.simantics.db.common.request.UnaryRead;
import org.simantics.db.common.request.WriteRequest;
-import org.simantics.db.common.utils.Logger;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.common.utils.RequestUtil;
import org.simantics.db.exception.DatabaseException;
import org.simantics.ui.workbench.action.DefaultActions;
import org.simantics.utils.threads.SWTThread;
import org.simantics.utils.ui.workbench.WorkbenchUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class All {
+ private static final Logger LOGGER = LoggerFactory.getLogger(All.class);
+
private static boolean createDocument(WriteGraph graph, Resource resource, Resource model) throws DatabaseException {
Layer0 L0 = Layer0.getInstance(graph);
if(document == null) return;
RemoverUtil.remove(graph, document);
+ graph.markUndoPoint();
}
@Override
public void perform(WriteGraph graph) throws DatabaseException {
-
Variable selection = resolveEditSelection(graph, context, "..../Scroll/Browser#edited");
- if (selection != null)
+ if (selection != null) {
selection.setValue(graph, (String)value, Bindings.STRING);
- else {
- System.err.println("no selection for resource : " + resource + ", Variable context : " + context + ", value : " + value);
+ graph.markUndoPoint();
+ } else {
+ LOGGER.error("No selection for resource : " + resource + ", Variable context : " + context + ", value : " + value);
}
}
String editorId = CSSEditor.EDITOR_ID;
RVI rvi = null;
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-
- @Override
- public void run() {
-
- try {
- WorkbenchUtils.openEditor(editorId, new ResourceEditorInput2(editorId, root, root, rvi));
- } catch (PartInitException e) {
- Logger.defaultLogError(e);
- }
-
+ PlatformUI.getWorkbench().getDisplay().asyncExec(() -> {
+ try {
+ WorkbenchUtils.openEditor(editorId, new ResourceEditorInput2(editorId, root, root, rvi));
+ } catch (PartInitException e) {
+ LOGGER.error("Failed to open CSS editor for root " + root, e);
}
-
});
}