Examples of replaceText()


Examples of org.apache.poi.hwpf.usermodel.Range.replaceText()

    public void testUpdateText()
    {
        HWPFDocument doc = HWPFTestDataSamples.openSampleFile( "pageref.doc" );
        Bookmark bookmark = doc.getBookmarks().getBookmark( 0 );
        Range range = new Range( bookmark.getStart(), bookmark.getEnd(), doc );
        range.replaceText( "destination", "1destin2ation3" );

        bookmark = doc.getBookmarks().getBookmark( 0 );
        assertEquals( "userref", bookmark.getName() );
        assertEquals( 27, bookmark.getStart() );
        assertEquals( 41, bookmark.getEnd() );
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

    // requester.
    // Otherwise, if requester is not identical,
    // the undo group gets "broken" into multiple pieces based
    // on the requesters being different. Technically, any unique, common
    // requester object would work.
    structuredDocument.replaceText(structuredDocument, startOffset + offset, length, source);
  }

  /**
   */
  protected void replaceSource(IDOMModel model, int offset, int length, String source) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

    // requester.
    // Otherwise, if requester is not identical,
    // the undo group gets "broken" into multiple pieces based
    // on the requesters being different. Technically, any unique, common
    // requester object would work.
    structuredDocument.replaceText(structuredDocument, offset, length, source);
  }

  /**
   */
  protected void setWidth(HTMLFormatContraints contraints, String source) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

            IStructuredDocument structuredDocument = structuredModel.getStructuredDocument();

            int startTagStartOffset = newNode.getStartOffset();
            int offset = endTagStructuredDocumentRegion.getStart();
            int length = endTagStructuredDocumentRegion.getLength();
            structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
            newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save

            offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
            structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
            newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

            int length = endTagStructuredDocumentRegion.getLength();
            structuredDocument.replaceText(structuredDocument, offset, length, ""); //$NON-NLS-1$
            newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save

            offset = startTagStructuredDocumentRegion.getStart() + lastRegion.getStart();
            structuredDocument.replaceText(structuredDocument, offset, 0, "/"); //$NON-NLS-1$
            newNode = (IDOMNode) structuredModel.getIndexedRegion(startTagStartOffset); // save
          }
        }
      }
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

    if (structuredDocument == null)
      return;
    int offset = this.element.getStartEndOffset();
    int end = this.element.getEndStartOffset();
    int length = end - offset;
    structuredDocument.replaceText(model, offset, length, source);
  }
}
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

    if (structuredDocument.containsReadOnly(offset, length))
      return result;
    if (requester == null) {
      requester = structuredDocument;
    }
    return structuredDocument.replaceText(requester, offset, length, source);
  }

  protected Preferences getModelPreferences() {
    return HTMLCorePlugin.getDefault().getPluginPreferences();
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

                // String(buffer, 0, nRead));
              }
            }
            // ignore read-only settings if reverting whole
            // document
            innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
            model.setDirtyState(false);

          }
          catch (CoreException e) {
            Logger.logException(e);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

          }
          else {
            stringBuffer.append(buffer, 0, nRead);
          }
        }
        innerdocument.replaceText(this, 0, originalLengthToReplace, stringBuffer.toString(), true);
      }
      catch (CoreException e) {
        Logger.logException(e);
      }
      catch (IOException e) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replaceText()

        break;

    if (start == oldData.length() && start == data.length())
      return; // no change
    else if (start == oldData.length()) {
      structuredDocument.replaceText(getRequesterH2C(), start, 0, data.substring(start)); // append text to last
    }
    else if (start == data.length()) {
      structuredDocument.replaceText(getRequesterH2C(), start, oldData.length() - start, ""); // remove text of last //$NON-NLS-1$
    }
    else {
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.