Kaydet (Commit) bc2b4210 authored tarafından Noel Grandin's avatar Noel Grandin

java: simplify CommonListenere some more

and remove some unused methods in UnoDialog2, and rename some
parameters to be more explanatory

Change-Id: Ic57510159bebacc1c79d8d689a14bd3cd5a81ae8
üst fb914bac
...@@ -66,28 +66,19 @@ public class CommonListener implements XActionListener, XItemListener, XTextList ...@@ -66,28 +66,19 @@ public class CommonListener implements XActionListener, XItemListener, XTextList
} }
} }
public void add(String componentName, EventNames eventName, MethodInvocation mi) private void add(String componentName, EventNames eventName, MethodInvocation mi)
{ {
mHashtable.put(componentName + eventName, mi); mHashtable.put(componentName + eventName, mi);
} }
private MethodInvocation get(String componentName, EventNames eventName) private void invoke(String componentName, EventNames eventName, Object param)
{
return mHashtable.get(componentName + eventName);
}
private Object invoke(String componentName, EventNames eventName, Object param)
{ {
try try
{ {
MethodInvocation mi = get(componentName, eventName); MethodInvocation mi = mHashtable.get(componentName + eventName);
if (mi != null) if (mi != null)
{ {
return mi.invoke(param); mi.invoke(param);
}
else
{
return null;
} }
} }
catch (InvocationTargetException ite) catch (InvocationTargetException ite)
...@@ -115,8 +106,6 @@ public class CommonListener implements XActionListener, XItemListener, XTextList ...@@ -115,8 +106,6 @@ public class CommonListener implements XActionListener, XItemListener, XTextList
System.out.println("======================================================="); System.out.println("=======================================================");
ex.printStackTrace(); ex.printStackTrace();
} }
return null;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment