X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Faccessor%2Fimpl%2FListenerEntry.java;h=755d67f9512214175de1f173f97ef6e862b1ca32;hb=refs%2Fchanges%2F22%2F2422%2F4;hp=f21cdf10c29ce8ce34c7fa0555b444eb105a62e9;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/impl/ListenerEntry.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/impl/ListenerEntry.java index f21cdf10c..755d67f95 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/impl/ListenerEntry.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/accessor/impl/ListenerEntry.java @@ -1,24 +1,24 @@ -/******************************************************************************* - * Copyright (c) 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 - *******************************************************************************/ +/******************************************************************************* + * Copyright (c) 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.databoard.accessor.impl; -import java.util.Collection; -import java.util.Collections; -import java.util.concurrent.Executor; - -import org.simantics.databoard.accessor.Accessor.Listener; -import org.simantics.databoard.accessor.event.Event; -import org.simantics.databoard.accessor.interestset.InterestSet; -import org.simantics.databoard.accessor.reference.ChildReference; +import java.util.Collection; +import java.util.Collections; +import java.util.concurrent.Executor; + +import org.simantics.databoard.accessor.Accessor.Listener; +import org.simantics.databoard.accessor.event.Event; +import org.simantics.databoard.accessor.interestset.InterestSet; +import org.simantics.databoard.accessor.reference.ChildReference; /** * ListenerEntry is a linked list of pairs @@ -30,7 +30,7 @@ public class ListenerEntry { public Listener listener; public InterestSet interestSet; // Path from the listened object - public ChildReference path; + public ChildReference path; public Executor executor; public ListenerEntry next; @@ -39,7 +39,7 @@ public class ListenerEntry { this.listener = listener; this.interestSet = interestSet; this.path = path; - this.executor = executor; + this.executor = executor; } /** @@ -93,30 +93,30 @@ public class ListenerEntry { * @param e */ public void emitEvent(final Event e) { -// e.reference = ChildReference.concatenate(path, e.reference); +// e.reference = ChildReference.concatenate(path, e.reference); + if (executor == null) { + listener.onEvents( Collections.singleton(e) ); + } else { + executor.execute( new Runnable() { + public void run() { + listener.onEvents( Collections.singleton(e) ); + }}); + } + } + + public void emitEvents(final Collection events) { +// for (Event e : events) { +// e.reference = ChildReference.concatenate(path, e.reference); +// } if (executor == null) { - listener.onEvents( Collections.singleton(e) ); - } else { - executor.execute( new Runnable() { - public void run() { - listener.onEvents( Collections.singleton(e) ); - }}); + listener.onEvents( events ); + } else { + executor.execute( new Runnable() { + public void run() { + listener.onEvents( events ); + }}); } } - - public void emitEvents(final Collection events) { -// for (Event e : events) { -// e.reference = ChildReference.concatenate(path, e.reference); -// } - if (executor == null) { - listener.onEvents( events ); - } else { - executor.execute( new Runnable() { - public void run() { - listener.onEvents( events ); - }}); - } - } }