Examples of XWindowPeer


Examples of com.sun.star.awt.XWindowPeer

    * </ul>
    */
    protected TestEnvironment createTestEnvironment(TestParameters Param,
                                                    PrintWriter log) {
        XInterface oObj = null;
        XWindowPeer the_win = null;
        XToolkit the_kit = null;
        XDevice aDevice = null;
        XGraphics aGraphic = null;
        XPropertySet aControl = null;
        XPropertySet aControl2 = null;
        XPropertySet aControl3 = null;
        XPropertySet aControl4 = null;
        XGridColumnFactory columns = null;

        //Insert a ControlShape and get the ControlModel
        XControlShape aShape = createGrid(xTextDoc, 3000, 4500, 15000, 10000);

        XControlModel the_Model = aShape.getControl();

        WriterTools.getDrawPage(xTextDoc).add((XShape) aShape);

        XLoadable formLoader = FormTools.bindForm(xTextDoc);

        //Try to query XControlAccess
        XControlAccess the_access = (XControlAccess) UnoRuntime.queryInterface(
                                            XControlAccess.class,
                                            xTextDoc.getCurrentController());

        try {
            columns = (XGridColumnFactory) UnoRuntime.queryInterface(
                              XGridColumnFactory.class, the_Model);
            aControl = columns.createColumn("TextField");
            aControl.setPropertyValue("DataField", "Identifier");
            aControl.setPropertyValue("Label", "Identifier");
            aControl2 = columns.createColumn("TextField");
            aControl2.setPropertyValue("DataField", "Publisher");
            aControl2.setPropertyValue("Label", "Publisher");
            aControl3 = columns.createColumn("TextField");
            aControl3.setPropertyValue("DataField", "Author");
            aControl3.setPropertyValue("Label", "Author");
            aControl4 = columns.createColumn("TextField");
            aControl4.setPropertyValue("DataField", "Title");
            aControl4.setPropertyValue("Label", "Title");
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        } catch (com.sun.star.lang.WrappedTargetException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        } catch (com.sun.star.beans.PropertyVetoException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
            // Some exception occures.FAILED
            log.println("!!! Couldn't create instance : " + e);
            throw new StatusException("Can't create column instances.", e);
        }

        XNameContainer aContainer = (XNameContainer) UnoRuntime.queryInterface(
                                            XNameContainer.class, the_Model);

        try {
            aContainer.insertByName("First", aControl);
            aContainer.insertByName("Second", aControl2);
        } catch (com.sun.star.uno.Exception e) {
            log.println("!!! Could't insert column Instance");
            e.printStackTrace(log);
            throw new StatusException("Can't insert columns", e);
        }

        //now get the OGridControl
        try {
            oObj = the_access.getControl(the_Model);
            the_win = the_access.getControl(the_Model).getPeer();
            the_kit = the_win.getToolkit();
            aDevice = the_kit.createScreenCompatibleDevice(200, 200);
            aGraphic = aDevice.createGraphics();
        } catch (com.sun.star.uno.Exception e) {
            log.println("Couldn't get GridControl");
            e.printStackTrace(log);
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

                else
                    CurFrame = Desktop.getActiveFrame(xMSF);
    //          CurFrame = OfficeDocument.createNewFrame(xMSF, this);
    //          desktopFrame = Desktop.findAFrame(xMSF, CurFrame, desktopFrame);

                XWindowPeer windowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, CurFrame.getContainerWindow());
                this.xMSF = xMSF;
                createWindowPeer(windowPeer);
                CurDBMetaData.setWindowPeer(this.xControl.getPeer());
                insertQueryRelatedSteps();
                executeDialog(CurFrame.getContainerWindow().getPosSize());
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

            updateUI();

            if(myPathSelection.xSaveTextBox.getText().equalsIgnoreCase("")) {myPathSelection.initializePath();}

            XWindow xContainerWindow = myLetterDoc.xFrame.getContainerWindow();
            XWindowPeer xWindowPeer = (XWindowPeer) UnoRuntime.queryInterface(XWindowPeer.class, xContainerWindow);
            createWindowPeer(xWindowPeer);

            //add the Roadmap to the dialog:
            insertRoadmap();
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

    {
      // get this windows native window type
            int type = getNativeWindowSystemType();

            // Java AWT windows only have a system window when showing.
            XWindowPeer parentPeer;
            if ( isShowing() )
            {
        // create direct parent relationship
        //setVisible( true );
                parentPeer = new JavaWindowPeerFake(getWrappedWindowHandle(), type);
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

    * <p>
    * Has <b> OK </b> status if the method successfully returns
    * and no exceptions were thrown.
    */
    public void _createPeer() {
        XWindowPeer the_win = (XWindowPeer) tEnv.getObjRelation("WINPEER");
        XToolkit the_kit = (XToolkit) tEnv.getObjRelation("TOOLKIT");
        oObj.createPeer(the_kit,the_win);
        tRes.tested("createPeer()",true);
    }
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

    * The following method tests are to be completed successfully before :
    */
    public void _getPeer() {
        requiredMethod("createPeer()");
        boolean res = false;
        XWindowPeer get = oObj.getPeer();
        if (get == null) {
            log.println("The method 'getPeer' returns NULL");
        } else {
           res = true;
        }
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

        {
            XMultiServiceFactory xMSF = (XMultiServiceFactory) param.getMSF();
            assure("failed: There is no office.", xMSF != null);

            // create a window
            XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
            assure("failed: there is no window peer", xWindowPeer != null);


            // resize and move the window to a well known position and size
            XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

          aDescriptor.Bounds            = new Rectangle(0,0,300,200);
          aDescriptor.WindowAttributes  = WindowAttribute.BORDER |
            WindowAttribute.MOVEABLE |
            WindowAttribute.CLOSEABLE;
               
          XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
          if ( null != xPeer ) {
            XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface(
              XMessageBox.class, xPeer);
            if ( null != xMsgBox )
            {
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

     * shows a message box "Unexpected Error... " :-)
     * @param ex
     */
    protected void unexpectedError(Exception ex) {
        ex.printStackTrace();
        XWindowPeer peer = xControl.getPeer();
        AbstractErrorHandler.showMessage(xMSF,peer,resources.resErrUnexpected, ErrorHandler.ERROR_PROCESS_FATAL);
    }
View Full Code Here

Examples of com.sun.star.awt.XWindowPeer

                                            WindowAttribute.SIZEABLE             |
                                            //WindowAttribute.CLOSEABLE            |
                                            VclWindowPeerAttribute.CLIPCHILDREN  ;
       
        //create a new blank container window
        XWindowPeer xPeer = null;
        try {
            xPeer = (XWindowPeer)UnoRuntime.queryInterface(XWindowPeer.class,xToolkit.createWindow(aDescriptor));
        } catch (IllegalArgumentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.