Show browser preview only then editor area is visible
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPEditor.java
index ade4363..585993d 100644 (file)
@@ -55,6 +55,7 @@ import net.sourceforge.phpdt.ui.text.JavaTextTools;
 import net.sourceforge.phpdt.ui.text.PHPSourceViewerConfiguration;
 import net.sourceforge.phpdt.ui.text.folding.IJavaFoldingStructureProvider;
 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+import net.sourceforge.phpeclipse.ui.editor.ShowExternalPreviewAction;
 
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IResource;
@@ -171,7 +172,6 @@ import org.eclipse.ui.texteditor.ITextEditorActionConstants;
 import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
 import org.eclipse.ui.texteditor.IUpdate;
 import org.eclipse.ui.texteditor.MarkerAnnotation;
-import org.eclipse.ui.texteditor.ResourceAction;
 import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
 import org.eclipse.ui.texteditor.TextEditorAction;
 import org.eclipse.ui.texteditor.TextNavigationAction;
@@ -901,7 +901,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
   //
   //        while (offset >= 0) {
   //          c = document.getChar(offset);
-  //          if (!Character.isJavaIdentifierPart(c))
+  //          if (!Scanner.isPHPIdentifierPart(c))
   //            break;
   //          --offset;
   //        }
@@ -913,7 +913,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
   //
   //        while (offset < length) {
   //          c = document.getChar(offset);
-  //          if (!Character.isJavaIdentifierPart(c))
+  //          if (!Scanner.isPHPIdentifierPart(c))
   //            break;
   //          ++offset;
   //        }
@@ -1578,7 +1578,6 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
 
         while (offset >= 0) {
           c = document.getChar(offset);
-          //                                   if (!Character.isJavaIdentifierPart(c)&&c!='$')
           if (!Scanner.isPHPIdentifierPart(c) && c != '$')
             break;
           --offset;
@@ -1591,7 +1590,6 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
 
         while (offset < length) {
           c = document.getChar(offset);
-          //                                   if (!Character.isJavaIdentifierPart(c)&&c!='$')
           if (!Scanner.isPHPIdentifierPart(c) && c != '$')
             break;
           ++offset;
@@ -2287,7 +2285,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#setCaretPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#setCaretPosition(int)
      */
     protected void setCaretPosition(final int position) {
       getTextWidget().setCaretOffset(modelOffset2WidgetOffset(getSourceViewer(), position));
@@ -2309,7 +2307,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#setCaretPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#setCaretPosition(int)
      */
     protected void setCaretPosition(final int position) {
       if (!validateEditorInputState())
@@ -2326,7 +2324,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#findNextPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#findNextPosition(int)
      */
     protected int findNextPosition(int position) {
       return fIterator.following(position);
@@ -2355,7 +2353,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#setCaretPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.NextSubWordAction#setCaretPosition(int)
      */
     protected void setCaretPosition(final int position) {
       final ISourceViewer viewer = getSourceViewer();
@@ -2464,7 +2462,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#setCaretPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#setCaretPosition(int)
      */
     protected void setCaretPosition(final int position) {
       getTextWidget().setCaretOffset(modelOffset2WidgetOffset(getSourceViewer(), position));
@@ -2486,7 +2484,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#setCaretPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#setCaretPosition(int)
      */
     protected void setCaretPosition(final int position) {
       if (!validateEditorInputState())
@@ -2503,7 +2501,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#findPreviousPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#findPreviousPosition(int)
      */
     protected int findPreviousPosition(int position) {
       return fIterator.preceding(position);
@@ -2532,7 +2530,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     }
 
     /*
-     * @see org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#setCaretPosition(int)
+     * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor.PreviousSubWordAction#setCaretPosition(int)
      */
     protected void setCaretPosition(final int position) {
       final ISourceViewer viewer = getSourceViewer();
@@ -2886,6 +2884,7 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
     JavaTextTools textTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
     setSourceViewerConfiguration(new PHPSourceViewerConfiguration(textTools.getColorManager(), store, this,
         IPHPPartitions.PHP_PARTITIONING));
+    
     // TODO changed in 3.x ?
     //    setRangeIndicator(new DefaultRangeIndicator());
     //    if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE))
@@ -3187,12 +3186,13 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements I
 
     fFoldingGroup = new FoldingActionGroup(this, getViewer());
 
-    ResourceAction resAction = new TextOperationAction(PHPEditorMessages.getResourceBundle(),
-        "ShowJavaDoc.", this, ISourceViewer.INFORMATION, true); //$NON-NLS-1$
-    resAction = new InformationDispatchAction(PHPEditorMessages.getResourceBundle(),
-        "ShowJavaDoc.", (TextOperationAction) resAction); //$NON-NLS-1$
-    resAction.setActionDefinitionId(net.sourceforge.phpdt.ui.actions.PHPEditorActionDefinitionIds.SHOW_JAVADOC);
-    setAction("ShowJavaDoc", resAction); //$NON-NLS-1$
+//    ResourceAction resAction = new TextOperationAction(PHPEditorMessages.getResourceBundle(),
+//        "ShowJavaDoc.", this, ISourceViewer.INFORMATION, true); //$NON-NLS-1$
+//    resAction = new InformationDispatchAction(PHPEditorMessages.getResourceBundle(),
+//        "ShowJavaDoc.", (TextOperationAction) resAction); //$NON-NLS-1$
+//    resAction.setActionDefinitionId(net.sourceforge.phpdt.ui.actions.PHPEditorActionDefinitionIds.SHOW_JAVADOC);
+//    setAction("ShowJavaDoc", resAction); //$NON-NLS-1$
+    
     // WorkbenchHelp.setHelp(resAction,
     // IJavaHelpContextIds.SHOW_JAVADOC_ACTION);