Package com.sun.star.awt

Examples of com.sun.star.awt.XCheckBox


     
        if ( checkBoxDialog )
        {
            // add to checkbox
            Object objectCheckBox = xControlCont.getControl( _checkBoxName );
            XCheckBox xCheckBox = ( XCheckBox )UnoRuntime.queryInterface(
                XCheckBox.class, objectCheckBox );
            xCheckBox.addItemListener((XItemListener) new ItemListenerImpl( xControlCont ) );
        }
     
        // create a peer
        Object toolkit = xMultiComponentFactory.createInstanceWithContext(
            "com.sun.star.awt.ExtToolkit", _xComponentContext );     
View Full Code Here


        tEnv.addObjRelation("MODEL", the_Model);

        // adding object relation for XItemListener
        ifc.awt._XItemListener.TestItemListener listener =
                new ifc.awt._XItemListener.TestItemListener();
        XCheckBox check = (XCheckBox) UnoRuntime.queryInterface(
                                  XCheckBox.class, oObj);
        check.addItemListener(listener);
        tEnv.addObjRelation("TestItemListener", listener);

        System.out.println("ImplementationName: " + utils.getImplName(oObj));

        try {
View Full Code Here

        tEnv.addObjRelation("MODEL",the_Model);

        // Adding relation for XItemListener
        ifc.awt._XItemListener.TestItemListener listener =
            new ifc.awt._XItemListener.TestItemListener() ;
        XCheckBox box = (XCheckBox) UnoRuntime.queryInterface
            (XCheckBox.class, oObj) ;
        box.addItemListener(listener) ;
        tEnv.addObjRelation("TestItemListener", listener) ;

        // Adding relation for XWindow
        XWindow forObjRel = (XWindow)
                            UnoRuntime.queryInterface(XWindow.class,aControl);
View Full Code Here

        tEnv.addObjRelation("MODEL", the_Model);

        // adding object relation for XItemListener
        ifc.awt._XItemListener.TestItemListener listener =
                new ifc.awt._XItemListener.TestItemListener();
        XCheckBox check = (XCheckBox) UnoRuntime.queryInterface(
                                  XCheckBox.class, oObj);
        check.addItemListener(listener);
        tEnv.addObjRelation("TestItemListener", listener);

        System.out.println("ImplementationName: " + utils.getImplName(oObj));

        try {
View Full Code Here

     
        if ( checkBoxDialog )
        {
            // add to checkbox
            Object objectCheckBox = xControlCont.getControl( _checkBoxName );
            XCheckBox xCheckBox = ( XCheckBox )UnoRuntime.queryInterface(
                XCheckBox.class, objectCheckBox );
            xCheckBox.addItemListener((XItemListener) new ItemListenerImpl( xControlCont ) );
        }
     
        // create a peer
        Object toolkit = xMultiComponentFactory.createInstanceWithContext(
            "com.sun.star.awt.ExtToolkit", _xComponentContext );     
View Full Code Here

        tEnv.addObjRelation("MODEL",the_Model);

        // Adding relation for XItemListener
        ifc.awt._XItemListener.TestItemListener listener =
            new ifc.awt._XItemListener.TestItemListener() ;
        XCheckBox box = (XCheckBox) UnoRuntime.queryInterface
            (XCheckBox.class, oObj) ;
        box.addItemListener(listener) ;
        tEnv.addObjRelation("TestItemListener", listener) ;

        // Adding relation for XWindow
        XWindow forObjRel = (XWindow)
                            UnoRuntime.queryInterface(XWindow.class,aControl);
View Full Code Here

        tEnv.addObjRelation("MODEL", the_Model);

        // adding object relation for XItemListener
        ifc.awt._XItemListener.TestItemListener listener =
                new ifc.awt._XItemListener.TestItemListener();
        XCheckBox check = (XCheckBox) UnoRuntime.queryInterface(
                                  XCheckBox.class, oObj);
        check.addItemListener(listener);
        tEnv.addObjRelation("TestItemListener", listener);

        System.out.println("ImplementationName: " + utils.getImplName(oObj));

        try {
View Full Code Here

     
        if ( checkBoxDialog )
        {
            // add to checkbox
            Object objectCheckBox = xControlCont.getControl( _checkBoxName );
            XCheckBox xCheckBox = ( XCheckBox )UnoRuntime.queryInterface(
                XCheckBox.class, objectCheckBox );
            xCheckBox.addItemListener((XItemListener) new ItemListenerImpl( xControlCont ) );
        }
     
        // create a peer
        Object toolkit = xMultiComponentFactory.createInstanceWithContext(
            "com.sun.star.awt.ExtToolkit", _xComponentContext );     
View Full Code Here

        return _sElementName;
    }
   
   
    public XCheckBox insertCheckBox(XItemListener _xItemListener, int _nPosX, int _nPosY, int _nWidth){
        XCheckBox xCheckBox = null;
        try{
            // create a unique name by means of an own implementation...
            String sName = createUniqueName(m_xDlgModelNameContainer, "CheckBox");
           
            // create a controlmodel at the multiservicefactory of the dialog model...
            Object oCBModel = m_xMSFDialogModel.createInstance("com.sun.star.awt.UnoControlCheckBoxModel");
           
            // Set the properties at the model - keep in mind to pass the property names in alphabetical order!
            XMultiPropertySet xCBMPSet = (XMultiPropertySet) UnoRuntime.queryInterface(XMultiPropertySet.class, oCBModel);
            xCBMPSet.setPropertyValues(
                    new String[]  {"Height", "Label", "Name", "PositionX", "PositionY", "Width" } ,
                    new Object[] {new Integer(8), "~Include page number", sName, new Integer(_nPosX), new Integer(_nPosY), new Integer(_nWidth)});
           
            // The following property may also be set with XMultiPropertySet but we
            // use the XPropertySet interface merely for reasons of demonstration
            XPropertySet xCBModelPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xCBMPSet);
            xCBModelPSet.setPropertyValue("TriState", Boolean.TRUE);
            xCBModelPSet.setPropertyValue("State", new Short((short) 1));
           
            // add the model to the NameContainer of the dialog model
            m_xDlgModelNameContainer.insertByName(sName, oCBModel);
            XControl xCBControl = m_xDlgContainer.getControl(sName);
            xCheckBox = (XCheckBox) UnoRuntime.queryInterface(XCheckBox.class, xCBControl);
            // An ActionListener will be notified on the activation of the button...
            xCheckBox.addItemListener(_xItemListener);
        } catch (com.sun.star.uno.Exception ex) {
            /* perform individual exception handling here.
             * Possible exception types are:
             * com.sun.star.lang.IllegalArgumentException,
             * com.sun.star.lang.WrappedTargetException,
 
View Full Code Here

   
   
    public void itemStateChanged(ItemEvent itemEvent) {
        try{
            // retrieve the control that the event has been invoked at...
            XCheckBox xCheckBox = (XCheckBox) UnoRuntime.queryInterface(XCheckBox.class, itemEvent.Source);
            // retrieve the control that we want to disable or enable
            XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, m_xDlgContainer.getControl("CommandButton1"));
            XPropertySet xModelPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xControl.getModel());
            short nState = xCheckBox.getState();
            boolean bdoEnable = true;
            switch (nState){
                case 1:     // checked
                    bdoEnable = true;
                    break;
View Full Code Here

TOP

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

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.