Class SharedImages

java.lang.Object
com.e1c.langtool.flags.ui.SharedImages

public class SharedImages extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the available country codes of ISO-3166 standard with flags.
    static org.eclipse.swt.graphics.Image
    Retrieves the specified image from the flags ui plugin's image registry.
    static org.eclipse.swt.graphics.Image
    getImage(String symbolicName)
    Retrieves the specified image from the flags ui plugin's image registry.
    static org.eclipse.jface.resource.ImageDescriptor
    getImageDescriptor(String symbolicName)
    Retrieves the image descriptor for specified image from the flags ui plugin's image registry.
    Gets the language codes for languages that has an origin according ISO-639-1 Standard.
    static org.eclipse.swt.graphics.Image
    Retrieves the specified image from the flags ui plugin's image registry.
    static org.eclipse.swt.graphics.Image
    getLanguageFlagImage(org.eclipse.core.resources.IProject project, String languageCode)
    Retrieves the specified image from the flags ui plugin's image registry according the project's settings.
    static org.eclipse.jface.resource.ImageDescriptor
    getLanguageFlagImageDescriptor(org.eclipse.core.resources.IProject project, String languageCode)
    Retrieves the image descriptor for specified image from the flags ui plugin's image registry according the project's settings.
    static void
    initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry reg)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SharedImages

      public SharedImages()
  • Method Details

    • initializeImageRegistry

      public static void initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry reg)
    • getCountryCodes

      public static Collection<String> getCountryCodes()
      Gets the available country codes of ISO-3166 standard with flags. Codes are in Upper case.
      Returns:
      the country codes, nevere returns null.
    • getLanguageCodes

      public static Collection<String> getLanguageCodes()
      Gets the language codes for languages that has an origin according ISO-639-1 Standard.
      Returns:
      the language codes
    • getLanguageFlagImage

      public static org.eclipse.swt.graphics.Image getLanguageFlagImage(org.eclipse.core.resources.IProject project, String languageCode)
      Retrieves the specified image from the flags ui plugin's image registry according the project's settings. Note: The returned Image is managed by the workbench; clients must not dispose of the returned image.
      Parameters:
      project - the project which has specific settings of mapping language code and coutry code
      languageCode - the language code of the image
      Returns:
      the image, or IMG_OBJ16_DEFAULT default image if not found, never returns null
    • getLanguageFlagImageDescriptor

      public static org.eclipse.jface.resource.ImageDescriptor getLanguageFlagImageDescriptor(org.eclipse.core.resources.IProject project, String languageCode)
      Retrieves the image descriptor for specified image from the flags ui plugin's image registry according the project's settings. Unlike Images, image descriptors themselves do not need to be disposed.
      Parameters:
      project - the project which has specific settings of mapping language code and coutry code
      languageCode - the language code
      Returns:
      the image descriptor, or IMG_OBJ16_DEFAULT default image if not found, never returns null
    • getLanguageFlagImage

      public static org.eclipse.swt.graphics.Image getLanguageFlagImage(String languageCode)
      Retrieves the specified image from the flags ui plugin's image registry. Note: The returned Image is managed by the workbench; clients must not dispose of the returned image.
      Parameters:
      languageCode - the language code of the image
      Returns:
      the image, or IMG_OBJ16_DEFAULT default image if not found, never returns null
      See Also:
    • getCountryFlagImage

      public static org.eclipse.swt.graphics.Image getCountryFlagImage(String countryCode)
      Retrieves the specified image from the flags ui plugin's image registry. Note: The returned Image is managed by the workbench; clients must not dispose of the returned image.
      Parameters:
      countryCode - the country code of the image, the code should be in upper case, according to ISO-3166 standard
      Returns:
      the image, or IMG_OBJ16_DEFAULT default image if not found, never returns null
      See Also:
    • getImage

      public static org.eclipse.swt.graphics.Image getImage(String symbolicName)
      Retrieves the specified image from the flags ui plugin's image registry. Note: The returned Image is managed by the workbench; clients must not dispose of the returned image.
      Parameters:
      symbolicName - the symbolic name of the image. Use IMG_OBJ16_DEFAULT as symbolic name or call getCountryFlagImage(String), getLanguageFlagImage(String), getLanguageFlagImage(IProject, String) instead.
      Returns:
      the image, or returns null image if not found
      See Also:
    • getImageDescriptor

      public static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(String symbolicName)
      Retrieves the image descriptor for specified image from the flags ui plugin's image registry. Unlike Images, image descriptors themselves do not need to be disposed.
      Parameters:
      symbolicName - the symbolic name of the image; there are constants declared in this interface for build-in images that come with the workbench
      Returns:
      the image descriptor, or IMG_OBJ16_DEFAULT default image if not found, never returns null