summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-05-03 14:35:04 +0200
committerNoel Grandin <noel@peralex.com>2013-05-06 11:45:50 +0200
commit587c59fbc931b12f4d63d077a78bcaa43ffbf83d (patch)
treec1984991960664faf41ea3e32e3804404aecb22d /odk
parent95e1ecbf89f75e2b298b931c3cc2e0d5655c31ed (diff)
Java cleanup, Convert Vector to ArrayList
Change-Id: I323a6625f93347e69f3114fc10cb04dc759a539f
Diffstat (limited to 'odk')
-rw-r--r--odk/examples/DevelopersGuide/Forms/ButtonOperator.java14
-rw-r--r--odk/examples/DevelopersGuide/Forms/SalesFilter.java6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/IOnewayLink.java4
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java16
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java6
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java13
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java12
-rw-r--r--odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java48
-rw-r--r--odk/examples/DevelopersGuide/UCB/PropertiesComposer.java24
-rw-r--r--odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java22
-rw-r--r--odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java40
-rw-r--r--odk/examples/java/Inspector/HideableTreeModel.java33
-rw-r--r--odk/examples/java/Inspector/Inspector.java14
-rw-r--r--odk/examples/java/Inspector/Introspector.java11
-rw-r--r--odk/examples/java/Inspector/MethodParametersDialog.java14
-rw-r--r--odk/examples/java/Inspector/SourceCodeGenerator.java15
-rw-r--r--odk/examples/java/Inspector/SwingUnoMethodNode.java9
-rw-r--r--odk/examples/java/Inspector/UnoMethodNode.java3
-rw-r--r--odk/examples/java/Inspector/UnoNode.java7
-rw-r--r--odk/examples/java/Inspector/XUnoMethodNode.java3
-rw-r--r--odk/examples/java/ToDo/ToDo.java64
22 files changed, 193 insertions, 193 deletions
diff --git a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
index a447381a2c69..3d121589d8e6 100644
--- a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
+++ b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
@@ -32,6 +32,8 @@
*
*************************************************************************/
// java base stuff
+import java.util.ArrayList;
+
import com.sun.star.awt.ActionEvent;
import com.sun.star.awt.XActionListener;
import com.sun.star.awt.XButton;
@@ -42,7 +44,6 @@ import com.sun.star.form.runtime.XFormOperations;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
-import java.util.Vector;
/**************************************************************************/
@@ -55,7 +56,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
private XPropertySet m_form;
private XFormOperations m_formOperations;
- private Vector<XPropertySet> m_aButtons;
+ private ArrayList<XPropertySet> m_aButtons;
/* ------------------------------------------------------------------ */
/** ctor
@@ -65,7 +66,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
m_componentContext = xCtx;
m_aDocument = aDocument;
m_form = _form;
- m_aButtons = new Vector<XPropertySet>();
+ m_aButtons = new ArrayList<XPropertySet>();
}
/* ------------------------------------------------------------------ */
@@ -89,7 +90,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
{
for ( int i=0; i < m_aButtons.size(); ++i )
{
- XPropertySet button = m_aButtons.elementAt( i );
+ XPropertySet button = m_aButtons.get( i );
if ( _formFeature == getAssociatedFormFeature( button ) )
return button;
}
@@ -104,7 +105,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
int nPos = -1;
for ( int i=0; ( i < m_aButtons.size() ) && ( -1 == nPos ); ++i )
{
- if ( xButton.equals( m_aButtons.elementAt( i ) ) )
+ if ( xButton.equals( m_aButtons.get( i ) ) )
nPos = i;
}
return nPos;
@@ -207,9 +208,8 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
public void invalidateAllFeatures() throws com.sun.star.uno.RuntimeException
{
- for ( int i=0; i < m_aButtons.size(); ++i )
+ for ( XPropertySet buttonModel : m_aButtons )
{
- XPropertySet buttonModel = m_aButtons.elementAt( i );
updateButtonState( buttonModel, getAssociatedFormFeature( buttonModel ) );
}
}
diff --git a/odk/examples/DevelopersGuide/Forms/SalesFilter.java b/odk/examples/DevelopersGuide/Forms/SalesFilter.java
index e4c516160d0f..33053db662ca 100644
--- a/odk/examples/DevelopersGuide/Forms/SalesFilter.java
+++ b/odk/examples/DevelopersGuide/Forms/SalesFilter.java
@@ -362,7 +362,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
String[] aOldFilterItems = (String[])m_xFilterList.getPropertyValue( "StringItemList" );
// translate this into a vector - much more comfort to work with a vector than with an array ....
- java.util.Vector aFilterItems = new java.util.Vector();
+ java.util.ArrayList aFilterItems = new java.util.ArrayList();
for ( int i=0; i<aOldFilterItems.length; ++i )
aFilterItems.add( aOldFilterItems[i] );
@@ -384,7 +384,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
if ( aFilterItems.size() > 10 ) // (6 standard items + 5 user defined items)
{
// the first (and thus oldes) user defined item
- aFilterItems.removeElementAt( 6 );
+ aFilterItems.remove( 6 );
// keep our date vector synchron
m_aFilterDates.removeElementAt( 6 );
}
@@ -397,7 +397,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
m_bAdjustingFilterList = true;
String[] aNewFilterItems = new String[ aFilterItems.size() ];
for ( int i=0; i<aFilterItems.size(); ++i )
- aNewFilterItems[i] = (String)aFilterItems.elementAt( i );
+ aNewFilterItems[i] = (String)aFilterItems.get( i );
m_xFilterList.setPropertyValue( "StringItemList", aNewFilterItems );
m_bAdjustingFilterList = false;
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 ;
}
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
index 388e4890bbd2..47cc018ac2e4 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
@@ -38,7 +38,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
{
private String aName;
private int nValue;
- private java.util.Vector<XResultListener> aListeners = new java.util.Vector<XResultListener>();
+ private java.util.ArrayList<XResultListener> aListeners = new java.util.ArrayList<XResultListener>();
public ExampleAddInResult( String aNewName )
{
@@ -56,7 +56,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
public void addResultListener(com.sun.star.sheet.XResultListener aListener)
{
- aListeners.addElement( aListener );
+ aListeners.add( aListener );
// immediately notify of initial value
aListener.modified( getResult() );
@@ -64,7 +64,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
public void removeResultListener(com.sun.star.sheet.XResultListener aListener)
{
- aListeners.removeElement( aListener );
+ aListeners.remove( aListener );
}
public void incrementValue()
@@ -72,10 +72,8 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
++nValue;
com.sun.star.sheet.ResultEvent aEvent = getResult();
- java.util.Enumeration<XResultListener> aEnum = aListeners.elements();
- while (aEnum.hasMoreElements())
- aEnum.nextElement().modified(
- aEvent);
+ for( XResultListener l : aListeners)
+ l.modified(aEvent);
}
}
diff --git a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
index 00591ec4bc58..03a45bae9c23 100644
--- a/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
+++ b/odk/examples/DevelopersGuide/UCB/ChildrenRetriever.java
@@ -32,19 +32,18 @@
*
*************************************************************************/
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import com.sun.star.beans.Property;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XRow;
import com.sun.star.ucb.OpenCommandArgument2;
import com.sun.star.ucb.OpenMode;
import com.sun.star.ucb.XContent;
import com.sun.star.ucb.XContentAccess;
import com.sun.star.ucb.XDynamicResultSet;
-import com.sun.star.beans.Property;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.sdbc.XRow;
-import com.sun.star.sdbc.XResultSet;
-
-import java.util.Vector;
-import java.util.Enumeration;
-import java.util.StringTokenizer;
/**
* Retrieve the Children of a UCB Folder Content
@@ -57,7 +56,7 @@ public class ChildrenRetriever {
private Helper m_helper;
private XContent m_content;
private String m_contenturl = "";
- private Vector<String> m_propnames = new Vector<String>();
+ private ArrayList<String> m_propnames = new ArrayList<String>();
/**
* Constructor. Create a new connection with the specific args to a running office
@@ -87,30 +86,30 @@ public class ChildrenRetriever {
* This method requires the main and the optional arguments to be set in order to work.
* See Constructor.
*
- *@return Vector Returns children properties values if values successfully retrieved,
+ *@return Returns children properties values if values successfully retrieved,
* null otherwise
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Vector<Object>> getChildren()
+ public ArrayList<ArrayList<Object>> getChildren()
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<String> properties = getProperties();
+ ArrayList<String> properties = getProperties();
return getChildren ( properties );
}
/**
* Open a folder content, get properties values for the properties.
*
- *@param Vector Properties
- *@return Vector Returns children properties values if values successfully retrieved,
+ *@param properties
+ *@return Returns children properties values if values successfully retrieved,
* null otherwise
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Vector<Object>> getChildren( Vector<String> properties )
+ public ArrayList<ArrayList<Object>> getChildren( ArrayList<String> properties )
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<Vector<Object>> result = null;
+ ArrayList<ArrayList<Object>> result = null;
if ( m_content != null ) {
int size = 0;
if ( properties != null && !properties.isEmpty()) {
@@ -140,7 +139,7 @@ public class ChildrenRetriever {
XDynamicResultSet.class, m_helper.executeCommand( m_content, "open", arg ));
XResultSet resultSet = set.getStaticResultSet();
- result = new Vector<Vector<Object>>();
+ result = new ArrayList<ArrayList<Object>>();
/////////////////////////////////////////////////////////////////////
// Iterate over children, access children and property values...
@@ -153,7 +152,7 @@ public class ChildrenRetriever {
XRow row = UnoRuntime.queryInterface( XRow.class, resultSet );
do {
- Vector<Object> propsValues = new Vector<Object>();
+ ArrayList<Object> propsValues = new ArrayList<Object>();
// Obtain URL of child.
String id = contentAccess.queryContentIdentifierString();
@@ -187,7 +186,7 @@ public class ChildrenRetriever {
*
*@return String That contains the properties
*/
- public Vector<String> getProperties() {
+ public ArrayList<String> getProperties() {
return m_propnames;
}
@@ -240,10 +239,8 @@ public class ChildrenRetriever {
/**
* Print all properties out contained in vector .
- *
- *@param Vector
*/
- public void printLine( Vector<Object> props ) {
+ public void printLine( ArrayList<Object> props ) {
int limit;
while ( !props.isEmpty() ) {
String print = "";
@@ -305,7 +302,7 @@ public class ChildrenRetriever {
ChildrenRetriever access = new ChildrenRetriever( args );
// Get the properties Title and IsFolder for the children.
- Vector<Vector<Object>> result = access.getChildren();
+ ArrayList<ArrayList<Object>> result = access.getChildren();
String tempPrint = "\nChildren of resource " + access.getContentURL();
int size = tempPrint.length();
@@ -318,9 +315,9 @@ public class ChildrenRetriever {
if ( result != null && !result.isEmpty() ) {
- Vector<Object> cont = new Vector<Object>();
+ ArrayList<Object> cont = new ArrayList<Object>();
cont.add("URL:");
- Vector<String> props = access.getProperties();
+ ArrayList<String> props = access.getProperties();
size = props.size();
for ( int i = 0; i < size; i++ ) {
Object obj = props.get( i );
@@ -329,8 +326,7 @@ public class ChildrenRetriever {
}
access.printLine(cont);
System.out.println( "\n" );
- for ( Enumeration<Vector<Object>> e = result.elements(); e.hasMoreElements(); ) {
- Vector<Object> propsV = e.nextElement();
+ for ( ArrayList<Object> propsV : result ) {
access.printLine( propsV );
}
}
diff --git a/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java b/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java
index 794502262ff2..19a11139bad8 100644
--- a/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java
+++ b/odk/examples/DevelopersGuide/UCB/PropertiesComposer.java
@@ -32,7 +32,7 @@
*
*************************************************************************/
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.StringTokenizer;
import com.sun.star.beans.PropertyValue;
@@ -49,8 +49,8 @@ public class PropertiesComposer {
private Helper m_helper;
private XContent m_content;
private String m_contenturl = "";
- private Vector<String> m_propNames = new Vector<String>();
- private Vector<String> m_propValues = new Vector<String>();
+ private ArrayList<String> m_propNames = new ArrayList<String>();
+ private ArrayList<String> m_propValues = new ArrayList<String>();
/**
* Constructor.
@@ -89,22 +89,22 @@ public class PropertiesComposer {
*/
public Object[] setProperties()
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<String> properties = getProperties();
- Vector<String> propertyValues = getPropertyValues();
+ ArrayList<String> properties = getProperties();
+ ArrayList<String> propertyValues = getPropertyValues();
return setProperties( properties, propertyValues );
}
/**
* Set values of the properties.
*
- *@param Vector Properties
- *@param Vector Properties value
+ *@param properties
+ *@param propertiesValue
*@return Object[] Returns null or instance object of com.sun.star.uno.Any
* if values successfully seted, properties otherwise
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Object[] setProperties( Vector<String> properties, Vector<String> propertiesValues )
+ public Object[] setProperties( ArrayList<String> properties, ArrayList<String> propertiesValues )
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
Object[] result = null;
@@ -161,7 +161,7 @@ public class PropertiesComposer {
*
*@return Vector That contains the properties names
*/
- public Vector<String> getProperties() {
+ public ArrayList<String> getProperties() {
return m_propNames;
}
@@ -170,7 +170,7 @@ public class PropertiesComposer {
*
*@return Vector That contains the properties values
*/
- public Vector<String> getPropertyValues() {
+ public ArrayList<String> getPropertyValues() {
return m_propValues;
}
@@ -263,8 +263,8 @@ public class PropertiesComposer {
try {
PropertiesComposer setProp = new PropertiesComposer( args );
- Vector<String> properties = setProp.getProperties();
- Vector<String> propertiesValues = setProp.getPropertyValues();
+ ArrayList<String> properties = setProp.getProperties();
+ ArrayList<String> propertiesValues = setProp.getPropertyValues();
Object[] result = setProp.setProperties( properties, propertiesValues );
String tempPrint = "\nSetting properties of resource " + setProp.getContentURL();
diff --git a/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java b/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
index 49f0fa2a3604..002d5c4e6cc2 100644
--- a/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
+++ b/odk/examples/DevelopersGuide/UCB/PropertiesRetriever.java
@@ -32,13 +32,13 @@
*
*************************************************************************/
-import java.util.Vector;
+import java.util.ArrayList;
import java.util.StringTokenizer;
import com.sun.star.beans.Property;
+import com.sun.star.sdbc.XRow;
import com.sun.star.ucb.XContent;
import com.sun.star.uno.UnoRuntime;
-import com.sun.star.sdbc.XRow;
/**
@@ -52,7 +52,7 @@ public class PropertiesRetriever {
private Helper m_helper;
private XContent m_content;
private String m_contenturl = "";
- private Vector<String> m_propNames = new Vector<String>();
+ private ArrayList<String> m_propNames = new ArrayList<String>();
/**
* Constructor.
@@ -87,9 +87,9 @@ public class PropertiesRetriever {
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Object> getPropertyValues()
+ public ArrayList<Object> getPropertyValues()
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<String> properties = getProperties();
+ ArrayList<String> properties = getProperties();
return getPropertyValues ( properties );
}
@@ -101,9 +101,9 @@ public class PropertiesRetriever {
*@exception com.sun.star.ucb.CommandAbortedException
*@exception com.sun.star.uno.Exception
*/
- public Vector<Object> getPropertyValues( Vector<String> properties )
+ public ArrayList<Object> getPropertyValues( ArrayList<String> properties )
throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {
- Vector<Object> m_propValues = null;
+ ArrayList<Object> m_propValues = null;
if ( m_content != null && properties != null && !properties.isEmpty() ) {
int size = properties.size();
@@ -124,7 +124,7 @@ public class PropertiesRetriever {
UnoRuntime.queryInterface(
XRow.class, m_helper.executeCommand( m_content,"getPropertyValues", props ));
- m_propValues = new Vector<Object>();
+ m_propValues = new ArrayList<Object>();
/*
Extract values from row object. Note that the
@@ -155,7 +155,7 @@ public class PropertiesRetriever {
*
*@return Vector That contains the properties
*/
- public Vector<String> getProperties() {
+ public ArrayList<String> getProperties() {
return m_propNames;
}
@@ -222,8 +222,8 @@ public class PropertiesRetriever {
"--------------------------------------------------------------" );
try {
PropertiesRetriever obtProperty = new PropertiesRetriever( args );
- Vector<String> properties = obtProperty.getProperties();
- Vector<Object> propertiesValues = obtProperty.getPropertyValues( properties );
+ ArrayList<String> properties = obtProperty.getProperties();
+ ArrayList<Object> propertiesValues = obtProperty.getPropertyValues( properties );
String tempPrint = "\nProperties of resource " + obtProperty.getContentURL();
int size = tempPrint.length();
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
index cdf3c290199e..b38bb8c3b56f 100644
--- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
@@ -16,27 +16,25 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XComponentContext;
-import com.sun.star.lang.XMultiComponentFactory;
-import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.uno.AnyConverter;
-import com.sun.star.lib.uno.helper.WeakBase;
-import com.sun.star.io.XStream;
-import com.sun.star.io.XOutputStream;
+import java.awt.Dimension;
+import java.util.ArrayList;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.embed.VisualRepresentation;
+import com.sun.star.embed.XStorage;
+import com.sun.star.embed.XTransactedObject;
import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.io.XStream;
import com.sun.star.io.XTruncate;
-import com.sun.star.beans.XPropertySet;
import com.sun.star.lang.XComponent;
-import com.sun.star.embed.VisualRepresentation;
-import com.sun.star.container.XNameAccess;
-
-
-import com.sun.star.embed.*;
-
-import java.util.Vector;
-import java.awt.Dimension;
-import java.lang.Integer;
+import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lib.uno.helper.WeakBase;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
public final class OwnEmbeddedObject extends WeakBase
implements com.sun.star.embed.XEmbedPersist,
@@ -59,7 +57,7 @@ public final class OwnEmbeddedObject extends WeakBase
protected EditorFrame m_aEditorFrame;
- protected Vector<Object> m_aListeners;
+ protected ArrayList<Object> m_aListeners;
com.sun.star.embed.VerbDescriptor[] m_pOwnVerbs;
@@ -68,10 +66,10 @@ public final class OwnEmbeddedObject extends WeakBase
Dimension m_aObjSize;
// -------------------------------------------------------------
- protected Vector<Object> GetListeners()
+ protected ArrayList<Object> GetListeners()
{
if ( m_aListeners == null )
- m_aListeners = new Vector<Object>( 10, 10 );
+ m_aListeners = new ArrayList<Object>(10);
return m_aListeners;
}
diff --git a/odk/examples/java/Inspector/HideableTreeModel.java b/odk/examples/java/Inspector/HideableTreeModel.java
index 44c208c8be3a..0184e24b8aed 100644
--- a/odk/examples/java/Inspector/HideableTreeModel.java
+++ b/odk/examples/java/Inspector/HideableTreeModel.java
@@ -18,15 +18,18 @@
import java.util.ArrayList;
import java.util.Enumeration;
-import java.util.Vector;
-import javax.swing.*;
-import javax.swing.event.*;
-import javax.swing.tree.*;
+
+import javax.swing.JTree;
+import javax.swing.event.TreeModelEvent;
+import javax.swing.event.TreeModelListener;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
public class HideableTreeModel implements TreeModel {
- private Vector<TreeModelListener> modelListeners = new Vector<TreeModelListener>();
+ private ArrayList<TreeModelListener> modelListeners = new ArrayList<TreeModelListener>();
private Object root = null;
@@ -72,12 +75,12 @@ public class HideableTreeModel implements TreeModel {
public void addTreeModelListener(TreeModelListener l) {
- modelListeners.addElement(l);
+ modelListeners.add(l);
}
public void removeTreeModelListener(TreeModelListener l) {
- modelListeners.removeElement(l);
+ modelListeners.remove(l);
}
@@ -135,28 +138,28 @@ public class HideableTreeModel implements TreeModel {
protected void fireTreeNodesChanged(TreeModelEvent event) {
- for(int i = 0; i < modelListeners.size(); i++) {
- modelListeners.elementAt(i).treeNodesChanged(event);
+ for(TreeModelListener l : modelListeners) {
+ l.treeNodesChanged(event);
}
}
protected void fireTreeNodesInserted(TreeModelEvent event) {
- for(int i = 0; i < modelListeners.size(); i++) {
- modelListeners.elementAt(i).treeNodesInserted(event);
+ for(TreeModelListener l : modelListeners) {
+ l.treeNodesInserted(event);
}
}
protected void fireTreeNodesRemoved(TreeModelEvent event) {
- for(int i = 0; i < modelListeners.size(); i++) {
- modelListeners.elementAt(i).treeNodesRemoved(event);
+ for(TreeModelListener l : modelListeners) {
+ l.treeNodesRemoved(event);
}
}
protected void fireTreeStructureChanged(TreeModelEvent event) {
- for(int i = 0; i < modelListeners.size(); i++) {
- modelListeners.elementAt(i).treeStructureChanged(event);
+ for(TreeModelListener l : modelListeners) {
+ l.treeStructureChanged(event);
}
}
diff --git a/odk/examples/java/Inspector/Inspector.java b/odk/examples/java/Inspector/Inspector.java
index 3b5052d7041b..137a08019f70 100644
--- a/odk/examples/java/Inspector/Inspector.java
+++ b/odk/examples/java/Inspector/Inspector.java
@@ -32,6 +32,13 @@
*
*************************************************************************/
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.openoffice.XInstanceInspector;
+
import com.sun.star.awt.Rectangle;
import com.sun.star.awt.XMessageBox;
import com.sun.star.awt.XMessageBoxFactory;
@@ -56,11 +63,6 @@ import com.sun.star.uno.XComponentContext;
import com.sun.star.util.CloseVetoException;
import com.sun.star.util.XChangesBatch;
import com.sun.star.util.XCloseable;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-import org.openoffice.XInstanceInspector;
/** The purpose of this class is to provide a factory for creating the service
@@ -79,7 +81,7 @@ public class Inspector{
static private final String __serviceName = "org.openoffice.InstanceInspector";
private HashMap<String, String> aApplicationHashMap = new HashMap<String, String>();
private String sTitle = "Object Inspector";
- private Vector<XComponent> aHiddenDocuments = new Vector<XComponent>();
+ private ArrayList<XComponent> aHiddenDocuments = new ArrayList<XComponent>();
// private String[] sApplicationDocUrls = new String[]{"private:factory/swriter", "private:factory/scalc", "private:factory/simpress", "private:factory/sdraw", "private:factory/sbase"};
// private String[] sApplicationDocNames = new String[]{"Text Document", "Spreadsheet", "Presentation", "Drawing", "Database"};
private XComponentContext m_xComponentContext;
diff --git a/odk/examples/java/Inspector/Introspector.java b/odk/examples/java/Inspector/Introspector.java
index e8c80cf5c82d..79b90d4ef859 100644
--- a/odk/examples/java/Inspector/Introspector.java
+++ b/odk/examples/java/Inspector/Introspector.java
@@ -32,6 +32,9 @@
*
*************************************************************************/
+import java.util.ArrayList;
+import java.util.List;
+
import com.sun.star.beans.IllegalTypeException;
import com.sun.star.beans.MethodConcept;
import com.sun.star.beans.Property;
@@ -66,8 +69,6 @@ import com.sun.star.uno.TypeClass;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.util.URL;
-import java.util.List;
-import java.util.Vector;
public class Introspector extends WeakBase{
@@ -160,7 +161,7 @@ public class Introspector extends WeakBase{
public Object[] getUnoObjectsOfContainer(Object _oUnoParentObject) {
Object[] oRetComponents = null;
try {
- Vector<Object> oRetComponentsVector = new Vector<Object>();
+ ArrayList<Object> oRetComponentsVector = new ArrayList<Object>();
XIntrospectionAccess xIntrospectionAccessObject = getXIntrospectionAccess(_oUnoParentObject);
if ( xIntrospectionAccessObject != null ) {
XEnumerationAccess xEnumerationAccess = UnoRuntime.queryInterface(XEnumerationAccess.class, xIntrospectionAccessObject.queryAdapter( new Type( XEnumerationAccess.class ) ) );
@@ -260,7 +261,7 @@ public class Introspector extends WeakBase{
protected Property[] getProperties(Object _oUnoObject, String _sServiceName){
Property[] aProperties = getProperties(_oUnoObject);
List<Property> aListOfProperties = java.util.Arrays.asList(aProperties);
- Vector<Property> aPropertiesVector = new Vector<Property>(aListOfProperties);
+ ArrayList<Property> aPropertiesVector = new ArrayList<Property>(aListOfProperties);
if (aProperties != null){
XPropertyTypeDescription[] xPropertyTypeDescriptions = getPropertyDescriptionsOfService(_sServiceName);
for (int i = aProperties.length - 1; i >= 0; i--){
@@ -278,7 +279,7 @@ public class Introspector extends WeakBase{
protected Type[] getInterfaces(Object _oUnoObject, String _sServiceName){
Type[] aTypes = getInterfaces(_oUnoObject);
List<Type> aListOfTypes = java.util.Arrays.asList(aTypes);
- Vector<Type> aTypesVector = new Vector<Type>(aListOfTypes);
+ ArrayList<Type> aTypesVector = new ArrayList<Type>(aListOfTypes);
if (aTypes != null){
XInterfaceTypeDescription[] xInterfaceTypeDescriptions = getInterfaceDescriptionsOfService(_sServiceName);
for (int i = aTypes.length - 1; i >= 0; i--){
diff --git a/odk/examples/java/Inspector/MethodParametersDialog.java b/odk/examples/java/Inspector/MethodParametersDialog.java
index 8a261b1d98b6..6a43c697ad0d 100644
--- a/odk/examples/java/Inspector/MethodParametersDialog.java
+++ b/odk/examples/java/Inspector/MethodParametersDialog.java
@@ -32,15 +32,13 @@
*
*************************************************************************/
-import com.sun.star.reflection.ParamInfo;
-import com.sun.star.reflection.XIdlMethod;
-import com.sun.star.uno.TypeClass;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
-import java.util.Vector;
+import java.util.ArrayList;
+
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
@@ -49,6 +47,10 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
+import com.sun.star.reflection.ParamInfo;
+import com.sun.star.reflection.XIdlMethod;
+import com.sun.star.uno.TypeClass;
+
public class MethodParametersDialog extends JDialog{
private javax.swing.JPanel jPnlParamContainer;
private ParameterPanel[] m_aParameterPanels;
@@ -76,7 +78,7 @@ public class MethodParametersDialog extends JDialog{
}
- public Vector<Object> getMethodObjects() {
+ public ArrayList<Object> getMethodObjects() {
super.setModal(true);
addBorderPanel(getContentPane(), BorderLayout.NORTH);
addBorderPanel(getContentPane(), BorderLayout.WEST);
@@ -105,7 +107,7 @@ public class MethodParametersDialog extends JDialog{
m_aParameterPanels[0].getInputComponent().requestFocusInWindow();
setVisible(true);
if (!bisdiposed){
- Vector<Object> aMethodObjects = new Vector<Object>();
+ ArrayList<Object> aMethodObjects = new ArrayList<Object>();
for (int i = 0; i < m_aParameterPanels.length; i++){
aMethodObjects.add(m_aParameterPanels[i].getValue());
}
diff --git a/odk/examples/java/Inspector/SourceCodeGenerator.java b/odk/examples/java/Inspector/SourceCodeGenerator.java
index 45431bd86f38..4e6f3bc30115 100644
--- a/odk/examples/java/Inspector/SourceCodeGenerator.java
+++ b/odk/examples/java/Inspector/SourceCodeGenerator.java
@@ -32,6 +32,10 @@
*
*************************************************************************/
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+
import com.sun.star.reflection.ParamInfo;
import com.sun.star.reflection.XIdlClass;
import com.sun.star.reflection.XIdlMethod;
@@ -40,15 +44,12 @@ import com.sun.star.uno.Any;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
import com.sun.star.uno.TypeClass;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
public class SourceCodeGenerator {
- private Vector<String> sExceptions = new Vector<String>();
- Vector<String> sHeaderStatements = new HeaderStatements();
+ private ArrayList<String> sExceptions = new ArrayList<String>();
+ ArrayList<String> sHeaderStatements = new HeaderStatements();
private XLanguageSourceCodeGenerator m_xLanguageSourceCodeGenerator;
private String sHeaderCode = "";
private String sStatementCode = "";
@@ -61,7 +62,7 @@ public class SourceCodeGenerator {
private final String SUNOOBJECTNAME = "oUnobject";
private final String SUNOSTRUCTNAME = "aUnoStruct";
private Introspector m_oIntrospector;
- private Vector<XTreePathProvider> aTreepathProviders = new Vector<XTreePathProvider>();
+ private ArrayList<XTreePathProvider> aTreepathProviders = new ArrayList<XTreePathProvider>();
private XTreePathProvider xTreepathProvider = null;
private boolean baddExceptionHandling = false;
private boolean bXPropertySetExceptionsAreAdded = false;
@@ -361,7 +362,7 @@ public class SourceCodeGenerator {
}
- private class HeaderStatements extends Vector<String> {
+ private class HeaderStatements extends ArrayList<String> {
public boolean contains(String _oElement){
String sCompName = _oElement;
diff --git a/odk/examples/java/Inspector/SwingUnoMethodNode.java b/odk/examples/java/Inspector/SwingUnoMethodNode.java
index 3f67de3a2096..92bebe505e1c 100644
--- a/odk/examples/java/Inspector/SwingUnoMethodNode.java
+++ b/odk/examples/java/Inspector/SwingUnoMethodNode.java
@@ -31,11 +31,12 @@
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*************************************************************************/
-import com.sun.star.reflection.XIdlMethod;
-import com.sun.star.uno.TypeClass;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-import java.util.Vector;
+import java.util.ArrayList;
+
+import com.sun.star.reflection.XIdlMethod;
+import com.sun.star.uno.TypeClass;
@@ -120,7 +121,7 @@ public class SwingUnoMethodNode extends SwingUnoNode implements ActionListener,
openIdlDescription(m_xDialogProvider.getIDLPath());
}
- public Vector<Object> getMethodObjects(){
+ public ArrayList<Object> getMethodObjects(){
MethodParametersDialog oMethodParametersDialog = new MethodParametersDialog(this);
oMethodParametersDialog.addActionListener(this);
return oMethodParametersDialog.getMethodObjects();
diff --git a/odk/examples/java/Inspector/UnoMethodNode.java b/odk/examples/java/Inspector/UnoMethodNode.java
index c02261f5efe3..69bb58e4d2d9 100644
--- a/odk/examples/java/Inspector/UnoMethodNode.java
+++ b/odk/examples/java/Inspector/UnoMethodNode.java
@@ -37,7 +37,6 @@ import com.sun.star.reflection.ParamMode;
import com.sun.star.reflection.XIdlClass;
import com.sun.star.reflection.XIdlMethod;
import com.sun.star.uno.TypeClass;
-import java.util.Vector;
public class UnoMethodNode extends UnoNode{
XIdlMethod m_xIdlMethod = null;
@@ -93,7 +92,7 @@ public class UnoMethodNode extends UnoNode{
m_bisInvoked = true;
}
else{
- Vector<Object> oUnoMethodObjects = m_xUnoMethodNode.getMethodObjects();
+ java.util.List<Object> oUnoMethodObjects = m_xUnoMethodNode.getMethodObjects();
if (oUnoMethodObjects != null){
for (int i = 0; i < getXIdlMethod().getParameterInfos().length; i++){
this.m_oParamObjects[i] = oUnoMethodObjects.get(i);
diff --git a/odk/examples/java/Inspector/UnoNode.java b/odk/examples/java/Inspector/UnoNode.java
index dac2e82ed58d..76592251405f 100644
--- a/odk/examples/java/Inspector/UnoNode.java
+++ b/odk/examples/java/Inspector/UnoNode.java
@@ -32,6 +32,9 @@
*
*************************************************************************/
+import java.util.ArrayList;
+import java.util.List;
+
import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.FrameSearchFlag;
import com.sun.star.frame.XDesktop;
@@ -52,8 +55,6 @@ import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.util.URL;
import com.sun.star.util.XURLTransformer;
-import java.util.List;
-import java.util.Vector;
public class UnoNode{
@@ -270,7 +271,7 @@ public class UnoNode{
private static String[] removeMandatoryServiceNames(String[] _sServiceNames){
try{
List<String> aList = java.util.Arrays.asList(_sServiceNames);
- Vector<String> aVector = new Vector<String>(aList);
+ ArrayList<String> aVector = new ArrayList<String>(aList);
for (int n = 0; n < _sServiceNames.length; n++){
String[] sDelServiceNames = getMandatoryServiceNames(_sServiceNames[n]);
for (int m = 0; m < sDelServiceNames.length; m++){
diff --git a/odk/examples/java/Inspector/XUnoMethodNode.java b/odk/examples/java/Inspector/XUnoMethodNode.java
index eee0cb023a18..c0186f5e99b7 100644
--- a/odk/examples/java/Inspector/XUnoMethodNode.java
+++ b/odk/examples/java/Inspector/XUnoMethodNode.java
@@ -34,7 +34,6 @@
import com.sun.star.reflection.XIdlMethod;
import com.sun.star.uno.TypeClass;
-import java.util.Vector;
public interface XUnoMethodNode extends XUnoNode {
@@ -59,7 +58,7 @@ public interface XUnoMethodNode extends XUnoNode {
public boolean isPrimitive();
- public Vector<Object> getMethodObjects();
+ public java.util.List<Object> getMethodObjects();
public boolean isFoldable();
diff --git a/odk/examples/java/ToDo/ToDo.java b/odk/examples/java/ToDo/ToDo.java
index fa457156978a..71854936f895 100644
--- a/odk/examples/java/ToDo/ToDo.java
+++ b/odk/examples/java/ToDo/ToDo.java
@@ -32,37 +32,37 @@
*
*************************************************************************/
-import com.sun.star.lib.uno.helper.Factory;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XIndexAccess;
import com.sun.star.lang.XMultiComponentFactory;
-import com.sun.star.lang.XSingleComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lang.XSingleComponentFactory;
+import com.sun.star.lib.uno.helper.Factory;
import com.sun.star.lib.uno.helper.WeakBase;
-import com.sun.star.uno.UnoRuntime;
-import com.sun.star.uno.XComponentContext;
-// addintional interfaces used by the implementation
-import com.sun.star.sheet.XSpreadsheetDocument;
-import com.sun.star.sheet.XSpreadsheet;
import com.sun.star.sheet.XCellRangeMovement;
import com.sun.star.sheet.XFunctionAccess;
-import com.sun.star.container.XIndexAccess;
-import com.sun.star.table.XCellRange;
-import com.sun.star.table.XCell;
+import com.sun.star.sheet.XSpreadsheet;
+import com.sun.star.sheet.XSpreadsheetDocument;
import com.sun.star.table.CellAddress;
import com.sun.star.table.CellRangeAddress;
+import com.sun.star.table.XCell;
+import com.sun.star.table.XCellRange;
import com.sun.star.table.XColumnRowRange;
import com.sun.star.table.XTableRows;
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.text.XTextRange;
import com.sun.star.text.XSimpleText;
-import com.sun.star.text.XTextCursor;
import com.sun.star.text.XText;
+import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextField;
-
-import java.util.GregorianCalendar;
-import java.util.Calendar;
-import java.util.Vector;
-import java.util.Arrays;
+import com.sun.star.text.XTextRange;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+// addintional interfaces used by the implementation
/** This class capsulates the class, that implements the minimal component, a
* factory for creating the service (<CODE>__getServiceFactory</CODE>) and a
@@ -208,7 +208,7 @@ public class ToDo {
objectFunctionAccess );
// Creating vector for holidays
- Vector<Object> vectorHolidays = new Vector<Object>();
+ ArrayList<Object> vectorHolidays = new ArrayList<Object>();
// Get the Official Holidays
this.getOfficialHolidays( vectorHolidays, xcellrange,
@@ -706,7 +706,7 @@ public class ToDo {
* @param intYear Year to calculate the official holidays.
*/
public void getOfficialHolidays(
- Vector<Object> vectorHolidays,
+ ArrayList<Object> vectorHolidays,
XCellRange xcellrange,
XFunctionAccess xfunctionaccess,
int intYear ) {
@@ -729,7 +729,7 @@ public class ToDo {
dEasterSunday.doubleValue());
// New-year
- vectorHolidays.addElement( xfunctionaccess.callFunction(
+ vectorHolidays.add( xfunctionaccess.callFunction(
"DATE",
new Object[] {
new Integer( intYear ),
@@ -737,15 +737,15 @@ public class ToDo {
new Integer( 1 ) } ));
// Good Friday
- vectorHolidays.addElement(
+ vectorHolidays.add(
new Double( intEasterSunday - 2 ) );
// Easter monday
- vectorHolidays.addElement(
+ vectorHolidays.add(
new Double( intEasterSunday + 1 ) );
// Labour Day
- vectorHolidays.addElement( xfunctionaccess.callFunction(
+ vectorHolidays.add( xfunctionaccess.callFunction(
"DATE",
new Object[] {
new Integer( intYear ),
@@ -753,13 +753,13 @@ public class ToDo {
new Integer( 1 ) } ));
// Ascension Day
- vectorHolidays.addElement(new Double(intEasterSunday + 39 ));
+ vectorHolidays.add(new Double(intEasterSunday + 39 ));
// Pentecost monday
- vectorHolidays.addElement(new Double(intEasterSunday + 50 ));
+ vectorHolidays.add(new Double(intEasterSunday + 50 ));
// German Unification
- vectorHolidays.addElement( xfunctionaccess.callFunction(
+ vectorHolidays.add( xfunctionaccess.callFunction(
"DATE",
new Object[] {
new Integer( intYear ),
@@ -767,7 +767,7 @@ public class ToDo {
new Integer( 3 ) } ));
// Christmas Day First
- vectorHolidays.addElement( xfunctionaccess.callFunction(
+ vectorHolidays.add( xfunctionaccess.callFunction(
"DATE",
new Object[] {
new Integer( intYear ),
@@ -775,7 +775,7 @@ public class ToDo {
new Integer( 25 ) } ));
// Christmas Day Second
- vectorHolidays.addElement( xfunctionaccess.callFunction(
+ vectorHolidays.add( xfunctionaccess.callFunction(
"DATE",
new Object[] {
new Integer( intYear ),
@@ -841,7 +841,7 @@ public class ToDo {
* @param xcellrange Providing the cells.
* @param xfunctionaccess Provides the access to functions of the Calc.
*/
- public void getPrivateHolidays( Vector<Object> vectorHolidays,
+ public void getPrivateHolidays( ArrayList<Object> vectorHolidays,
XCellRange xcellrange,
XFunctionAccess xfunctionaccess ) {
try {
@@ -856,7 +856,7 @@ public class ToDo {
while ( dHolidayStart != 0 ) {
if ( dHolidayEnd == 0 ) {
- vectorHolidays.addElement(
+ vectorHolidays.add(
new Integer( (int) Math.round(
dHolidayStart ) ) );
}
@@ -865,7 +865,7 @@ public class ToDo {
dHolidayStart );
intHoliday <= (int) Math.round( dHolidayEnd );
intHoliday++ ) {
- vectorHolidays.addElement( new Double( intHoliday ) );
+ vectorHolidays.add( new Double( intHoliday ) );
}
}