summaryrefslogtreecommitdiff
path: root/sources/prefs/editors/VSProcessEditor.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-18 23:20:08 +0000
committerPaul Buetow <paul@buetow.org>2008-05-18 23:20:08 +0000
commit36f74586cc61f5899c16b6f84a04be37688cc719 (patch)
tree3ce0df2cf2dc18b2bdd27b546305c4a73598c457 /sources/prefs/editors/VSProcessEditor.java
parent34b16d2ffc7b40df933ba85ddb8e414121116ca5 (diff)
TaskManager bugfixes.
Diffstat (limited to 'sources/prefs/editors/VSProcessEditor.java')
-rw-r--r--sources/prefs/editors/VSProcessEditor.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/sources/prefs/editors/VSProcessEditor.java b/sources/prefs/editors/VSProcessEditor.java
index dcbe376..4103624 100644
--- a/sources/prefs/editors/VSProcessEditor.java
+++ b/sources/prefs/editors/VSProcessEditor.java
@@ -66,7 +66,17 @@ public class VSProcessEditor extends VSEditorFrame {
private JPanel createProtocolSelector() {
JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(BorderFactory.createLineBorder(Color.black));
- Vector<String> registeredProtocols = VSRegisteredEvents.getProtocolNames();
+
+ Vector<String> registeredProtocolsNames = VSRegisteredEvents.getProtocolNames();
+ Vector<String> registeredProtocolsShortnames = new Vector<String>();
+ final HashMap<String,String> eventNames = new HashMap<String,String>();
+
+ for (String protocolName : registeredProtocolsNames) {
+ String protocolClassname = VSRegisteredEvents.getClassname(protocolName);
+ String protocolShortname = VSRegisteredEvents.getShortname(protocolClassname);
+ registeredProtocolsShortnames.add(protocolShortname);
+ eventNames.put(protocolShortname, protocolName);
+ }
GridBagConstraints constraints = new GridBagConstraints();
constraints.fill = GridBagConstraints.HORIZONTAL;
@@ -75,7 +85,8 @@ public class VSProcessEditor extends VSEditorFrame {
constraints.insets = new Insets(5, 0, 5, 0);
constraints.ipadx = 10;
constraints.ipady = 10;
- final JComboBox comboBox = new JComboBox(registeredProtocols);
+
+ final JComboBox comboBox = new JComboBox(registeredProtocolsShortnames);
comboBox.setBackground(Color.WHITE);
panel.add(comboBox, constraints);
constraints.gridy = 1;
@@ -83,7 +94,8 @@ public class VSProcessEditor extends VSEditorFrame {
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
if (ae.getActionCommand().equals(prefs.getString("lang.edit"))) {
- String eventName = (String) comboBox.getSelectedItem();
+ String eventShortname = (String) comboBox.getSelectedItem();
+ String eventName = eventNames.get(eventShortname);
String eventClassname = VSRegisteredEvents.getClassname(eventName);
VSProtocol protocol = null;
if (process.objectExists(eventClassname)) {
@@ -96,6 +108,7 @@ public class VSProcessEditor extends VSEditorFrame {
protocol = (VSProtocol) VSRegisteredEvents.createEventInstanceByName(eventName, process);
process.setObject(eventClassname, protocol);
}
+
new VSProtocolEditor(prefs, frame, protocol);
}
}