Package com.sun.star.view

Examples of com.sun.star.view.XSelectionSupplier


        XController cont2 = model2.getCurrentController();

        cont1.getFrame().setName("cont1");
        cont2.getFrame().setName("cont2");

        XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface(
                                         XSelectionSupplier.class, cont1);

        log.println("Adding SelectionSupplier and Shape to select for XModel");
        tEnv.addObjRelation("SELSUPP", sel);
        tEnv.addObjRelation("TOSELECT", the_table);
View Full Code Here


    public void run() {
        boolean bTrying = true;
       
        while( bTrying ) {
            // start listening for selection changes
            XSelectionSupplier aSelSupp = (XSelectionSupplier) UnoRuntime.queryInterface(
                XSelectionSupplier.class,
                (((XModel) UnoRuntime.queryInterface(
                XModel.class, maChartDocument )).getCurrentController()) );
            if( aSelSupp != null ) {
                aSelSupp.addSelectionChangeListener( this );
                System.out.println( "Successfully attached as selection change listener" );
                bTrying = false;
            }
           
            // start listening for death of Controller
View Full Code Here

    // XEventListener (base of XSelectionChangeListener)
    public void disposing( EventObject aSourceObj ) {
        System.out.println( "disposing called.  detaching as listener" );
       
        // stop listening for selection changes
        XSelectionSupplier aCtrl = (XSelectionSupplier) UnoRuntime.queryInterface(
            XSelectionSupplier.class, aSourceObj );
        if( aCtrl != null )
            aCtrl.removeSelectionChangeListener( this );
       
        // remove as dispose listener
        XComponent aComp = (XComponent) UnoRuntime.queryInterface( XComponent.class, aSourceObj );
        if( aComp != null )
            aComp.removeEventListener( this );
View Full Code Here

      // the following code will demonstrate how to
      // make a selection that contains our new created ControlShape
      XModel xModel = (XModel)UnoRuntime.queryInterface( XModel.class,
                                                               xComponent );
      XController xController = xModel.getCurrentController();
      XSelectionSupplier xSelectionSupplier =(XSelectionSupplier)
        UnoRuntime.queryInterface( XSelectionSupplier.class, xController );
      // take care to use the global service factory only and not the one
      // that is provided by the component if you create the ShapeColletion
      XShapes xSelection = (XShapes)UnoRuntime.queryInterface( XShapes.class,
        xOfficeContext.getServiceManager().createInstanceWithContext(
                    "com.sun.star.drawing.ShapeCollection", xOfficeContext ) );
      xSelection.add( xShape );
      xSelectionSupplier.select( xSelection );
    }
    catch( java.lang.Exception ex )
    {
      System.out.println( ex );
    }
View Full Code Here

    public void run() {
        boolean bTrying = true;
       
        while( bTrying ) {
            // start listening for selection changes
            XSelectionSupplier aSelSupp = (XSelectionSupplier) UnoRuntime.queryInterface(
                XSelectionSupplier.class,
                (((XModel) UnoRuntime.queryInterface(
                XModel.class, maChartDocument )).getCurrentController()) );
            if( aSelSupp != null ) {
                aSelSupp.addSelectionChangeListener( this );
                System.out.println( "Successfully attached as selection change listener" );
                bTrying = false;
            }
           
            // start listening for death of Controller
View Full Code Here

    // XEventListener (base of XSelectionChangeListener)
    public void disposing( EventObject aSourceObj ) {
        System.out.println( "disposing called.  detaching as listener" );
       
        // stop listening for selection changes
        XSelectionSupplier aCtrl = (XSelectionSupplier) UnoRuntime.queryInterface(
            XSelectionSupplier.class, aSourceObj );
        if( aCtrl != null )
            aCtrl.removeSelectionChangeListener( this );
       
        // remove as dispose listener
        XComponent aComp = (XComponent) UnoRuntime.queryInterface( XComponent.class, aSourceObj );
        if( aComp != null )
            aComp.removeEventListener( this );
View Full Code Here

        XController cont2 = xModel2.getCurrentController();
       
        cont1.getFrame().setName("cont1");
        cont2.getFrame().setName("cont2");
       
        XSelectionSupplier sel = (XSelectionSupplier) UnoRuntime.queryInterface(
            XSelectionSupplier.class, cont1);
       
        XShape aShape = SOF.createShape(xImpressDoc, 5000, 3500, 7500, 5000,
            "Rectangle");
       
View Full Code Here

        PropertyValue param3 = new PropertyValue();
        param3.Name = "Command";
        param3.Value = "biblio";
        params[2] = param3;
       
        final XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface(
            XSelectionSupplier.class, xCont);
       
       
        final Object[] initArgs = params;
       
        XInterface oObj = null;
       
        try {
            oObj = (XInterface)((XMultiServiceFactory)tParam.getMSF())
            .createInstance("com.sun.star.awt.Toolkit");
        } catch (com.sun.star.uno.Exception e) {
            log.println("Couldn't get toolkit");
            e.printStackTrace(log);
            throw new StatusException("Couldn't get toolkit", e);
        }
       
        XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
            XExtendedToolkit.class, oObj);
       
        AccessibilityTools at = new AccessibilityTools();
       
        XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
            tk.getActiveTopWindow());
       
        XAccessible xRoot = at.getAccessibleObject(xWindow);
       
        oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE,
            "Table");
       
        log.println("ImplementationName: " + util.utils.getImplName(oObj));
       
        TestEnvironment tEnv = new TestEnvironment(oObj);
       
        tEnv.addObjRelation("EventProducer",
            new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
            public void fireEvent() {
                try {
                    xSelect.select(params);
                } catch (com.sun.star.lang.IllegalArgumentException ex) {
                }
            }
        });
       
View Full Code Here

       
        the_frame2.setName("DatasourceBrowser");
       
        XController xCont = the_frame2.getController();
       
        XSelectionSupplier xSelect = (XSelectionSupplier) UnoRuntime.queryInterface(
            XSelectionSupplier.class, xCont);
       
        try {
            xSelect.select(params);
        } catch (com.sun.star.lang.IllegalArgumentException ex) {
            throw new StatusException("Could not select Biblio-Database", ex);
        }
       
        XInterface oObj = null;
View Full Code Here

            XFrame xFrame = this.xTextDocument.getCurrentController().getFrame();
            int ColCount = xTextTable.getColumns().getCount();
            XCellRange xCellRange = (XCellRange) UnoRuntime.queryInterface(XCellRange.class, xTextTable);
            XCellRange xLocCellRange = xCellRange.getCellRangeByPosition(0, 0, ColCount - 1, 1);
            short iHoriOrient = AnyConverter.toShort(Helper.getUnoPropertyValue(xTextTable, "HoriOrient"));
            XSelectionSupplier xSelection = (XSelectionSupplier) UnoRuntime.queryInterface(XSelectionSupplier.class, xTextDocument.getCurrentController());
            xSelection.select(xLocCellRange);
            Desktop.dispatchURL(_xMSF, ".Uno:DistributeColumns", xFrame);
            Desktop.dispatchURL(_xMSF, ".Uno:SetOptimalColumnWidth", xFrame);
            Helper.setUnoPropertyValue(xTextTable, "HoriOrient", new Short(iHoriOrient));
        }
        catch (Exception exception)
View Full Code Here

TOP

Related Classes of com.sun.star.view.XSelectionSupplier

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.