Package com.sun.star.container

Examples of com.sun.star.container.XIndexContainer


      if (form != null && formComponent != null) {
        XFormsSupplier formsSupplier = (XFormsSupplier) UnoRuntime
            .queryInterface(XFormsSupplier.class, xDrawPage);
        if (formsSupplier != null) {
          XNameContainer nameContainer = formsSupplier.getForms();
          XIndexContainer indexContainer = (XIndexContainer) UnoRuntime
              .queryInterface(XIndexContainer.class,
                  nameContainer);
          int len = indexContainer.getCount();
          for (int i = 0; i < len; i++) {
            XForm tmpForm = (XForm) UnoRuntime.queryInterface(
                XForm.class, indexContainer.getByIndex(i));
            if (tmpForm != null
                && UnoRuntime.areSame(form.getXFormComponent(),
                    tmpForm)) {
              XIndexContainer container = (XIndexContainer) UnoRuntime
                  .queryInterface(XIndexContainer.class,
                      tmpForm);
              int lenFormPComponents = container.getCount();
              for (int j = 0; j < lenFormPComponents; j++) {
                Object tmpObject = container.getByIndex(j);
                if (tmpObject != null) {
                  XFormComponent tmpFormComponent = (XFormComponent) UnoRuntime
                      .queryInterface(
                          XFormComponent.class,
                          tmpObject);
View Full Code Here


    try {
      if(formName != null) {
        XFormsSupplier formsSupplier = (XFormsSupplier) UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage);
        if(formsSupplier != null) {
          XNameContainer nameContainer = formsSupplier.getForms();
          XIndexContainer indexContainer = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, nameContainer);
          int len = indexContainer.getCount();
          List forms = new ArrayList();
          for(int i = 0; i < len; i++) {
            Object tmpForm = indexContainer.getByIndex(i);
            if(tmpForm != null) {             
              XNamed tmpNamed =
                (XNamed) UnoRuntime.queryInterface(XNamed.class, tmpForm);
              if(tmpNamed != null && tmpNamed.getName().equalsIgnoreCase(formName)) {
                XFormComponent tmpFormComponent =
View Full Code Here

    try {
      if(form != null) {
        XFormsSupplier formsSupplier = (XFormsSupplier) UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage);
        if(formsSupplier != null) {
          XNameContainer nameContainer = formsSupplier.getForms();
          XIndexContainer indexContainer = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, nameContainer);
          int len = indexContainer.getCount();
          for(int i = 0; i < len; i++) {
            XForm tmpForm = (XForm) UnoRuntime.queryInterface(XForm.class, indexContainer.getByIndex(i));
            if(tmpForm != null && UnoRuntime.areSame(form.getXFormComponent(),tmpForm)) {
              XEventAttacherManager tmpEventAttacherManager =
                (XEventAttacherManager) UnoRuntime.queryInterface(XEventAttacherManager.class, tmpForm);
              return tmpEventAttacherManager;
            }
View Full Code Here

    try {
      if(form!= null && formComponent != null) {
        XFormsSupplier formsSupplier = (XFormsSupplier) UnoRuntime.queryInterface(XFormsSupplier.class, xDrawPage);
        if(formsSupplier != null) {
          XNameContainer nameContainer = formsSupplier.getForms();
          XIndexContainer indexContainer = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, nameContainer);
          int len = indexContainer.getCount();
          for(int i = 0; i < len; i++) {
            XForm tmpForm = (XForm) UnoRuntime.queryInterface(XForm.class, indexContainer.getByIndex(i));
            if(tmpForm != null && UnoRuntime.areSame(form.getXFormComponent(),tmpForm)) {   
              XIndexContainer container = (XIndexContainer) UnoRuntime.queryInterface(XIndexContainer.class, tmpForm);
              int lenFormPComponents = container.getCount();          
              for(int j = 0; j < lenFormPComponents; j++) {
                Object tmpObject = container.getByIndex(j);
                if(tmpObject != null) {
                  XFormComponent tmpFormComponent = (XFormComponent) UnoRuntime.queryInterface(XFormComponent.class, tmpObject);
                  if(tmpFormComponent != null && UnoRuntime.areSame(tmpFormComponent,formComponent.getXFormComponent()))
                    return j;
                }
View Full Code Here

      XNameContainer xNameContainer = xCustPresSupplier.getCustomPresentations();
      XSingleServiceFactory xFactory = (XSingleServiceFactory)
        UnoRuntime.queryInterface( XSingleServiceFactory.class, xNameContainer );

      Object      xObj;
      XIndexContainer xContainer;

      /* instanciate an IndexContainer that will take
         a list of draw pages for the first custom show */
      xObj = xFactory.createInstance();
        xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
      for ( i = 5; i < 10; i++ )
        xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
      xNameContainer.insertByName( "ShortVersion", xContainer );

      /* instanciate an IndexContainer that will take
         a list of draw page for the second custom show */
      xObj = xFactory.createInstance();
        xContainer = (XIndexContainer)UnoRuntime.queryInterface( XIndexContainer.class, xObj );
      for ( i = 1; i < 10; i++ )
        xContainer.insertByIndex( xContainer.getCount(), xDrawPages.getByIndex( i ) );
      xNameContainer.insertByName( "LongVersion", xContainer );

      /* which custom show is to use
         can been set in the presentation settings */

 
View Full Code Here

    /** 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

        } catch (com.sun.star.lang.IllegalArgumentException e) {
            e.printStackTrace(log);
            throw new StatusException("Couldn't get by index", e);
        }

        XIndexContainer aIContainer = (XIndexContainer)
            UnoRuntime.queryInterface(XIndexContainer.class,oInstance);

        try {
            aIContainer.insertByIndex(0, oDrawPage);
        } catch (com.sun.star.lang.WrappedTargetException e){
            e.printStackTrace(log);
            throw new StatusException("Could't insert DrawPage", e);
        } catch (com.sun.star.lang.IllegalArgumentException e){
            e.printStackTrace(log);
View Full Code Here

                    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

        final String i_interfaceMethod, final String i_scriptURI )
    {
        try
        {
            final XChild modelAsChild = UnoRuntime.queryInterface( XChild.class, i_controlModel );
            final XIndexContainer parentForm = UnoRuntime.queryInterface( XIndexContainer.class, modelAsChild.getParent() );

            final XEventAttacherManager manager = UnoRuntime.queryInterface( XEventAttacherManager.class, parentForm );

            int containerPosition = -1;
            for ( int i = 0; i < parentForm.getCount(); ++i )
            {
                final XPropertySet child = UnoRuntime.queryInterface( XPropertySet.class, parentForm.getByIndex( i ) );
                if ( UnoRuntime.areSame( child, i_controlModel ) )
                {
                    containerPosition = i;
                    break;
                }
View Full Code Here

     */
    public void _ImageMap() {
        boolean result = true;

        try {
            XIndexContainer imgMap = (XIndexContainer) UnoRuntime.queryInterface(
                                             XIndexContainer.class,
                                             oObj.getPropertyValue("ImageMap"));
            int previous = imgMap.getCount();
            log.println("Count (previous) " + previous);

            Object im = tEnv.getObjRelation("IMGMAP");
            imgMap.insertByIndex(0, im);
            oObj.setPropertyValue("ImageMap", imgMap);
            imgMap = (XIndexContainer) UnoRuntime.queryInterface(
                             XIndexContainer.class,
                             oObj.getPropertyValue("ImageMap"));

            int after = imgMap.getCount();
            log.println("Count (after) " + after);
            result = previous < after;
        } catch (Exception ex) {
            result = false;
        }
View Full Code Here

TOP

Related Classes of com.sun.star.container.XIndexContainer

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.