Search in sources :

Example 1 with DecoratingStyledCellLabelProvider

use of org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider in project erlide_eclipse by erlang.

the class ErlangSearchResultPage method configureTreeViewer.

@Override
protected void configureTreeViewer(final TreeViewer viewer) {
    viewer.setUseHashlookup(true);
    innerLabelProvider = new SearchResultLabelProvider(this, SearchResultLabelProvider.SHOW_LABEL, true);
    viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(innerLabelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), null));
    viewer.setContentProvider(new ErlangSearchTreeContentProvider(viewer, this));
    viewer.setComparator(new DecoratorIgnoringViewerSorter(innerLabelProvider));
    fContentProvider = (IErlSearchContentProvider) viewer.getContentProvider();
    addDragAdapters(viewer);
}
Also used : DecoratingStyledCellLabelProvider(org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider)

Example 2 with DecoratingStyledCellLabelProvider

use of org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider in project erlide_eclipse by erlang.

the class ErlangSearchResultPage method configureTableViewer.

@Override
protected void configureTableViewer(final TableViewer viewer) {
    viewer.setUseHashlookup(true);
    viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(getInnerLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), null));
    viewer.setContentProvider(new ErlangSearchTableContentProvider(this));
    viewer.setComparator(new DecoratorIgnoringViewerSorter(getInnerLabelProvider()));
    fContentProvider = (IErlSearchContentProvider) viewer.getContentProvider();
    addDragAdapters(viewer);
}
Also used : DecoratingStyledCellLabelProvider(org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider)

Example 3 with DecoratingStyledCellLabelProvider

use of org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider in project tmdm-studio-se by Talend.

the class RepositoryViewObjectCheckedWidget method installColumns.

private void installColumns() {
    treeViewer.getTree().setHeaderVisible(true);
    // 
    TreeViewerColumn nameColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    nameColumn.getColumn().setWidth(320);
    nameColumn.getColumn().setText(Messages.ConsistencyConflict_name);
    ILabelDecorator labelDecorator = RepositoryPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator();
    DecoratingStyledCellLabelProvider consistencyLabelProvider = new DecoratingStyledCellLabelProvider(new MDMRepositoryLabelProvider(), labelDecorator, null);
    nameColumn.setLabelProvider(consistencyLabelProvider);
    // compare result
    TreeViewerColumn resultColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    resultColumn.getColumn().setWidth(120);
    resultColumn.getColumn().setText(Messages.ConsistencyConflict_compareResult);
    resultColumn.setLabelProvider(new CompareResultColumnProvider());
    // 
    localTimeColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    localTimeColumn.getColumn().setText(Messages.ConsistencyConflict_retrievalTimestamp);
    localTimeColumn.setLabelProvider(new TimeStampColumnProvider(true));
    // 
    serverTimeColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    serverTimeColumn.getColumn().setText(Messages.ConsistencyConflict_serverTimestamp);
    serverTimeColumn.setLabelProvider(new TimeStampColumnProvider(false));
    // 
    showTimeStampColumns(false);
}
Also used : ILabelDecorator(org.eclipse.jface.viewers.ILabelDecorator) MDMRepositoryLabelProvider(org.talend.mdm.repository.ui.navigator.MDMRepositoryLabelProvider) DecoratingStyledCellLabelProvider(org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider) TreeViewerColumn(org.eclipse.jface.viewers.TreeViewerColumn)

Example 4 with DecoratingStyledCellLabelProvider

use of org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider in project tmdm-studio-se by Talend.

the class ConsistencyConflictDialog method installColumns.

private void installColumns() {
    treeViewer.getTree().setHeaderVisible(true);
    nameColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    nameColumn.getColumn().setWidth(320);
    nameColumn.getColumn().setText(Messages.ConsistencyConflict_name);
    ILabelDecorator labelDecorator = RepositoryPlugin.getDefault().getWorkbench().getDecoratorManager().getLabelDecorator();
    DecoratingStyledCellLabelProvider consistencyLabelProvider = new DecoratingStyledCellLabelProvider(new MDMRepositoryLabelProvider(), labelDecorator, null) {

        @Override
        public Color getBackground(Object element) {
            IRepositoryViewObject viewObj = (IRepositoryViewObject) element;
            return getBackgroundColor(viewObj);
        }
    };
    nameColumn.setLabelProvider(consistencyLabelProvider);
    resultColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    resultColumn.getColumn().setWidth(120);
    resultColumn.getColumn().setText(Messages.ConsistencyConflict_compareResult);
    resultColumn.setLabelProvider(new CompareResultColumnProvider());
    // 
    operationColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    operationColumn.getColumn().setWidth(120);
    operationColumn.getColumn().setText(Messages.ConsistencyConflictDialog_Operation);
    operationColumn.setLabelProvider(new OperationProvider());
    // 
    localTimeColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    localTimeColumn.getColumn().setText(Messages.ConsistencyConflict_retrievalTimestamp);
    localTimeColumn.setLabelProvider(new TimeStampColumnProvider(true));
    // 
    serverTimeColumn = new TreeViewerColumn(treeViewer, SWT.NONE);
    serverTimeColumn.getColumn().setText(Messages.ConsistencyConflict_serverTimestamp);
    serverTimeColumn.setLabelProvider(new TimeStampColumnProvider(false));
    // 
    showTimeStampColumns(false);
}
Also used : ILabelDecorator(org.eclipse.jface.viewers.ILabelDecorator) MDMRepositoryLabelProvider(org.talend.mdm.repository.ui.navigator.MDMRepositoryLabelProvider) DecoratingStyledCellLabelProvider(org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) FolderRepositoryObject(org.talend.mdm.repository.models.FolderRepositoryObject) TreeViewerColumn(org.eclipse.jface.viewers.TreeViewerColumn)

Example 5 with DecoratingStyledCellLabelProvider

use of org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider in project egit by eclipse.

the class CommitViewerComparator method createStatusLabelProvider.

private static CellLabelProvider createStatusLabelProvider() {
    CommitStatusLabelProvider baseProvider = new CommitStatusLabelProvider();
    ProblemLabelDecorator decorator = new ProblemLabelDecorator(null);
    return new DecoratingStyledCellLabelProvider(baseProvider, decorator, null) {

        @Override
        public String getToolTipText(Object element) {
            return ((CommitItem) element).status.getText();
        }
    };
}
Also used : DecoratingStyledCellLabelProvider(org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider) ProblemLabelDecorator(org.eclipse.egit.ui.internal.decorators.ProblemLabelDecorator)

Aggregations

DecoratingStyledCellLabelProvider (org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider)5 ILabelDecorator (org.eclipse.jface.viewers.ILabelDecorator)2 TreeViewerColumn (org.eclipse.jface.viewers.TreeViewerColumn)2 MDMRepositoryLabelProvider (org.talend.mdm.repository.ui.navigator.MDMRepositoryLabelProvider)2 ProblemLabelDecorator (org.eclipse.egit.ui.internal.decorators.ProblemLabelDecorator)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 FolderRepositoryObject (org.talend.mdm.repository.models.FolderRepositoryObject)1