Package com.sun.star.view

Examples of com.sun.star.view.XSelectionSupplier


        log.println("ImplementationName " + utils.getImplName(oObj));

        TestEnvironment tEnv = new TestEnvironment(oObj);

        //selecting the inserted shape
        final XSelectionSupplier SelSupp = (XSelectionSupplier)
                UnoRuntime.queryInterface(XSelectionSupplier.class,xController);

        tEnv.addObjRelation("EventProducer",
            new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
                public void fireEvent() {
                    try {
                        SelSupp.select(oShape);
                    } catch (com.sun.star.lang.IllegalArgumentException iae) {
                        System.out.println("Couldn't select shape");
                    }
                }
            });
View Full Code Here


    * After obtaining object relations 'SELSUPP' and 'TOSELECT', test prepares
    * selection and calls the method. <p>
    * Has <b> OK </b> status if the method does not return null.
    */
    public void _getCurrentSelection() {
        XSelectionSupplier selsupp = (XSelectionSupplier) tEnv.getObjRelation(
                                             "SELSUPP");
        Object toSelect = tEnv.getObjRelation("TOSELECT");
        result = false;

        if (selsupp == null) {
            log.println("No Selection Supplier no show");
        } else {
            try {
                selsupp.select(toSelect);
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                log.println("Exception occured while select:");
                e.printStackTrace(log);

                return;
View Full Code Here

        while (enumeration.hasMoreElements())
        {
            enumeration.nextElement();
            ++count;
        }
        final XSelectionSupplier selSup = (XSelectionSupplier)UnoRuntime.queryInterface(XSelectionSupplier.class, beamer.getController());
        selSup.select(props);
        final com.sun.star.util.XCloseable close = (com.sun.star.util.XCloseable)UnoRuntime.queryInterface(com.sun.star.util.XCloseable.class, frame);
        close.close(false);

        enumeration = evtBc.createEnumeration();
        int count2 = 0;
View Full Code Here

  /** Creates an XSelectionChangeListener and adds it to the active document
   */
  private void initListeners()
  {
    XSelectionSupplier xSelectionSupplier = null;

    if (getFrame() == null) return;

    if (mXSelectionChangeListener == null) {
      try {
View Full Code Here

   * @return The XSelectionSupplier interface of the document frame
   * controller.
   */
  public XSelectionSupplier getSelectionSupplier()
  {
    XSelectionSupplier  selection;
    selection  = (XSelectionSupplier)UnoRuntime.queryInterface(
      XSelectionSupplier.class, mFrame.getController());
    return selection;
  }
View Full Code Here

   */   
  private XIndexAccess getSelectionIndex()
    throws java.lang.Exception
  {
    XIndexAccess xIndexAccess = null;
    XSelectionSupplier xSelectionSupplier = getSelectionSupplier();

    if (xSelectionSupplier == null)
      throw new Exception("queryCurrentPosition: xSelectionSupplier == null");

    try {
      XInterface xInterface = (XInterface) UnoRuntime.queryInterface(
                XInterface.class,xSelectionSupplier.getSelection());
      xIndexAccess = (XIndexAccess)UnoRuntime.queryInterface(
        XIndexAccess.class,xInterface);
    }
    catch( java.lang.Exception e ) {
      e.printStackTrace(System.err);
View Full Code Here

            XFrame xframe = xdesktop.getCurrentFrame();
           
            // Getting the controller.
            XController xcontroller = xframe.getController();
           
            XSelectionSupplier xselectionsupplier =
            ( XSelectionSupplier ) UnoRuntime.queryInterface(
            XSelectionSupplier.class, xcontroller );
           
            Object objectSelection = xselectionsupplier.getSelection();
           
            XServiceInfo xserviceinfo = ( XServiceInfo )
            UnoRuntime.queryInterface( XServiceInfo.class,
            objectSelection );
           
View Full Code Here

        throw new DocumentException("Invalid zoom value. Use values between 20 and 600.");

      XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, getXComponent());
      if (xModel != null) {
        XController xController = xModel.getCurrentController();
        XSelectionSupplier selectionSupplier = (XSelectionSupplier) UnoRuntime.queryInterface(XSelectionSupplier.class,
            xController);
        if (selectionSupplier != null) {
          XViewSettingsSupplier viewSettingsSupplier = (XViewSettingsSupplier) UnoRuntime.queryInterface(XViewSettingsSupplier.class,
              xController);
          if (viewSettingsSupplier != null) {
View Full Code Here

            .getCell();
        if (thisCompareRangeCell != null
            && textRangeToCompareCell == null) {
          XTextContent textTable = thisCompareRangeCell
              .getTextTable().getXTextContent();
          XSelectionSupplier selectionSupplier = (XSelectionSupplier) UnoRuntime
              .queryInterface(XSelectionSupplier.class,
                  textDocument.getXTextDocument()
                      .getCurrentController());
          selectionSupplier.select(textTable);
          XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime
              .queryInterface(XTextViewCursorSupplier.class,
                  textDocument.getXTextDocument()
                      .getCurrentController());
          xTextViewCursorSupplier.getViewCursor().goLeft((short) 1,
              false);
          thisCompareRange = textDocument.getViewCursorService()
              .getViewCursor().getTextCursorFromEnd().getEnd();
        } else if (textRangeToCompareCell != null
            && thisCompareRangeCell == null) {
          XTextContent textTable = textRangeToCompareCell
              .getTextTable().getXTextContent();
          XSelectionSupplier selectionSupplier = (XSelectionSupplier) UnoRuntime
              .queryInterface(XSelectionSupplier.class,
                  textDocument.getXTextDocument()
                      .getCurrentController());
          selectionSupplier.select(textTable);
          XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime
              .queryInterface(XTextViewCursorSupplier.class,
                  textDocument.getXTextDocument()
                      .getCurrentController());
          xTextViewCursorSupplier.getViewCursor().goLeft((short) 1,
              false);
          textRangeToCompare = textDocument.getViewCursorService()
              .getViewCursor().getTextCursorFromEnd().getEnd();
        } else if (thisCompareRangeCell != null
            && textRangeToCompareCell != null) {
          XTextContent thisCompareRangeTable = thisCompareRangeCell
              .getTextTable().getXTextContent();
          XTextContent textRangeToCompareTable = textRangeToCompareCell
              .getTextTable().getXTextContent();
          boolean sameTable = UnoRuntime.areSame(
              thisCompareRangeTable, textRangeToCompareTable);
          if (sameTable) {
            ITextTableCellName thisCompareRangeCellName = thisCompareRangeCell
                .getName();
            ITextTableCellName textRangeToCompareCellName = textRangeToCompareCell
                .getName();
            int thisCompareRangeCellRow = thisCompareRangeCellName
                .getRowIndex();
            int thisCompareRangeCellCol = thisCompareRangeCellName
                .getColumnIndex();
            int textRangeToCompareCellRow = textRangeToCompareCellName
                .getRowIndex();
            int textRangeToCompareCellCol = textRangeToCompareCellName
                .getColumnIndex();
            if (thisCompareRangeCellRow < textRangeToCompareCellRow)
              return 1;
            else if (thisCompareRangeCellRow > textRangeToCompareCellRow)
              return -1;
            else {
              if (thisCompareRangeCellCol < textRangeToCompareCellCol)
                return 1;
              else if (thisCompareRangeCellCol > textRangeToCompareCellCol)
                return -1;
            }
          } else {
            XSelectionSupplier selectionSupplier = (XSelectionSupplier) UnoRuntime
                .queryInterface(XSelectionSupplier.class,
                    textDocument.getXTextDocument()
                        .getCurrentController());
            selectionSupplier.select(thisCompareRangeTable);
            XTextViewCursorSupplier xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime
                .queryInterface(XTextViewCursorSupplier.class,
                    textDocument.getXTextDocument()
                        .getCurrentController());
            xTextViewCursorSupplier.getViewCursor().goLeft(
                (short) 1, false);
            thisCompareRange = textDocument.getViewCursorService()
                .getViewCursor().getTextCursorFromEnd()
                .getEnd();

            selectionSupplier = (XSelectionSupplier) UnoRuntime
                .queryInterface(XSelectionSupplier.class,
                    textDocument.getXTextDocument()
                        .getCurrentController());
            selectionSupplier.select(textRangeToCompareTable);
            xTextViewCursorSupplier = (XTextViewCursorSupplier) UnoRuntime
                .queryInterface(XTextViewCursorSupplier.class,
                    textDocument.getXTextDocument()
                        .getCurrentController());
            xTextViewCursorSupplier.getViewCursor().goLeft(
View Full Code Here

      XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class,
          getXComponent());
      if (xModel != null) {
        XController xController = xModel.getCurrentController();
        XSelectionSupplier selectionSupplier = (XSelectionSupplier) UnoRuntime
            .queryInterface(XSelectionSupplier.class, xController);
        if (selectionSupplier != null) {
          XViewSettingsSupplier viewSettingsSupplier = (XViewSettingsSupplier) UnoRuntime
              .queryInterface(XViewSettingsSupplier.class,
                  xController);
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.