From 6100734897d23d2743cf7e5e75bdcad8d552cc06 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 27 Oct 2009 09:31:22 +0000 Subject: [PATCH] added convenience method for accessing active plugins --- tools/cooja/java/se/sics/cooja/GUI.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index d9ad950f7..8245e99fe 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.144 2009/09/18 16:13:31 fros4943 Exp $ + * $Id: GUI.java,v 1.145 2009/10/27 09:31:22 fros4943 Exp $ */ package se.sics.cooja; @@ -1959,6 +1959,21 @@ public class GUI extends Observable { pluginClassesTemporary.clear(); } + /** + * Returns started plugin with given class name, if any. + * + * @param classname Class name + * @return Plugin instance + */ + public Plugin getStartedPlugin(String classname) { + for (Plugin p: startedPlugins) { + if (p.getClass().getName().equals(classname)) { + return p; + } + } + return null; + } + /** * Return a mote plugins submenu for given mote. *