Class ApplicationsLabelProvider

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.viewers.BaseLabelProvider
org.eclipse.jface.viewers.LabelProvider
org.eclipse.ui.model.WorkbenchLabelProvider
com.e1c.g5.dt.applications.ui.view.ApplicationsLabelProvider
All Implemented Interfaces:
DelegatingStyledCellLabelProvider.IStyledLabelProvider, IBaseLabelProvider, IColorProvider, IFontProvider, ILabelProvider, IToolTipProvider, org.eclipse.ui.navigator.ICommonLabelProvider, org.eclipse.ui.navigator.IDescriptionProvider, org.eclipse.ui.navigator.IMementoAware

public class ApplicationsLabelProvider extends org.eclipse.ui.model.WorkbenchLabelProvider implements org.eclipse.ui.navigator.ICommonLabelProvider, IToolTipProvider
Label provider that can be used to display applications.

The primary intended usage is Applications view.

Items to be displayed are supposed to be mainly IApplication. However, the implementation will gracefully chew anything that is not an application by falling back to basic default behaviour:

  • Label and icon for the item to be displayed are determined by adapting the item to IWorkbenchAdapter that is supposed to provide both label and icon. This allows to have icons and labels specific for each application type and even for items that are not applications but something else (for example, server sub-item in case of application on standalone server).
Note: Examples of such workbench adapters include InfobaseApplicationWorkbenchAdapter for infobase applications and ServerApplicationWorkbenchAdapter for applications on standalone server.

A bold font (which is cached for performance purpose) will be used for the label if either this is a default application or the application is web accessible and its identifier matches that of default web access.

Tooltip depends on if application artifacts are shown or not and its state:

  • Constructor Details

    • ApplicationsLabelProvider

      @Inject public ApplicationsLabelProvider(IApplicationManager applicationManager)
      Constructs label provider
      Parameters:
      applicationManager - the application manager, cannot be enull
    • ApplicationsLabelProvider

      public ApplicationsLabelProvider(IApplicationManager applicationManager, boolean showArtifacts)
      Constructs label provider
      Parameters:
      applicationManager - the application manager, cannot be enull
      showArtifacts - if true then tooltip will include publish state only and full state otherwise
  • Method Details

    • restoreState

      public void restoreState(org.eclipse.ui.IMemento aMemento)
      Specified by:
      restoreState in interface org.eclipse.ui.navigator.IMementoAware
    • saveState

      public void saveState(org.eclipse.ui.IMemento aMemento)
      Specified by:
      saveState in interface org.eclipse.ui.navigator.IMementoAware
    • getDescription

      public String getDescription(Object anElement)
      Specified by:
      getDescription in interface org.eclipse.ui.navigator.IDescriptionProvider
    • init

      public void init(org.eclipse.ui.navigator.ICommonContentExtensionSite aConfig)
      Specified by:
      init in interface org.eclipse.ui.navigator.ICommonLabelProvider
    • getFont

      public org.eclipse.swt.graphics.Font getFont(Object element)
      Specified by:
      getFont in interface IFontProvider
      Overrides:
      getFont in class org.eclipse.ui.model.WorkbenchLabelProvider
    • getToolTipText

      public String getToolTipText(Object element)
      Specified by:
      getToolTipText in interface IToolTipProvider
    • dispose

      public void dispose()
      Specified by:
      dispose in interface IBaseLabelProvider
      Overrides:
      dispose in class org.eclipse.ui.model.WorkbenchLabelProvider