From 43cd64dd61f24ac6ce1a2b4b7a04604734bfef2b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 7 Sep 2012 09:51:41 +0200 Subject: Java cleanup, simplify and generify Convert this code to use generics and remove needless complexity Change-Id: Icc87face21de963f433d2422b3e9d62042de24a8 --- .../DesktopEnvironment/StatusListener.java | 28 +++++++--------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java') diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java index ac5d429ba08a..753249d4ab09 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java @@ -34,13 +34,14 @@ // __________ Imports __________ -import com.sun.star.uno.UnoRuntime; - -import java.lang.String; import java.awt.Component; +import java.util.Vector; + import javax.swing.JCheckBox; import javax.swing.JLabel; -import java.util.Vector; + +import com.sun.star.frame.FrameActionEvent; +import com.sun.star.uno.UnoRuntime; // __________ Implementation __________ @@ -176,14 +177,7 @@ class StatusListener implements com.sun.star.frame.XStatusListener, // was it frameAction()? if (nRequest==OnewayExecutor.REQUEST_FRAMEACTION) { - com.sun.star.frame.FrameActionEvent[] lOutAction = new com.sun.star.frame.FrameActionEvent[1]; - Vector[] lInParams = new Vector[1]; - lInParams[0] = lParams; - - OnewayExecutor.codeFrameAction( OnewayExecutor.DECODE_PARAMS , - lInParams , - lOutAction ); - impl_frameAction(lOutAction[0]); + impl_frameAction((FrameActionEvent) lParams.get(0)); } } @@ -220,16 +214,12 @@ class StatusListener implements com.sun.star.frame.XStatusListener, if (! bHandle) return; - Vector[] lOutParams = new Vector[1]; - com.sun.star.frame.FrameActionEvent[] lInAction = new com.sun.star.frame.FrameActionEvent[1]; - lInAction[0] = aEvent; + Vector lOutParams = new Vector(); + lOutParams.add(aEvent); - OnewayExecutor.codeFrameAction( OnewayExecutor.ENCODE_PARAMS , - lOutParams , - lInAction ); OnewayExecutor aExecutor = new OnewayExecutor( (IOnewayLink)this , OnewayExecutor.REQUEST_FRAMEACTION , - lOutParams[0] ); + lOutParams ); aExecutor.start(); } -- cgit