Introduce a field "stringValue" used by the new method getString() that read a string...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPActionContributor.java
index 84fdf1c..f90cf80 100644 (file)
@@ -12,23 +12,21 @@ Contributors:
     Klaus Hartlage - www.eclipseproject.de
 **********************************************************************/
 
-import java.util.ResourceBundle;
+import net.sourceforge.phpdt.ui.actions.*;
 import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.editors.text.TextEditorActionContributor;
+import org.eclipse.ui.actions.ActionGroup;
 import org.eclipse.ui.texteditor.BasicTextEditorActionContributor;
 import org.eclipse.ui.texteditor.ITextEditor;
 import org.eclipse.ui.texteditor.RetargetTextEditorAction;
-import org.eclipse.ui.texteditor.TextEditorAction;
 
 /**
  * Contributes interesting PHP actions to the desktop's Edit menu and the toolbar.
  */
-public class PHPActionContributor extends BasicTextEditorActionContributor implements PHPEditorActionDefinitionIds {
+public class PHPActionContributor extends BasicTextEditorActionContributor   {
 
   protected RetargetTextEditorAction fContentAssistProposal;
   // protected RetargetTextEditorAction fContentAssistTip;
@@ -78,9 +76,15 @@ public class PHPActionContributor extends BasicTextEditorActionContributor imple
     //  fContentAssistTip.setAction(getAction(editor, "ContentAssistTip")); //$NON-NLS-1$
 
     IActionBars bars = getActionBars();
-    bars.setGlobalActionHandler(COMMENT, getAction(textEditor, "Comment"));
-    bars.setGlobalActionHandler(UNCOMMENT, getAction(textEditor, "Uncomment"));
-
+    bars.setGlobalActionHandler(PHPdtActionConstants.COMMENT, getAction(textEditor, "Comment"));
+    bars.setGlobalActionHandler(PHPdtActionConstants.UNCOMMENT, getAction(textEditor, "Uncomment"));
+
+    if (part instanceof PHPEditor) {
+      PHPEditor cuEditor= (PHPEditor)part;
+      ActionGroup group= cuEditor.getActionGroup();
+      if (group != null)
+        group.fillActionBars(bars);
+    }
     //    fTogglePresentation.setEditor(editor);
     //    fTogglePresentation.update();
 
@@ -92,9 +96,7 @@ public class PHPActionContributor extends BasicTextEditorActionContributor imple
    * @see IEditorActionBarContributor#setActiveEditor(IEditorPart)
    */
   public void setActiveEditor(IEditorPart part) {
-    super.setActiveEditor(part);
-    doSetActiveEditor(part);
-
+    doSetActiveEditor(part);   
   }
 
   /*