Kaydet (Commit) 0f1dba83 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Java5 cleanup, cleanup Vector and ArrayList to use generics

Change-Id: I7c2a3346f5c089424377302e1029b6f6aa971d76
üst b89ae706
......@@ -52,7 +52,7 @@ public class EventHandler
mnTopWindowCount = 0;
maListenerProxy = new EventListenerProxy (this);
maConnectionTask = new ConnectionTask (maListenerProxy);
maObjectDisplays = new Vector ();
maObjectDisplays = new Vector<IAccessibleObjectDisplay> ();
}
public synchronized void addObjectDisplay (IAccessibleObjectDisplay aDisplay)
......@@ -148,7 +148,7 @@ public class EventHandler
for (int i=0; i<maObjectDisplays.size(); i++)
{
IAccessibleObjectDisplay aDisplay =
(IAccessibleObjectDisplay)maObjectDisplays.get(i);
maObjectDisplays.get(i);
if (aDisplay != null)
aDisplay.setAccessibleObject (xContext);
}
......@@ -179,7 +179,7 @@ public class EventHandler
for (int i=0; i<maObjectDisplays.size(); i++)
{
IAccessibleObjectDisplay aDisplay =
(IAccessibleObjectDisplay)maObjectDisplays.get(i);
maObjectDisplays.get(i);
if (aDisplay != null)
aDisplay.setAccessibleObject (null);
}
......@@ -285,7 +285,7 @@ public class EventHandler
for (int i=0; i<maObjectDisplays.size(); i++)
{
IAccessibleObjectDisplay aDisplay =
(IAccessibleObjectDisplay)maObjectDisplays.get(i);
maObjectDisplays.get(i);
if (aDisplay != null)
aDisplay.updateAccessibleObject (mxFocusedObject);
}
......@@ -437,7 +437,7 @@ public class EventHandler
ways such as showing a graphical representation or some textual
descriptions.
*/
private Vector maObjectDisplays;
private Vector<IAccessibleObjectDisplay> maObjectDisplays;
/** The timer task that attempts in regular intervals to connect to a
running Office application.
......
......@@ -66,7 +66,7 @@ class EventListenerProxy
mbAsynchron = true;
if (mbAsynchron)
{
maEventQueue = new LinkedList();
maEventQueue = new LinkedList<Runnable>();
new Thread (this, "EventListenerProxy").start();
}
}
......@@ -105,7 +105,7 @@ class EventListenerProxy
synchronized (maEventQueue)
{
if (maEventQueue.size() > 0)
aEvent = (Runnable)maEventQueue.removeFirst();
aEvent = maEventQueue.removeFirst();
else
aEvent = null;
}
......@@ -174,7 +174,7 @@ class EventListenerProxy
public void run()
{
maListener.windowOpened (
(XAccessible) UnoRuntime.queryInterface(
UnoRuntime.queryInterface(
XAccessible.class,
aEvent.Source));
}
......@@ -192,7 +192,7 @@ class EventListenerProxy
public void run()
{
maListener.windowClosed (
(XAccessible) UnoRuntime.queryInterface(
UnoRuntime.queryInterface(
XAccessible.class,
aEvent.Source));
}
......@@ -219,7 +219,7 @@ class EventListenerProxy
The queue object will also serve as lock for the consumer/producer type
syncronization.
*/
private LinkedList maEventQueue;
private LinkedList<Runnable> maEventQueue;
/** This is the actual listener that the events will eventually forwarded to.
*/
......
......@@ -154,8 +154,8 @@ class TextualDisplay
// Try to cast the given accessible context to the
// XAccessibleComponent interface.
XAccessibleComponent xComponent =
(XAccessibleComponent)UnoRuntime.queryInterface(
XAccessibleComponent.class, xContext);
UnoRuntime.queryInterface(
XAccessibleComponent.class, xContext);
if (xComponent != null)
{
Point aLocation = xComponent.getLocationOnScreen();
......@@ -179,7 +179,7 @@ class TextualDisplay
private String showParents (XAccessibleContext xContext)
{
// Create the path from the given object to its tree's root.
Vector aPathToRoot = new Vector();
Vector<XAccessibleContext> aPathToRoot = new Vector<XAccessibleContext>();
while (xContext != null)
{
aPathToRoot.add (xContext);
......@@ -203,7 +203,7 @@ class TextualDisplay
String sIndentation = new String ();
for (int i=aPathToRoot.size()-1; i>=0; i--)
{
XAccessibleContext xParentContext = (XAccessibleContext)aPathToRoot.get(i);
XAccessibleContext xParentContext = aPathToRoot.get(i);
String sParentName = xParentContext.getAccessibleName();
if (sParentName.length() == 0)
sParentName = "<unnamed> / Role "
......
......@@ -55,7 +55,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
private XPropertySet m_form;
private XFormOperations m_formOperations;
private Vector m_aButtons;
private Vector<XPropertySet> m_aButtons;
/* ------------------------------------------------------------------ */
/** ctor
......@@ -65,7 +65,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
m_componentContext = xCtx;
m_aDocument = aDocument;
m_form = _form;
m_aButtons = new Vector();
m_aButtons = new Vector<XPropertySet>();
}
/* ------------------------------------------------------------------ */
......@@ -89,7 +89,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
{
for ( int i=0; i < m_aButtons.size(); ++i )
{
XPropertySet button = (XPropertySet)m_aButtons.elementAt( i );
XPropertySet button = m_aButtons.elementAt( i );
if ( _formFeature == getAssociatedFormFeature( button ) )
return button;
}
......@@ -119,7 +119,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
DocumentViewHelper aCurrentView = m_aDocument.getCurrentView();
// add a listener so we get noticed if the user presses the button
XButton xButtonControl = (XButton)UnoRuntime.queryInterface( XButton.class,
XButton xButtonControl = UnoRuntime.queryInterface( XButton.class,
aCurrentView.getFormControl( _buttonModel ) );
xButtonControl.addActionListener( this );
......@@ -215,7 +215,7 @@ public class ButtonOperator implements XActionListener, XFeatureInvalidation
{
for ( int i=0; i < m_aButtons.size(); ++i )
{
XPropertySet buttonModel = (XPropertySet)m_aButtons.elementAt( i );
XPropertySet buttonModel = m_aButtons.elementAt( i );
updateButtonState( buttonModel, getAssociatedFormFeature( buttonModel ) );
}
}
......
......@@ -45,15 +45,15 @@ public class TableCellTextBinding
private String m_newCellText;
private String m_lastKnownCellText;
private boolean m_haveNewCellText;
private java.util.List m_listeners;
private java.util.List<XModifyListener> m_listeners;
/** Creates a new instance of TableCellTextBinding */
public TableCellTextBinding( XCell cell )
{
m_cellText = (XTextRange)UnoRuntime.queryInterface( XTextRange.class, cell );
m_cellText = UnoRuntime.queryInterface( XTextRange.class, cell );
m_newCellText = new String();
m_listeners = new java.util.LinkedList();
m_listeners = new java.util.LinkedList<XModifyListener>();
start();
}
......@@ -161,10 +161,10 @@ public class TableCellTextBinding
{
com.sun.star.lang.EventObject eventSource = new com.sun.star.lang.EventObject( this );
java.util.Iterator loop = m_listeners.iterator();
java.util.Iterator<XModifyListener> loop = m_listeners.iterator();
while ( loop.hasNext() )
{
((XModifyListener)loop.next()).modified( eventSource );
loop.next().modified( eventSource );
}
}
}
......
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