Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorpfullbright2007-05-08 15:42:36 +0000
committerpfullbright2007-05-08 15:42:36 +0000
commit770969752bd3153e62464a440fbf197d8f72b58f (patch)
tree3562e7072c850c0f5c4ea5dfa1b381be07801656 /jpa
parent1782ba18b19579e6d2601214ddd1e213ded1dfb8 (diff)
downloadwebtools.dali-770969752bd3153e62464a440fbf197d8f72b58f.tar.gz
webtools.dali-770969752bd3153e62464a440fbf197d8f72b58f.tar.xz
webtools.dali-770969752bd3153e62464a440fbf197d8f72b58f.zip
added ghosting of icons for virtual xml attributes
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF1
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java37
3 files changed, 28 insertions, 13 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
index 2d67474341..0e2c0c45a9 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.ui/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Bundle-ClassPath: .
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
+ org.eclipse.draw2d,
org.eclipse.emf.edit.ui,
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java
index 33866200a6..7acab93e34 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/JptUiMappingsImages.java
@@ -9,6 +9,7 @@
package org.eclipse.jpt.ui.internal.mappings;
import org.eclipse.jpt.ui.internal.JptUiPlugin;
+import org.eclipse.swt.graphics.Image;
public class JptUiMappingsImages
{
@@ -47,7 +48,7 @@ public class JptUiMappingsImages
public final static String VERSION = "full/obj16/version";
- public static Object getImage(String imageLocator) {
+ public static Image getImage(String imageLocator) {
return JptUiPlugin.getPlugin().getImageDescriptor(imageLocator).createImage();
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
index 282038d1ef..e9f4260b1f 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.ui.internal.xml.structure;
+import org.eclipse.draw2d.ImageUtilities;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
@@ -31,6 +32,9 @@ import org.eclipse.jpt.core.internal.mappings.IOneToOne;
import org.eclipse.jpt.core.internal.mappings.ITransient;
import org.eclipse.jpt.core.internal.mappings.IVersion;
import org.eclipse.jpt.ui.internal.mappings.JptUiMappingsImages;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
public class XmlPersistentAttributeItemProvider extends ItemProviderAdapter
implements IEditingDomainItemProvider,
@@ -46,40 +50,49 @@ public class XmlPersistentAttributeItemProvider extends ItemProviderAdapter
public Object getImage(Object object) {
XmlAttributeMapping mapping = ((XmlPersistentAttribute) object).getMapping();
+ Image image;
if (mapping instanceof IBasic) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.BASIC);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.BASIC);
}
else if (mapping instanceof IId) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ID);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.ID);
}
else if (mapping instanceof IVersion) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.VERSION);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.VERSION);
}
else if (mapping instanceof IEmbedded) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED);
}
else if (mapping instanceof IEmbeddedId) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED_ID);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.EMBEDDED_ID);
}
else if (mapping instanceof IOneToOne) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_ONE);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_ONE);
}
else if (mapping instanceof IOneToMany) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_MANY);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.ONE_TO_MANY);
}
else if (mapping instanceof IManyToOne) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_ONE);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_ONE);
}
else if (mapping instanceof IManyToMany) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_MANY);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.MANY_TO_MANY);
}
else if (mapping instanceof ITransient) {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.TRANSIENT);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.TRANSIENT);
}
else {
- return JptUiMappingsImages.getImage(JptUiMappingsImages.NULL_ATTRIBUTE_MAPPING);
+ image = JptUiMappingsImages.getImage(JptUiMappingsImages.NULL_ATTRIBUTE_MAPPING);
}
-
+
+ // apply "ghosting"
+ if (mapping.isVirtual()) {
+ Color offwhite = new Color(image.getDevice(), 250, 250, 250);
+ ImageData imageData = ImageUtilities.createShadedImage(image, offwhite);
+ image = new Image(image.getDevice(), imageData);
+ }
+
+ return image;
}
@Override

Back to the top