Examples of XControlContainer


Examples of com.sun.star.awt.XControlContainer

      }
      return "Created dialog \"" + DialogURL + "\"";
    }
   
    public void copyText( XDialog xDialog, Object aEventObject ) {
      XControlContainer 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.class, xControlModel1 );
      try
      {
        aText = (String)xPropertySet1.getPropertyValue( aTextPropertyStr );
      }
      catch (Exception e) {
        e.printStackTrace();
      }
 
      XControl xTextField2Control = xControlContainer.getControl( "TextField2" )
      XControlModel xControlModel2 = xTextField2Control.getModel();
      XPropertySet xPropertySet2 = (XPropertySet)UnoRuntime.queryInterface(
        XPropertySet.class, xControlModel2 );
      try
      {
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

                throw new com.sun.star.lang.IllegalArgumentException(
                    "This window is not supported by this handler", this, (short) -1);

            //To access the separate controls of the window we need to obtain the
            //XControlContainer from the window implementation
            XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(
                XControlContainer.class, aWindow);
            if (xContainer == null)
                throw new com.sun.star.uno.Exception(
                    "Could not get XControlContainer from window.", this);

            //This is an implementation which will be used for several options pages
            //which all have the same controls. m_arStringControls is an array which
            //contains the names.
            for (int i = 0; i < m_arStringControls.length; i++) {

                //To obtain the data from the controls we need to get their model.
                //First get the respective control from the XControlContainer.
                XControl xControl = xContainer.getControl(m_arStringControls[i]);

                //This generic handler and the corresponding registry schema support
                //up to five text controls. However, if a options page does not use all
                //five controls then we will not complain here.
                if (xControl == null)
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

                throw new com.sun.star.lang.IllegalArgumentException(
                    "The window is not supported by this handler", this, (short) -1);

            //To acces the separate controls of the window we need to obtain the
            //XControlContainer from window implementation
            XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(
                XControlContainer.class, aWindow);
            if (xContainer == null)
                throw new com.sun.star.uno.Exception(
                    "Could not get XControlContainer from window.", this);

            //This is an implementation which will be used for several options pages
            //which all have the same controls. m_arStringControls is an array which
            //contains the names.
            for (int i = 0; i < m_arStringControls.length; i++) {

                //load the values from the registry
                //To access the registry we have previously created a service instance
                //of com.sun.star.configuration.ConfigurationUpdateAccess which supports
                //com.sun.star.container.XNameAccess. We obtain now the section
                //of the registry which is assigned to this options page.
                XPropertySet xLeaf = (XPropertySet) UnoRuntime.queryInterface(
                    XPropertySet.class, m_xAccessLeaves.getByName(sWindowName));
                if (xLeaf == null)
                    throw new  com.sun.star.uno.Exception(
                        "XPropertySet not supported.", this);

                //The properties in the registry have the same name as the respective
                //controls. We use the names now to obtain the property values.
                Object aValue = xLeaf.getPropertyValue(m_arStringControls[i]);

                //Now that we have the value we need to set it at the corresponding
                //control in the window. The XControlContainer, which we obtained earlier
                //is the means to get hold of all the controls.
                XControl xControl = xContainer.getControl(m_arStringControls[i]);

                //This generic handler and the corresponding registry schema support
                //up to five text controls. However, if a options page does not use all
                //five controls then we will not complain here.
                if (xControl == null)
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

    }

    private static XControl GetControlFromDialog( XDialog xDialog, String aControlName )
    {
        XControl xResult = null;
        XControlContainer xControlCont = (XControlContainer) UnoRuntime.queryInterface( XControlContainer.class, xDialog );
               
        if ( xControlCont != null )
        {
            Object oControl = xControlCont.getControl( aControlName );
            xResult = ( XControl ) UnoRuntime.queryInterface( XControl.class, oControl );
        }

        return xResult;
    }
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

                if ( xResult != null )
                {
                    SetTitle( xResult, Helper.GetLocalizedString( xContext, nTitleID ) );
                    if ( pControls != null && pStringIDs != null && pControls.length == pStringIDs.length )
                    {
                        XControlContainer xControlContainer = (XControlContainer)UnoRuntime.queryInterface( XControlContainer.class, xResult );
                        for ( int nInd = 0; nInd < pControls.length; nInd++ )
                            GetPropSet( xControlContainer, pControls[nInd] ).setPropertyValue( "Label", new Integer( pStringIDs[nInd] ) );
                    }
                }
            }
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

    *  <li> <code> setContainer() </code> : sets container for the object</li>
    * </ul>
    */
    public void _getContainer() {
        requiredMethod( "setContainer()");
        XControlContainer setContainer = oObj.getContainer();
        XControlContainer relContainer = (XControlContainer )
                                            tEnv.getObjRelation("CONTAINER");
        tRes.tested("getContainer()", Status.skipped(true) );
    }
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

        XControl butControl1 = null;
        XControl butControl2 = null;
        XTabController tabControl1 = null;
        XTabController tabControl2 = null;

        XControlContainer ctrlCont = null;

        if (xWinDlg != null) {
            xWinDlg.dispose();
        }
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

    public TestEnvironment createTestEnvironment(TestParameters param,
                                                 PrintWriter log) {
        XInterface oObj = null;
        XControl xCtrl1 = null;
        XTabControllerModel tabCtrlModel = null;
        XControlContainer aCtrlContainer = null;


        // create object relations
        FormTools.insertForm(xTextDoc,
                             FormTools.getForms(WriterTools.getDrawPage(
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

                        mxMSF.createInstance("com.sun.star.awt.Toolkit" ));
           
          xDialogControl.createPeer( xToolkit, null );
 
            // get the peers of the sub controls from the dialog peer container
            XControlContainer xDialogContainer = (XControlContainer)
            UnoRuntime.queryInterface(XControlContainer.class ,xDialogControl);
           
            XTreeControl xTreeControl = (XTreeControl)
            UnoRuntime.queryInterface(XTreeControl.class, xDialogContainer.getControl( sTreeControlName ));
           
            xTreeControl.expandNode(xNode);
            oObj = xTreeControl;

          XDialog xDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, xDialogControl);
View Full Code Here

Examples of com.sun.star.awt.XControlContainer

        gridModelProps.setPropertyValue( "Height", 88 );
        final XNameContainer modelContainer = UnoRuntime.queryInterface( XNameContainer.class, dialogModel );
        modelContainer.insertByName( "grid", gridModelProps );

        // check the respective control has been created
        final XControlContainer controlContainer = UnoRuntime.queryInterface( XControlContainer.class, dialogControl );
        final XControl gridControl = controlContainer.getControl( "grid" );
        assertNotNull( "no grid control created in the dialog", gridControl );

        return gridControl;
    }
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.