[251720] [Graphical Editor] Provide better visual cues for abstract types/elements
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
index ae847ef..30ab79a 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/design/editparts/model/SpaceFiller.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -158,6 +158,12 @@
     // TODO Auto-generated method stub
     return false;
   }
+
+  public boolean isAbstract()
+  {
+    // TODO Auto-generated method stub
+    return false;
+  }
 }
 
 
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
index 0ff12cf..89bacb6 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/ComplexTypeEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2007 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -12,15 +12,21 @@
 
 import java.util.Iterator;
 
+import org.eclipse.draw2d.Label;
 import org.eclipse.draw2d.ManhattanConnectionRouter;
 import org.eclipse.gef.EditPart;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.FocusTypeColumn;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IComplexType;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IType;
 
 public class ComplexTypeEditPart extends StructureEditPart
-{   
+{
+  private Font italicFont;
+
   protected boolean shouldDrawConnection()
   {
     if (getParent().getModel() instanceof FocusTypeColumn)
@@ -80,5 +86,40 @@
       }
     }    
     return connectionFigure;
-  }  
+  }
+
+  protected void refreshVisuals()
+  {
+    super.refreshVisuals();
+    Label label = getNameLabelFigure();
+    IComplexType complexType = (IComplexType)getModel();
+    if (complexType.isAbstract())
+    {
+      if (italicFont == null)
+      {
+        Font font = label.getFont();
+        FontData [] fd = font.getFontData();
+        if (fd.length > 0)
+        {
+          fd[0].setStyle(fd[0].getStyle() | SWT.ITALIC);
+          italicFont = new Font(font.getDevice(), fd);
+        }
+      }
+      label.setFont(italicFont);
+    }
+    else
+    {
+      label.setFont(label.getParent().getFont());
+    }
+  }
+  
+  public void deactivate()
+  {
+    if (italicFont != null)
+    {
+      italicFont.dispose();
+      italicFont = null;
+    }
+    super.deactivate();
+  }
 }
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
index 9a28e75..fec8bec 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/TopLevelFieldEditPart.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -16,6 +16,9 @@
 import org.eclipse.gef.Request;
 import org.eclipse.gef.RequestConstants;
 import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTDirectEditPolicy;
 import org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies.ADTSelectionFeedbackEditPolicy;
 import org.eclipse.wst.xsd.ui.internal.adt.facade.IField;
@@ -25,6 +28,7 @@
 public class TopLevelFieldEditPart extends BoxEditPart implements INamedEditPart
 {
   protected ADTDirectEditPolicy adtDirectEditPolicy = new ADTDirectEditPolicy();
+  private Font italicFont;
   
   protected boolean shouldDrawConnection()
   {
@@ -64,10 +68,39 @@
   {
     IField field = (IField)getModel();
     BoxFigure boxFigure = (BoxFigure)getFigure();
-    boxFigure.getNameLabel().setText(field.getName());
+    Label label = boxFigure.getNameLabel();
+    label.setText(field.getName());
+    if (field.isAbstract())
+    {
+      if (italicFont == null)
+      {
+        Font font = label.getFont();
+        FontData [] fd = font.getFontData();
+        if (fd.length > 0)
+        {
+          fd[0].setStyle(fd[0].getStyle() | SWT.ITALIC);
+          italicFont = new Font(font.getDevice(), fd);
+        }
+      }
+      label.setFont(italicFont);
+    }
+    else
+    {
+      label.setFont(label.getParent().getFont());
+    }
     super.refreshVisuals();
   }
   
+  public void deactivate()
+  {
+    if (italicFont != null)
+    {
+      italicFont.dispose();
+      italicFont = null;
+    }
+    super.deactivate();
+  }
+  
   public Label getNameLabelFigure()
   {
     BoxFigure boxFigure = (BoxFigure)getFigure();
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
index 38387ac..c19224b 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IComplexType.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -14,4 +14,5 @@
 
 public interface IComplexType extends IType, IStructure
 {
+  boolean isAbstract();
 }
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
index 59a6280..7e31d32 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IField.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2006 IBM Corporation and others.
+ * Copyright (c) 2001, 2009 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@
   int getMaxOccurs();
   boolean isGlobal();
   boolean isReference();
+  boolean isAbstract();
   
   Command getUpdateMinOccursCommand(int minOccurs);
   Command getUpdateMaxOccursCommand(int maxOccurs);