Class UIHelper

java.lang.Object
com._1c.g5.v8.dt.internal.ui.validation.UIHelper

public class UIHelper extends Object
This ui helper for MarkerSeverity and IssueType classes.
  • Constructor Details

    • UIHelper

      public UIHelper()
  • Method Details

    • getGroupImage

      public static org.eclipse.swt.graphics.Image getGroupImage(MarkerSeverity input)
      Get group Image by MarkerSeverity.
      Parameters:
      input - the MarkerSeverity, can be null
      Returns:
      return group image corresponding MarkerSeverity, can be null
    • getImageId

      public static String getImageId(IssueType input)
      Parameters:
      input - the IssueType., can be null
      Returns:
      V8UiSharedImages ID by IssueType, or null if not found.
    • getImage

      public static org.eclipse.swt.graphics.Image getImage(IssueType input)
      Get Image by IssueType.
      Parameters:
      input - the IssueType., can be null
      Returns:
      return image corresponding IssueType, can be null
    • getImage

      public static org.eclipse.swt.graphics.Image getImage(MarkerSeverity input)
      Get Image by MarkerSeverity.
      Parameters:
      input - the MarkerSeverity, can be null.
      Returns:
      return image corresponding MarkerSeverity, can be null.
    • getCountMessage

      public static String getCountMessage(int shown, int total)
      Returns localized string ~ (shown of total items.) or (total items.)
      Parameters:
      shown - shown items count
      total - total items count
      Returns:
      localized string, not null
    • getIssueType

      public static IssueType getIssueType(org.eclipse.core.resources.IProject project, Marker marker, ICheckRepository checkRepo)
      Returns issue type for given marker.
      Parameters:
      project - the project marker belongs to, not null
      marker - the marker, not null
      checkRepo - check repository, not null
      Returns:
      issue type or null if check not found.
    • getIssueType

      public static IssueType getIssueType(org.eclipse.core.resources.IProject project, String checkId, IssueType defValue, ICheckRepository checkRepo)
      Returns issue type for given check ID.
      Parameters:
      project - the project to get check settings from, not null
      checkId - check ID, not null
      defValue - default value to return, if the given project does not have settings for the given check ID
      checkRepo - check repository, not null
      Returns:
      issue type or defValue if check not found.
    • getIssueType

      public static IssueType getIssueType(Marker marker)
      Returns issue type for given marker.
      Parameters:
      marker - the marker, not null.
      Returns:
      issue type or null if check not found.
    • getIssueType

      public static IssueType getIssueType(org.eclipse.core.resources.IProject project, Marker marker)
      Returns issue type for given marker.
      Parameters:
      project - the project marker belongs to, not null
      marker - the marker, not null.
      Returns:
      issue type or null if check not found.
    • getImage

      public static org.eclipse.swt.graphics.Image getImage(org.eclipse.emf.ecore.EClass type)
      Returns image by eClass.
      Parameters:
      type - eclass, not null
      Returns:
      image, can be null
    • convert

      public static MarkerSeverity convert(IssueSeverity severity)
      Parameters:
      severity - severity, not null
      Returns:
      marker severity, not null
    • getCreationDate

      public static Date getCreationDate(Marker marker)
      Gets the marker's creation date.
      Parameters:
      marker - marker, cannot be null.
      Returns:
      the marker's creation date, never null.