Ejemplo n.º 1
0
 public void clear() {
   final ImageRegistry imageRegistry = super.getImageRegistry();
   Plugins.useConfigElements(
       IMAGE_ID,
       new ICallback<IConfigurationElement>() {
         @Override
         public void process(IConfigurationElement t) throws Exception {
           String key = t.getAttribute("editKey");
           Images.removeImage(imageRegistry, key);
         }
       },
       ICallback.Utils.sysErrCallback());
   registeredExtraImages = false;
 }
Ejemplo n.º 2
0
 public ImageRegistry getImageRegistry(final Display display) {
   final ImageRegistry result = super.getImageRegistry();
   if (!registeredExtraImages) {
     Plugins.useConfigElements(
         IMAGE_ID,
         new ICallback<IConfigurationElement>() {
           @Override
           public void process(IConfigurationElement t) throws Exception {
             Class<IImageRegister> clazz = Plugins.classFrom(t);
             IImageRegister register = clazz.newInstance();
             register.registerWith(display, result);
           }
         },
         ICallback.Utils.sysErrCallback());
     registeredExtraImages = true;
   }
   return result;
 }
Ejemplo n.º 3
0
 public IResourceGetter getResourceGetter() {
   if (resourceGetter == null) {
     resourceGetter = IResourceGetter.Utils.noResources();
     Plugins.useConfigElements(
         BUNDLE_ID,
         new ICallback<IConfigurationElement>() {
           @Override
           public void process(IConfigurationElement t) throws Exception {
             Class<? extends Object> anchorClass = t.createExecutableExtension("class").getClass();
             String name = t.getAttribute("name");
             if (name == null)
               throw new RuntimeException(
                   MessageFormat.format(DisplayCoreConstants.nameMissing, anchorClass));
             resourceGetter = resourceGetter.with(anchorClass, name);
           }
         },
         ICallback.Utils.sysErrCallback());
   }
   return resourceGetter;
 }