package com.sogeti.rental.ui;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;

/**
 * The activator class controls the plug-in life cycle
 */
public class RentalUIActivator extends AbstractUIPlugin implements RentalUIConstants {

	// The plug-in ID
	public static final String PLUGIN_ID = "com.sogeti.rental.ui"; //$NON-NLS-1$

	// The shared instance
	private static RentalUIActivator plugin;
	
	/**
	 * The constructor
	 */
	public RentalUIActivator() {
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}

	/**
	 * Returns the shared instance
	 *
	 * @return the shared instance
	 */
	public static RentalUIActivator getDefault() {
		return plugin;
	}
	
	@Override
	protected void initializeImageRegistry(ImageRegistry reg) {
		Bundle b = FrameworkUtil.getBundle(this.getClass());
		
		reg.put(IMG_CUSTOMER, ImageDescriptor.createFromURL(b.getEntry(IMG_CUSTOMER)));
		reg.put(IMG_RENTAL, ImageDescriptor.createFromURL(b.getEntry(IMG_RENTAL)));
		reg.put(IMG_OBJECT, ImageDescriptor.createFromURL(b.getEntry(IMG_OBJECT)));
		reg.put(IMG_AGENCY, ImageDescriptor.createFromURL(b.getEntry(IMG_AGENCY)));
	}

}

@@ -26,16 +26,168 @@
 .ui;%0D%0A%0D%0A
+import org.eclipse.core.runtime.IConfigurationElement;%0D%0Aimport org.eclipse.core.runtime.IExtensionRegistry;%0D%0Aimport org.eclipse.core.runtime.Platform;%0D%0A
 import o
@@ -1071,16 +1071,393 @@
  this;%0D%0A
+%09%09readExtensions();%0D%0A%09%7D%0D%0A%0D%0A%09private void readExtensions() %7B%0D%0A%09%09IExtensionRegistry reg = Platform.getExtensionRegistry();%0D%0A%09%09for (IConfigurationElement e : reg.getConfigurationElementsFor(%22org.eclipse.ui.views%22)) %7B%0D%0A%09%09%09if (e.getName().equals(%22view%22)) %7B%0D%0A%09%09%09%09System.out.println(%22Plugin : %22 + e.getNamespaceIdentifier() + %22, Vue : %22 + e.getAttribute(%22name%22));%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09%0D%0A%09%09%0D%0A
 %09%7D%0D%0A%0D%0A%09/

liste des points d extension view