--- extensions.org.eclipse.ui.actions.TextActionHandler.java	Thu Aug  6 11:12:05 2009
+++ src.org.eclipse.ui.internal.navigator.TextActionHandler.java	Thu Aug  6 11:12:44 2009
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 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
@@ -8,7 +8,7 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-package org.eclipse.ui.actions;
+package org.eclipse.ui.internal.navigator;
 
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
@@ -19,14 +19,12 @@
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.MouseAdapter;
 import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
-import org.eclipse.ui.internal.ide.IIDEHelpContextIds;
+import org.eclipse.ui.actions.ActionFactory;
 
 /**
  * Handles the redirection of the global Cut, Copy, Paste, and
@@ -43,7 +41,6 @@
  * textActionHandler.setSelectAllAction(selectAllAction);
  * </pre>
  * </p>
- * @noextend This class is not intended to be subclassed by clients.
  */
 public class TextActionHandler {
     private DeleteActionHandler textDeleteAction = new DeleteActionHandler();
@@ -135,31 +132,18 @@
 
     private class DeleteActionHandler extends Action {
         protected DeleteActionHandler() {
-            super(IDEWorkbenchMessages.Delete);
+            super(CommonNavigatorMessages.Delete);
             setId("TextDeleteActionHandler");//$NON-NLS-1$
             setEnabled(false);
             PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
-					IIDEHelpContextIds.TEXT_DELETE_ACTION);
+            		INavigatorHelpContextIds.TEXT_DELETE_ACTION);
         }
 
         public void runWithEvent(Event event) {
             if (activeTextControl != null && !activeTextControl.isDisposed()) {
-				String text = activeTextControl.getText();
-				Point selection = activeTextControl.getSelection();
-				if (selection.y == selection.x) {
-					++selection.y;
-				}
-				if (selection.y > text.length()) {
-					return;
-				}
-				StringBuffer buf = new StringBuffer(text.substring(0,
-						selection.x));
-				buf.append(text.substring(selection.y));
-				activeTextControl.setText(buf.toString());
-				activeTextControl.setSelection(selection.x, selection.x);
-				updateActionsEnableState();
-				return;
-			}
+                activeTextControl.clearSelection();
+                return;
+            }
             if (deleteAction != null) {
                 deleteAction.runWithEvent(event);
                 return;
@@ -186,17 +170,16 @@
 
     private class CutActionHandler extends Action {
         protected CutActionHandler() {
-            super(IDEWorkbenchMessages.Cut);
+            super(CommonNavigatorMessages.Cut);
             setId("TextCutActionHandler");//$NON-NLS-1$
             setEnabled(false);
             PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
-					IIDEHelpContextIds.TEXT_CUT_ACTION);
+            		INavigatorHelpContextIds.TEXT_CUT_ACTION);
         }
 
         public void runWithEvent(Event event) {
             if (activeTextControl != null && !activeTextControl.isDisposed()) {
                 activeTextControl.cut();
-                updateActionsEnableState();
                 return;
             }
             if (cutAction != null) {
@@ -223,17 +206,16 @@
 
     private class CopyActionHandler extends Action {
         protected CopyActionHandler() {
-            super(IDEWorkbenchMessages.Copy);
+            super(CommonNavigatorMessages.Copy);
             setId("TextCopyActionHandler");//$NON-NLS-1$
             setEnabled(false);
             PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
-					IIDEHelpContextIds.TEXT_COPY_ACTION);
+            		INavigatorHelpContextIds.TEXT_COPY_ACTION);
         }
 
         public void runWithEvent(Event event) {
             if (activeTextControl != null && !activeTextControl.isDisposed()) {
                 activeTextControl.copy();
-                updateActionsEnableState();
                 return;
             }
             if (copyAction != null) {
@@ -260,17 +242,16 @@
 
     private class PasteActionHandler extends Action {
         protected PasteActionHandler() {
-            super(IDEWorkbenchMessages.Paste);
+            super(CommonNavigatorMessages.Paste);
             setId("TextPasteActionHandler");//$NON-NLS-1$
             setEnabled(false);
             PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
-					IIDEHelpContextIds.TEXT_PASTE_ACTION);
+            		INavigatorHelpContextIds.TEXT_PASTE_ACTION);
         }
 
         public void runWithEvent(Event event) {
             if (activeTextControl != null && !activeTextControl.isDisposed()) {
                 activeTextControl.paste();
-                updateActionsEnableState();
                 return;
             }
             if (pasteAction != null) {
@@ -297,17 +278,16 @@
 
     private class SelectAllActionHandler extends Action {
         protected SelectAllActionHandler() {
-            super(IDEWorkbenchMessages.TextAction_selectAll);
+            super(CommonNavigatorMessages.TextAction_selectAll);
             setId("TextSelectAllActionHandler");//$NON-NLS-1$
             setEnabled(false);
             PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
-					IIDEHelpContextIds.TEXT_SELECT_ALL_ACTION);
+					INavigatorHelpContextIds.TEXT_SELECT_ALL_ACTION);
         }
 
         public void runWithEvent(Event event) {
             if (activeTextControl != null && !activeTextControl.isDisposed()) {
                 activeTextControl.selectAll();
-                updateActionsEnableState();
                 return;
             }
             if (selectAllAction != null) {
@@ -555,3 +535,4 @@
         textDeleteAction.updateEnabledState();
     }
 }
+
