use of org.jkiss.dbeaver.model.DBPMessageType in project dbeaver by dbeaver.
the class CoreApplicationActivator method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
// Set notifications handler
DBeaverNotifications.setHandler(new DBeaverNotifications.NotificationHandler() {
@Override
public void sendNotification(DBPDataSource dataSource, String id, String text, DBPMessageType messageType, Runnable feedback) {
NotificationUtils.sendNotification(dataSource, id, text, messageType, feedback);
}
@Override
public void sendNotification(String id, String title, String text, DBPMessageType messageType, Runnable feedback) {
NotificationUtils.sendNotification(id, title, text, messageType, feedback);
}
});
// Add bundle load logger
if (!Log.isQuietMode()) {
context.registerService(EventHook.class, (event, contexts) -> {
String message = null;
Bundle bundle = event.getBundle();
if (event.getType() == BundleEvent.STARTED) {
if (bundle.getState() == Bundle.ACTIVE) {
message = "> Start " + getBundleName(bundle) + " [" + bundle.getSymbolicName() + " " + bundle.getVersion() + "]";
}
} else if (event.getType() == BundleEvent.STOPPING) {
if (bundle.getState() != BundleEvent.STOPPING && bundle.getState() != BundleEvent.UNINSTALLED) {
message = "< Stop " + getBundleName(bundle) + " [" + bundle.getSymbolicName() + " " + bundle.getVersion() + "]";
}
}
if (message != null) {
System.err.println(message);
}
}, null);
// context.addBundleListener(new BundleLoadListener());
}
plugin = this;
}
use of org.jkiss.dbeaver.model.DBPMessageType in project dbeaver by serge-rider.
the class CoreApplicationActivator method start.
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
// Set notifications handler
DBeaverNotifications.setHandler(new DBeaverNotifications.NotificationHandler() {
@Override
public void sendNotification(DBPDataSource dataSource, String id, String text, DBPMessageType messageType, Runnable feedback) {
NotificationUtils.sendNotification(dataSource, id, text, messageType, feedback);
}
@Override
public void sendNotification(String id, String title, String text, DBPMessageType messageType, Runnable feedback) {
NotificationUtils.sendNotification(id, title, text, messageType, feedback);
}
});
// Add bundle load logger
if (!Log.isQuietMode()) {
context.registerService(EventHook.class, (event, contexts) -> {
String message = null;
Bundle bundle = event.getBundle();
if (event.getType() == BundleEvent.STARTED) {
if (bundle.getState() == Bundle.ACTIVE) {
message = "> Start " + getBundleName(bundle) + " [" + bundle.getSymbolicName() + " " + bundle.getVersion() + "]";
}
} else if (event.getType() == BundleEvent.STOPPING) {
if (bundle.getState() != BundleEvent.STOPPING && bundle.getState() != BundleEvent.UNINSTALLED) {
message = "< Stop " + getBundleName(bundle) + " [" + bundle.getSymbolicName() + " " + bundle.getVersion() + "]";
}
}
if (message != null) {
System.err.println(message);
}
}, null);
// context.addBundleListener(new BundleLoadListener());
}
plugin = this;
}
Aggregations