Author: scabanovich
Date: 2012-10-17 13:53:54 -0400 (Wed, 17 Oct 2012)
New Revision: 44563
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-12866
https://issues.jboss.org/browse/JBIDE-12866
CDIImages modified.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2012-10-17 17:52:07
UTC (rev 44562)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2012-10-17 17:53:54
UTC (rev 44563)
@@ -29,7 +29,7 @@
org.jboss.tools.common.validation,
org.jboss.tools.cdi.xml;visibility:=reexport,
org.eclipse.ui.ide;bundle-version="3.7.0",
- org.jboss.tools.common.ui
+ org.jboss.tools.common.ui;visibility:=reexport
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: JBoss by Red Hat
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java 2012-10-17
17:52:07 UTC (rev 44562)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java 2012-10-17
17:53:54 UTC (rev 44563)
@@ -15,12 +15,13 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.cdi.internal.core.impl.EventBean;
import org.jboss.tools.cdi.xml.CDIXMLImages;
-import org.jboss.tools.common.ui.CommonUIPlugin;
+import org.jboss.tools.common.ui.CommonUIImages;
-public class CDIImages {
+public class CDIImages extends CommonUIImages {
private static CDIImages INSTANCE;
@@ -54,16 +55,12 @@
public static final String CDI_CLASS_IMAGE = "wizard/CDIClassWizBan.png";
//$NON-NLS-1$
public static final String CDI_ANNOTATION_IMAGE =
"wizard/CDIAnnotationWizBan.png"; //$NON-NLS-1$
- public static Image getImage(ImageDescriptor descriptor) {
- return CommonUIPlugin.getImageDescriptorRegistry().get(descriptor);
- }
-
public static Image getImage(String key) {
- return INSTANCE.createImageDescriptor(key).createImage();
+ return getImageDescriptor(key).createImage();
}
public static ImageDescriptor getImageDescriptor(String key) {
- return INSTANCE.createImageDescriptor(key);
+ return getInstance().getOrCreateImageDescriptor(key);
}
public static void setImageDescriptors(IAction action, String iconName) {
@@ -74,40 +71,18 @@
return INSTANCE;
}
- private URL baseUrl;
- private CDIImages parentRegistry;
-
protected CDIImages(URL registryUrl, CDIImages parent){
- if(registryUrl == null) throw new
IllegalArgumentException(CDICoreMessages.CDI_IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL);
- baseUrl = registryUrl;
- parentRegistry = parent;
+ super(registryUrl, parent);
}
protected CDIImages(URL url){
this(url,null);
}
- public Image getImageByFileName(String key) {
- return createImageDescriptor(key).createImage();
+ protected ImageRegistry getImageRegistry() {
+ return CDICorePlugin.getDefault().getImageRegistry();
}
- public ImageDescriptor createImageDescriptor(String key) {
- try {
- return ImageDescriptor.createFromURL(makeIconFileURL(key));
- } catch (MalformedURLException e) {
- if(parentRegistry == null) {
- return ImageDescriptor.getMissingImageDescriptor();
- } else {
- return parentRegistry.createImageDescriptor(key);
- }
- }
- }
-
- private URL makeIconFileURL(String name) throws MalformedURLException {
- if (name == null) throw new
MalformedURLException(CDICoreMessages.CDI_IMAGESIMAGE_NAME_CANNOT_BE_NULL);
- return new URL(baseUrl, name);
- }
-
public static Image getImageByElement(ICDIElement element) {
return getImage(getImageDescriptorByElement(element));
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-10-17
17:52:07 UTC (rev 44562)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2012-10-17
17:53:54 UTC (rev 44563)
@@ -92,7 +92,7 @@
BeansXMLData projectBeansXMLData = new BeansXMLData();
public CDIProject() {
- dbCache = CDICorePlugin.getDefault().getDBCache();
+// dbCache = CDICorePlugin.getDefault().getDBCache();
}
public CDIProject getModifiedCopy(IFile file, Collection<IBean> beans) {