From: incastrix Date: Wed, 23 Dec 2009 17:33:07 +0000 (+0000) Subject: Refactory: remove unused classes, imports, fields and methods. X-Git-Url: http://secure.phpeclipse.com Refactory: remove unused classes, imports, fields and methods. --- diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/ActionMessages.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/ActionMessages.java deleted file mode 100644 index 23e28bc..0000000 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/ActionMessages.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package net.sourceforge.phpdt.internal.debug.ui.actions; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class ActionMessages { - - private static final String BUNDLE_NAME = "org.eclipse.jdt.internal.debug.ui.actions.ActionMessages";//$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle - .getBundle(BUNDLE_NAME); - - private ActionMessages() { - } - - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - public static ResourceBundle getResourceBundle() { - return RESOURCE_BUNDLE; - } -} diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/PHPManageBreakpointRulerAction.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/PHPManageBreakpointRulerAction.java index 0efe1b1..7276c91 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/PHPManageBreakpointRulerAction.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/PHPManageBreakpointRulerAction.java @@ -19,7 +19,7 @@ import net.sourceforge.phpdt.debug.core.PHPDebugModel; import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiMessages; //import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin; -import org.eclipse.core.resources.IContainer; +//import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; @@ -50,7 +50,7 @@ public class PHPManageBreakpointRulerAction extends Action implements IUpdate { private ITextEditor fTextEditor; - private String fMarkerType; + //private String fMarkerType; private List fMarkers; @@ -62,7 +62,7 @@ public class PHPManageBreakpointRulerAction extends Action implements IUpdate { ITextEditor editor) { fRuler = ruler; fTextEditor = editor; - fMarkerType = IBreakpoint.BREAKPOINT_MARKER; + //fMarkerType = IBreakpoint.BREAKPOINT_MARKER; fAddLabel = PHPDebugUiMessages .getString("PHPManageBreakpointRulerAction.ToggleBreakpoint"); //$NON-NLS-1$ fRemoveLabel = PHPDebugUiMessages @@ -278,24 +278,24 @@ public class PHPManageBreakpointRulerAction extends Action implements IUpdate { } } - public IResource getUnderlyingResource(String fName) { - IResource parentResource = getResource(); // fParent.getUnderlyingResource(); - if (parentResource == null) { - return null; - } - int type = parentResource.getType(); - if (type == IResource.FOLDER || type == IResource.PROJECT) { - IContainer folder = (IContainer) parentResource; - IResource resource = folder.findMember(fName); - if (resource == null) { - // throw newNotPresentException(); - return null; - } else { - return resource; - } - } else { - return parentResource; - } - } +// public IResource getUnderlyingResource(String fName) { +// IResource parentResource = getResource(); // fParent.getUnderlyingResource(); +// if (parentResource == null) { +// return null; +// } +// int type = parentResource.getType(); +// if (type == IResource.FOLDER || type == IResource.PROJECT) { +// IContainer folder = (IContainer) parentResource; +// IResource resource = folder.findMember(fName); +// if (resource == null) { +// // throw newNotPresentException(); +// return null; +// } else { +// return resource; +// } +// } else { +// return parentResource; +// } +// } } diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java index 836c07e..e767a84 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/actions/ToggleBreakpointAdapter.java @@ -10,17 +10,17 @@ *******************************************************************************/ package net.sourceforge.phpdt.internal.debug.ui.actions; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; +//import java.util.ArrayList; +//import java.util.Iterator; +//import java.util.List; -import net.sourceforge.phpdt.core.Flags; -import net.sourceforge.phpdt.core.ICompilationUnit; -import net.sourceforge.phpdt.core.IJavaElement; -import net.sourceforge.phpdt.core.IMethod; -import net.sourceforge.phpdt.core.IType; -import net.sourceforge.phpdt.core.JavaModelException; -import net.sourceforge.phpdt.core.Signature; +//import net.sourceforge.phpdt.core.Flags; +//import net.sourceforge.phpdt.core.ICompilationUnit; +//import net.sourceforge.phpdt.core.IJavaElement; +//import net.sourceforge.phpdt.core.IMethod; +//import net.sourceforge.phpdt.core.IType; +//import net.sourceforge.phpdt.core.JavaModelException; +//import net.sourceforge.phpdt.core.Signature; import net.sourceforge.phpdt.debug.core.PHPDebugModel; import net.sourceforge.phpdt.internal.debug.core.breakpoints.PHPLineBreakpoint; import net.sourceforge.phpdt.internal.debug.ui.PHPDebugUiPlugin; @@ -33,7 +33,7 @@ import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; //import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; @@ -133,7 +133,7 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget { // String typeName= null; IResource resource; - PHPLineBreakpoint breakpoint = null; + //PHPLineBreakpoint breakpoint = null; // if (type == null) { if (editorInput instanceof IFileEditorInput) { resource = ((IFileEditorInput) editorInput).getFile(); @@ -159,8 +159,8 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget { .removeBreakpoint(existingBreakpoint, true); return; } else { - breakpoint = PHPDebugModel.createLineBreakpoint(resource, - lineNumber, 0, true, null); +// breakpoint = PHPDebugModel.createLineBreakpoint(resource, +// lineNumber, 0, true, null); } // } // new BreakpointLocationVerifierJob(document, breakpoint, @@ -312,25 +312,25 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget { return false; } - protected IMethod[] getMethods(IStructuredSelection selection) { - if (selection.isEmpty()) { - return new IMethod[0]; - } else { - List methods = new ArrayList(selection.size()); - Iterator iterator = selection.iterator(); - while (iterator.hasNext()) { - Object thing = iterator.next(); - try { - if (thing instanceof IMethod - && !Flags.isAbstract(((IMethod) thing).getFlags())) { - methods.add(thing); - } - } catch (JavaModelException e) { - } - } - return (IMethod[]) methods.toArray(new IMethod[methods.size()]); - } - } +// protected IMethod[] getMethods(IStructuredSelection selection) { +// if (selection.isEmpty()) { +// return new IMethod[0]; +// } else { +// List methods = new ArrayList(selection.size()); +// Iterator iterator = selection.iterator(); +// while (iterator.hasNext()) { +// Object thing = iterator.next(); +// try { +// if (thing instanceof IMethod +// && !Flags.isAbstract(((IMethod) thing).getFlags())) { +// methods.add(thing); +// } +// } catch (JavaModelException e) { +// } +// } +// return (IMethod[]) methods.toArray(new IMethod[methods.size()]); +// } +// } // protected IField[] getFields(IStructuredSelection selection) { // if (selection.isEmpty()) { @@ -433,65 +433,65 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget { // } } - public static String resolveMethodSignature(IType type, - String methodSignature) throws JavaModelException { - String[] parameterTypes = Signature.getParameterTypes(methodSignature); - int length = parameterTypes.length; - String[] resolvedParameterTypes = new String[length]; - - for (int i = 0; i < length; i++) { - resolvedParameterTypes[i] = resolveType(type, parameterTypes[i]); - if (resolvedParameterTypes[i] == null) { - return null; - } - } - - String resolvedReturnType = resolveType(type, Signature - .getReturnType(methodSignature)); - if (resolvedReturnType == null) { - return null; - } - - return Signature.createMethodSignature(resolvedParameterTypes, - resolvedReturnType); - } +// public static String resolveMethodSignature(IType type, +// String methodSignature) throws JavaModelException { +// String[] parameterTypes = Signature.getParameterTypes(methodSignature); +// int length = parameterTypes.length; +// String[] resolvedParameterTypes = new String[length]; +// +// for (int i = 0; i < length; i++) { +// resolvedParameterTypes[i] = resolveType(type, parameterTypes[i]); +// if (resolvedParameterTypes[i] == null) { +// return null; +// } +// } +// +// String resolvedReturnType = resolveType(type, Signature +// .getReturnType(methodSignature)); +// if (resolvedReturnType == null) { +// return null; +// } +// +// return Signature.createMethodSignature(resolvedParameterTypes, +// resolvedReturnType); +// } - private static String resolveType(IType type, String typeSignature) - throws JavaModelException { - // int count= Signature.getArrayCount(typeSignature); - // String elementTypeSignature= Signature.getElementType(typeSignature); - // if (elementTypeSignature.length() == 1) { - // // no need to resolve primitive types - // return typeSignature; - // } - // String elementTypeName= Signature.toString(elementTypeSignature); - // String[][] resolvedElementTypeNames= - // type.resolveType(elementTypeName); - // if (resolvedElementTypeNames == null || - // resolvedElementTypeNames.length != 1) { - // // the type name cannot be resolved - // return null; - // } - // String resolvedElementTypeName= - // Signature.toQualifiedName(resolvedElementTypeNames[0]); - // String resolvedElementTypeSignature= - // Signature.createTypeSignature(resolvedElementTypeName, - // true).replace('.', '/'); - // return Signature.createArraySignature(resolvedElementTypeSignature, - // count); - return ""; - } +// private static String resolveType(IType type, String typeSignature) +// throws JavaModelException { +// // int count= Signature.getArrayCount(typeSignature); +// // String elementTypeSignature= Signature.getElementType(typeSignature); +// // if (elementTypeSignature.length() == 1) { +// // // no need to resolve primitive types +// // return typeSignature; +// // } +// // String elementTypeName= Signature.toString(elementTypeSignature); +// // String[][] resolvedElementTypeNames= +// // type.resolveType(elementTypeName); +// // if (resolvedElementTypeNames == null || +// // resolvedElementTypeNames.length != 1) { +// // // the type name cannot be resolved +// // return null; +// // } +// // String resolvedElementTypeName= +// // Signature.toQualifiedName(resolvedElementTypeNames[0]); +// // String resolvedElementTypeSignature= +// // Signature.createTypeSignature(resolvedElementTypeName, +// // true).replace('.', '/'); +// // return Signature.createArraySignature(resolvedElementTypeSignature, +// // count); +// return ""; +// } - protected static IResource getResource(IEditorPart editor) { - IResource resource; - IEditorInput editorInput = editor.getEditorInput(); - if (editorInput instanceof IFileEditorInput) { - resource = ((IFileEditorInput) editorInput).getFile(); - } else { - resource = ResourcesPlugin.getWorkspace().getRoot(); - } - return resource; - } +// protected static IResource getResource(IEditorPart editor) { +// IResource resource; +// IEditorInput editorInput = editor.getEditorInput(); +// if (editorInput instanceof IFileEditorInput) { +// resource = ((IFileEditorInput) editorInput).getFile(); +// } else { +// resource = ResourcesPlugin.getWorkspace().getRoot(); +// } +// return resource; +// } /** * Returns a handle to the specified method or null if none. @@ -503,29 +503,29 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget { * @param signature * @return handle or null */ - protected IMethod getMethodHandle(IEditorPart editorPart, String typeName, - String methodName, String signature) throws CoreException { - IJavaElement element = (IJavaElement) editorPart.getEditorInput() - .getAdapter(IJavaElement.class); - IType type = null; - if (element instanceof ICompilationUnit) { - IType[] types = ((ICompilationUnit) element).getAllTypes(); - for (int i = 0; i < types.length; i++) { - if (types[i].getFullyQualifiedName().equals(typeName)) { - type = types[i]; - break; - } - } - } - // else if (element instanceof IClassFile) { - // type = ((IClassFile)element).getType(); - // } - if (type != null) { - String[] sigs = Signature.getParameterTypes(signature); - return type.getMethod(methodName, sigs); - } - return null; - } +// protected IMethod getMethodHandle(IEditorPart editorPart, String typeName, +// String methodName, String signature) throws CoreException { +// IJavaElement element = (IJavaElement) editorPart.getEditorInput() +// .getAdapter(IJavaElement.class); +// IType type = null; +// if (element instanceof ICompilationUnit) { +// IType[] types = ((ICompilationUnit) element).getAllTypes(); +// for (int i = 0; i < types.length; i++) { +// if (types[i].getFullyQualifiedName().equals(typeName)) { +// type = types[i]; +// break; +// } +// } +// } +// // else if (element instanceof IClassFile) { +// // type = ((IClassFile)element).getType(); +// // } +// if (type != null) { +// String[] sigs = Signature.getParameterTypes(signature); +// return type.getMethod(methodName, sigs); +// } +// return null; +// } // protected IJavaBreakpoint getBreakpoint(IMember element) { // IBreakpointManager breakpointManager= diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/ExecutionArguments.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/ExecutionArguments.java index 79311cd..1c2974f 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/ExecutionArguments.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/ExecutionArguments.java @@ -1,7 +1,7 @@ package net.sourceforge.phpdt.internal.debug.ui.launcher; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; +//import org.eclipse.core.resources.IFile; +//import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.QualifiedName; public class ExecutionArguments { @@ -12,49 +12,49 @@ public class ExecutionArguments { protected String interpreterArguments, phpFileArguments; - public static ExecutionArguments getExecutionArguments(IFile phpScriptFile) { - try { - String executionArgumentsPersistableFormat = phpScriptFile - .getPersistentProperty(EXECUTION_ARGUMENTS_PROPERTY); - ExecutionArguments executionArguments = new ExecutionArguments(); - - if (executionArgumentsPersistableFormat != null) { - int argBreakIndex = executionArgumentsPersistableFormat - .indexOf(ARGUMENT_SEPARATOR); - executionArguments - .setInterpreterArguments(executionArgumentsPersistableFormat - .substring(0, argBreakIndex)); - executionArguments - .setPHPFileArguments(executionArgumentsPersistableFormat - .substring(argBreakIndex - + ARGUMENT_SEPARATOR.length())); - } - - return executionArguments; - } catch (CoreException e) { - } - - return null; - } - - public static void setExecutionArguments(IFile phpScriptFile, - ExecutionArguments arguments) { - try { - phpScriptFile.setPersistentProperty(EXECUTION_ARGUMENTS_PROPERTY, - arguments.toPersistableFormat()); - } catch (CoreException e) { - } - } - - public void setInterpreterArguments(String theArguments) { - interpreterArguments = theArguments; - } - - public void setPHPFileArguments(String theArguments) { - phpFileArguments = theArguments; - } - - public String toPersistableFormat() { - return interpreterArguments + ARGUMENT_SEPARATOR + phpFileArguments; - } +// public static ExecutionArguments getExecutionArguments(IFile phpScriptFile) { +// try { +// String executionArgumentsPersistableFormat = phpScriptFile +// .getPersistentProperty(EXECUTION_ARGUMENTS_PROPERTY); +// ExecutionArguments executionArguments = new ExecutionArguments(); +// +// if (executionArgumentsPersistableFormat != null) { +// int argBreakIndex = executionArgumentsPersistableFormat +// .indexOf(ARGUMENT_SEPARATOR); +// executionArguments +// .setInterpreterArguments(executionArgumentsPersistableFormat +// .substring(0, argBreakIndex)); +// executionArguments +// .setPHPFileArguments(executionArgumentsPersistableFormat +// .substring(argBreakIndex +// + ARGUMENT_SEPARATOR.length())); +// } +// +// return executionArguments; +// } catch (CoreException e) { +// } +// +// return null; +// } + +// public static void setExecutionArguments(IFile phpScriptFile, +// ExecutionArguments arguments) { +// try { +// phpScriptFile.setPersistentProperty(EXECUTION_ARGUMENTS_PROPERTY, +// arguments.toPersistableFormat()); +// } catch (CoreException e) { +// } +// } + +// public void setInterpreterArguments(String theArguments) { +// interpreterArguments = theArguments; +// } + +// public void setPHPFileArguments(String theArguments) { +// phpFileArguments = theArguments; +// } + +// public String toPersistableFormat() { +// return interpreterArguments + ARGUMENT_SEPARATOR + phpFileArguments; +// } } \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java index c51906a..87e8a33 100644 --- a/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java +++ b/net.sourceforge.phpeclipse.debug.ui/src/net/sourceforge/phpdt/internal/debug/ui/launcher/PHPEnvironmentTab.java @@ -33,7 +33,7 @@ import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; +//import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; @@ -479,22 +479,22 @@ public class PHPEnvironmentTab extends AbstractLaunchConfigurationTab { // is customizable on the configuration // } - protected SelectionListener getLoadPathSelectionListener() { - return new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - System.out.println("Loadpath list selection occurred: " - + e.getSource()); - } - }; - } - - protected SelectionListener getLoadPathDefaultButtonSelectionListener() { - return new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - setUseLoadPathDefaults(((Button) e.getSource()).getSelection()); - } - }; - } +// protected SelectionListener getLoadPathSelectionListener() { +// return new SelectionAdapter() { +// public void widgetSelected(SelectionEvent e) { +// System.out.println("Loadpath list selection occurred: " +// + e.getSource()); +// } +// }; +// } + +// protected SelectionListener getLoadPathDefaultButtonSelectionListener() { +// return new SelectionAdapter() { +// public void widgetSelected(SelectionEvent e) { +// setUseLoadPathDefaults(((Button) e.getSource()).getSelection()); +// } +// }; +// } protected void addInterpreterTab(TabFolder tabFolder) { Composite interpreterComposite = new Composite(tabFolder, SWT.NONE); @@ -711,10 +711,10 @@ public class PHPEnvironmentTab extends AbstractLaunchConfigurationTab { // } // } - protected void setUseLoadPathDefaults(boolean useDefaults) { - loadPathListViewer.getList().setEnabled(!useDefaults); - // loadPathDefaultButton.setSelection(useDefaults); - } +// protected void setUseLoadPathDefaults(boolean useDefaults) { +// loadPathListViewer.getList().setEnabled(!useDefaults); +// // loadPathDefaultButton.setSelection(useDefaults); +// } protected void initializeInterpreterSelection( ILaunchConfiguration configuration) {