Package lib

Examples of lib.StatusException


        try {
            oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).
                createInstance("com.sun.star.comp.sdbcx.adabas.ODriver");
        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log);
            throw new StatusException(Status.failed("Couldn't create object"));
        }

        log.println("creating a new environment for object");
        TestEnvironment tEnv = new TestEnvironment(oObj);

        //adding relation for sdbc.XDriver
        String adabasURL = (String) Param.get("adabas.url");
        if (adabasURL == null) {
            throw new StatusException(Status.failed(
                "Couldn't get 'adabas.url' from ini-file"));
        }
        tEnv.addObjRelation("XDriver.URL", "sdbc:adabas:" + adabasURL);


        String user = (String) Param.get("adabas.user");
        if (user == null) {
            throw new StatusException(Status.failed(
                "Couldn't get 'adabas.user' from ini-file"));
        }
        String password = (String) Param.get("adabas.password");
        if (password == null) {
            throw new StatusException(Status.failed(
                "Couldn't get 'adabas.password' from ini-file"));
        }
        PropertyValue[] info = new PropertyValue[2];
        info[0] = new PropertyValue();
        info[0].Name = "user"; info[0].Value = user;
        info[1] = new PropertyValue();
        info[1].Name = "password"; info[1].Value = password;
        tEnv.addObjRelation("XDriver.INFO", info);

        String jdbcUrl = (String) Param.get("jdbc.url");
        if (jdbcUrl == null) {
            throw new StatusException(Status.failed(
                "Couldn't get 'jdbc.url' from ini-file"));
        }
        tEnv.addObjRelation("XDriver.UNSUITABLE_URL", "jdbc:" + jdbcUrl);

        return tEnv;
View Full Code Here


            oInterface = ((XMultiServiceFactory)Param.getMSF()).createInstance
                ("com.sun.star.sdb.ContentLoader") ;
        } catch (com.sun.star.uno.Exception e) {
            log.println("Couldn't get service");
            e.printStackTrace(log);
            throw new StatusException("Couldn't get GridControl", e );
        }

        if (oInterface == null) {
            log.println("Service wasn't created") ;
            throw new StatusException(Status.failed("Service wasn't created")) ;
        }

        oObj = (XInterface) oInterface ;

        log.println("ImplementationName " + util.utils.getImplName(oObj));
View Full Code Here

        try {
            xMSF = (XMultiServiceFactory)Param.getMSF();
            oDBC = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
        }
        catch( com.sun.star.uno.Exception e ) {
            throw new StatusException("Could not instantiate DatabaseContext", e) ;
        }
       
        Object oDataSource = null;
        try{
            XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oDBC);
            oDataSource = xNA.getByName(sDataSourceName);
        } catch ( com.sun.star.container.NoSuchElementException e){
            throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
        } catch ( com.sun.star.lang.WrappedTargetException e){
            throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
        }
        XDocumentDataSource xDDS = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource);
        XModel xMod = (XModel) UnoRuntime.queryInterface(XModel.class, xDDS.getDatabaseDocument ());
       
        Frame = xMod.getCurrentController().getFrame();
       
         // get an instance of Frame
        Object oFrame = null;
        XTextDocument xTextDoc = null;;
        SOfficeFactory SOF = null;

        SOF = SOfficeFactory.getFactory( xMSF );
        try {
            log.println( "creating a textdocument" );
            xTextDoc = SOF.createTextDoc( null );
        } catch ( com.sun.star.uno.Exception e ) {
            e.printStackTrace( log );
            throw new StatusException( "Could not create document", e );
        }

        XModel xDocMod = (XModel) UnoRuntime.queryInterface(XModel.class, xTextDoc);
       
        XFrame xTextFrame  = xDocMod.getCurrentController().getFrame();
View Full Code Here

        try {
            xMSF = (XMultiServiceFactory)Param.getMSF();
            oDBC = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" );
        }
        catch( com.sun.star.uno.Exception e ) {
            throw new StatusException("Could not instantiate DatabaseContext", e) ;
        }
       
        Object oDataSource = null;
        try{
            XNameAccess xNA = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oDBC);
            oDataSource = xNA.getByName(sDataSourceName);
        } catch ( com.sun.star.container.NoSuchElementException e){
            throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
        } catch ( com.sun.star.lang.WrappedTargetException e){
            throw new StatusException("could not get '" + sDataSourceName + "'" , e) ;
        }
       
        XDocumentDataSource xDDS = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, oDataSource);
        XModel xMod = (XModel) UnoRuntime.queryInterface(XModel.class, xDDS.getDatabaseDocument ());

        // get an intaces of QueryDesign
        Object oQueryDesign = null;
        try{
            oQueryDesign = xMSF.createInstance("com.sun.star.sdb.QueryDesign");
        }catch( com.sun.star.uno.Exception e ) {
            throw new StatusException("Could not instantiate QueryDesign", e) ;
        }
       
        XController xCont = (XController) UnoRuntime.queryInterface(XController.class, oQueryDesign);
       
        // marry them all
        xCont.attachModel(xMod);
        xMod.connectController(xCont);
        try{
            xMod.setCurrentController(xCont);
        } catch (com.sun.star.container.NoSuchElementException e){
            throw new StatusException("Could not set controller", e) ;
        }
       
        //xCont.attachFrame(xFrame);
       
        return (XInitialization) UnoRuntime.queryInterface(XInitialization.class, oQueryDesign);
View Full Code Here

                XMultiServiceFactory xMSF = (XMultiServiceFactory)Param.getMSF ();
                    aFile = utils.getOfficeTemp (xMSF)+dbSourceName+".odb";
            } catch (com.sun.star.uno.Exception e) {
                log.println("Error while object test initialization :") ;
                e.printStackTrace(log) ;
                throw new StatusException("Error while object test" +
                    " initialization", e);
            }
        } else {
            try {
                srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir) ;
                dbSrc = srcInf.getDataSourceService() ;
                if (uniqueSuffix < 1)
                    dbTools.reRegisterDB(dbSourceName, dbSrc) ;
            } catch (com.sun.star.uno.Exception e) {
                log.println("Error while object test initialization :") ;
                e.printStackTrace(log) ;
                throw new
                    StatusException("Error while object test initialization",e) ;
            }
        }
    }
View Full Code Here

        if (isMySQLDB) {
            try {
                dbTools.initTestTableUsingJDBC(tableName, srcInf);
            } catch(java.sql.SQLException e) {
                e.printStackTrace(log);
                throw new StatusException(Status.failed("Couldn't " +
                    " init test table. SQLException..."));
            } catch(java.lang.ClassNotFoundException e) {
                throw new StatusException(Status.failed("Couldn't " +
                    "register mysql driver"));
            }
        } else {
            String oldF = null ;
            String newF = null ;
            do {
                tableName = "ORowSet_tmp" + uniqueSuffix ;
                oldF = utils.getFullURL(origDB);
                newF = utils.getOfficeTemp((XMultiServiceFactory)Param.getMSF())+tableName+".dbf";
            } while (!utils.overwriteFile((XMultiServiceFactory)Param.getMSF(),oldF,newF) &&
                uniqueSuffix++ < 50);
        }
       
        XConnection connection = null ;

        try {
            xMSF = (XMultiServiceFactory)Param.getMSF();

            Object oRowSet = xMSF.createInstance("com.sun.star.sdb.RowSet") ;

            XPropertySet xSetProp = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, oRowSet) ;

            log.println("Trying to open: " + tableName);

            xSetProp.setPropertyValue("DataSourceName", dbSourceName) ;
            xSetProp.setPropertyValue("Command", tableName) ;
            xSetProp.setPropertyValue("CommandType",
                new Integer(CommandType.TABLE)) ;

            com.sun.star.sdbc.XRowSet xORowSet = (com.sun.star.sdbc.XRowSet)
                UnoRuntime.queryInterface(com.sun.star.sdbc.XRowSet.class,
                oRowSet) ;                  

            xORowSet.execute() ;

            connection = null;

            try {
                connection = (XConnection) AnyConverter.toObject(
                                    new Type(XConnection.class),
                                    xSetProp.getPropertyValue("ActiveConnection"));
            } catch (com.sun.star.lang.IllegalArgumentException iae) {
                throw new StatusException("couldn't convert Any",iae);
            }

            oInterface = oRowSet ;

            XResultSet xRes = (XResultSet) UnoRuntime.queryInterface
                (XResultSet.class, oRowSet) ;

            xRes.first() ;

            if (oInterface == null) {
                log.println("Service wasn't created") ;
                throw new StatusException("Service wasn't created",
                    new NullPointerException()) ;
            }

            oObj = (XInterface) oInterface;

            log.println( "    creating a new environment for object" );
            TestEnvironment tEnv = new TestEnvironment( oObj );

            // Adding relations for disposing object
            tEnv.addObjRelation("ORowSet.Connection", connection) ;
            this.conn = (XConnection) tEnv.getObjRelation("ORowSet.Connection");


            // Adding obj relation for XRowSetApproveBroadcaster test
            {
                final XResultSet xResSet = (XResultSet)
                    UnoRuntime.queryInterface(XResultSet.class, oObj) ;
                final XResultSetUpdate xResSetUpdate = (XResultSetUpdate)
                    UnoRuntime.queryInterface(XResultSetUpdate.class, oObj) ;
                final XRowSet xRowSet = (XRowSet) UnoRuntime.queryInterface
                    (XRowSet.class, oObj) ;
                final XRowUpdate xRowUpdate = (XRowUpdate)
                    UnoRuntime.queryInterface(XRowUpdate.class, oObj) ;
                final PrintWriter logF = log ;
                tEnv.addObjRelation("XRowSetApproveBroadcaster.ApproveChecker",
                    new ifc.sdb._XRowSetApproveBroadcaster.RowSetApproveChecker() {
                        public void moveCursor() {
                            try {
                                xResSet.beforeFirst() ;
                                xResSet.afterLast() ;
                                xResSet.first() ;
                            } catch (com.sun.star.sdbc.SQLException e) {
                                logF.println("### _XRowSetApproveBroadcaster." +
                                    "RowSetApproveChecker.moveCursor() :") ;
                                e.printStackTrace(logF) ;
                            }
                        }
                        public RowChangeEvent changeRow() {
                            try {
                                xResSet.first() ;
                                xRowUpdate.updateString(1, "ORowSetTest2") ;
                                xResSetUpdate.updateRow() ;
                            } catch (com.sun.star.sdbc.SQLException e) {
                                logF.println("### _XRowSetApproveBroadcaster." +
                                    "RowSetApproveChecker.changeRow() :") ;
                                e.printStackTrace(logF) ;
                            }
                            RowChangeEvent ev = new RowChangeEvent() ;
                            ev.Action = com.sun.star.sdb.RowChangeAction.UPDATE ;
                            ev.Rows = 1 ;

                            return ev ;
                        }
                        public void changeRowSet() {
                            try {
                                xRowSet.execute() ;
                                xResSet.first() ;
                            } catch (com.sun.star.sdbc.SQLException e) {
                                logF.println("### _XRowSetApproveBroadcaster."+
                                    "RowSetApproveChecker.changeRowSet() :") ;
                                e.printStackTrace(logF) ;
                            }
                        }
                    }) ;
            }
            // Adding relations for XRow as a Vector with all data
            // of current row of RowSet.

            Vector rowData = new Vector() ;

            for (int i = 0; i < DBTools.TST_TABLE_VALUES[0].length; i++) {
                rowData.add(DBTools.TST_TABLE_VALUES[0][i]) ;
            }

            // here XRef must be added
            // here XBlob must be added
            // here XClob must be added
            // here XArray must be added

            tEnv.addObjRelation("CurrentRowData", rowData) ;

            // Adding relation for XColumnLocate ifc test
            tEnv.addObjRelation("XColumnLocate.ColumnName",
                DBTools.TST_STRING_F) ;

            // Adding relation for XCompletedExecution
            tEnv.addObjRelation("InteractionHandlerChecker", new InteractionHandlerImpl());
            XPropertySet xProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, oObj) ;
            try {
                xProp.setPropertyValue("DataSourceName", dbSourceName) ;
                if(isMySQLDB) {
                    xProp.setPropertyValue("Command", "SELECT Column0  FROM soffice_test_table  WHERE ( (  Column0 = :param1 ) )");
                }
                else {
                    xProp.setPropertyValue("Command", "SELECT \"_TEXT\" FROM \"ORowSet_tmp" + uniqueSuffix + "\" WHERE ( ( \"_TEXT\" = :param1 ) )");
                }

                xProp.setPropertyValue("CommandType", new Integer(CommandType.COMMAND)) ;
            }
            catch(Exception e) {
            }

           
           
           
           
            // Adding relation for XParameters ifc test
            Vector params = new Vector() ;


            tEnv.addObjRelation("XParameters.ParamValues", params) ;

            // Adding relation for XRowUpdate
            XRow row = (XRow) UnoRuntime.queryInterface (XRow.class, oObj) ;
            tEnv.addObjRelation("XRowUpdate.XRow", row) ;

            // Adding relation for XResultSetUpdate
            {
                final XResultSet xResSet = (XResultSet)
                    UnoRuntime.queryInterface(XResultSet.class, oObj) ;
                final XRowUpdate xRowUpdate = (XRowUpdate)
                    UnoRuntime.queryInterface(XRowUpdate.class, oObj) ;
                final XRow xRow = (XRow) UnoRuntime.queryInterface
                    (XRow.class, oObj) ;

                tEnv.addObjRelation("XResultSetUpdate.UpdateTester",
                    new ifc.sdbc._XResultSetUpdate.UpdateTester() {
                        String lastUpdate = null ;

                        public int rowCount() throws SQLException {
                            int prevPos = xResSet.getRow() ;
                            xResSet.last() ;
                            int count = xResSet.getRow() ;
                            xResSet.absolute(prevPos) ;

                            return count ;
                        }

                        public void update() throws SQLException {
                            lastUpdate = xRow.getString(1) ;
                            lastUpdate += "_" ;
                            xRowUpdate.updateString(1, lastUpdate) ;
                        }

                        public boolean wasUpdated() throws SQLException {
                            String getStr = xRow.getString(1) ;
                            return lastUpdate.equals(getStr) ;
                        }

                        public int currentRow() throws SQLException {
                            return xResSet.getRow() ;
                        }
                    }) ;
            }

            envCreatedOK = true ;
            return tEnv;

        } catch(com.sun.star.uno.Exception e) {
            log.println("Can't create object" );
            e.printStackTrace(log) ;
            try {
                connection.close() ;
            } catch(Exception ex) {}
            throw new StatusException("Can't create object", e) ;
        } finally {
            if (!envCreatedOK) {
                try {
                    connection.close() ;
                } catch(Exception ex) {}
View Full Code Here

            xMSF = (XMultiServiceFactory)Param.getMSF();
            oInterface = xMSF.createInstance( "com.sun.star.sdb.QueryDefinition" );
        }
        catch( com.sun.star.uno.Exception e ) {
            log.println("Service not available" );
            throw new StatusException("Service not available", e) ;
        }

        if (oInterface == null) {
            log.println("Service wasn't created") ;
            throw new StatusException(Status.failed("Service wasn't created")) ;
        }

        oObj = (XInterface) oInterface;

        log.println( "    creating a new environment for object" );
View Full Code Here

            toolkit = ((XMultiServiceFactory) Param.getMSF ())
            .createInstance ("com.sun.star.awt.Toolkit");
        } catch (com.sun.star.uno.Exception e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed ("Couldn't create instance"));
        }
       
        String mysqlURL = (String) Param.get ("mysql.url");
       
        if (mysqlURL == null)
        {
            throw new StatusException (Status.failed (
            "Couldn't get 'mysql.url' from ini-file"));
        }
       
        user = (String) Param.get ("jdbc.user");
        password = (String) Param.get ("jdbc.password");
       
        if ((user == null) || (password == null))
        {
            throw new StatusException (Status.failed (
            "Couldn't get 'jdbc.user' or 'jdbc.password' from ini-file"));
        }
       
        PropertyValue[] info = new PropertyValue[2];
        info[0] = new PropertyValue ();
        info[0].Name = "user";
        info[0].Value = user;
        info[1] = new PropertyValue ();
        info[1].Name = "password";
        info[1].Value = password;
       
        XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface (
        XPropertySet.class, oDBSource);
       
        try
        {
            propSetDBSource.setPropertyValue ("URL", mysqlURL);
            propSetDBSource.setPropertyValue ("Info", info);
        } catch (com.sun.star.lang.WrappedTargetException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        } catch (com.sun.star.lang.IllegalArgumentException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        } catch (com.sun.star.beans.PropertyVetoException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        } catch (com.sun.star.beans.UnknownPropertyException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        }
       
        try
        {
            log.println ("writing database file ...");
            XDocumentDataSource xDDS = (XDocumentDataSource)
            UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource);
            store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
                    xDDS.getDatabaseDocument());
            aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"JoinView.odb";
            log.println ("... filename will be "+aFile);
            store.storeAsURL (aFile,new PropertyValue[]
            {});
            log.println ("... done");
        } catch (com.sun.star.uno.Exception e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed ("Couldn't register object"));
        }
       
        isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface (
        XIsolatedConnection.class,
        oDBSource);
       
        XConnection connection = null;
        XStatement statement = null;
       
        final String tbl_name1 = "tst_table1";
        final String tbl_name2 = "tst_table2";
        final String col_name1 = "id1";
        final String col_name2 = "id2";
       
        try
        {
            connection = isolConnection.getIsolatedConnection (user, password);
            statement = connection.createStatement ();
            statement.executeUpdate ("drop table if exists " + tbl_name1);
            statement.executeUpdate ("drop table if exists " + tbl_name2);
            statement.executeUpdate ("create table " + tbl_name1 + " (" +
            col_name1 + " int)");
            statement.executeUpdate ("create table " + tbl_name2 + " (" +
            col_name2 + " int)");
        } catch (com.sun.star.sdbc.SQLException e)
        {
            try
            {
                shortWait ();
                connection = isolConnection.getIsolatedConnection (user,
                password);
                statement = connection.createStatement ();
                statement.executeUpdate ("drop table if exists " + tbl_name1);
                statement.executeUpdate ("drop table if exists " + tbl_name2);
                statement.executeUpdate ("create table " + tbl_name1 + " (" +
                col_name1 + " int)");
                statement.executeUpdate ("create table " + tbl_name2 + " (" +
                col_name2 + " int)");
            } catch (com.sun.star.sdbc.SQLException e2)
            {
                e2.printStackTrace (log);
                throw new StatusException (Status.failed ("SQLException"));
            }
        }
       
        XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface (
        XQueryDefinitionsSupplier.class,
        oDBSource);
       
        XNameAccess defContainer = querySuppl.getQueryDefinitions ();
       
        XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface (
        XPropertySet.class, newQuery);
       
        try
        {
            final String query = "select * from " + tbl_name1 + ", " +
            tbl_name2 + " where " + tbl_name1 + "." +
            col_name1 + "=" + tbl_name2 + "." +
            col_name2;
            queryProp.setPropertyValue ("Command", query);
        } catch (com.sun.star.lang.WrappedTargetException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        } catch (com.sun.star.lang.IllegalArgumentException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        } catch (com.sun.star.beans.PropertyVetoException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        } catch (com.sun.star.beans.UnknownPropertyException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed (
            "Couldn't set property value"));
        }
       
        XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface (
        XNameContainer.class,
        defContainer);
       
        try
        {
            queryContainer.insertByName ("Query1", newQuery);
            store.store ();
            connection.close ();
        } catch (com.sun.star.lang.WrappedTargetException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed ("Couldn't insert query"));
        } catch (com.sun.star.container.ElementExistException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed ("Couldn't insert query"));
        } catch (com.sun.star.lang.IllegalArgumentException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed ("Couldn't insert query"));
        } catch (com.sun.star.io.IOException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed ("Couldn't insert query"));
        } catch (com.sun.star.sdbc.SQLException e)
        {
            e.printStackTrace (log);
            throw new StatusException (Status.failed ("Couldn't insert query"));
        }
       
        PropertyValue[] loadProps = new PropertyValue[3];
        loadProps[0] = new PropertyValue ();
        loadProps[0].Name = "QueryDesignView";
View Full Code Here

                            "com.sun.star.sdb.InteractionHandler" );

        }
        catch( com.sun.star.uno.Exception e ) {
            log.println("Service not available" );
            throw new StatusException("Service not available", e) ;
        }

        if (oInterface == null) {
            log.println("Service wasn't created") ;
            throw new StatusException(Status.failed("Service wasn't created")) ;
        }

          oObj = (XInterface) oInterface;

        log.println( "    creating a new environment for object" );
View Full Code Here

            err1 = new com.sun.star.sdbc.SQLException("err1");
            err2 = new com.sun.star.sdbc.SQLException("err2");
        }
        catch( com.sun.star.uno.Exception e ) {
            log.println("Service not available" );
            throw new StatusException("Service not available", e) ;
        }

        if (oInterface == null) {
            log.println("Service wasn't created") ;
            throw new StatusException(Status.failed("Service wasn't created")) ;
        }

        oObj = (XInterface) oInterface;

        // create XWindow for Object relations...
        com.sun.star.awt.XToolkit xToolkit = null;

        try{
            xToolkit = (com.sun.star.awt.XToolkit)UnoRuntime.queryInterface(
                        com.sun.star.awt.XToolkit.class,
            ((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.awt.Toolkit") );
        } catch (com.sun.star.uno.Exception e){
            log.println("could not create instacne of 'com.sun.star.awt.Toolkit'" );
            throw new StatusException("could not create instacne of 'com.sun.star.awt.Toolkit'", e) ;
        }
       
        // Describe the properties of the container window.
        com.sun.star.awt.WindowDescriptor aDescriptor =
        new com.sun.star.awt.WindowDescriptor();

        aDescriptor.Type              = com.sun.star.awt.WindowClass.TOP ;
        aDescriptor.WindowServiceName = "window" ;
        aDescriptor.ParentIndex       = -1;
        aDescriptor.Parent            = null;
        aDescriptor.Bounds            = new com.sun.star.awt.Rectangle(0,0,0,0);

        aDescriptor.WindowAttributes  =
        com.sun.star.awt.WindowAttribute.BORDER    |
        com.sun.star.awt.WindowAttribute.MOVEABLE  |
        com.sun.star.awt.WindowAttribute.SIZEABLE  |
        com.sun.star.awt.WindowAttribute.CLOSEABLE ;

        com.sun.star.awt.XWindowPeer xPeer = null;
        try{
       
            xPeer = xToolkit.createWindow(aDescriptor) ;

        } catch (com.sun.star.lang.IllegalArgumentException e){
            log.println("could not create window" );
            throw new StatusException("could not create window", e) ;
        }

        com.sun.star.awt.XWindow xWindow = (com.sun.star.awt.XWindow)UnoRuntime.queryInterface (
        com.sun.star.awt.XWindow .class, xPeer);       
       
View Full Code Here

TOP

Related Classes of lib.StatusException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.