Search in sources :

Example 46 with StyledString

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

the class Strings method markJavaElementLabelLTR.

/**
	 * Adds special marks so that that the given styled Java element label is readable in a BiDi
	 * environment.
	 * 
	 * @param styledString the styled string
	 * @return the processed styled string
	 * @since 3.6
	 */
public static StyledString markJavaElementLabelLTR(StyledString styledString) {
    if (!USE_TEXT_PROCESSOR)
        return styledString;
    String inputString = styledString.getString();
    String string = TextProcessor.process(inputString, JAVA_ELEMENT_DELIMITERS);
    if (string != inputString)
        insertMarks(styledString, inputString, string);
    return styledString;
}
Also used : StyledString(org.eclipse.jface.viewers.StyledString)

Example 47 with StyledString

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

the class Strings method markLTR.

/**
	 * Adds special marks so that that the given styled string is readable in a BiDi environment.
	 * 
	 * @param styledString the styled string
	 * @return the processed styled string
	 * @since 3.4
	 */
public static StyledString markLTR(StyledString styledString) {
    if (!USE_TEXT_PROCESSOR)
        return styledString;
    String inputString = styledString.getString();
    String string = TextProcessor.process(inputString);
    if (string != inputString)
        insertMarks(styledString, inputString, string);
    return styledString;
}
Also used : StyledString(org.eclipse.jface.viewers.StyledString)

Example 48 with StyledString

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

the class Strings method markLTR.

/**
	 * Adds special marks so that that the given styled string is readable in a BiDi environment.
	 * 
	 * @param styledString the styled string
	 * @param delimiters the additional delimiters
	 * @return the processed styled string
	 * @since 3.4
	 */
public static StyledString markLTR(StyledString styledString, String delimiters) {
    if (!USE_TEXT_PROCESSOR)
        return styledString;
    String inputString = styledString.getString();
    String string = TextProcessor.process(inputString, delimiters);
    if (string != inputString)
        insertMarks(styledString, inputString, string);
    return styledString;
}
Also used : StyledString(org.eclipse.jface.viewers.StyledString)

Example 49 with StyledString

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

the class JavaElementLabels method getStyledElementLabel.

/**
	 * Returns the styled label for a Java element with the flags as defined by this class.
	 *
	 * @param element the element to render
	 * @param flags the rendering flags
	 * @return the label of the Java element
	 *
	 * @since 3.4
	 */
public static StyledString getStyledElementLabel(IJavaElement element, long flags) {
    StyledString result = new StyledString();
    getElementLabel(element, flags, result);
    return Strings.markJavaElementLabelLTR(result);
}
Also used : StyledString(org.eclipse.jface.viewers.StyledString)

Example 50 with StyledString

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

the class CompletionProposalCollector method createAnnotationAttributeReferenceProposal.

private IJavaCompletionProposal createAnnotationAttributeReferenceProposal(CompletionProposal proposal) {
    StyledString displayString = fLabelProvider.createLabelWithTypeAndDeclaration(proposal);
    ImageDescriptor descriptor = fLabelProvider.createMethodImageDescriptor(proposal);
    String completion = String.valueOf(proposal.getCompletion());
    JavaCompletionProposal javaProposal = new JavaCompletionProposal(completion, proposal.getReplaceStart(), getLength(proposal), getImage(descriptor), displayString, computeRelevance(proposal));
    if (fJavaProject != null)
        javaProposal.setProposalInfo(new AnnotationAtttributeProposalInfo(fJavaProject, proposal));
    return javaProposal;
}
Also used : AnnotationAtttributeProposalInfo(org.eclipse.jdt.internal.ui.text.java.AnnotationAtttributeProposalInfo) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString) JavaCompletionProposal(org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposal) LazyJavaCompletionProposal(org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal)

Aggregations

StyledString (org.eclipse.jface.viewers.StyledString)95 Image (org.eclipse.swt.graphics.Image)17 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 Styler (org.eclipse.jface.viewers.StyledString.Styler)4 Capability (org.osgi.resource.Capability)4 EObject (org.eclipse.emf.ecore.EObject)3 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)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 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)2 IStatus (org.eclipse.core.runtime.IStatus)2