Search in sources :

Example 1 with ModelRepoTreeLabelProvider

use of org.archicontribs.modelrepository.views.repositories.ModelRepositoryTreeViewer.ModelRepoTreeLabelProvider in project archi-modelrepository-plugin by archi-contribs.

the class ModelRepositoryView method updateStatusBar.

protected void updateStatusBar(ISelection selection) {
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    if (obj instanceof IArchiRepository) {
        IArchiRepository repo = (IArchiRepository) obj;
        ModelRepoTreeLabelProvider labelProvider = (ModelRepoTreeLabelProvider) getViewer().getLabelProvider();
        Image image = labelProvider.getImage(repo);
        // $NON-NLS-1$
        String text = repo.getName() + " - " + labelProvider.getStatusText(repo);
        getViewSite().getActionBars().getStatusLineManager().setMessage(image, text);
    } else {
        // $NON-NLS-1$
        getViewSite().getActionBars().getStatusLineManager().setMessage(null, "");
    }
}
Also used : IArchiRepository(org.archicontribs.modelrepository.grafico.IArchiRepository) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ModelRepoTreeLabelProvider(org.archicontribs.modelrepository.views.repositories.ModelRepositoryTreeViewer.ModelRepoTreeLabelProvider) Image(org.eclipse.swt.graphics.Image)

Aggregations

IArchiRepository (org.archicontribs.modelrepository.grafico.IArchiRepository)1 ModelRepoTreeLabelProvider (org.archicontribs.modelrepository.views.repositories.ModelRepositoryTreeViewer.ModelRepoTreeLabelProvider)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 Image (org.eclipse.swt.graphics.Image)1