Search in sources :

Example 1 with GitChangeSetModelProvider

use of org.eclipse.egit.ui.internal.synchronize.GitChangeSetModelProvider in project egit by eclipse.

the class GitChangeSetLabelProvider method getStyledText.

@Override
public StyledString getStyledText(Object element) {
    // need to compare classes as everything is 'instanceof GitModelCommit'
    if (element.getClass().equals(GitModelCommit.class)) {
        String formattedName = createChangeSetLabel((GitModelCommit) element);
        StyledString string = new StyledString(formattedName);
        GitModelCommit commit = (GitModelCommit) element;
        // $NON-NLS-1$//$NON-NLS-2$
        String format = " [" + getAbbreviatedId(commit) + "]";
        string.append(format, StyledString.DECORATIONS_STYLER);
        return string;
    }
    if (element instanceof GitChangeSetModelProvider)
        return new StyledString(UIText.GitChangeSetModelProviderLabel);
    return getDelegateLabelProvider().getStyledText(element);
}
Also used : GitModelCommit(org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit) GitChangeSetModelProvider(org.eclipse.egit.ui.internal.synchronize.GitChangeSetModelProvider) StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString)

Aggregations

GitChangeSetModelProvider (org.eclipse.egit.ui.internal.synchronize.GitChangeSetModelProvider)1 GitModelCommit (org.eclipse.egit.ui.internal.synchronize.model.GitModelCommit)1 StyledString (org.eclipse.jface.viewers.StyledString)1