From 9f0d5c8015f4504bc8400cbb4247f38d9df62768 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 24 May 2008 16:47:25 +0000 Subject: new protocol editor works. --- sources/events/VSRegisteredEvents.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sources/events/VSRegisteredEvents.java') diff --git a/sources/events/VSRegisteredEvents.java b/sources/events/VSRegisteredEvents.java index 79fd31c..2643d6f 100644 --- a/sources/events/VSRegisteredEvents.java +++ b/sources/events/VSRegisteredEvents.java @@ -10,6 +10,7 @@ public final class VSRegisteredEvents { private static HashMap eventClassnames; private static HashMap eventShortnames; private static HashMap eventNames; + private static ArrayList editableProtocolsClassnames; private static VSPrefs prefs; public static void init(VSPrefs prefs_) { @@ -17,6 +18,7 @@ public final class VSRegisteredEvents { eventNames = new HashMap(); eventShortnames = new HashMap(); eventClassnames = new HashMap(); + editableProtocolsClassnames = new ArrayList(); registerEvent("events.implementations.ProcessCrashEvent", "Prozessabsturz", null); registerEvent("events.implementations.ProcessRecoverEvent", "Prozesswiederbelebung", null); @@ -26,6 +28,22 @@ public final class VSRegisteredEvents { registerEvent("protocols.implementations.ExternalTimeSyncProtocol", "Christians Methode zur externen Sync.", "Christians"); registerEvent("protocols.implementations.InternalTimeSyncProtocol", "Interne Synchronisation", "Interne Sync."); registerEvent("protocols.implementations.PingPongProtocol", "Ping Pong", null); + + /* Make dummy objects of each protocol, to see if they contain VSPrefs values to edit */ + Vector protocolClassnames = getProtocolClassnames(); + VSClassLoader classLoader = new VSClassLoader(); + for (String protocolClassname : protocolClassnames) { + Object object = classLoader.newInstance(protocolClassname); + if (object instanceof protocols.VSProtocol) { + protocols.VSProtocol protocol = (protocols.VSProtocol) object; + if (!protocol.isEmpty()) + editableProtocolsClassnames.add(protocolClassname); + } + } + } + + public static ArrayList getEditableProtocolsClassnames() { + return editableProtocolsClassnames; } public static Vector getProtocolNames() { -- cgit v1.2.3