Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.simantics.db;bundle-version="1.1.0";visibility:=reexport,
gnu.trove3;bundle-version="3.0.3",
- org.apache.log4j;bundle-version="1.2.15",
org.simantics.layer0;bundle-version="1.0.0";visibility:=reexport,
org.simantics.graph;bundle-version="1.1.4",
org.simantics.scl.reflection;bundle-version="1.0.0";visibility:=reexport,
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2007, 2010 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package org.simantics.db.common.utils;
-
-import java.util.Properties;
-
-import org.apache.log4j.Logger;
-
-/*
- *
- * @deprecated in favor of org.simantics.db.common.Logger. Will be removed in Simantics 1.2
- *
- */
-@Deprecated
-public class ErrorLogger {
- public static final boolean ECHO = false;
- public static final Properties defaultProperties = new Properties();
- static {
- defaultProperties.put("log4j.rootCategory", "ERROR, default");
- defaultProperties.put("log4j.appender.default", "org.apache.log4j.FileAppender");
- defaultProperties.put("log4j.appender.default.File", "db-client-deprecated.log");
- defaultProperties.put("log4j.appender.default.append", "false");
- defaultProperties.put("log4j.appender.default.layout", "org.apache.log4j.PatternLayout");
- defaultProperties.put("log4j.appender.default.layout.ConversionPattern", "%-6r [%15.15t] %-5p %30.30c - %m%n");
- }
- private static LogManager defaultLogManager = new LogManager(defaultProperties);
- private static final ErrorLogger defaultErrorLogger = new ErrorLogger(LogManager.class);
- private Logger logger;
- ErrorLogger(Class<?> clazz) {
- logger = defaultLogManager.getLogger(clazz);
- }
-
- /**
- * Log a trace event.
- *
- * @param message message of the trace
- * @param exception the exception, or <code>null</code>
- */
- public void logTrace(String message, Throwable exception) {
- // Errors are much more useful with a stack trace!
- if (exception == null) {
- exception = new RuntimeException();
- }
- logger.trace(message, exception);
- }
-
- /**
- * Log an info event.
- *
- * @param message message of the info
- * @param exception the exception, or <code>null</code>
- */
- public void logInfo(String message, Throwable exception) {
- // Errors are much more useful with a stack trace!
- if (exception == null) {
- exception = new RuntimeException();
- }
- logger.info(message, exception);
- }
-
- /**
- * Log an error event.
- *
- * @param message message of the error
- * @param exception the exception, or <code>null</code>
- */
- public void logError(String message, Throwable exception) {
- // Errors are much more useful with a stack trace!
- if (exception == null) {
- exception = new RuntimeException();
- }
- logger.error(message, exception);
- }
-
- public static ErrorLogger getDefault() {
- return defaultErrorLogger;
- }
-
- public static LogManager getDefaultLogManager() {
- return defaultLogManager;
- }
- public static void defaultLogError(Throwable exception) {
- getDefault().logError(exception.getLocalizedMessage(), exception);
- if(ECHO) exception.printStackTrace();
- }
- public static void defaultLogError(String message) {
- getDefault().logError(message, null);
- if(ECHO)
- System.err.println(message);
- }
- public static void defaultLogError(String message, Throwable exception) {
- getDefault().logError(message, exception);
- if(ECHO)
- System.err.println(message);
- }
- public static void defaultLogInfo(String message) {
- getDefault().logInfo(message, null);
- if(ECHO)
- System.err.println(message);
- }
- public static void defaultLogTrace(String message) {
- getDefault().logTrace(message, null);
- if(ECHO)
- System.err.println(message);
- }
-}
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2007, 2010 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package org.simantics.db.common.utils;
-
-import java.util.Properties;
-
-import org.apache.log4j.Hierarchy;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.log4j.spi.LoggerFactory;
-import org.apache.log4j.spi.RootLogger;
-
-/**
- * This class encapsulates a Log4J Hierarchy and centralizes all Logger access.
- */
-public class LogManager {
-
- private Hierarchy hierarchy;
-
- /**
- * Creates a new LogManager. Saves the log and state location.
- * Creates a new Hierarchy and add a new EventListener to it.
- * Configure the hierarchy with the properties passed. Add this object to
- * the list of active log managers.
- *
- * @param properties log configuration properties
- */
- public LogManager(Properties properties) {
- this.hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
- new PropertyConfigurator().doConfigure(properties, this.hierarchy);
- }
-
- /**
- * Checks if this PluginLogManager is disabled for this level.
- *
- * @param level level value
- * @return boolean true if it is disabled
- */
- public boolean isDisabled(int level) {
- return this.hierarchy.isDisabled(level);
- }
-
- /**
- * Enable logging for logging requests with level l or higher. By default
- * all levels are enabled.
- *
- * @param level level object
- */
- public void setThreshold(Level level) {
- this.hierarchy.setThreshold(level);
- }
-
- /**
- * The string version of setThreshold(Level level)
- *
- * @param level level string
- */
- public void setThreshold(String level) {
- this.hierarchy.setThreshold(level);
- }
-
- /**
- * Get the repository-wide threshold.
- *
- * @return Level
- */
- public Level getThreshold() {
- return this.hierarchy.getThreshold();
- }
-
- /**
- * Returns a new logger instance named as the first parameter using the
- * default factory. If a logger of that name already exists, then it will be
- * returned. Otherwise, a new logger will be instantiated and then linked
- * with its existing ancestors as well as children.
- *
- * @param clazz the class to get the logger for
- * @return Logger
- */
- public Logger getLogger(Class<?> clazz) {
- return this.hierarchy.getLogger(clazz.getName());
- }
-
- /**
- * Returns a new logger instance named as the first parameter using the
- * default factory. If a logger of that name already exists, then it will be
- * returned. Otherwise, a new logger will be instantiated and then linked
- * with its existing ancestors as well as children.
- *
- * @param name logger name
- * @return Logger
- */
- public Logger getLogger(String name) {
- return this.hierarchy.getLogger(name);
- }
-
- /**
- * The same as getLogger(String name) but using a factory instance instead
- * of a default factory.
- *
- * @param name logger name
- * @param factory factory instance
- * @return Logger
- */
- public Logger getLogger(String name, LoggerFactory factory) {
- return this.hierarchy.getLogger(name, factory);
- }
-
- /**
- * Returns the root of this hierarchy.
- *
- * @return Logger
- */
- public Logger getRootLogger() {
- return this.hierarchy.getRootLogger();
- }
-
- /**
- * Checks if this logger exists.
- *
- * @return Logger
- */
- public Logger exists(String name) {
- return this.hierarchy.exists(name);
- }
-
- /**
- * Disposes the logger hierarchy
- */
- public void shutdown() {
- this.hierarchy.shutdown();
- }
-
- /**
- * Resets configuration values to its defaults.
- */
- public void resetConfiguration() {
- this.hierarchy.resetConfiguration();
- }
-
-}
\ No newline at end of file
org.simantics.databoard;bundle-version="0.6.2";visibility:=reexport,
org.simantics.db.services;bundle-version="1.1.0";visibility:=reexport,
org.simantics.db.management;bundle-version="1.1.0",
- org.apache.log4j;bundle-version="1.2.15",
org.apache.commons.io;bundle-version="1.4.0",
org.simantics.layer0;bundle-version="1.0.0";visibility:=reexport,
org.simantics.graph.db;bundle-version="1.1.5";visibility:=reexport,
Bundle-SymbolicName: org.simantics.db.procore
Bundle-Version: 1.2.1.qualifier
Bundle-Vendor: VTT Technical Research Centre of Finland
-Require-Bundle: org.apache.log4j;visibility:=reexport,
- org.simantics.db;bundle-version="0.8.0";visibility:=reexport,
+Require-Bundle: org.simantics.db;bundle-version="0.8.0";visibility:=reexport,
org.simantics.db.common;bundle-version="0.8.0";visibility:=reexport,
gnu.trove3;bundle-version="3.0.0",
org.simantics.db.impl;bundle-version="0.8.0",
Import-Package: gnu.trove.impl.hash,
gnu.trove.iterator,
gnu.trove.map.hash,
- org.apache.log4j,
- org.apache.log4j.spi,
org.eclipse.core.runtime,
org.osgi.framework;version="1.3.0",
org.simantics.db,
org.simantics.views.swt;bundle-version="1.0.0",
org.simantics.views.swt.client;bundle-version="1.0.0",
org.simantics.views.ontology;bundle-version="1.0.0",
- org.simantics.selectionview;bundle-version="1.0.0"
+ org.simantics.selectionview;bundle-version="1.0.0",
+ org.slf4j.api
Import-Package: org.simantics.views
Bundle-Vendor: Semantum Oy
Export-Package: org.simantics.diagram.profile.request
import org.simantics.db.common.request.WriteRequest;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.stubs.DiagramResource;
import org.simantics.layer0.Layer0;
import org.simantics.operation.Layer0X;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class CreateGroupAction extends ModelledActionImpl<Resource> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CreateGroupAction.class);
+
public CreateGroupAction(Resource configuration) {
super(configuration);
}
});
} catch (DatabaseException e) {
-
- Logger.defaultLogError(e);
-
+ LOGGER.error("CreateGroupAction failed", e);
}
}
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.common.utils.OrderedSetUtils;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.stubs.DiagramResource;
import org.simantics.layer0.Layer0;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class CreateProfileAction extends ModelledActionImpl<Resource> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CreateProfileAction.class);
+
public CreateProfileAction(Resource configuration) {
super(configuration);
}
});
} catch (DatabaseException e) {
-
- Logger.defaultLogError(e);
-
+ LOGGER.error("CreateProfileAction failed", e);
}
}
import org.simantics.db.common.request.WriteRequest;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.stubs.DiagramResource;
import org.simantics.layer0.Layer0;
import org.simantics.operation.Layer0X;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class CreateStyleAction extends ModelledActionImpl<Resource> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CreateStyleAction.class);
+
public CreateStyleAction(Resource configuration) {
super(configuration);
}
});
} catch (DatabaseException e) {
-
- Logger.defaultLogError(e);
-
+ LOGGER.error("CreateStyleAction failed", e);
}
}
org.simantics.diagram.ontology;bundle-version="1.0.0";visibility:=reexport,
org.simantics.structural.ontology;bundle-version="1.0.0",
org.simantics.layer0.utils;bundle-version="[1.0.0,2.0.0)",
- org.apache.log4j;bundle-version="1.2.15",
org.simantics.threadlog;bundle-version="1.0.0";resolution:=optional,
org.simantics.graph;bundle-version="1.1.5",
org.simantics.graph.db;bundle-version="1.1.5",
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2007, 2010 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package org.simantics.diagram;
-
-import java.util.Properties;
-
-import org.apache.log4j.Hierarchy;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.log4j.spi.LoggerFactory;
-import org.apache.log4j.spi.RootLogger;
-
-/**
- * This class encapsulates a Log4J Hierarchy and centralizes all Logger access.
- */
-public class LogManager {
-
- private Hierarchy hierarchy;
-
- /**
- * Creates a new LogManager. Saves the log and state location.
- * Creates a new Hierarchy and add a new EventListener to it.
- * Configure the hierarchy with the properties passed. Add this object to
- * the list of active log managers.
- *
- * @param properties log configuration properties
- */
- public LogManager(Properties properties) {
- this.hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
- new PropertyConfigurator().doConfigure(properties, this.hierarchy);
- }
-
- /**
- * Checks if this PluginLogManager is disabled for this level.
- *
- * @param level level value
- * @return boolean true if it is disabled
- */
- public boolean isDisabled(int level) {
- return this.hierarchy.isDisabled(level);
- }
-
- /**
- * Enable logging for logging requests with level l or higher. By default
- * all levels are enabled.
- *
- * @param level level object
- */
- public void setThreshold(Level level) {
- this.hierarchy.setThreshold(level);
- }
-
- /**
- * The string version of setThreshold(Level level)
- *
- * @param level level string
- */
- public void setThreshold(String level) {
- this.hierarchy.setThreshold(level);
- }
-
- /**
- * Get the repository-wide threshold.
- *
- * @return Level
- */
- public Level getThreshold() {
- return this.hierarchy.getThreshold();
- }
-
- /**
- * Returns a new logger instance named as the first parameter using the
- * default factory. If a logger of that name already exists, then it will be
- * returned. Otherwise, a new logger will be instantiated and then linked
- * with its existing ancestors as well as children.
- *
- * @param clazz the class to get the logger for
- * @return Logger
- */
- public Logger getLogger(Class<?> clazz) {
- return this.hierarchy.getLogger(clazz.getName());
- }
-
- /**
- * Returns a new logger instance named as the first parameter using the
- * default factory. If a logger of that name already exists, then it will be
- * returned. Otherwise, a new logger will be instantiated and then linked
- * with its existing ancestors as well as children.
- *
- * @param name logger name
- * @return Logger
- */
- public Logger getLogger(String name) {
- return this.hierarchy.getLogger(name);
- }
-
- /**
- * The same as getLogger(String name) but using a factory instance instead
- * of a default factory.
- *
- * @param name logger name
- * @param factory factory instance
- * @return Logger
- */
- public Logger getLogger(String name, LoggerFactory factory) {
- return this.hierarchy.getLogger(name, factory);
- }
-
- /**
- * Returns the root of this hierarchy.
- *
- * @return Logger
- */
- public Logger getRootLogger() {
- return this.hierarchy.getRootLogger();
- }
-
- /**
- * Checks if this logger exists.
- *
- * @return Logger
- */
- public Logger exists(String name) {
- return this.hierarchy.exists(name);
- }
-
- /**
- * Disposes the logger hierarchy
- */
- public void shutdown() {
- this.hierarchy.shutdown();
- }
-
- /**
- * Resets configuration values to its defaults.
- */
- public void resetConfiguration() {
- this.hierarchy.resetConfiguration();
- }
-
-}
\ No newline at end of file
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2007, 2010 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package org.simantics.diagram;
-
-import java.util.Properties;
-
-public class Logger {
- public static final boolean ECHO = false;
- public static final Properties defaultProperties = new Properties();
- static {
- defaultProperties.put("log4j.rootCategory", "ERROR, default");
- defaultProperties.put("log4j.appender.default", "org.apache.log4j.FileAppender");
- defaultProperties.put("log4j.appender.default.File", "diagram.log");
- defaultProperties.put("log4j.appender.default.append", "false");
- defaultProperties.put("log4j.appender.default.layout", "org.apache.log4j.PatternLayout");
- defaultProperties.put("log4j.appender.default.layout.ConversionPattern", "%-6r [%15.15t] %-5p %30.30c - %m%n");
- }
- private static LogManager defaultLogManager = new LogManager(defaultProperties);
- private static final Logger defaultErrorLogger = new Logger(LogManager.class);
- private org.apache.log4j.Logger logger;
- Logger(Class<?> clazz) {
- logger = defaultLogManager.getLogger(clazz);
- }
-
- /**
- * Log a trace event.
- *
- * @param message message of the trace
- * @param exception the exception, or <code>null</code>
- */
- public void logTrace(String message, Throwable exception) {
- // Errors are much more useful with a stack trace!
- if (exception == null) {
- exception = new RuntimeException();
- }
- logger.trace(message, exception);
- }
-
- /**
- * Log an info event.
- *
- * @param message message of the info
- * @param exception the exception, or <code>null</code>
- */
- public void logInfo(String message, Throwable exception) {
- // Errors are much more useful with a stack trace!
- if (exception == null) {
- exception = new RuntimeException();
- }
- logger.info(message, exception);
- }
-
- /**
- * Log an error event.
- *
- * @param message message of the error
- * @param exception the exception, or <code>null</code>
- */
- public void logError(String message, Throwable exception) {
- // Errors are much more useful with a stack trace!
- if (exception == null) {
- exception = new RuntimeException();
- }
- logger.error(message, exception);
- }
-
- public static Logger getDefault() {
- return defaultErrorLogger;
- }
-
- public static LogManager getDefaultLogManager() {
- return defaultLogManager;
- }
- public static void defaultLogError(Throwable exception) {
- getDefault().logError(exception.getLocalizedMessage(), exception);
- if(ECHO) exception.printStackTrace();
- }
- public static void defaultLogError(String message) {
- getDefault().logError(message, null);
- if(ECHO)
- System.err.println(message);
- }
- public static void defaultLogError(String message, Throwable exception) {
- getDefault().logError(message, exception);
- if(ECHO)
- System.err.println(message);
- }
- public static void defaultLogInfo(String message) {
- getDefault().logInfo(message, null);
- if(ECHO)
- System.err.println(message);
- }
- public static void defaultLogTrace(String message) {
- getDefault().logTrace(message, null);
- if(ECHO)
- System.err.println(message);
- }
-}
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.layer0.variable.Variables;
import org.simantics.db.request.Read;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.content.Change;
import org.simantics.diagram.content.ConnectionUtil;
import org.simantics.diagram.content.DiagramContentChanges;
import org.simantics.utils.threads.ThreadUtils;
import org.simantics.utils.ui.ErrorLogger;
import org.simantics.utils.ui.SWTUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* CopyPasteHandler is a canvas handler for Commands.CUT, Commands.COPY and
*/
public class CopyPasteHandler extends AbstractDiagramParticipant {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CopyPasteHandler.class);
+
public static final Key KEY_CUT_SELECTION_FRAME_COLOR = new KeyOf(Color.class, "CUT_SELECTION_FRAME_COLOR");
public static final Key KEY_CUT_SELECTION_CONTENT_COLOR = new KeyOf(Color.class, "CUT_SELECTION_CONTENT_COLOR");
public static final Key KEY_COPIED_SELECTION_FRAME_COLOR = new KeyOf(Color.class, "COPY_SELECTION_FRAME_COLOR");
});
}
} catch (DatabaseException e1) {
- Logger.defaultLogError(e1);
+ LOGGER.error("Monitor paste failed", e1);
}
}
return true;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.layer0.variable.Variables;
import org.simantics.db.request.Read;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.content.Change;
import org.simantics.diagram.content.ConnectionUtil;
import org.simantics.diagram.content.DiagramContentChanges;
import org.simantics.utils.threads.ThreadUtils;
import org.simantics.utils.ui.ErrorLogger;
import org.simantics.utils.ui.SWTUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* CopyPasteHandler is a canvas handler for Commands.CUT, Commands.COPY and
*/
public class CopyPasteHandler extends AbstractDiagramParticipant {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CopyPasteHandler.class);
+
public static final Key KEY_CUT_SELECTION_FRAME_COLOR = new KeyOf(Color.class, "CUT_SELECTION_FRAME_COLOR");
public static final Key KEY_CUT_SELECTION_CONTENT_COLOR = new KeyOf(Color.class, "CUT_SELECTION_CONTENT_COLOR");
public static final Key KEY_COPIED_SELECTION_FRAME_COLOR = new KeyOf(Color.class, "COPY_SELECTION_FRAME_COLOR");
});
}
} catch (DatabaseException e1) {
- Logger.defaultLogError(e1);
+ LOGGER.error("Monitor paste failed", e1);
}
}
return true;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.simantics.db.Session;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.adapter.GraphToDiagramSynchronizer;
import org.simantics.g2d.diagram.DiagramHints;
-import org.simantics.g2d.diagram.DiagramMutator;
import org.simantics.g2d.diagram.DiagramUtils;
import org.simantics.g2d.diagram.IDiagram;
import org.simantics.g2d.diagram.participant.AbstractDiagramParticipant;
import org.simantics.scenegraph.g2d.snap.ISnapAdvisor;
import org.simantics.ui.dnd.LocalObjectTransfer;
import org.simantics.ui.dnd.LocalObjectTransferable;
-import org.simantics.utils.datastructures.Callback;
import org.simantics.utils.logging.TimeLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
abstract public class PopulateSelectionDropParticipant extends AbstractDiagramParticipant implements IDropTargetParticipant {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PopulateSelectionDropParticipant.class);
+
public abstract List<ElementClassDragItem> getElements(Session session, IStructuredSelection selection) throws DatabaseException;
protected GraphToDiagramSynchronizer synchronizer;
}
- } catch (UnsupportedFlavorException e) {
- Logger.defaultLogError(e);
- } catch (IOException e) {
- Logger.defaultLogError(e);
- } catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ } catch (DatabaseException | IOException | UnsupportedFlavorException e) {
+ LOGGER.error("Unexpected failure", e);
}
}
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.simantics.fileimport.Activator
Require-Bundle: org.eclipse.core.runtime,
- org.apache.log4j,
org.simantics.db,
org.simantics,
org.simantics.graphfile;bundle-version="0.1.0",
import org.simantics.db.layer0.request.PossibleModel;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.layer0.variable.Variables;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.flag.FlagUtil;
import org.simantics.diagram.stubs.DiagramResource;
import org.simantics.diagram.ui.DiagramModelHints;
import org.simantics.utils.DataContainer;
import org.simantics.utils.threads.IThreadWorkQueue;
import org.simantics.utils.ui.ErrorLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* @author Antti Villberg
protected static class SelectionElement extends AdaptableHintContext {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SelectionElement.class);
+
final public Resource runtime;
final public Resource element;
}
});
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("WorkbenchSelectionElement.getContent failed for type AnyVariable", e);
}
}
else if(contentType instanceof ParentVariable) {
return (T) type.processor.sync(new ResourceRead2<Variable>(runtime, element) {
@Override
public Variable perform(ReadGraph graph) throws DatabaseException {
-
DiagramResource DIA = DiagramResource.getInstance(graph);
- ModelingResources MOD = ModelingResources.getInstance(graph);
- Layer0 L0 = Layer0.getInstance(graph);
String uri = graph.getPossibleRelatedValue(resource, DIA.RuntimeDiagram_HasVariable);
if (uri == null)
}
});
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("WorkbenchSelectionElement.getContent failed for type ParentVariable", e);
}
}
/*******************************************************************************
- * 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.layer0.request.IsLinkedTo;
import org.simantics.db.layer0.util.Layer0Utils;
import org.simantics.db.service.SerialisationSupport;
-import org.simantics.diagram.Logger;
import org.simantics.diagram.adapter.GraphToDiagramSynchronizer;
import org.simantics.diagram.content.Change;
import org.simantics.diagram.content.DiagramContentChanges;
import org.simantics.ui.selection.WorkbenchSelectionElement;
import org.simantics.ui.workbench.e4.E4WorkbenchUtils;
import org.simantics.utils.logging.TimeLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This participant populates Elements from ElementClass-resources drops
*/
public class PopulateElementDropParticipant extends AbstractDiagramParticipant implements IDropTargetParticipant {
+ private static final Logger LOGGER = LoggerFactory.getLogger(PopulateElementDropParticipant.class);
+
@Dependency PickContext pickContext;
@Dependency TransformUtil transformUtil;
});
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("symbolDropHandler invocation failed", e);
}
return;
import org.simantics.db.layer0.adapter.ActionFactory;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.layer0.variable.Variables;
-import org.simantics.diagram.Logger;
import org.simantics.scl.runtime.function.Function1;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SCLAction implements ActionFactory {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SCLAction.class);
+
final private Resource rule;
public SCLAction(ReadGraph graph, Resource rule) throws DatabaseException {
Function1<Resource, Object> function = Simantics.getSession().syncRequest(new RuleFunctionRequest(rule));
function.apply(resource);
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("SCLActionRunnable failed to request/apply RuleFunction {}", rule, e);
}
}
import org.simantics.db.layer0.adapter.DropActionFactory;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.layer0.variable.Variables;
-import org.simantics.diagram.Logger;
import org.simantics.scl.runtime.function.Function3;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SCLDropAction implements DropActionFactory {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SCLDropAction.class);
+
final private Resource rule;
public SCLDropAction(ReadGraph graph, Resource rule) throws DatabaseException {
Function3<Resource, Object, Integer, Object> function = Simantics.getSession().syncRequest(new RuleFunctionRequest(rule));
function.apply(target, source, operation);
} catch (DatabaseException e) {
- Logger.defaultLogError(e);
+ LOGGER.error("SCLDropActionRunnable failed to request/apply RuleFunction {}", rule, e);
}
}
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.simantics.utils.datastructures;bundle-version="1.0.0",
org.simantics.utils.ui;bundle-version="1.0.0",
- org.apache.log4j;bundle-version="1.2.15",
org.simantics.spreadsheet;bundle-version="1.1.0",
org.simantics.db.layer0;bundle-version="1.1.0",
org.simantics.scl.runtime;bundle-version="0.1.2",
org.simantics.project;bundle-version="1.0.1";visibility:=reexport,
org.simantics.graph.db;bundle-version="1.1.5",
org.eclipse.equinox.p2.metadata;bundle-version="2.0.0",
- org.apache.log4j;bundle-version="1.2.15",
org.simantics.layer0.utils;bundle-version="1.1.0",
org.simantics.application;bundle-version="1.1.0",
org.simantics.db.indexing;bundle-version="1.1.0",
+++ /dev/null
-/*******************************************************************************
- * Copyright (c) 2007, 2010 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
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * VTT Technical Research Centre of Finland - initial API and implementation
- *******************************************************************************/
-package org.simantics;
-
-import java.util.Properties;
-
-import org.apache.log4j.Hierarchy;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.log4j.spi.LoggerFactory;
-import org.apache.log4j.spi.RootLogger;
-
-/**
- * This class encapsulates a Log4J Hierarchy and centralizes all Logger access.
- */
-public class LogManager {
-
- private Hierarchy hierarchy;
-
- /**
- * Creates a new LogManager. Saves the log and state location.
- * Creates a new Hierarchy and add a new EventListener to it.
- * Configure the hierarchy with the properties passed. Add this object to
- * the list of active log managers.
- *
- * @param properties log configuration properties
- */
- public LogManager(Properties properties) {
- this.hierarchy = new Hierarchy(new RootLogger(Level.DEBUG));
- new PropertyConfigurator().doConfigure(properties, this.hierarchy);
- }
-
- /**
- * Checks if this PluginLogManager is disabled for this level.
- *
- * @param level level value
- * @return boolean true if it is disabled
- */
- public boolean isDisabled(int level) {
- return this.hierarchy.isDisabled(level);
- }
-
- /**
- * Enable logging for logging requests with level l or higher. By default
- * all levels are enabled.
- *
- * @param level level object
- */
- public void setThreshold(Level level) {
- this.hierarchy.setThreshold(level);
- }
-
- /**
- * The string version of setThreshold(Level level)
- *
- * @param level level string
- */
- public void setThreshold(String level) {
- this.hierarchy.setThreshold(level);
- }
-
- /**
- * Get the repository-wide threshold.
- *
- * @return Level
- */
- public Level getThreshold() {
- return this.hierarchy.getThreshold();
- }
-
- /**
- * Returns a new logger instance named as the first parameter using the
- * default factory. If a logger of that name already exists, then it will be
- * returned. Otherwise, a new logger will be instantiated and then linked
- * with its existing ancestors as well as children.
- *
- * @param clazz the class to get the logger for
- * @return Logger
- */
- public Logger getLogger(Class<?> clazz) {
- return this.hierarchy.getLogger(clazz.getName());
- }
-
- /**
- * Returns a new logger instance named as the first parameter using the
- * default factory. If a logger of that name already exists, then it will be
- * returned. Otherwise, a new logger will be instantiated and then linked
- * with its existing ancestors as well as children.
- *
- * @param name logger name
- * @return Logger
- */
- public Logger getLogger(String name) {
- return this.hierarchy.getLogger(name);
- }
-
- /**
- * The same as getLogger(String name) but using a factory instance instead
- * of a default factory.
- *
- * @param name logger name
- * @param factory factory instance
- * @return Logger
- */
- public Logger getLogger(String name, LoggerFactory factory) {
- return this.hierarchy.getLogger(name, factory);
- }
-
- /**
- * Returns the root of this hierarchy.
- *
- * @return Logger
- */
- public Logger getRootLogger() {
- return this.hierarchy.getRootLogger();
- }
-
- /**
- * Checks if this logger exists.
- *
- * @return Logger
- */
- public Logger exists(String name) {
- return this.hierarchy.exists(name);
- }
-
- /**
- * Disposes the logger hierarchy
- */
- public void shutdown() {
- this.hierarchy.shutdown();
- }
-
- /**
- * Resets configuration values to its defaults.
- */
- public void resetConfiguration() {
- this.hierarchy.resetConfiguration();
- }
-
-}
\ No newline at end of file
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.apache.log4j"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
<plugin
id="org.eclipse.ui.browser"
download-size="0"
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.apache.log4j"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
org.simantics.db.management;bundle-version="0.8.0",
gnu.trove3;bundle-version="3.0.3",
org.simantics.fastlz;bundle-version="1.0.0",
- org.apache.log4j;bundle-version="1.2.15",
org.simantics.db.impl;bundle-version="0.8.0",
org.simantics.db.layer0;bundle-version="0.8.0",
org.simantics.project;bundle-version="1.0.1",
<property name="classes.dir" value="classes.dir" />
<property name="databoard.jar" value="org.simantics.databoard_0.5.2.jar" />
<property name="trove.jar" value="gnu.trove2_2.0.4.jar" />
- <property name="log4j.jar" value="org.apache.log4j_1.2.15.20080201.jar" />
<property name="db.jar" value="db-connector-${version}.jar" />
<property name="installer.jar" value="installer.jar" />
- <property name="classpath-javac" value="${installer.dir}${db.jar}:${installer.dir}${databoard.jar}:${installer.dir}${trove.jar}:${installer.dir}${log4j.jar}" />
- <property name="classpath-manifest" value="${db.jar} ${databoard.jar} ${trove.jar} ${log4j.jar}" />
+ <property name="classpath-javac" value="${installer.dir}${db.jar}:${installer.dir}${databoard.jar}:${installer.dir}${trove.jar}" />
+ <property name="classpath-manifest" value="${db.jar} ${databoard.jar} ${trove.jar}" />
<target name="clean">
<delete dir="${classes.dir}" quiet="true" />
<target name="trove.dir" if="plugin.dir">
<copy file="${plugin.dir}${trove.jar}" toDir="${installer.dir}" />
</target>
-
- <target name="log4j.jar" if="plugin.dir">
- <copy file="${plugin.dir}${log4j.jar}" toDir="${installer.dir}" />
- </target>
<target name="db.jar" depends="clean">
<property name="origin.dir" value="../"/>
<include name="eclipse/plugins/org.eclipse.osgi_*.jar" />
<include name="external/plugins/gnu.trove*.jar" />
<include name="external/plugins/org.apache.commons.collections_*.jar" />
- <include name="external/plugins/org.apache.log4j_*.jar" />
<include name="external/plugins/org.apache.commons.io_*.jar" />
<include name="simantics/plugins/org.simantics.databoard_*.jar" />
<include name="simantics/plugins/org.simantics.db.layer0_*.jar" />