Examples of XIndexContainer


Examples of com.sun.star.container.XIndexContainer

            is an implementation detail) applies.
    */
    public XIndexContainer createSiblingForm( Object aForm, String sInitialName ) throws com.sun.star.uno.Exception
    {
        // get the parent
        XIndexContainer xContainer = (XIndexContainer)dbfTools.getParent(
            aForm, XIndexContainer.class );
        // append a new form to this parent container
        return createSubForm( xContainer, sInitialName );
    }
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

    * Gets glue points collection. <p>
    * Has <b> OK </b> status if the value returned is not null. <p>
    */
    public void _getGluePoints(){
        boolean result = true;
        XIndexContainer points = null;

        log.println("testing getDrawPages() ... ");

        points = oObj.getGluePoints();
        result = points != null;
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

                    PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry(
                    "Trigger Event", xMenuBarSettings, xMSF, log);
                    _XUIConfigurationManager.createMenuBarItem("Click for Macro",
                    (XIndexContainer)UnoRuntime.queryInterface(
                    XIndexContainer.class, prop[3].Value), log);
                    XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings);
                    x.insertByIndex(x.getCount(), prop);
                    xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings);
                    xUIManager.reset();
                }
            }
            catch(com.sun.star.container.NoSuchElementException e) {
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

        try {
            oInterface = xMSF.createInstance
                ( "com.sun.star.ucb.DataContainer" );

            // adding one child container
            XIndexContainer xIC = (XIndexContainer) UnoRuntime.queryInterface
                (XIndexContainer.class, oInterface) ;

            Object child = xMSF.createInstance
                ( "com.sun.star.ucb.DataContainer" );
            xIC.insertByIndex(0, child) ;

            relationContainer = xMSF.createInstance
                ( "com.sun.star.ucb.DataContainer" );

            xIn = xMSF.createInstance
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

                PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry(
                                        "Trigger Event", xMenuBarSettings, xMSF, log);
                _XUIConfigurationManager.createMenuBarItem("Click for Macro",
                                (XIndexContainer)UnoRuntime.queryInterface(
                                XIndexContainer.class, prop[3].Value), log);
                XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings);
                x.insertByIndex(x.getCount(), prop);
                xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings);
                xUIManager.reset();
            }
            catch(com.sun.star.container.NoSuchElementException e) {
                log.println("_XUIConfiguration.XUIConfigurationListenerImpl: Exception.");
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

  */
  XPropertySet createGridColumn( Object aGridModel, String sColumnService, String sDataField, int nWidth )
    throws com.sun.star.uno.Exception
  {
    // the container to insert columns into
    XIndexContainer xColumnContainer = UNO.queryIndexContainer( aGridModel );
    // the factory for creating column models
    XGridColumnFactory xColumnFactory = (XGridColumnFactory)UnoRuntime.queryInterface(
      XGridColumnFactory.class, aGridModel );

    // (let) create the new col
    XInterface xNewCol = (XInterface)xColumnFactory.createColumn( sColumnService );
    XPropertySet xColProps = UNO.queryPropertySet( xNewCol );

    // some props
    // the field the column is bound to
    xColProps.setPropertyValue( "DataField", sDataField );
    // the "display name" of the column
    xColProps.setPropertyValue( "Label", sDataField );
    // the name of the column within it's parent
    xColProps.setPropertyValue( "Name", sDataField );

    if ( nWidth > 0 )
      xColProps.setPropertyValue( "Width", new Integer( nWidth * 10 ) );

    // insert
    xColumnContainer.insertByIndex( xColumnContainer.getCount(), xNewCol );

    // outta here
    return xColProps;
  }
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

        // --------------------------------------------------------------
    // create a sub for for the sales

    // for this, first create a sub form and bind it to the SALES table
    XIndexContainer xSalesForm = m_document.createSubForm( m_xMasterForm, "Sales" );
    XPropertySet xSalesFormProps = UNO.queryPropertySet( xSalesForm );

    xSalesFormProps.setPropertyValue( "DataSourceName", m_database.getDocumentURL() );
    xSalesFormProps.setPropertyValue( "CommandType", new Integer( CommandType.COMMAND ) );

    String sCommand = new String( "SELECT * FROM " );
    sCommand += s_tableNameSales;
    sCommand += " WHERE " + s_tableNameSales + ".SNR = :salesmen";
    xSalesFormProps.setPropertyValue( "Command", sCommand );

    // the master-details connection
    String[] aMasterFields = new String[] { "SNR" };    // the field in the master form
    String[] aDetailFields = new String[] { "salesmen" }// the name in the detail form
    xSalesFormProps.setPropertyValue( "MasterFields", aMasterFields );
    xSalesFormProps.setPropertyValue( "DetailFields", aDetailFields );

    // the create thr grid model
        XPropertySet xSalesGridModel = m_formLayer.createControlAndShape( "GridControl", 2, 80, 162, 40, xSalesForm );
    xSalesGridModel.setPropertyValue( "Name", "SalesTable" );
    XPropertySet xKeyColumn     =  createGridColumn( xSalesGridModel, "NumericField", "SALENR", 12 );
    XPropertySet xCustomerColumn =  createGridColumn( xSalesGridModel, "ListBox", "COS_NR", 40 );
    XPropertySet xSalesNameColumn =  createGridColumn( xSalesGridModel, "TextField", "NAME", 25 );
                    createGridColumn( xSalesGridModel, "DateField", "SALEDATE", 24 );
                    createGridColumn( xSalesGridModel, "CurrencyField", "PRICE", 16 );

      // please note that a better solution for the SALEDATE field would have been to use
      // a FormattedField. But we want to demonstrate some effects with DateFields here ...

    m_aSalesNameValidator = new GridFieldValidator( m_xCtx, xSalesNameColumn );
    m_aSalesNameValidator.enableColumnWatch( m_bAllowEmptySales );

    xKeyColumn.setPropertyValue( "DecimalAccuracy", new Short( (short)0 ) );

    // init the list box which is for choosing the customer a sale belongs to
    xCustomerColumn.setPropertyValue( "BoundColumn", new Short( (short)1 ) );
    xCustomerColumn.setPropertyValue( "Label", "Customer" );
    xCustomerColumn.setPropertyValue( "ListSourceType", ListSourceType.SQL );

    String sListSource = "SELECT LASTNAME, COS_NR FROM ";
    sListSource += s_tableNameCustomers;
    String[] aListSource = new String[] { sListSource };
    xCustomerColumn.setPropertyValue( "ListSource", aListSource );

    // We want to demonstrate how to reset fields to NULL, we do this with the SALEDATE field
    // above. For this, we add as reset listener to the form
    XReset xFormReset = UNO.queryReset( xSalesForm );
    xFormReset.addResetListener( this );


        // --------------------------------------------------------------
    // the option for filtering the sales form
    XIndexContainer xSalesFilterForm = m_document.createSiblingForm( xSalesForm, "SalesFilter" );
    XPropertySet xSFFProps = UNO.queryPropertySet( xSalesFilterForm );
        XPropertySet xLabel = m_formLayer.createControlAndShape( "FixedText", 2, 125, 35, 6, xSalesFilterForm );
    xLabel.setPropertyValue( "Label", "show only sales since" );
    xLabel.setPropertyValue( "Name", "FilterLabel" );

        XPropertySet xFilterSelection = m_formLayer.createControlAndShape( "ListBox", 40, 125, 59, 6, xSalesFilterForm );
    xFilterSelection.setPropertyValue( "Name", "FilterList" );
    xFilterSelection.setPropertyValue( "LabelControl", xLabel );
        XPropertySet xManualFilter = m_formLayer.createControlAndShape( "DateField", 104, 125, 30, 6, xSalesFilterForm );
    xManualFilter.setPropertyValue( "Name", "ManualFilter" );
        XPropertySet xApplyFilter = m_formLayer.createControlAndShape( "CommandButton", 139, 125, 25, 6, xSalesFilterForm );
    xApplyFilter.setPropertyValue( "Name", "ApplyFilter" );
    xApplyFilter.setPropertyValue( "DefaultButton", new Boolean( true ) );
    m_aSalesFilter = new SalesFilter( m_document, xSalesFormProps, xFilterSelection,
      xManualFilter, xApplyFilter );


        // --------------------------------------------------------------
    // the options section
    // for this, we need a form which is a sibling of our master form (don't want to interfere
    // the controls which represent options only with the controls which are used for data access)

    XIndexContainer xOptionsForm = m_document.createSiblingForm( m_xMasterForm, "Options" );

        xLabel = m_formLayer.createControlAndShape( "GroupBox", 98, 0, 66, 62, xOptionsForm );
    xLabel.setPropertyValue( "Name", "Options" );
    xLabel.setPropertyValue( "Label", "Options" );

View Full Code Here

Examples of com.sun.star.container.XIndexContainer

    /** sets the focus to the first control
    */
    protected void grabControlFocus( ) throws java.lang.Exception
    {
        // the forms container of our document
        XIndexContainer xForms = UNO.queryIndexContainer( m_document.getFormComponentTreeRoot( ) );
        // the first form
        XIndexContainer xForm = UNO.queryIndexContainer( xForms.getByIndex( 0 ) );

        // the first control model which is no FixedText (FixedText's can't have the focus)
        for ( int i = 0; i<xForm.getCount(); ++i )
        {
            XPropertySet xControlProps = UNO.queryPropertySet( xForm.getByIndex( i ) );
            if ( FormComponentType.FIXEDTEXT != ((Short)xControlProps.getPropertyValue( "ClassId" )).shortValue() )
            {
                XControlModel xControlModel = (XControlModel)UnoRuntime.queryInterface(
                    XControlModel.class, xControlProps );
                // set the focus to this control
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

                    PropertyValue[]prop = _XUIConfigurationManager.createMenuBarEntry(
                    "Trigger Event", xMenuBarSettings, xMSF, log);
                    _XUIConfigurationManager.createMenuBarItem("Click for Macro",
                    (XIndexContainer)UnoRuntime.queryInterface(
                    XIndexContainer.class, prop[3].Value), log);
                    XIndexContainer x = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, xMenuBarSettings);
                    x.insertByIndex(x.getCount(), prop);
                    xUIManager.replaceSettings("private:resource/menubar/menubar", xMenuBarSettings);
                    xUIManager.reset();
                }
            }
            catch(com.sun.star.container.NoSuchElementException e) {
View Full Code Here

Examples of com.sun.star.container.XIndexContainer

                tRes.tested("ImageMap", false);
                return;
            }

            Object o = oObj.getPropertyValue("ImageMap");
            XIndexContainer xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, o);
            util.dbg.printInterfaces(xIndexContainer);
            int elementCountFirst = xIndexContainer.getCount();
            xIndexContainer.insertByIndex(elementCountFirst, imapObject);

            // this does not really change the property: the implementation
            // behind "ImageMap" stays the same, but for a real change a C++
            // implementation is needed. See css.lang.XUnoTunnel
            oObj.setPropertyValue("ImageMap", xIndexContainer);
            Object newObject = oObj.getPropertyValue("ImageMap");
            xIndexContainer = (XIndexContainer)UnoRuntime.queryInterface(XIndexContainer.class, newObject);

            int elementCountSecond = xIndexContainer.getCount();
            result = (elementCountFirst + 1 == elementCountSecond);
           
            tRes.tested("ImageMap", result);
        } catch (com.sun.star.beans.UnknownPropertyException e) {
            log.println("Exception while checking 'ImageMap'");
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.