/*******************************************************************************
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * Copyright (c) 2007, 2020 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
import org.simantics.db.common.ResourceArray;
import org.simantics.db.common.procedure.adapter.DisposableListener;
import org.simantics.db.common.request.UnaryRead;
-import org.simantics.db.common.utils.Logger;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.layer0.SelectionHints;
import org.simantics.db.layer0.request.PossibleURI;
import org.simantics.utils.ui.ErrorLogger;
import org.simantics.utils.ui.ISelectionUtils;
import org.simantics.utils.ui.PathUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
*/
public class VariableDebugger extends Composite {
+ private static final Logger LOGGER = LoggerFactory.getLogger(VariableDebugger.class);
+
public interface HistoryListener {
void historyChanged();
}
@Override
public void exception(Throwable t) {
- Logger.defaultLogError(t);
+ LOGGER.error("Page content listener failed unexpectedly", t);
}
}
@Override
public void drop(DropTargetEvent event) {
label.setBackground(null);
+ String uri = null;
try {
- String uri = parseUri(event);
+ uri = parseUri(event);
if (uri == null) {
event.detail = DND.DROP_NONE;
return;
}
changeLocation(uri);
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("Changing location to URI {} failed", uri, e);
}
}
@Override
public void widgetSelected(SelectionEvent e) {
+ String uri = null;
try {
- String uri = text.getText();
+ uri = text.getText();
// Make sure that URI is resolvable to Variable
session.sync(new ResourceURIToVariable(uri));
changeLocation(uri);
} catch (DatabaseException e1) {
- Logger.defaultLogError(e1);
+ LOGGER.error("Lookup failed for URI {}", uri, e1);
}
}
public Browser createBrowser(Composite parent) {
try {
- browser = new Browser(parent, SWT.MOZILLA);
+ browser = new Browser(parent, SWT.NONE);
} catch (SWTError e) {
//System.out.println("Could not instantiate Browser: " + e.getMessage());
browser = new Browser(parent, SWT.NONE);
else return value != null ? getValue(graph, r, value) : "null"; //$NON-NLS-1$
} catch (Throwable e) {
try {
- Logger.defaultLogError("getValue " + r.getURI(graph), e); //$NON-NLS-1$
+ LOGGER.error("getValue({})", r.getURI(graph), e); //$NON-NLS-1$
} catch (DatabaseException e1) {
- Logger.defaultLogError(e1);
+ LOGGER.error("Failed to get URI for problematic value variable", e1);
}
return e.getMessage();
}
String encoded = Base64.encode(uri.getBytes(utf8));
return encoded;
} catch (Exception e) {
- Logger.defaultLogError(e);
+ LOGGER.error("Failed to construct link string for variable", e); //$NON-NLS-1$
return e.getMessage();
}
}
String rviString = getRVIString(graph, var);
Object node = null;
if(var instanceof AbstractChildVariable) {
- VariableNode vn = ((AbstractChildVariable)var).node;
+ VariableNode<?> vn = ((AbstractChildVariable)var).node;
if(vn != null) node = vn.node;
}
if(var instanceof AbstractPropertyVariable) {
- VariableNode vn = ((AbstractPropertyVariable)var).node;
+ VariableNode<?> vn = ((AbstractPropertyVariable)var).node;
if(vn != null) node = vn.node;
}