summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/Forms
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-09-07 10:23:54 +0200
committerMichael Stahl <mstahl@redhat.com>2012-09-10 23:43:38 +0200
commit0f1dba83596b5e8e19203892cb1334b6bbe8f147 (patch)
tree325c31fa8dae055097e2352b8de07e78643d26e0 /odk/examples/DevelopersGuide/Forms
parentb89ae706c2b959dd41e821abc2efe1d4ba79de81 (diff)
Java5 cleanup, cleanup Vector and ArrayList to use generics
Change-Id: I7c2a3346f5c089424377302e1029b6f6aa971d76
Diffstat (limited to 'odk/examples/DevelopersGuide/Forms')
-rw-r--r--odk/examples/DevelopersGuide/Forms/ButtonOperator.java10
-rw-r--r--odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java10
2 files changed, 10 insertions, 10 deletions
diff --git a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
index 3b792e28ea22..f88d5b662115 100644
--- a/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
+++ b/odk/examples/DevelopersGuide/Forms/ButtonOperator.java
@@ -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 ) );
}
}
diff --git a/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java b/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
index bacb72240257..4b9fc6b84cdf 100644
--- a/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
+++ b/odk/examples/DevelopersGuide/Forms/TableCellTextBinding.java
@@ -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 );
}
}
}