INTEGRATION: CWS formcelllinkage (1.1.4); FILE ADDED

2003/10/02 13:44:28 fs 1.1.4.2: some extensions while writing a integration test for #18683#
2003/10/02 07:59:52 fs 1.1.4.1: #i18994# merging the changes from the CWS fs002
This commit is contained in:
Oliver Bolte 2003-10-21 07:54:03 +00:00
parent d58272088a
commit 9ee72dd371

View file

@ -0,0 +1,54 @@
package integration.forms;
import com.sun.star.uno.*;
import com.sun.star.lang.*;
import com.sun.star.beans.*;
import com.sun.star.container.*;
/** provides global helpers
*/
public class dbfTools
{
/* ------------------------------------------------------------------ */
/** disposes the component given
*/
static public void disposeComponent( Object xComp ) throws java.lang.RuntimeException
{
XComponent xComponent = queryXComponent( xComp );
if ( null != xComponent )
xComponent.dispose();
}
/* ------------------------------------------------------------------ */
/** queries an object for the XPropertySet interface
*/
static public XPropertySet queryXPropertySet( Object aComp )
{
return (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, aComp );
}
/* ------------------------------------------------------------------ */
/** queries an object for the XIndexContainer interface
*/
static public XIndexContainer queryXIndexContainer( Object aComp )
{
return (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, aComp );
}
/* ------------------------------------------------------------------ */
/** queries an object for the XComponent interface
*/
static public XComponent queryXComponent( Object aComp )
{
return (XComponent)UnoRuntime.queryInterface( XComponent.class, aComp );
}
/* ------------------------------------------------------------------ */
/** retrieves the parent of the given object
*/
static Object getParent( Object aComponent, Class aInterfaceClass )
{
XChild xAsChild = (XChild)UnoRuntime.queryInterface( XChild.class, aComponent );
return UnoRuntime.queryInterface( aInterfaceClass, xAsChild.getParent() );
}
};