made message: "Include filename doesn't exist in project" configurable
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.ui / src / net / sourceforge / phpdt / internal / debug / ui / PHPDebugHover.java
index 9b41956..8510396 100644 (file)
 package net.sourceforge.phpdt.internal.debug.ui;
 
 
+import net.sourceforge.phpdt.internal.debug.core.model.PHPStackFrame;
+import net.sourceforge.phpdt.internal.debug.core.model.PHPValue;
+import net.sourceforge.phpdt.internal.ui.text.HTMLTextPresenter;
+import net.sourceforge.phpdt.internal.ui.text.JavaWordFinder;
+import net.sourceforge.phpdt.ui.PreferenceConstants;
+import net.sourceforge.phpdt.ui.text.java.hover.IJavaEditorTextHover;
+
 import org.eclipse.core.runtime.IAdaptable;
-//import org.eclipse.core.runtime.Platform;
 import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.model.IValue;
 import org.eclipse.debug.core.model.IVariable;
 import org.eclipse.debug.ui.IDebugUIConstants;
-//import org.eclipse.jdt.debug.core.IJavaStackFrame;
-//import org.eclipse.jdt.debug.core.IJavaThread;
-//import org.eclipse.jdt.debug.core.IJavaType;
-//import org.eclipse.jdt.debug.core.IJavaValue;
-import net.sourceforge.phpdt.internal.ui.text.HTMLTextPresenter;
-//import org.eclipse.jdt.ui.PreferenceConstants;
-//import org.eclipse.jdt.ui.text.java.hover.IJavaEditorTextHover;
-import net.sourceforge.phpdt.ui.text.java.hover.IJavaEditorTextHover;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.DefaultInformationControl;
 import org.eclipse.jface.text.IDocument;
@@ -44,10 +42,6 @@ import org.eclipse.ui.ISelectionListener;
 import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPart;
 
-import net.sourceforge.phpdt.internal.debug.core.model.PHPStackFrame;
-import net.sourceforge.phpdt.internal.debug.core.model.PHPValue;
-import net.sourceforge.phpdt.internal.ui.text.JavaWordFinder;
-
 
 public class PHPDebugHover implements IJavaEditorTextHover, ITextHoverExtension, ISelectionListener, IPartListener {
                
@@ -237,4 +231,20 @@ public class PHPDebugHover implements IJavaEditorTextHover, ITextHoverExtension,
 //             }
 //             return null;
        }
+       
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.text.ITextHoverExtension#getHoverControlCreator()
+        */
+       public IInformationControlCreator getHoverControlCreator() {
+               if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE)) { //$NON-NLS-1$
+                       return new IInformationControlCreator() {
+                               public IInformationControl createInformationControl(Shell parent) {
+                                       return new DefaultInformationControl(parent, SWT.NONE, 
+                                               new HTMLTextPresenter(true),
+                                               PHPDebugUiMessages.getString("PHPDebugHover.16")); //$NON-NLS-1$
+                               }
+                       };
+               }
+               return null;
+       }
 }