Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.StyledString


    return new StyledString(element.errorDescription);
  }
 
  @Override
  public StyledString visitDepElement(DubDependencyElement element) {
    StyledString baseString = new StyledString(element.getBundleName());
    baseString = appendVersionString(baseString, element.getDubBundle());
    return baseString.append(" - " + element.getDubBundle().getLocationString(), fgColor(DUB_LOCATION_ANNOTATION_FG));
  }
View Full Code Here


    return baseString.append(" - " + element.getDubBundle().getLocationString(), fgColor(DUB_LOCATION_ANNOTATION_FG));
  }
 
  @Override
  public StyledString visitDepSourceFolderElement(DubDepSourceFolderElement element) {
    return new StyledString(element.getSourceFolderLocalPath().toString());
  }
View Full Code Here

    return new StyledString(element.getSourceFolderLocalPath().toString());
  }
 
  @Override
  public StyledString visitDubManifestFile(IFile element) {
    StyledString baseString = new StyledString(element.getName());
    DubBundleDescription bundleInfo = DeeCore.getWorkspaceModel().getBundleInfo(element.getProject());
    if(bundleInfo == null) {
      return null;
    }
    return appendVersionString(baseString, bundleInfo.getMainBundle());
View Full Code Here

  }
 
  @Override
  public StyledString visitModelElement(IModelElement element, IParent elementAsParent) {
    // TODO
    return new StyledString(element.getElementName());
  }
View Full Code Here

  // }
  @Test public void should_return_label_for_literal() {
    Literal literal = xtext.find("HOME", Literal.class);
    Object label = labels.labelFor(literal);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("HOME [0]"));
   }
View Full Code Here

  // }
  @Test public void should_return_label_for_field() {
    MessageField field = xtext.find("type", MessageField.class);
    Object label = labels.labelFor(field);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("type [1] : Type"));
  }
View Full Code Here

  // }
  @Test public void should_return_label_for_field_with_unresolved_type() {
    MessageField field = xtext.find("type", MessageField.class);
    Object label = labels.labelFor(field);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("type [1] : <unresolved>"));
  }
View Full Code Here

  // }
  @Test public void should_return_label_for_rpc() {
    Rpc rpc = xtext.findFirst(Rpc.class);
    Object label = labels.labelFor(rpc);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("PersonRpc : Person > Type"));
  }
View Full Code Here

  // }
  @Test public void should_return_label_for_rpc_with_unresolved_argument_type() {
    Rpc rpc = xtext.findFirst(Rpc.class);
    Object label = labels.labelFor(rpc);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("PersonRpc : <unresolved> > Type"));
  }
View Full Code Here

  // }
  @Test public void should_return_label_for_rpc_with_unresolved_return_type() {
    Rpc rpc = xtext.findFirst(Rpc.class);
    Object label = labels.labelFor(rpc);
    assertThat(label, instanceOf(StyledString.class));
    StyledString labelText = (StyledString) label;
    assertThat(labelText.getString(), equalTo("PersonRpc : Person > <unresolved>"));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.StyledString

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.