Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.TextPresentation


   *         <code>null</code> if the partitioning could not be computed
   */
  protected TextPresentation createPresentation(IRegion damage, IDocument document) {
    try {
      if (fRepairers == null || fRepairers.isEmpty()) {
        TextPresentation presentation= new TextPresentation(damage, 100);
        presentation.setDefaultStyleRange(new StyleRange(damage.getOffset(), damage.getLength(), null, null));
        return presentation;
      }

      TextPresentation presentation= new TextPresentation(damage, 1000);

      ITypedRegion[] partitioning= TextUtilities.computePartitioning(document, getDocumentPartitioning(), damage.getOffset(), damage.getLength(), false);
      for (int i= 0; i < partitioning.length; i++) {
        ITypedRegion r= partitioning[i];
        IPresentationRepairer repairer= getRepairer(r.getType());
View Full Code Here


   * @param damage the damage to be repaired
   * @param document the document whose presentation must be repaired
   */
  private void processDamage(IRegion damage, IDocument document) {
    if (damage != null && damage.getLength() > 0) {
      TextPresentation p= createPresentation(damage, document);
      if (p != null)
        applyTextRegionCollection(p);
    }
  }
View Full Code Here

    fContentAssistSubjectControlAdapter.installValidator(frame);

    if (frame.fPresenter != null) {
      if (fTextPresentation == null)
        fTextPresentation= new TextPresentation();
      fContentAssistSubjectControlAdapter.installContextInformationPresenter(frame);
      frame.fPresenter.updatePresentation(frame.fOffset, fTextPresentation);
    }

    createContextInfoPopup();
View Full Code Here

    int height= trim.height;

    //FIXME: The HTML2TextReader does not render <p> like a browser.
    // Instead of inserting an empty line, it just adds a single line break.
    // Furthermore, the indentation of <dl><dd> elements is too small (e.g with a long @see line)
    TextPresentation presentation= new TextPresentation();
    HTML2TextReader reader= new HTML2TextReader(new StringReader(fInput.getHtml()), presentation);
    String text;
    try {
      text= reader.getString();
    } catch (IOException e) {
      text= ""; //$NON-NLS-1$
    }

    fTextLayout.setText(text);
    fTextLayout.setWidth(sizeConstraints == null ? SWT.DEFAULT : sizeConstraints.x - trim.width);
    Iterator iter= presentation.getAllStyleRangeIterator();
    while (iter.hasNext()) {
      StyleRange sr= (StyleRange)iter.next();
      if (sr.fontStyle == SWT.BOLD)
        fTextLayout.setStyle(fBoldStyle, sr.start, sr.start + sr.length - 1);
    }
View Full Code Here

   * (org.eclipse.swt.widgets.Shell)
   */
  public IInformationControl createInformationControl(Shell parent) {
    fControl = new PHPSourceViewerInformationControl(parent, fOrientation) {
      public void setInformation(String content) {
        TextPresentation presentation = new TextPresentation();
        HTML2TextReader reader = new HTML2TextReader(new StringReader(
            content), presentation);
        try {
          super.setInformation(reader.getString());
        } catch (IOException e) {
View Full Code Here

      public void controlResized(ControlEvent e) {
        setJavadocInput(mainViewer.getSelection());
      }
    });
    htmlPresenter = new HTMLTextPresenter(false);
    textPresentation = new TextPresentation();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.TextPresentation

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.