summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/Components
diff options
context:
space:
mode:
Diffstat (limited to 'odk/examples/DevelopersGuide/Components')
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java8
-rw-r--r--odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java4
-rw-r--r--odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java15
3 files changed, 13 insertions, 14 deletions
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
index 758835579bb5..86d58da4ba0d 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
@@ -100,12 +100,12 @@ public class ProtocolHandlerAddon {
if ( object.length > 0 )
{
- m_xFrame = ( XFrame ) UnoRuntime.queryInterface(
+ m_xFrame = UnoRuntime.queryInterface(
XFrame.class, object[ 0 ] );
}
// Create the toolkit to have access to it later
- m_xToolkit = (XToolkit) UnoRuntime.queryInterface(
+ m_xToolkit = UnoRuntime.queryInterface(
XToolkit.class,
m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
m_xCmpCtx));
@@ -210,7 +210,7 @@ public class ProtocolHandlerAddon {
aDescriptor.Type = WindowClass.MODALTOP;
aDescriptor.WindowServiceName = new String( "infobox" );
aDescriptor.ParentIndex = -1;
- aDescriptor.Parent = (XWindowPeer)UnoRuntime.queryInterface(
+ aDescriptor.Parent = UnoRuntime.queryInterface(
XWindowPeer.class, m_xFrame.getContainerWindow());
aDescriptor.Bounds = new Rectangle(0,0,300,200);
aDescriptor.WindowAttributes = WindowAttribute.BORDER |
@@ -219,7 +219,7 @@ public class ProtocolHandlerAddon {
XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
if ( null != xPeer ) {
- XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
+ XMessageBox xMsgBox = UnoRuntime.queryInterface(
XMessageBox.class, xPeer);
if ( null != xMsgBox )
{
diff --git a/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java b/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
index 147473573c82..489e4c3ad45d 100644
--- a/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
+++ b/odk/examples/DevelopersGuide/Components/JavaComponent/TestJavaComponent.java
@@ -52,7 +52,7 @@ public class TestJavaComponent
XMultiComponentFactory serviceManager, Object singleFactory )
throws com.sun.star.uno.Exception
{
- XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
+ XSet set = UnoRuntime.queryInterface( XSet.class, serviceManager );
set.insert( singleFactory );
}
@@ -60,7 +60,7 @@ public class TestJavaComponent
XMultiComponentFactory serviceManager, Object singleFactory )
throws com.sun.star.uno.Exception
{
- XSet set = (XSet ) UnoRuntime.queryInterface( XSet.class, serviceManager );
+ XSet set = UnoRuntime.queryInterface( XSet.class, serviceManager );
set.remove( singleFactory );
}
diff --git a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
index 146aef4cf342..513cc1af4058 100644
--- a/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
+++ b/odk/examples/DevelopersGuide/Components/dialogcomponent/DialogComponent.java
@@ -82,7 +82,7 @@ public class DialogComponent {
try {
// Create the toolkit to have access to it later
- m_xToolkit = (XToolkit) UnoRuntime.queryInterface(
+ m_xToolkit = UnoRuntime.queryInterface(
XToolkit.class,
m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit",
m_xCmpCtx));
@@ -113,8 +113,7 @@ public class DialogComponent {
"com.sun.star.awt.DialogProvider2", m_xCmpCtx );
}
- XDialogProvider2 xDialogProvider = (XDialogProvider2)
- UnoRuntime.queryInterface( XDialogProvider2.class, obj );
+ XDialogProvider2 xDialogProvider = UnoRuntime.queryInterface( XDialogProvider2.class, obj );
XDialog xDialog = xDialogProvider.createDialogWithHandler( DialogURL, this );
if( xDialog != null )
@@ -127,13 +126,13 @@ public class DialogComponent {
}
public void copyText( XDialog xDialog, Object aEventObject ) {
- XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface(
+ XControlContainer xControlContainer = UnoRuntime.queryInterface(
XControlContainer.class, xDialog );
String aTextPropertyStr = "Text";
String aText = "";
XControl xTextField1Control = xControlContainer.getControl( "TextField1" );
XControlModel xControlModel1 = xTextField1Control.getModel();
- XPropertySet xPropertySet1 = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet xPropertySet1 = UnoRuntime.queryInterface(
XPropertySet.class, xControlModel1 );
try
{
@@ -145,7 +144,7 @@ public class DialogComponent {
XControl xTextField2Control = xControlContainer.getControl( "TextField2" );
XControlModel xControlModel2 = xTextField2Control.getModel();
- XPropertySet xPropertySet2 = (XPropertySet)UnoRuntime.queryInterface(
+ XPropertySet xPropertySet2 = UnoRuntime.queryInterface(
XPropertySet.class, xControlModel2 );
try
{
@@ -257,7 +256,7 @@ public class DialogComponent {
aDescriptor.Type = WindowClass.MODALTOP;
aDescriptor.WindowServiceName = new String( "infobox" );
aDescriptor.ParentIndex = -1;
- aDescriptor.Parent = (XWindowPeer)UnoRuntime.queryInterface(
+ aDescriptor.Parent = UnoRuntime.queryInterface(
XWindowPeer.class, m_xFrame.getContainerWindow());
aDescriptor.Bounds = new Rectangle(0,0,300,200);
aDescriptor.WindowAttributes = WindowAttribute.BORDER |
@@ -266,7 +265,7 @@ public class DialogComponent {
XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
if ( null != xPeer ) {
- XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
+ XMessageBox xMsgBox = UnoRuntime.queryInterface(
XMessageBox.class, xPeer);
if ( null != xMsgBox )
{