diff options
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev')
5 files changed, 23 insertions, 24 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java index 180137c9f61c..0ab7aa0cd606 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java @@ -32,7 +32,7 @@ * *************************************************************************/ -import java.util.Vector; +import java.util.ArrayList; // __________ Implementation __________ @@ -64,5 +64,5 @@ public interface IOnewayLink * Note: Atomic types (e.g. int, long) will be transported as objects * too (Integer, Long)! */ - public abstract void execOneway( int nRequest, Vector<Object> lParams ); + public abstract void execOneway( int nRequest, ArrayList<Object> lParams ); } diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java index c9fe4f38c33f..628cc587c83d 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java @@ -34,7 +34,7 @@ // __________ Imports __________ -import java.util.Vector; +import java.util.ArrayList; import com.sun.star.frame.FrameActionEvent; import com.sun.star.uno.UnoRuntime; @@ -160,7 +160,7 @@ public class Interceptor implements com.sun.star.frame.XFrameActionListener, * @param lParams * the vector with all packed parameters of the original request */ - public void execOneway(/*IN*/ int nRequest,/*IN*/ Vector<Object> lParams ) + public void execOneway(/*IN*/ int nRequest,/*IN*/ ArrayList<Object> lParams ) { synchronized(this) { @@ -234,7 +234,7 @@ public class Interceptor implements com.sun.star.frame.XFrameActionListener, return; // pack the event and start thread - which call us back later - Vector<Object> lOutParams = new Vector<Object>(); + ArrayList<Object> lOutParams = new ArrayList<Object>(); lOutParams.add(aEvent); OnewayExecutor aExecutor = new OnewayExecutor( this , @@ -272,7 +272,7 @@ public class Interceptor implements com.sun.star.frame.XFrameActionListener, lInURL[0] = aURL ; lInArguments[0] = lArguments; - Vector<Object> lOutParams = OnewayExecutor.encodeDispatch( + ArrayList<Object> lOutParams = OnewayExecutor.encodeDispatch( lInURL , lInArguments ); OnewayExecutor aExecutor = new OnewayExecutor( this , diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java index 0f48ede996ae..2861b23bde3a 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java @@ -32,7 +32,7 @@ * *************************************************************************/ -import java.util.Vector; +import java.util.ArrayList; // __________ Implementation __________ @@ -76,7 +76,7 @@ class OnewayExecutor extends Thread */ private IOnewayLink m_rLink ; private int m_nRequest ; - private Vector<Object> m_lParams ; + private ArrayList<Object> m_lParams ; // _______________________________ @@ -102,7 +102,7 @@ class OnewayExecutor extends Thread */ public OnewayExecutor( IOnewayLink rLink , int nRequest , - Vector<Object> lParams ) + ArrayList<Object> lParams ) { m_rLink = rLink ; m_nRequest = nRequest; @@ -144,13 +144,13 @@ class OnewayExecutor extends Thread // _______________________________ - public static Vector<Object> encodeDispatch( + public static ArrayList<Object> encodeDispatch( com.sun.star.util.URL[] aURL, com.sun.star.beans.PropertyValue[][] lArgs) { int nLength = lArgs.length+1; int nPos = 0; - Vector<Object> lParams = new Vector<Object>(nLength); + ArrayList<Object> lParams = new ArrayList<Object>(nLength); lParams.add( aURL[0] ); --nLength; @@ -165,7 +165,7 @@ class OnewayExecutor extends Thread } public static void decodeDispatch( - Vector<Object> lParams, + ArrayList<Object> lParams, com.sun.star.util.URL[] aURL, com.sun.star.beans.PropertyValue[][] lArgs) { @@ -173,12 +173,12 @@ class OnewayExecutor extends Thread int nPos = 0; lArgs[0] = new com.sun.star.beans.PropertyValue[nLength]; - aURL[0] = (com.sun.star.util.URL) lParams.elementAt(0); + aURL[0] = (com.sun.star.util.URL) lParams.get(0); while (nPos<nLength) { lArgs[0][nPos] = (com.sun.star.beans.PropertyValue) - (lParams.elementAt(nPos+1)); + (lParams.get(nPos+1)); ++nPos; } } diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java index fd79205cfaa3..5de834dac847 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java @@ -35,7 +35,7 @@ // __________ Imports __________ import java.awt.Component; -import java.util.Vector; +import java.util.ArrayList; import javax.swing.JCheckBox; import javax.swing.JLabel; @@ -166,7 +166,7 @@ class StatusListener implements com.sun.star.frame.XStatusListener, * @param lParams * the vector with all packed parameters of the original request */ - public void execOneway(/*IN*/ int nRequest,/*IN*/ Vector<Object> lParams ) + public void execOneway(/*IN*/ int nRequest,/*IN*/ ArrayList<Object> lParams ) { synchronized(this) { @@ -213,7 +213,7 @@ class StatusListener implements com.sun.star.frame.XStatusListener, if (! bHandle) return; - Vector<Object> lOutParams = new Vector<Object>(); + ArrayList<Object> lOutParams = new ArrayList<Object>(); lOutParams.add(aEvent); OnewayExecutor aExecutor = new OnewayExecutor( this , diff --git a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java index c2fbff2cde91..e9f396e1c0a2 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java @@ -74,8 +74,8 @@ public class ViewContainer extends Thread */ private ViewContainer() { - mlViews = new Vector<Object>(); - mlListener = new Vector<IShutdownListener>(); + mlViews = new ArrayList<Object>(); + mlListener = new ArrayList<IShutdownListener>(); mbShutdownActive = false ; Runtime.getRuntime().addShutdownHook(this); } @@ -204,9 +204,8 @@ public class ViewContainer extends Thread IShutdownListener aListener = null; synchronized(mlListener) { - try{ - aListener = mlListener.firstElement(); - } catch(java.util.NoSuchElementException exEmpty) {} + if (!mlListener.isEmpty()) + aListener = mlListener.get(0); } if (aListener==null) break; @@ -258,7 +257,7 @@ public class ViewContainer extends Thread */ public static boolean mbInplace = false ; private static ViewContainer maSingleton = null ; - private Vector<Object> mlViews ; - private Vector<IShutdownListener> mlListener ; + private ArrayList<Object> mlViews ; + private ArrayList<IShutdownListener> mlListener ; private boolean mbShutdownActive ; } |