Example usage for org.eclipse.jface.viewers IDecoration addSuffix

List of usage examples for org.eclipse.jface.viewers IDecoration addSuffix

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers IDecoration addSuffix.

Prototype

void addSuffix(String suffix);

Source Link

Document

Adds a suffix to the element's label.

Usage

From source file:org.eclipse.datatools.enablement.sybase.ase.internal.ui.decorator.ProxyTableDecorationService.java

License:Open Source License

public void decorate(Object element, IDecoration decoration) {

    /**/* w w  w  . jav  a  2  s  .c  o  m*/
      * ASE has four kinds of proxy table. Each proxy table has a special icon,
      */
    if (element instanceof SybaseASEProxyTable && !(element instanceof SybaseASEWebServiceTable)) {
        SybaseASEProxyTable table = (SybaseASEProxyTable) element;
        decoration.addSuffix(" [" + table.getExternalPath() + "]");
        switch (table.getExternalType().getValue()) {
        case ProxyTableExternalType.FILE:
            decoration.addOverlay(ASEImages.DESC_FILEPROXYTABLE);
            break;
        case ProxyTableExternalType.DIRECTORY:
            decoration.addOverlay(ASEImages.DESC_DIRPROXYTABLE);
            break;
        case ProxyTableExternalType.PROCEDURE:
            decoration.addOverlay(ASEImages.DESC_RPCPROXYTABLE);
            break;
        case ProxyTableExternalType.TABLE:
            decoration.addOverlay(ASEImages.DESC_REMOTETABLE);
            break;
        }
    }
}

From source file:org.eclipse.dltk.internal.ui.rse.RemoteProjectLabelDecorator.java

License:Open Source License

/**
 * @param project//  w  ww.ja v  a2  s .c  o  m
 * @param decoration
 * @return
 */
private void decorateProjectText(IProject project, IDecoration decoration) {
    final URI uri = project.getLocationURI();
    if (uri != null && RSEEnvironmentProvider.RSE_SCHEME.equalsIgnoreCase(uri.getScheme())
            && uri.getHost() != null) {
        addHostNameSuffix(decoration, uri.getHost());
    } else if (project.isOpen()) {
        final String envId = EnvironmentManager.getEnvironmentId(project, false);
        if (envId != null) {
            final IEnvironment environment = EnvironmentManager.getEnvironmentById(envId);
            if (environment instanceof RSEEnvironment) {
                final String hostName = ((RSEEnvironment) environment).getHost().getHostName();
                if (hostName != null) {
                    addHostNameSuffix(decoration, hostName);
                    if (!environment.isConnected()) {
                        decoration.addSuffix(" [Not connected]");
                    }
                }
            }
        }
    }
}

From source file:org.eclipse.dltk.internal.ui.rse.RemoteProjectLabelDecorator.java

License:Open Source License

private static void addHostNameSuffix(IDecoration decoration, final String hostName) {
    decoration.addSuffix(" (" + hostName.toLowerCase() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
}

From source file:org.eclipse.ease.modules.unittest.ui.decorators.TestDecorator.java

License:Open Source License

@Override
public void decorate(final Object element, final IDecoration decoration) {
    if (element instanceof TestComposite) {
        final TestStatus status = ((TestComposite) element).getStatus();
        addOverlay(status, decoration);/* ww  w. java 2s.  co  m*/

        if (status != TestStatus.PASS) {
            final Collection<? extends TestEntity> testEntities = ((TestComposite) element).getChildren();
            int valid = 0;
            for (final TestEntity entity : testEntities) {
                if (entity.getStatus() == TestStatus.PASS)
                    valid++;
            }

            // if (!element.isActive())
            // decoration.setForegroundColor(new Color(Display.getDefault(), 180, 180, 180));

            if ((testEntities.size() > 0) && (valid != testEntities.size()))
                decoration.addSuffix(" (" + valid + "/" + testEntities.size() + " valid)");
        }
    }
}

From source file:org.eclipse.ease.ui.modules.decorators.ModulesExplorerFieldDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {

    if (element instanceof Field) {

        decoration.addSuffix(" : " + ((Field) element).getType().getSimpleName());

    }/*from  w w w  .  jav  a2s.  c  o  m*/

}

From source file:org.eclipse.ease.ui.modules.decorators.ModulesExplorerMethodDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {

    if (element instanceof Method) {

        decoration.addSuffix(" : " + ((Method) element).getReturnType().getSimpleName());

    }// w  ww .ja va2s. co m

}

From source file:org.eclipse.ease.ui.modules.decorators.ModulesExplorerModuleDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {

    if (element instanceof ModuleDefinition) {

        decoration.addSuffix(" : " + ((ModuleDefinition) element).getBundleID());

    }/*from  w  ww  .j a  v a  2  s  .  com*/

}

From source file:org.eclipse.ecf.salvo.ui.internal.provider.SalvoDecorator.java

License:Open Source License

private void decorate(INewsgroup newsgroup, IDecoration decoration) {
    Debug.log(this.getClass(),
            "Decorating newsgroup: " + newsgroup.getNewsgroupName() + " - " + newsgroup.getArticleCount());
    decoration.addSuffix(" (" + newsgroup.getArticleCount() + ")");
}

From source file:org.eclipse.emf.ecp.emfstore.internal.ui.decorator.RepositoryViewBranchDecorator.java

License:Open Source License

@Override
public void decorate(Object element, IDecoration decoration) {
    if (element instanceof EMFStoreProjectWrapper) {
        final EMFStoreProjectWrapper wrapper = (EMFStoreProjectWrapper) element;
        final ESRemoteProject remoteProject = wrapper.getCheckoutData();

        if (remoteProject == null) {
            return;
        }/*from w  w w .j  a v a 2s  .  c o m*/

        try {
            final List<ESBranchInfo> branches = remoteProject.getBranches(new NullProgressMonitor());
            for (final ESBranchInfo bi : branches) {
                final ESPrimaryVersionSpec versSpec = bi.getHead();
                decoration.addSuffix(" [" + versSpec.getBranch() + ", v" + versSpec.getIdentifier() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            }
        } catch (final ESException ex) {
        }
    } else {
        return;
    }
}

From source file:org.eclipse.emf.emfstore.client.ui.decorators.UsernameDecorator.java

License:Open Source License

/**
 * {@inheritDoc}//from   w  w w .j  av  a 2  s .c  om
 */
public void decorate(Object element, final IDecoration decoration) {
    if (element instanceof ProjectSpace) {
        ProjectSpace projectSpace = (ProjectSpace) element;
        if (projectSpace.getUsersession() != null) {
            String string = " " + projectSpace.getUsersession().getUsername();
            decoration.addSuffix(string);
        }
    }
}