Search in sources :

Example 21 with StyledString

use of org.eclipse.jface.viewers.StyledString in project cubrid-manager by CUBRID.

the class NavigatorTreeLabelProvider method getStyledText.

public StyledString getStyledText(Object element) {
    String text = getText(element);
    StyledString styledString = new StyledString(text);
    return styledString;
}
Also used : StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString)

Example 22 with StyledString

use of org.eclipse.jface.viewers.StyledString in project ow by vtst.

the class SoyLabelProvider method text.

StyledString text(SoyFile obj) {
    // We are careful about null, because we don't know all possible cases.
    Resource resource = obj.eResource();
    String label = messages.getString("soy_file");
    if (resource != null) {
        URI uri = resource.getURI();
        if (uri != null)
            label = (label + " [" + uri.lastSegment() + "]");
    }
    return new StyledString(label, rootStyler);
}
Also used : Resource(org.eclipse.emf.ecore.resource.Resource) StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString) URI(org.eclipse.emf.common.util.URI)

Example 23 with StyledString

use of org.eclipse.jface.viewers.StyledString in project ow by vtst.

the class LessLabelProvider method text.

StyledString text(StyleSheet obj) {
    // We are careful about null, because we don't know all possible cases.
    Resource resource = obj.eResource();
    String label = messages.getString("stylesheet");
    if (resource != null) {
        URI uri = resource.getURI();
        if (uri != null)
            label = (label + " [" + uri.lastSegment() + "]");
    }
    return new StyledString(label, rootStyler);
}
Also used : Resource(org.eclipse.emf.ecore.resource.Resource) StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString) URI(org.eclipse.emf.common.util.URI)

Example 24 with StyledString

use of org.eclipse.jface.viewers.StyledString in project ow by vtst.

the class AbstractCompletionProposal method getStyledDisplayString.

@Override
public StyledString getStyledDisplayString() {
    StyledString result = new StyledString();
    result.append(completionString);
    return result;
}
Also used : StyledString(org.eclipse.jface.viewers.StyledString)

Example 25 with StyledString

use of org.eclipse.jface.viewers.StyledString in project bndtools by bndtools.

the class RunBundlesPart method getLabelProvider.

@Override
protected IBaseLabelProvider getLabelProvider() {
    return new VersionedClauseLabelProvider() {

        @Override
        public void update(ViewerCell cell) {
            Object element = cell.getElement();
            if (element instanceof Builder) {
                @SuppressWarnings("resource") Builder builder = (Builder) element;
                StyledString label = new StyledString(builder.getBsn(), StyledString.QUALIFIER_STYLER);
                cell.setText(label.getString());
                cell.setStyleRanges(label.getStyleRanges());
                cell.setImage(projectImg);
            } else {
                super.update(cell);
            }
        }
    };
}
Also used : VersionedClauseLabelProvider(bndtools.model.clauses.VersionedClauseLabelProvider) Builder(aQute.bnd.osgi.Builder) StyledString(org.eclipse.jface.viewers.StyledString) ViewerCell(org.eclipse.jface.viewers.ViewerCell)

Aggregations

StyledString (org.eclipse.jface.viewers.StyledString)69 Image (org.eclipse.swt.graphics.Image)14 JavaCompletionProposal (org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal)8 LazyJavaCompletionProposal (org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal)8 ViewerCell (org.eclipse.jface.viewers.ViewerCell)5 GridData (org.eclipse.swt.layout.GridData)5 Table (org.eclipse.swt.widgets.Table)5 Entry (java.util.Map.Entry)4 StyledCellLabelProvider (org.eclipse.jface.viewers.StyledCellLabelProvider)4 Capability (org.osgi.resource.Capability)4 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)3 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 Styler (org.eclipse.jface.viewers.StyledString.Styler)3 TableViewer (org.eclipse.jface.viewers.TableViewer)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Composite (org.eclipse.swt.widgets.Composite)3 Label (org.eclipse.swt.widgets.Label)3 Version (org.osgi.framework.Version)3 Resource (org.osgi.resource.Resource)3