Author: DartPeng
Date: 2009-05-12 05:15:47 -0400 (Tue, 12 May 2009)
New Revision: 15220
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
Log:
JBIDE-4232
change the tooltip of notification image
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12
07:54:28 UTC (rev 15219)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12
09:15:47 UTC (rev 15220)
@@ -119,7 +119,6 @@
}
Thread thread = new Thread() {
public void run() {
- long startTime = System.currentTimeMillis();
synchronized (lock) {
starting = true;
waiting = true;
@@ -171,8 +170,6 @@
} finally {
waiting = false;
starting = false;
- long engTime = System.currentTimeMillis();
- System.out.println(engTime - startTime);
}
}
};
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2009-05-12
07:54:28 UTC (rev 15219)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2009-05-12
09:15:47 UTC (rev 15220)
@@ -10,12 +10,20 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.IFormColors;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
/**
@@ -28,15 +36,47 @@
private Image waringImage = null;
-// private Image informationImage = null;
+ // private Image informationImage = null;
private int type = TYPE_NONE;
+ private DefaultToolTip toolTip = null;
+
+
public FieldMarkerComposite(Composite parent, int style) {
super(parent, style);
- errorImage =
SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_OVR_ERROR);
- waringImage =
SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_OVR_WARING);
+ errorImage = SmooksConfigurationActivator.getDefault().getImageRegistry()
+ .get(GraphicsConstants.IMAGE_OVR_ERROR);
+ waringImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(
+ GraphicsConstants.IMAGE_OVR_WARING);
this.addPaintListener(this);
+ toolTip = new DefaultToolTip(this) {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.window.DefaultToolTip#createToolTipContentArea
+ * (org.eclipse.swt.widgets.Event,
+ * org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Composite createToolTipContentArea(Event event, Composite parent) {
+ return super.createToolTipContentArea(event, parent);
+ }
+
+ public Point getLocation(Point tipSize, Event event) {
+ Point point = super.getLocation(tipSize, event);
+ point.y = ((Control) getToolTipArea(null)).toDisplay(0,0).y - 24;
+ point.x = ((Control) getToolTipArea(null)).toDisplay(0,0).x;
+ return point;
+ }
+
+ };
+ ((DefaultToolTip)toolTip).setBackgroundColor(new Color(null,255,255,255));
+ FormColors colors = new FormColors(getDisplay());
+ ((DefaultToolTip)toolTip).setForegroundColor(colors.getColor(IFormColors.TITLE));
+ toolTip.setStyle(SWT.NONE);
}
/*
@@ -49,8 +89,8 @@
this.type = type;
this.redraw();
}
-
- public int getMarkerType(){
+
+ public int getMarkerType() {
return type;
}
@@ -61,10 +101,10 @@
* org.jboss.tools.smooks.configuration.editors.IFieldMarker#setMessage()
*/
public void setMessage(String message) {
- this.setToolTipText(message);
+ toolTip.setText(message);
}
-
- public String getMessage(){
+
+ public String getMessage() {
return getToolTipText();
}
Show replies by date