Examples of TextSelection


Examples of org.eclipse.jface.text.TextSelection

          if (newNode instanceof IndexedRegion) {
            IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
            newRegion = new Region(newIndexedRegion.getStartOffset(), textSelection.getOffset() + textSelection.getLength() - newIndexedRegion.getStartOffset());

            if (newNode.getNodeType() == Node.TEXT_NODE) {
              newRegion = getNewSelectionRegion(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
            }
          }
        }

      }
View Full Code Here

Examples of org.eclipse.jface.text.TextSelection

        if (newNode instanceof IndexedRegion) {
          IndexedRegion newIndexedRegion = (IndexedRegion) newNode;
          newRegion = new Region(textSelection.getOffset(), newIndexedRegion.getEndOffset() - textSelection.getOffset());

          if (newNode.getNodeType() == Node.TEXT_NODE) {
            newRegion = getNewSelectionRegion2(newIndexedRegion, new TextSelection(newRegion.getOffset(), newRegion.getLength()));
          }
        }
      }
    }
    return newRegion;
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.search.TextSelection

  @Test
  public void testGetInstance() {
    //get the text content contains "cell"
    TextNavigation search = new TextNavigation("cell", odtdoc);
    while (search.hasNext()) {
      TextSelection item = (TextSelection) search.getCurrentItem();
      OdfElement containerEle = item.getContainerElement();
      if (containerEle instanceof OdfTextParagraph) {
        Node ele = containerEle.getParentNode();
        if (ele instanceof TableTableCellElement) {
          OdfTableCell cell = OdfTableCell.getInstance((TableTableCellElementBase) ele);
          Assert.assertTrue(cell.getStringValue().contains("cell"));
View Full Code Here

Examples of org.odftoolkit.simple.common.navigation.TextSelection

  public void testSpan() {
    try {
      TextDocument doc = TextDocument.newTextDocument();
      doc.addParagraph("This is a test paragraph!");
      TextNavigation navigation = new TextNavigation("test", doc);
      TextSelection sel = (TextSelection) navigation.nextSelection();
      Span span = Span.newSpan(sel);
      TextHyperlink link = span.applyHyperlink(new URI("http://www.ibm.com"));
      DefaultStyleHandler handler = span.getStyleHandler();
      Font font1Base = new Font("Arial", FontStyle.ITALIC, 10, Color.BLACK, TextLinePosition.THROUGH);
      handler.getTextPropertiesForWrite().setFont(font1Base);
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.