1) Action for breakpoint properties menu.
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.ui / src / net / sourceforge / phpdt / internal / debug / ui / actions / ToggleBreakpointAdapter.java
index 45c59bc..f898f61 100644 (file)
 package net.sourceforge.phpdt.internal.debug.ui.actions;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import net.sourceforge.phpdt.core.Flags;
 import net.sourceforge.phpdt.core.ICompilationUnit;
-import net.sourceforge.phpdt.core.IField;
 import net.sourceforge.phpdt.core.IJavaElement;
-import net.sourceforge.phpdt.core.IJavaProject;
-import net.sourceforge.phpdt.core.IMember;
 import net.sourceforge.phpdt.core.IMethod;
-import net.sourceforge.phpdt.core.ISourceRange;
 import net.sourceforge.phpdt.core.IType;
-import net.sourceforge.phpdt.core.JavaCore;
 import net.sourceforge.phpdt.core.JavaModelException;
 import net.sourceforge.phpdt.core.Signature;
-import net.sourceforge.phpdt.core.dom.CompilationUnit;
-import net.sourceforge.phpdt.core.search.IJavaSearchConstants;
-import net.sourceforge.phpdt.core.search.ITypeNameRequestor;
 import net.sourceforge.phpdt.debug.core.PHPDebugModel;
 import net.sourceforge.phpdt.internal.debug.core.breakpoints.PHPLineBreakpoint;
 import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin;
 import net.sourceforge.phpdt.internal.ui.util.ExceptionHandler;
-import net.sourceforge.phpdt.ui.IWorkingCopyManager;
-import net.sourceforge.phpdt.ui.JavaUI;
 
-import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.debug.core.DebugException;
 import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.IBreakpointManager;
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.model.IBreakpoint;
 import org.eclipse.debug.internal.ui.actions.ActionMessages;
 import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget;
-import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IFileEditorInput;
@@ -170,7 +146,8 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
                                //                              }
 //                             new BreakpointLocationVerifierJob(document, breakpoint, lineNumber, typeName, type, resource, (IEditorStatusLine) editorPart.getAdapter(IEditorStatusLine.class)).schedule();
                        } catch (CoreException ce) {
-                               ExceptionHandler.handle(ce, ActionMessages.getString("ManageBreakpointActionDelegate.error.title1"), ActionMessages.getString("ManageBreakpointActionDelegate.error.message1")); //$NON-NLS-1$ //$NON-NLS-2$
+               // TODO: no message in ActionMessages
+                //ExceptionHandler.handle(ce, ActionMessages.getString("ManageBreakpointActionDelegate.error.title1"), ActionMessages.getString("ManageBreakpointActionDelegate.error.message1")); //$NON-NLS-1$ //$NON-NLS-2$
                                return;
                        }
                }
@@ -274,12 +251,13 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
         * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
         */
        public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) {
-               if (selection instanceof IStructuredSelection) {
-                       IStructuredSelection ss = (IStructuredSelection) selection;
-                       return getMethods(ss).length > 0;
-               } else {
-                       return selection instanceof ITextSelection;
-               }
+//             if (selection instanceof IStructuredSelection) {
+//                     IStructuredSelection ss = (IStructuredSelection) selection;
+//                     return getMethods(ss).length > 0;
+//             } else {
+//                     return selection instanceof ITextSelection;
+//             }
+               return false;
        }
        
        protected IMethod[] getMethods(IStructuredSelection selection) {