Examples of TextPresentation


Examples of org.eclipse.jface.text.TextPresentation

public class PyInformationPresenterTest extends TestCase {

    public void testStyleRanges() throws Exception {
        PyInformationPresenter presenter = new PyInformationPresenter();
        TextPresentation presentation = new TextPresentation();
        String str = "<pydev_hint_bold>bold</pydev_hint_bold> <pydev_link link=\"itemPointer\">link</pydev_link>";
        String handled = presenter.handlePydevTags(presentation, str);
        assertEquals("bold link", handled);
        Iterator it = presentation.getAllStyleRangeIterator();
        ArrayList<String> tagsReplaced = new ArrayList<String>();

        ArrayList<String> expected = new ArrayList<String>();
        expected.add("<pydev_hint_bold>");
        expected.add("<pydev_link link=\"itemPointer\">");
View Full Code Here

Examples of org.eclipse.jface.text.TextPresentation

    frame.fValidator.install(frame.fInformation, fViewer, frame.fOffset);

    if (frame.fPresenter != null) {
      if (fTextPresentation == null)
        fTextPresentation= new TextPresentation();
      frame.fPresenter.install(frame.fInformation, fViewer, frame.fBeginOffset);
      frame.fPresenter.updatePresentation(frame.fOffset, fTextPresentation);
    }

    createContextInfoPopup();
View Full Code Here

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

Examples of org.eclipse.jface.text.TextPresentation

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

Examples of org.eclipse.jface.text.TextPresentation

    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

Examples of org.eclipse.jface.text.TextPresentation

    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

Examples of org.eclipse.jface.text.TextPresentation

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

Examples of org.eclipse.jface.text.TextPresentation

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

Examples of org.eclipse.sapphire.ui.forms.swt.internal.TextPresentation

        return (String) this.contentFunctionResult.value();
    }

    public FormComponentPresentation createPresentation( final SwtPresentation parent, final Composite composite )
    {
        return new TextPresentation( this, parent, composite );
    }
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.