Exemplo n.º 1
0
 /**
  * Puts the given renderers into the table of renderer.
  *
  * @param rendererExtensions descriptors of renderer
  * @since 1.2
  */
 @InjectExtension
 public void update(final ILnfRendererExtension[] rendererExtensions) {
   rendererTable.clear();
   for (final ILnfRendererExtension rendererExtension : rendererExtensions) {
     final String id = rendererExtension.getLnfId();
     if (StringUtils.isEmpty(id) || id.equals(getLnfId())) {
       if (StringUtils.isEmpty(id)) {
         if (rendererTable.get(rendererExtension.getLnfKey()) != null) {
           continue;
         }
       }
       rendererTable.put(rendererExtension.getLnfKey(), rendererExtension.createRenderer());
     }
   }
 }
Exemplo n.º 2
0
  /**
   * Returns the marker support that will be used according to the Look&Feel setting ({@code
   * LnfKeyConstants.MARKER_SUPPORT_ID}) and for the given Ridget class.
   *
   * @param ridgetClass class of the Ridget
   * @return marker support or {@code null} if no appropriate marker support was found
   * @since 2.0
   */
  public AbstractMarkerSupport getMarkerSupport(final Class<? extends IRidget> ridgetClass) {
    final String markerSupportID = getStringSetting(LnfKeyConstants.MARKER_SUPPORT_ID);

    for (final ILnfMarkerSupportExtension lnfMarkerSupportExtension : markerSupportList) {
      if (StringUtils.isEmpty(lnfMarkerSupportExtension.getId())) {
        continue;
      }
      if (lnfMarkerSupportExtension.getId().equals(markerSupportID)) {
        return lnfMarkerSupportExtension.createMarkerSupport();
      }
    }

    // only log this when running in an bundle environment
    if (Platform.getBundle("org.eclipse.swt") != null) { // $NON-NLS-1$
      LOGGER.log(
          LogService.LOG_INFO,
          "No MarkerSupport with the ID \""
              + markerSupportID
              + "\" exists."); //$NON-NLS-1$ //$NON-NLS-2$
    }

    return null;
  }