Package com.sun.star.awt

Examples of com.sun.star.awt.XControl


        XControlModel shapeModel = aShape.getControl();

        XControlAccess xCtrlAccess = (XControlAccess) UnoRuntime.queryInterface(
                                             XControlAccess.class,
                                             secondController);
        XControl xCtrl = null;

        try {
            xCtrl = xCtrlAccess.getControl(shapeModel);
        } catch (com.sun.star.uno.Exception e) {
            // Some exception occures.FAILED
View Full Code Here


    public static void SetTitle( XDialog xDialog, String sTitle )
        throws Exception
    {
        if ( xDialog != null && sTitle != null )
        {
            XControl xDialogControl = (XControl)UnoRuntime.queryInterface( XControl.class, xDialog );
            if ( xDialogControl != null )
            {
                XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, xDialogControl.getModel() );
                if ( xPropSet != null )
                    xPropSet.setPropertyValue( "Title", sTitle );
            }
        }
    }
View Full Code Here

    {
        XPropertySet xPS = null;

        if ( xControlContainer != null && sControl != null )
        {
            XControl xControl = xControlContainer.getControl(sControl);
            xPS = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel() );
        }

        if ( xPS == null )
            throw new com.sun.star.uno.RuntimeException();
       
View Full Code Here

    protected void InsertThrobber( int X, int Y, int Width, int Height )
    {
        try
        {
            XControl xDialogControl = ( XControl ) UnoRuntime.queryInterface( XControl.class, m_xDialog );
            XControlModel xDialogModel = null;
            if ( xDialogControl != null )
                xDialogModel = xDialogControl.getModel();

            XMultiServiceFactory xDialogFactory = ( XMultiServiceFactory ) UnoRuntime.queryInterface( XMultiServiceFactory.class, xDialogModel );
            if ( xDialogFactory != null )
            {
                XControlModel xThrobberModel = (XControlModel)UnoRuntime.queryInterface( XControlModel.class, xDialogFactory.createInstance( "com.sun.star.awt.UnoThrobberControlModel" ) );
View Full Code Here

     * in order to use the "move up", "down" "insert" and "remove" buttons,
     * we track the last control the gained focus, in order to know which
     * row should be handled.
     */
    public void focusGained(FocusEvent fe) {
        XControl xc = (XControl)UnoRuntime.queryInterface(XControl.class,fe.Source);
        focusGained(xc);
    }
View Full Code Here

    private void focus(Object textControl) {
        ((XWindow)UnoRuntime.queryInterface(XWindow.class,textControl)).setFocus();
        XTextComponent xTextComponent = (XTextComponent)UnoRuntime.queryInterface(XTextComponent.class,textControl);
        String text = xTextComponent.getText();
        xTextComponent.setSelection( new Selection(0, text.length()) );
        XControl xc = (XControl)UnoRuntime.queryInterface(XControl.class,textControl);
        focusGained(xc);
    }
View Full Code Here

            XNameContainer xDialogModelContainer = (XNameContainer)
            UnoRuntime.queryInterface(XNameContainer.class, xDialogModel);
           
            xDialogModelContainer.insertByName( sTreeControlName, xTreeControlModel);
           
            XControl xDialogControl = (XControl)
            UnoRuntime.queryInterface(XControl.class,
                mxMSF.createInstance("com.sun.star.awt.UnoControlDialog"));
           
            xDialogControl.setModel( xDialogModel );
 
            XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class,
                        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);
           
View Full Code Here

            XControlModel CM = ((XControlShape)button).getControl();
            log.println("Getting ControlModel "
                + ((CM == null) ? "FAILED" : "OK"));

            XControl oControl = oObj.getControl(CM);
            log.println("Getting Control " + ((CM == null) ? "FAILED" : "OK"));

            bResult &= oControl != null;
        } catch (com.sun.star.container.NoSuchElementException e) {
            log.println("Exception occured calling the method: " + e);
View Full Code Here

    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
      {
        xPropertySet2.setPropertyValue( aTextPropertyStr, aText );
View Full Code Here

                xWindow.setVisible(true);

                XFixedText xFixedText = (XFixedText)UnoRuntime.queryInterface(XFixedText.class, aFixedText);
                xFixedText.setText("Dies ist ein String");

                XControl xControl = (XControl)UnoRuntime.queryInterface(XControl.class, xFixedText);
                xControl.setModel(xFixedTextModel);

                XLayoutConstrains xLayoutConstrains = (XLayoutConstrains)UnoRuntime.queryInterface(XLayoutConstrains.class, aFixedText);
                Size aSize = xLayoutConstrains.getPreferredSize();
               
                // xToolkit.createScreenCompatibleDevice(_nWidth, _nWidth).
View Full Code Here

TOP

Related Classes of com.sun.star.awt.XControl

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.