summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/Forms
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-23 09:01:41 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-23 10:29:36 +0000
commit68b9fb0aaeff4aef41dfd6989491b522578ca079 (patch)
tree91ce6c4395e11b17c7ca652a66bd8ce905afcd7b /odk/examples/DevelopersGuide/Forms
parent4f6adb0585037013241bd59e5c869a261c1f20c1 (diff)
Java cleanup - remove unnecessary casts in the ODK code
Change-Id: I1ab8ad5182444fc3eebd2349135a0240ebbe0fd4 Reviewed-on: https://gerrit.libreoffice.org/3566 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'odk/examples/DevelopersGuide/Forms')
-rw-r--r--odk/examples/DevelopersGuide/Forms/ControlLock.java4
-rw-r--r--odk/examples/DevelopersGuide/Forms/DataAwareness.java14
-rw-r--r--odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java5
-rw-r--r--odk/examples/DevelopersGuide/Forms/DocumentHelper.java38
-rw-r--r--odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java14
-rw-r--r--odk/examples/DevelopersGuide/Forms/FLTools.java14
-rw-r--r--odk/examples/DevelopersGuide/Forms/FormLayer.java12
-rw-r--r--odk/examples/DevelopersGuide/Forms/GridFieldValidator.java4
-rw-r--r--odk/examples/DevelopersGuide/Forms/HsqlDatabase.java18
-rw-r--r--odk/examples/DevelopersGuide/Forms/KeyGenerator.java22
-rw-r--r--odk/examples/DevelopersGuide/Forms/RowSet.java10
-rw-r--r--odk/examples/DevelopersGuide/Forms/SalesFilter.java2
-rw-r--r--odk/examples/DevelopersGuide/Forms/SingleControlValidation.java6
-rw-r--r--odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java10
-rw-r--r--odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java6
-rw-r--r--odk/examples/DevelopersGuide/Forms/SpreadsheetView.java8
-rw-r--r--odk/examples/DevelopersGuide/Forms/UNO.java16
-rw-r--r--odk/examples/DevelopersGuide/Forms/ValueBinding.java6
18 files changed, 104 insertions, 105 deletions
diff --git a/odk/examples/DevelopersGuide/Forms/ControlLock.java b/odk/examples/DevelopersGuide/Forms/ControlLock.java
index a24a28203119..efce0c990462 100644
--- a/odk/examples/DevelopersGuide/Forms/ControlLock.java
+++ b/odk/examples/DevelopersGuide/Forms/ControlLock.java
@@ -65,7 +65,7 @@ class LockControlModels extends ComponentTreeTraversal
if ( !super.shouldStepInto( xContainer ) )
return false; // don't try to be more clever than our base class
- XForm xForm = (XForm)UnoRuntime.queryInterface( XForm.class, xContainer );
+ XForm xForm = UnoRuntime.queryInterface( XForm.class, xContainer );
if ( ( null != xForm ) && ( m_nLevel > 1 ) )
// don't step into sub forms - we only handle the form we were originally
// applied to
@@ -169,7 +169,7 @@ class ControlLock implements XRowSetListener
m_bLockingEnabled = bLock;
// add or remove ourself as listener to get notified of cursor moves
- XRowSet xRowSet = (XRowSet)UnoRuntime.queryInterface(
+ XRowSet xRowSet = UnoRuntime.queryInterface(
XRowSet.class, m_xForm );
if ( m_bLockingEnabled )
{
diff --git a/odk/examples/DevelopersGuide/Forms/DataAwareness.java b/odk/examples/DevelopersGuide/Forms/DataAwareness.java
index a5aa106fb9d2..70323e25a373 100644
--- a/odk/examples/DevelopersGuide/Forms/DataAwareness.java
+++ b/odk/examples/DevelopersGuide/Forms/DataAwareness.java
@@ -76,7 +76,7 @@ class PrintComponentTree extends ComponentTreeTraversal
public void handle( Object aFormComponent ) throws com.sun.star.uno.Exception
{
// the name of the child
- XNamed xName = (XNamed)UnoRuntime.queryInterface( XNamed.class, aFormComponent );
+ XNamed xName = UnoRuntime.queryInterface( XNamed.class, aFormComponent );
// if it's a form control model, check it's type
XPropertySet xProps = UNO.queryPropertySet( aFormComponent );
@@ -183,7 +183,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
{
String sObjectName;
- XNamed xNameAcc = (XNamed)UnoRuntime.queryInterface( XNamed.class, xContainer );
+ XNamed xNameAcc = UnoRuntime.queryInterface( XNamed.class, xContainer );
if ( null == xNameAcc )
sObjectName = new String( "<unnamed>" );
else
@@ -244,12 +244,12 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
// get the columns of our master form
- XColumnsSupplier xSuppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
+ XColumnsSupplier xSuppCols = UnoRuntime.queryInterface(
XColumnsSupplier.class, xFormProps );
XNameAccess xCols = xSuppCols.getColumns();
// and update the date column with a NULL value
- XColumnUpdate xDateColumn = (XColumnUpdate)UnoRuntime.queryInterface(
+ XColumnUpdate xDateColumn = UnoRuntime.queryInterface(
XColumnUpdate.class, xCols.getByName( "SALEDATE" ) );
xDateColumn.updateNull();
@@ -644,11 +644,11 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
// the container to insert columns into
XIndexContainer xColumnContainer = UNO.queryIndexContainer( aGridModel );
// the factory for creating column models
- XGridColumnFactory xColumnFactory = (XGridColumnFactory)UnoRuntime.queryInterface(
+ XGridColumnFactory xColumnFactory = UnoRuntime.queryInterface(
XGridColumnFactory.class, aGridModel );
// (let) create the new col
- XInterface xNewCol = (XInterface)xColumnFactory.createColumn( sColumnService );
+ XInterface xNewCol = xColumnFactory.createColumn( sColumnService );
XPropertySet xColProps = UNO.queryPropertySet( xNewCol );
// some props
@@ -913,7 +913,7 @@ public class DataAwareness extends DocumentBasedExample implements XPropertyChan
m_aSalesNameValidator.enableColumnWatch( false );
// remove our own reset listener from the form
- XNameAccess xMasterAsNames = (XNameAccess)UnoRuntime.queryInterface(
+ XNameAccess xMasterAsNames = UnoRuntime.queryInterface(
XNameAccess.class, m_xMasterForm );
XReset xFormReset = UNO.queryReset( xMasterAsNames.getByName( "Sales" ) );
xFormReset.removeResetListener( this );
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java b/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
index 2b10138471e3..456e4125c9d2 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentBasedExample.java
@@ -159,9 +159,8 @@ public abstract class DocumentBasedExample implements com.sun.star.lang.XEventLi
// close our document
if ( m_document != null )
{
- XCloseable closeDoc = (XCloseable)
- UnoRuntime.queryInterface( XCloseable.class,
- m_document.getDocument() );
+ XCloseable closeDoc = UnoRuntime.queryInterface( XCloseable.class,
+ m_document.getDocument() );
if (closeDoc != null)
closeDoc.close( true );
else
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentHelper.java b/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
index 9132a9c27f0a..b10f52d27440 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentHelper.java
@@ -58,7 +58,7 @@ public class DocumentHelper
public DocumentHelper( XComponentContext xContext, XComponent document )
{
m_remoteContext = xContext;
- m_orb = (XMultiServiceFactory)UnoRuntime.queryInterface(
+ m_orb = UnoRuntime.queryInterface(
XMultiServiceFactory.class, m_remoteContext.getServiceManager());
m_documentComponent = document;
}
@@ -66,7 +66,7 @@ public class DocumentHelper
/* ------------------------------------------------------------------ */
protected static XComponent implCreateBlankDocument( XComponentContext xCtx, String factoryURL ) throws com.sun.star.uno.Exception
{
- XComponentLoader aLoader = (XComponentLoader)UnoRuntime.queryInterface(
+ XComponentLoader aLoader = UnoRuntime.queryInterface(
XComponentLoader.class,
xCtx.getServiceManager().createInstanceWithContext(
"com.sun.star.frame.Desktop", xCtx ));
@@ -100,7 +100,7 @@ public class DocumentHelper
public DocumentViewHelper getCurrentView( )
{
// get the model interface for the document
- XModel xDocModel = (XModel)UnoRuntime.queryInterface(XModel.class, m_documentComponent );
+ XModel xDocModel = UnoRuntime.queryInterface(XModel.class, m_documentComponent );
// get the current controller for the document - as a controller is tied to a view,
// this gives us the currently active view for the document.
XController xController = xDocModel.getCurrentController();
@@ -137,7 +137,7 @@ public class DocumentHelper
}
// outta here
- return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
+ return UnoRuntime.queryInterface( XIndexContainer.class, xNewForm );
}
/* ------------------------------------------------------------------ */
@@ -152,7 +152,7 @@ public class DocumentHelper
public XIndexContainer createSubForm( Object aParentContainer, String sInitialName )
throws com.sun.star.uno.Exception
{
- XIndexContainer xParentContainer = (XIndexContainer)UnoRuntime.queryInterface(
+ XIndexContainer xParentContainer = UnoRuntime.queryInterface(
XIndexContainer.class, aParentContainer );
return createSubForm( xParentContainer, sInitialName );
}
@@ -169,8 +169,8 @@ public class DocumentHelper
public XIndexContainer createSiblingForm( Object aForm, String sInitialName ) throws com.sun.star.uno.Exception
{
// get the parent
- XChild xAsChild = (XChild)UnoRuntime.queryInterface( XChild.class, aForm );
- XIndexContainer xContainer = (XIndexContainer)UnoRuntime.queryInterface(
+ XChild xAsChild = UnoRuntime.queryInterface( XChild.class, aForm );
+ XIndexContainer xContainer = UnoRuntime.queryInterface(
XIndexContainer.class, xAsChild.getParent() );;
// append a new form to this parent container
return createSubForm( xContainer, sInitialName );
@@ -181,13 +181,13 @@ public class DocumentHelper
*/
static public DocumentHelper getDocumentForComponent( Object aFormComponent, XComponentContext xCtx )
{
- XChild xChild = (XChild)UnoRuntime.queryInterface( XChild.class, aFormComponent );
+ XChild xChild = UnoRuntime.queryInterface( XChild.class, aFormComponent );
XModel xModel = null;
while ( ( null != xChild ) && ( null == xModel ) )
{
XInterface xParent = (XInterface)xChild.getParent();
- xModel = (XModel)UnoRuntime.queryInterface( XModel.class, xParent );
- xChild = (XChild)UnoRuntime.queryInterface( XChild.class, xParent );
+ xModel = UnoRuntime.queryInterface( XModel.class, xParent );
+ xChild = UnoRuntime.queryInterface( XChild.class, xParent );
}
return new DocumentHelper( xCtx, xModel );
@@ -212,7 +212,7 @@ public class DocumentHelper
*/
public DocumentType classify( )
{
- XServiceInfo xSI = (XServiceInfo)UnoRuntime.queryInterface(
+ XServiceInfo xSI = UnoRuntime.queryInterface(
XServiceInfo.class, m_documentComponent );
if ( xSI.supportsService( "com.sun.star.text.TextDocument" ) )
@@ -234,11 +234,11 @@ public class DocumentHelper
*/
protected XDrawPage getDrawPage( int index ) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException
{
- XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+ XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
XDrawPagesSupplier.class, getDocument() );
XDrawPages xPages = xSuppPages.getDrawPages();
- return (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
+ return UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( index ) );
}
/* ------------------------------------------------------------------ */
@@ -249,18 +249,18 @@ public class DocumentHelper
XDrawPage xReturn;
// in case of a Writer document, this is rather easy: simply ask the XDrawPageSupplier
- XDrawPageSupplier xSuppPage = (XDrawPageSupplier)UnoRuntime.queryInterface(
+ XDrawPageSupplier xSuppPage = UnoRuntime.queryInterface(
XDrawPageSupplier.class, getDocument() );
if ( null != xSuppPage )
xReturn = xSuppPage.getDrawPage();
else
{ // the model itself is no draw page supplier - okay, it may be a Writer or Calc document
// (or any other multi-page document)
- XDrawPagesSupplier xSuppPages = (XDrawPagesSupplier)UnoRuntime.queryInterface(
+ XDrawPagesSupplier xSuppPages = UnoRuntime.queryInterface(
XDrawPagesSupplier.class, getDocument() );
XDrawPages xPages = xSuppPages.getDrawPages();
- xReturn = (XDrawPage)UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
+ xReturn = UnoRuntime.queryInterface( XDrawPage.class, xPages.getByIndex( 0 ) );
// Note that this is no really error-proof code: If the document model does not support the
// XDrawPagesSupplier interface, or if the pages collection returned is empty, this will break.
@@ -274,7 +274,7 @@ public class DocumentHelper
*/
protected XNameContainer getFormComponentTreeRoot( ) throws com.sun.star.uno.Exception
{
- XFormsSupplier xSuppForms = (XFormsSupplier)UnoRuntime.queryInterface(
+ XFormsSupplier xSuppForms = UnoRuntime.queryInterface(
XFormsSupplier.class, getMainDrawPage( ) );
XNameContainer xFormsCollection = null;
@@ -290,7 +290,7 @@ public class DocumentHelper
*/
public XInterface createInstance( String serviceSpecifier ) throws com.sun.star.uno.Exception
{
- XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+ XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
m_documentComponent );
return (XInterface)xORB.createInstance( serviceSpecifier );
}
@@ -300,7 +300,7 @@ public class DocumentHelper
*/
public XInterface createInstanceWithArguments( String serviceSpecifier, Object[] arguments ) throws com.sun.star.uno.Exception
{
- XMultiServiceFactory xORB = (XMultiServiceFactory)UnoRuntime.queryInterface( XMultiServiceFactory.class,
+ XMultiServiceFactory xORB = UnoRuntime.queryInterface( XMultiServiceFactory.class,
m_documentComponent );
return (XInterface) xORB.createInstanceWithArguments( serviceSpecifier, arguments );
}
diff --git a/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java b/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
index 7b160831b83c..25308ea29cf1 100644
--- a/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
+++ b/odk/examples/DevelopersGuide/Forms/DocumentViewHelper.java
@@ -90,12 +90,12 @@ class DocumentViewHelper
// go get the current view
XController xController = (XController)get( XController.class );
// go get the dispatch provider of it's frame
- XDispatchProvider xProvider = (XDispatchProvider)UnoRuntime.queryInterface(
+ XDispatchProvider xProvider = UnoRuntime.queryInterface(
XDispatchProvider.class, xController.getFrame() );
if ( null != xProvider )
{
// need an URLTransformer
- XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+ XURLTransformer xTransformer = UnoRuntime.queryInterface(
XURLTransformer.class, m_orb.createInstance( "com.sun.star.util.URLTransformer" ) );
xTransformer.parseStrict( aURL );
@@ -120,7 +120,7 @@ class DocumentViewHelper
public XFormController getFormController( Object _form )
{
XFormLayerAccess formLayer = (XFormLayerAccess)get( XFormLayerAccess.class );
- return formLayer.getFormController( (XForm)UnoRuntime.queryInterface( XForm.class, _form ) );
+ return formLayer.getFormController( UnoRuntime.queryInterface( XForm.class, _form ) );
}
/* ------------------------------------------------------------------ */
@@ -141,14 +141,14 @@ class DocumentViewHelper
/* ------------------------------------------------------------------ */
public XControl getFormControl( Object aModel ) throws com.sun.star.uno.Exception
{
- XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+ XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
return getFormControl( xModel );
}
/* ------------------------------------------------------------------ */
public Object getFormControl( Object aModel, Class aInterfaceClass ) throws com.sun.star.uno.Exception
{
- XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aModel );
+ XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class, aModel );
return UnoRuntime.queryInterface( aInterfaceClass, getFormControl( xModel ) );
}
@@ -179,7 +179,7 @@ class DocumentViewHelper
XControl xControl = getFormControl( xModel );
// the focus can be set to an XWindow only
- XWindow xControlWindow = (XWindow)UnoRuntime.queryInterface( XWindow.class,
+ XWindow xControlWindow = UnoRuntime.queryInterface( XWindow.class,
xControl );
// grab the focus
@@ -202,7 +202,7 @@ class DocumentViewHelper
XPropertySet xControlProps = UNO.queryPropertySet( xForm.getByIndex( i ) );
if ( FormComponentType.FIXEDTEXT != ((Short)xControlProps.getPropertyValue( "ClassId" )).shortValue() )
{
- XControlModel xControlModel = (XControlModel)UnoRuntime.queryInterface(
+ XControlModel xControlModel = UnoRuntime.queryInterface(
XControlModel.class, xControlProps );
// set the focus to this control
grabControlFocus( xControlModel );
diff --git a/odk/examples/DevelopersGuide/Forms/FLTools.java b/odk/examples/DevelopersGuide/Forms/FLTools.java
index 3f87e77e1bd6..143816625e44 100644
--- a/odk/examples/DevelopersGuide/Forms/FLTools.java
+++ b/odk/examples/DevelopersGuide/Forms/FLTools.java
@@ -64,7 +64,7 @@ public class FLTools
URL[] aURL = new URL[] { new URL() };
aURL[0].Complete = sURL;
// need an URLTransformer
- XURLTransformer xTransformer = (XURLTransformer)UnoRuntime.queryInterface(
+ XURLTransformer xTransformer = UnoRuntime.queryInterface(
XURLTransformer.class,
xCtx.getServiceManager().createInstanceWithContext(
"com.sun.star.util.URLTransformer", xCtx ) );
@@ -78,7 +78,7 @@ public class FLTools
*/
public static String getName( Object aFormComponent ) throws com.sun.star.uno.Exception
{
- XNamed xNamed = (XNamed)UnoRuntime.queryInterface( XNamed.class,
+ XNamed xNamed = UnoRuntime.queryInterface( XNamed.class,
aFormComponent );
String sName = "";
if ( null != xNamed )
@@ -130,7 +130,7 @@ public class FLTools
int nIndex = -1;
// norm the element
- XInterface xElement = (XInterface)UnoRuntime.queryInterface(
+ XInterface xElement = UnoRuntime.queryInterface(
XInterface.class, aElement );
// get the container
@@ -142,7 +142,7 @@ public class FLTools
for ( int i = 0; i < nCount; ++i )
{
// compare with the element
- XInterface xCurrent = (XInterface)UnoRuntime.queryInterface(
+ XInterface xCurrent = UnoRuntime.queryInterface(
XInterface.class, xIndexCont.getByIndex( 0 ) );
if ( xCurrent.equals( xElement ) )
{ // found
@@ -161,7 +161,7 @@ public class FLTools
*/
static Object getParent( Object aComponent, Class aInterfaceClass )
{
- XChild xAsChild = (XChild)UnoRuntime.queryInterface( XChild.class, aComponent );
+ XChild xAsChild = UnoRuntime.queryInterface( XChild.class, aComponent );
return UnoRuntime.queryInterface( aInterfaceClass, xAsChild.getParent() );
}
@@ -179,7 +179,7 @@ public class FLTools
*/
static public void disposeComponent( Object xComp ) throws java.lang.RuntimeException
{
- XComponent xComponent = (XComponent)UnoRuntime.queryInterface( XComponent.class,
+ XComponent xComponent = UnoRuntime.queryInterface( XComponent.class,
xComp );
if ( null != xComponent )
xComponent.dispose();
@@ -190,7 +190,7 @@ public class FLTools
*/
static public Object getModel( Object aControl, Class aInterfaceClass )
{
- XControl xControl = (XControl)UnoRuntime.queryInterface(
+ XControl xControl = UnoRuntime.queryInterface(
XControl.class, aControl );
XControlModel xModel = null;
if ( null != xControl )
diff --git a/odk/examples/DevelopersGuide/Forms/FormLayer.java b/odk/examples/DevelopersGuide/Forms/FormLayer.java
index 1436591292a3..e7eb0699347b 100644
--- a/odk/examples/DevelopersGuide/Forms/FormLayer.java
+++ b/odk/examples/DevelopersGuide/Forms/FormLayer.java
@@ -87,9 +87,9 @@ public class FormLayer
int nYPos, int nWidth, int nHeight, XIndexContainer xParentForm ) throws java.lang.Exception
{
// let the document create a shape
- XMultiServiceFactory xDocAsFactory = (XMultiServiceFactory)UnoRuntime.queryInterface(
+ XMultiServiceFactory xDocAsFactory = UnoRuntime.queryInterface(
XMultiServiceFactory.class, m_document.getDocument() );
- XControlShape xShape = (XControlShape)UnoRuntime.queryInterface( XControlShape.class,
+ XControlShape xShape = UnoRuntime.queryInterface( XControlShape.class,
xDocAsFactory.createInstance( "com.sun.star.drawing.ControlShape" ) );
// position and size of the shape
@@ -103,7 +103,7 @@ public class FormLayer
// create the form component (the model of a form control)
String sQualifiedComponentName = "com.sun.star.form.component." + sFormComponentService;
- XControlModel xModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class,
+ XControlModel xModel = UnoRuntime.queryInterface( XControlModel.class,
m_document.getOrb().createInstance( sQualifiedComponentName ) );
// insert the model into the form component hierarchy, if the caller gave us a location
@@ -118,7 +118,7 @@ public class FormLayer
// add the shape to the shapes collection of the document
XDrawPage pageWhereToInsert = ( m_insertPage != -1 ) ? m_document.getDrawPage( m_insertPage ) : m_document.getMainDrawPage();
- XShapes xDocShapes = (XShapes)UnoRuntime.queryInterface( XShapes.class, pageWhereToInsert );
+ XShapes xDocShapes = UnoRuntime.queryInterface( XShapes.class, pageWhereToInsert );
xDocShapes.add( xShape );
// some initializations which are the same for all controls
@@ -240,7 +240,7 @@ public class FormLayer
*/
public XPropertySet getRadioModelByRefValue( XPropertySet form, String name, String refValue ) throws com.sun.star.uno.Exception, java.lang.Exception
{
- XIndexAccess indexAccess = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ XIndexAccess indexAccess = UnoRuntime.queryInterface( XIndexAccess.class,
form );
for ( int i=0; i<indexAccess.getCount(); ++i )
@@ -265,7 +265,7 @@ public class FormLayer
*/
public XPropertySet getRadioModelByTag( XPropertySet form, String name, String tag ) throws com.sun.star.uno.Exception, java.lang.Exception
{
- XIndexAccess indexAccess = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ XIndexAccess indexAccess = UnoRuntime.queryInterface( XIndexAccess.class,
form );
for ( int i=0; i<indexAccess.getCount(); ++i )
diff --git a/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java b/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
index e32cccc147c2..073289f06bca 100644
--- a/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
+++ b/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java
@@ -72,7 +72,7 @@ class GridFieldValidator implements XUpdateListener
if ( bEnable == m_bWatching )
return;
- XUpdateBroadcaster xUpdate = (XUpdateBroadcaster)UnoRuntime.queryInterface(
+ XUpdateBroadcaster xUpdate = UnoRuntime.queryInterface(
XUpdateBroadcaster.class, m_xWatchedColumn );
if ( bEnable )
@@ -105,7 +105,7 @@ class GridFieldValidator implements XUpdateListener
);
// instantiate an interaction handler who can handle SQLExceptions
- XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface(
+ XInteractionHandler xHandler = UnoRuntime.queryInterface(
XInteractionHandler.class,
m_xCtx.getServiceManager().createInstanceWithContext(
"com.sun.star.task.InteractionHandler", m_xCtx ) );
diff --git a/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java b/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
index 01a364c8f3f9..d56501ad9f19 100644
--- a/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
+++ b/odk/examples/DevelopersGuide/Forms/HsqlDatabase.java
@@ -65,9 +65,9 @@ public class HsqlDatabase
{
m_databaseDocumentFile = _docURL;
- XNameAccess dbContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
+ XNameAccess dbContext = UnoRuntime.queryInterface( XNameAccess.class,
m_context.getServiceManager().createInstanceWithContext( "com.sun.star.sdb.DatabaseContext", m_context ) );
- XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( XDocumentDataSource.class,
+ XDocumentDataSource dataSource = UnoRuntime.queryInterface( XDocumentDataSource.class,
dbContext.getByName( _docURL ) );
m_databaseDocument = dataSource.getDatabaseDocument();
@@ -81,14 +81,14 @@ public class HsqlDatabase
documentFile.deleteOnExit();
m_databaseDocumentFile = URLHelper.getFileURLFromSystemPath( documentFile );
- m_databaseDocument = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(
+ m_databaseDocument = UnoRuntime.queryInterface(
XOfficeDatabaseDocument.class, m_context.getServiceManager().createInstanceWithContext(
"com.sun.star.sdb.OfficeDatabaseDocument", m_context ) );
- XPropertySet dsProperties = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, m_databaseDocument.getDataSource() );
+ XPropertySet dsProperties = UnoRuntime.queryInterface( XPropertySet.class, m_databaseDocument.getDataSource() );
dsProperties.setPropertyValue("URL", "sdbc:embedded:hsqldb");
- XStorable storable = (XStorable)UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
+ XStorable storable = UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
storable.storeAsURL( m_databaseDocumentFile, new PropertyValue[]{} );
}
@@ -120,7 +120,7 @@ public class HsqlDatabase
{
if ( m_databaseDocument != null )
{
- XStorable storeDoc = (XStorable)UnoRuntime.queryInterface( XStorable.class,
+ XStorable storeDoc = UnoRuntime.queryInterface( XStorable.class,
m_databaseDocument );
storeDoc.store();
}
@@ -134,7 +134,7 @@ public class HsqlDatabase
public void close()
{
// close connection
- XCloseable closeConn = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,
+ XCloseable closeConn = UnoRuntime.queryInterface( XCloseable.class,
m_connection );
if ( closeConn != null )
{
@@ -149,7 +149,7 @@ public class HsqlDatabase
m_connection = null;
// close document
- com.sun.star.util.XCloseable closeDoc = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(
+ com.sun.star.util.XCloseable closeDoc = UnoRuntime.queryInterface(
com.sun.star.util.XCloseable.class, m_databaseDocument );
if ( closeDoc != null )
{
@@ -202,7 +202,7 @@ public class HsqlDatabase
*/
XModel getModel()
{
- return (XModel)UnoRuntime.queryInterface( XModel.class, m_databaseDocument );
+ return UnoRuntime.queryInterface( XModel.class, m_databaseDocument );
}
/** returns the URL of the ODB document represented by this instance
diff --git a/odk/examples/DevelopersGuide/Forms/KeyGenerator.java b/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
index 85a56aca3eeb..d3e74669bcb0 100644
--- a/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
+++ b/odk/examples/DevelopersGuide/Forms/KeyGenerator.java
@@ -64,19 +64,19 @@ class UniqueColumnValue
if ( CommandType.COMMAND == aCommandType.intValue() )
{
// get the connection from the form
- XConnection xFormConn = (XConnection)UnoRuntime.queryInterface( XConnection.class,
+ XConnection xFormConn = UnoRuntime.queryInterface( XConnection.class,
xForm.getPropertyValue( "ActiveConnection" ) );
// and let it create a composer for us
XSQLQueryComposerFactory xComposerFac =
- (XSQLQueryComposerFactory)UnoRuntime.queryInterface(
- XSQLQueryComposerFactory.class, xFormConn );
+ UnoRuntime.queryInterface(
+ XSQLQueryComposerFactory.class, xFormConn );
XSQLQueryComposer xComposer = xComposerFac.createQueryComposer( );
// let this composer analyze the command
xComposer.setQuery( sCommand );
// and ask it for the table(s)
- XTablesSupplier xSuppTables = (XTablesSupplier)UnoRuntime.queryInterface(
+ XTablesSupplier xSuppTables = UnoRuntime.queryInterface(
XTablesSupplier.class, xComposer );
XNameAccess xTables = xSuppTables.getTables();
@@ -126,7 +126,7 @@ class UniqueColumnValue
protected int generatePrimaryKey( XPropertySet xForm, String sFieldName ) throws com.sun.star.uno.Exception
{
// get the current connection of the form
- XConnection xConn = (XConnection)UnoRuntime.queryInterface(
+ XConnection xConn = UnoRuntime.queryInterface(
XConnection.class, xForm.getPropertyValue( "ActiveConnection" ) );
// let it create a new statement
XStatement xStatement = xConn.createStatement();
@@ -141,7 +141,7 @@ class UniqueColumnValue
xResults.next( );
// get the value
- XRow xRow = (XRow)UnoRuntime.queryInterface( XRow.class, xResults );
+ XRow xRow = UnoRuntime.queryInterface( XRow.class, xResults );
int nFreeValue = xRow.getInt( 1 );
// dispose the temporary objects
@@ -165,10 +165,10 @@ class UniqueColumnValue
if ( ResultSetConcurrency.READ_ONLY != aConcurrency.intValue() )
{
// get the column object
- XColumnsSupplier xSuppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
+ XColumnsSupplier xSuppCols = UnoRuntime.queryInterface(
XColumnsSupplier.class, xForm );
XNameAccess xCols = xSuppCols.getColumns();
- XColumnUpdate xCol = (XColumnUpdate)UnoRuntime.queryInterface(
+ XColumnUpdate xCol = UnoRuntime.queryInterface(
XColumnUpdate.class, xCols.getByName( sFieldName ) );
xCol.updateInt( generatePrimaryKey( xForm, sFieldName ) );
@@ -204,7 +204,7 @@ class KeyGeneratorForReset extends UniqueColumnValue implements XResetListener
*/
public void defaultNewRecordFocus( XPropertySet xForm ) throws com.sun.star.uno.Exception
{
- XIndexAccess xFormAsContainer = (XIndexAccess)UnoRuntime.queryInterface(
+ XIndexAccess xFormAsContainer = UnoRuntime.queryInterface(
XIndexAccess.class, xForm );
for ( int i = 0; i<xFormAsContainer.getCount(); ++i )
{
@@ -390,7 +390,7 @@ public class KeyGenerator
XReset xFormReset = UNO.queryReset( m_xForm );
xFormReset.removeResetListener( m_aResetKeyGenerator );
- XRowSetApproveBroadcaster xFormBroadcaster = (XRowSetApproveBroadcaster)UnoRuntime.queryInterface(
+ XRowSetApproveBroadcaster xFormBroadcaster = UnoRuntime.queryInterface(
XRowSetApproveBroadcaster.class, m_xForm );
xFormBroadcaster.removeRowSetApproveListener( m_aUpdateKeyGenerator );
@@ -405,7 +405,7 @@ public class KeyGenerator
// for resets
XReset xFormReset = UNO.queryReset( m_xForm );
// for approving actions
- XRowSetApproveBroadcaster xFormBroadcaster = (XRowSetApproveBroadcaster)UnoRuntime.queryInterface(
+ XRowSetApproveBroadcaster xFormBroadcaster = UnoRuntime.queryInterface(
XRowSetApproveBroadcaster.class, m_xForm );
if ( bGenerateOnReset )
diff --git a/odk/examples/DevelopersGuide/Forms/RowSet.java b/odk/examples/DevelopersGuide/Forms/RowSet.java
index acd56f96abff..b5338810aef2 100644
--- a/odk/examples/DevelopersGuide/Forms/RowSet.java
+++ b/odk/examples/DevelopersGuide/Forms/RowSet.java
@@ -45,14 +45,14 @@ public class RowSet implements XRowSet, XRow
{
try
{
- m_rowSetProps = (XPropertySet)UnoRuntime.queryInterface(
+ m_rowSetProps = UnoRuntime.queryInterface(
XPropertySet.class, _context.getServiceManager().createInstanceWithContext( "com.sun.star.sdb.RowSet", _context ) );
m_rowSetProps.setPropertyValue( "DataSourceName", _dataSource );
m_rowSetProps.setPropertyValue( "CommandType", new Integer( _commandType ) );
m_rowSetProps.setPropertyValue( "Command", _command );
- m_rowSet = (XRowSet)UnoRuntime.queryInterface( XRowSet.class, m_rowSetProps );
- m_row = (XRow)UnoRuntime.queryInterface( XRow.class, m_rowSetProps );
+ m_rowSet = UnoRuntime.queryInterface( XRowSet.class, m_rowSetProps );
+ m_row = UnoRuntime.queryInterface( XRow.class, m_rowSetProps );
}
catch ( Exception e )
{
@@ -64,9 +64,9 @@ public class RowSet implements XRowSet, XRow
// misc
public int getColumnCount()
{
- XColumnsSupplier suppCols = (XColumnsSupplier)UnoRuntime.queryInterface(
+ XColumnsSupplier suppCols = UnoRuntime.queryInterface(
XColumnsSupplier.class, m_rowSet );
- XIndexAccess columns = (XIndexAccess)UnoRuntime.queryInterface(
+ XIndexAccess columns = UnoRuntime.queryInterface(
XIndexAccess.class, suppCols.getColumns() );
return columns.getCount();
}
diff --git a/odk/examples/DevelopersGuide/Forms/SalesFilter.java b/odk/examples/DevelopersGuide/Forms/SalesFilter.java
index 9fc561759633..df7e96aa2d64 100644
--- a/odk/examples/DevelopersGuide/Forms/SalesFilter.java
+++ b/odk/examples/DevelopersGuide/Forms/SalesFilter.java
@@ -433,7 +433,7 @@ class SalesFilter implements XActionListener, XPropertyChangeListener, XResetLis
m_xSalesForm.setPropertyValue( "ApplyFilter", new Boolean( true ) );
// and reload the form
- XLoadable xLoad = (XLoadable)UnoRuntime.queryInterface(
+ XLoadable xLoad = UnoRuntime.queryInterface(
XLoadable.class, m_xSalesForm );
xLoad.reload();
diff --git a/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java b/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
index 50b59640fae3..c54283470963 100644
--- a/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
+++ b/odk/examples/DevelopersGuide/Forms/SingleControlValidation.java
@@ -96,7 +96,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
if ( controls[ i ].getPropertySetInfo().hasPropertyByName( "Border" ) )
controls[ i ].setPropertyValue( "Border", new Short( (short)2 ) );
- XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+ XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
controls[ i ] );
xComp.addFormComponentValidityListener( this );
}
@@ -118,7 +118,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
m_explanationField = m_formLayer.createControlAndShape( "FixedText", columnPos, controlPos, 70, 4, null );
m_explanationField.setPropertyValue( "Label", new String( "" ) );
- XValidatable xValidatable = (XValidatable)UnoRuntime.queryInterface( XValidatable.class, m_inputField );
+ XValidatable xValidatable = UnoRuntime.queryInterface( XValidatable.class, m_inputField );
xValidatable.setValidator( m_validator );
}
catch( java.lang.Exception e )
@@ -144,7 +144,7 @@ public class SingleControlValidation implements XFormComponentValidityListener
{
if ( m_inputField.equals( eventObject.Source ) )
{
- XValidatableFormComponent xComp = (XValidatableFormComponent)UnoRuntime.queryInterface( XValidatableFormComponent.class,
+ XValidatableFormComponent xComp = UnoRuntime.queryInterface( XValidatableFormComponent.class,
eventObject.Source );
// the current value
Object value = xComp.getCurrentValue();
diff --git a/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java b/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
index c722bf36a894..1016f49ca970 100644
--- a/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
+++ b/odk/examples/DevelopersGuide/Forms/SpreadsheetDocument.java
@@ -40,13 +40,13 @@ public class SpreadsheetDocument extends DocumentHelper
public XCellRange getSheet( int index ) throws com.sun.star.uno.Exception
{
- XSpreadsheetDocument spreadsheetDoc = (XSpreadsheetDocument)UnoRuntime.queryInterface( XSpreadsheetDocument.class,
+ XSpreadsheetDocument spreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,
m_documentComponent
);
- XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface( XIndexAccess.class,
+ XIndexAccess sheets = UnoRuntime.queryInterface( XIndexAccess.class,
spreadsheetDoc.getSheets()
);
- return (XCellRange)UnoRuntime.queryInterface( XCellRange.class,
+ return UnoRuntime.queryInterface( XCellRange.class,
sheets.getByIndex( index )
);
}
@@ -74,7 +74,7 @@ public class SpreadsheetDocument extends DocumentHelper
{
CellAddress address = new CellAddress( sheet, column, row );
Object[] initParam = new Object[] { new NamedValue( "BoundCell", address ) };
- cellBinding = (com.sun.star.form.binding.XValueBinding)UnoRuntime.queryInterface(
+ cellBinding = UnoRuntime.queryInterface(
com.sun.star.form.binding.XValueBinding.class,
createInstanceWithArguments(
supportIntegerValues ? "com.sun.star.table.ListPositionCellBinding"
@@ -102,7 +102,7 @@ public class SpreadsheetDocument extends DocumentHelper
CellRangeAddress rangeAddress = new CellRangeAddress( sheet, column,
topRow, column, bottomRow );
Object[] initParam = new Object[] { new NamedValue( "CellRange", rangeAddress ) };
- entrySource = (com.sun.star.form.binding.XListEntrySource)UnoRuntime.queryInterface(
+ entrySource = UnoRuntime.queryInterface(
com.sun.star.form.binding.XListEntrySource.class,
createInstanceWithArguments(
"com.sun.star.table.CellRangeListSource", initParam ) );
diff --git a/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java b/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
index 5b7c1c1b00e3..09233addc5dd 100644
--- a/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
+++ b/odk/examples/DevelopersGuide/Forms/SpreadsheetValueBinding.java
@@ -74,7 +74,7 @@ public class SpreadsheetValueBinding extends DocumentBasedExample
listSourceSheet, column, topRow, bottomRow );
// bind it to the list box
- XListEntrySink consumer = (XListEntrySink)UnoRuntime.queryInterface(
+ XListEntrySink consumer = UnoRuntime.queryInterface(
XListEntrySink.class, listBox );
consumer.setListEntrySource( entrySource );
@@ -87,7 +87,7 @@ public class SpreadsheetValueBinding extends DocumentBasedExample
String[] listContent = new String[] { "first", "second", "third", "forth", "fivth" };
for ( short row = topRow; row <= bottomRow; ++row )
{
- XTextRange cellText = (XTextRange)UnoRuntime.queryInterface(
+ XTextRange cellText = UnoRuntime.queryInterface(
XTextRange.class, exchangeSheet.getCellByPosition( column, row ) );
cellText.setString( listContent[row] );
}
@@ -104,7 +104,7 @@ public class SpreadsheetValueBinding extends DocumentBasedExample
/* ------------------------------------------------------------------ */
private void implBind( XPropertySet controlModel, XValueBinding binding ) throws com.sun.star.form.binding.IncompatibleTypesException
{
- XBindableValue bindable = (XBindableValue)UnoRuntime.queryInterface(
+ XBindableValue bindable = UnoRuntime.queryInterface(
XBindableValue.class, controlModel
);
bindable.setValueBinding( binding );
diff --git a/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java b/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
index 679c520f92c3..21dfb947d048 100644
--- a/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
+++ b/odk/examples/DevelopersGuide/Forms/SpreadsheetView.java
@@ -43,16 +43,16 @@ public class SpreadsheetView extends DocumentViewHelper
try
{
// get the sheet to activate
- XSpreadsheetDocument doc = (XSpreadsheetDocument)UnoRuntime.queryInterface(
+ XSpreadsheetDocument doc = UnoRuntime.queryInterface(
XSpreadsheetDocument.class, getDocument().getDocument() );
- XIndexAccess sheets = (XIndexAccess)UnoRuntime.queryInterface(
+ XIndexAccess sheets = UnoRuntime.queryInterface(
XIndexAccess.class, doc.getSheets() );
- XSpreadsheet sheet = (XSpreadsheet)UnoRuntime.queryInterface(
+ XSpreadsheet sheet = UnoRuntime.queryInterface(
XSpreadsheet.class, sheets.getByIndex( sheetIndex ) );
// activate
- XSpreadsheetView view = (XSpreadsheetView)UnoRuntime.queryInterface(
+ XSpreadsheetView view = UnoRuntime.queryInterface(
XSpreadsheetView.class, getController() );
view.setActiveSheet( sheet );
}
diff --git a/odk/examples/DevelopersGuide/Forms/UNO.java b/odk/examples/DevelopersGuide/Forms/UNO.java
index 39540613d478..109618ca2b7d 100644
--- a/odk/examples/DevelopersGuide/Forms/UNO.java
+++ b/odk/examples/DevelopersGuide/Forms/UNO.java
@@ -45,37 +45,37 @@ public class UNO
{
public static XPropertySet queryPropertySet( Object aObject )
{
- return (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, aObject );
+ return UnoRuntime.queryInterface( XPropertySet.class, aObject );
}
public static XControlModel queryControlModel( Object aObject )
{
- return (XControlModel)UnoRuntime.queryInterface( XControlModel.class, aObject );
+ return UnoRuntime.queryInterface( XControlModel.class, aObject );
}
public static XIndexContainer queryIndexContainer( Object aObject )
{
- return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, aObject );
+ return UnoRuntime.queryInterface( XIndexContainer.class, aObject );
}
public static XReset queryReset( Object aObject )
{
- return (XReset)UnoRuntime.queryInterface( XReset.class, aObject );
+ return UnoRuntime.queryInterface( XReset.class, aObject );
}
public static XServiceInfo queryServiceInfo( Object aObject )
{
- return (XServiceInfo)UnoRuntime.queryInterface( XServiceInfo.class, aObject );
+ return UnoRuntime.queryInterface( XServiceInfo.class, aObject );
}
public static XColumn queryColumn( Object aObject )
{
- return (XColumn)UnoRuntime.queryInterface( XColumn.class, aObject );
+ return UnoRuntime.queryInterface( XColumn.class, aObject );
}
public static XComponent queryComponent( Object aObject )
{
- return (XComponent)UnoRuntime.queryInterface( XComponent.class, aObject );
+ return UnoRuntime.queryInterface( XComponent.class, aObject );
}
public static XTablesSupplier queryTablesSupplier( Object aObject )
{
- return (XTablesSupplier)UnoRuntime.queryInterface( XTablesSupplier.class, aObject );
+ return UnoRuntime.queryInterface( XTablesSupplier.class, aObject );
}
/* replace Foo with the identifier of your choice.
diff --git a/odk/examples/DevelopersGuide/Forms/ValueBinding.java b/odk/examples/DevelopersGuide/Forms/ValueBinding.java
index ffb7555eaf5f..3cf649cce543 100644
--- a/odk/examples/DevelopersGuide/Forms/ValueBinding.java
+++ b/odk/examples/DevelopersGuide/Forms/ValueBinding.java
@@ -41,7 +41,7 @@ public class ValueBinding extends DocumentBasedExample
// insert a table with exactly one cell. The content of this table will be synced with
// the content of a form control
- XTextDocument textDoc = (XTextDocument)UnoRuntime.queryInterface( XTextDocument.class, m_document.getDocument() );
+ XTextDocument textDoc = UnoRuntime.queryInterface( XTextDocument.class, m_document.getDocument() );
XText documentText = textDoc.getText();
XTextCursor textCursor = documentText.createTextCursor();
documentText.insertString( textCursor, "Below, there's a table cell, and a text field. ", false );
@@ -49,7 +49,7 @@ public class ValueBinding extends DocumentBasedExample
documentText.insertString( textCursor, "That means that anything you insert into the table cell is reflected in the ", false );
documentText.insertString( textCursor, "text field, and vice versa.\n", false );
- XTextTable table = (XTextTable)UnoRuntime.queryInterface( XTextTable.class,
+ XTextTable table = UnoRuntime.queryInterface( XTextTable.class,
m_document.createInstance( "com.sun.star.text.TextTable" )
);
table.initialize( 1, 1 );
@@ -61,7 +61,7 @@ public class ValueBinding extends DocumentBasedExample
// create a value binding for the first cell of the table
XValueBinding cellBinding = new TableCellTextBinding( table.getCellByName( "A1" ) );
// and bind it to the control
- XBindableValue bindable = (XBindableValue)UnoRuntime.queryInterface(
+ XBindableValue bindable = UnoRuntime.queryInterface(
XBindableValue.class, textControl
);
bindable.setValueBinding( cellBinding );