From: incastrix Date: Mon, 5 Oct 2009 22:46:26 +0000 (+0000) Subject: removed unused private methods. X-Git-Url: http://git.phpeclipse.com?hp=97bec29acd0cf050718c9e44e34513bfc0042660 removed unused private methods. --- diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/actions/ExternalPHPParser.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/actions/ExternalPHPParser.java index e88a6bb..7329758 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/actions/ExternalPHPParser.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/actions/ExternalPHPParser.java @@ -164,34 +164,34 @@ public class ExternalPHPParser { * @throws CoreException * an exception throwed by the MarkerUtilities */ - private void setMarker(final IFile file, final String message, - final int charStart, final int charEnd, final int errorLevel) - throws CoreException { - if (file != null) { - final Hashtable attributes = new Hashtable(); - MarkerUtilities.setMessage(attributes, message); - switch (errorLevel) { - case ERROR: - attributes.put(IMarker.SEVERITY, new Integer( - IMarker.SEVERITY_ERROR)); - break; - case WARNING: - attributes.put(IMarker.SEVERITY, new Integer( - IMarker.SEVERITY_WARNING)); - break; - case INFO: - attributes.put(IMarker.SEVERITY, new Integer( - IMarker.SEVERITY_INFO)); - break; - case TASK: - attributes.put(IMarker.SEVERITY, new Integer(IMarker.TASK)); - break; - } - MarkerUtilities.setCharStart(attributes, charStart); - MarkerUtilities.setCharEnd(attributes, charEnd); - MarkerUtilities.createMarker(file, attributes, PROBLEM_ID); - } - } +// private void setMarker(final IFile file, final String message, +// final int charStart, final int charEnd, final int errorLevel) +// throws CoreException { +// if (file != null) { +// final Hashtable attributes = new Hashtable(); +// MarkerUtilities.setMessage(attributes, message); +// switch (errorLevel) { +// case ERROR: +// attributes.put(IMarker.SEVERITY, new Integer( +// IMarker.SEVERITY_ERROR)); +// break; +// case WARNING: +// attributes.put(IMarker.SEVERITY, new Integer( +// IMarker.SEVERITY_WARNING)); +// break; +// case INFO: +// attributes.put(IMarker.SEVERITY, new Integer( +// IMarker.SEVERITY_INFO)); +// break; +// case TASK: +// attributes.put(IMarker.SEVERITY, new Integer(IMarker.TASK)); +// break; +// } +// MarkerUtilities.setCharStart(attributes, charStart); +// MarkerUtilities.setCharEnd(attributes, charEnd); +// MarkerUtilities.createMarker(file, attributes, PROBLEM_ID); +// } +// } /** * This will set a marker. @@ -207,37 +207,37 @@ public class ExternalPHPParser { * @throws CoreException * an exception throwed by the MarkerUtilities */ - private void setMarker(final IFile file, final String message, - final int line, final int errorLevel, final String location) - throws CoreException { - if (file != null) { - String markerKind = PROBLEM_ID; - final Hashtable attributes = new Hashtable(); - MarkerUtilities.setMessage(attributes, message); - switch (errorLevel) { - case ERROR: - attributes.put(IMarker.SEVERITY, new Integer( - IMarker.SEVERITY_ERROR)); - break; - case WARNING: - attributes.put(IMarker.SEVERITY, new Integer( - IMarker.SEVERITY_WARNING)); - break; - case INFO: - attributes.put(IMarker.SEVERITY, new Integer( - IMarker.SEVERITY_INFO)); - break; - case TASK: - attributes.put(IMarker.SEVERITY, new Integer( - IMarker.SEVERITY_INFO)); - markerKind = IMarker.TASK; - break; - } - attributes.put(IMarker.LOCATION, location); - MarkerUtilities.setLineNumber(attributes, line); - MarkerUtilities.createMarker(file, attributes, markerKind); - } - } +// private void setMarker(final IFile file, final String message, +// final int line, final int errorLevel, final String location) +// throws CoreException { +// if (file != null) { +// String markerKind = PROBLEM_ID; +// final Hashtable attributes = new Hashtable(); +// MarkerUtilities.setMessage(attributes, message); +// switch (errorLevel) { +// case ERROR: +// attributes.put(IMarker.SEVERITY, new Integer( +// IMarker.SEVERITY_ERROR)); +// break; +// case WARNING: +// attributes.put(IMarker.SEVERITY, new Integer( +// IMarker.SEVERITY_WARNING)); +// break; +// case INFO: +// attributes.put(IMarker.SEVERITY, new Integer( +// IMarker.SEVERITY_INFO)); +// break; +// case TASK: +// attributes.put(IMarker.SEVERITY, new Integer( +// IMarker.SEVERITY_INFO)); +// markerKind = IMarker.TASK; +// break; +// } +// attributes.put(IMarker.LOCATION, location); +// MarkerUtilities.setLineNumber(attributes, line); +// MarkerUtilities.createMarker(file, attributes, markerKind); +// } +// } /** * This will set a marker. @@ -253,14 +253,14 @@ public class ExternalPHPParser { * @throws CoreException * an exception throwed by the MarkerUtilities */ - private void setMarker(final String message, final int charStart, - final int charEnd, final int errorLevel, final String location) - throws CoreException { - if (fFileToParse != null) { - setMarker(fFileToParse, message, charStart, charEnd, errorLevel, - location); - } - } +// private void setMarker(final String message, final int charStart, +// final int charEnd, final int errorLevel, final String location) +// throws CoreException { +// if (fFileToParse != null) { +// setMarker(fFileToParse, message, charStart, charEnd, errorLevel, +// location); +// } +// } /** * This will set a marker. diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java index babbcc6..1568284 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java @@ -150,13 +150,13 @@ public final class ExternalToolMigration { /* package */ // This method is not called. It is left here in case // we decide to do tool migration in the future - private static void readInOldTools() { - readIn20Tools(); - readIn21Tools(); - } +// private static void readInOldTools() { +// readIn20Tools(); +// readIn21Tools(); +// } - private static void readIn21Tools() { - } +// private static void readIn21Tools() { +// } public static void readIn20Tools() { boolean migrationSuccessful = true; diff --git a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java index 8d4c5c2..135cdcd 100644 --- a/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java +++ b/net.sourceforge.phpeclipse.phpunit/src/net/sourceforge/phpeclipse/phpunit/PHPUnitView.java @@ -135,26 +135,26 @@ public class PHPUnitView extends ViewPart { /** * @param parent */ - private void buildSettingsComposite(Composite parent) { - - // settingsInfoComposite = new Group(parent, SWT.NONE); - // settingsInfoComposite.setText("Settings"); - // settingsInfoComposite.setLayout(new GridLayout(2,false)); - // - // - // //the test suite to launch - // Label testSuiteLabel = new Label(settingsInfoComposite, SWT.NONE); - // testSuiteLabel.setText("Test suite to run:"); - // //testSuiteLabel.setLayoutData(new GridData()) - // Text testSuiteText = new Text(settingsInfoComposite, SWT.NONE); - // - // //the path to php - // Label phpPathLabel = new Label(settingsInfoComposite, SWT.NONE); - // phpPathLabel.setText("php Path:"); - // //testSuiteLabel.setLayoutData(new GridData()) - // Text phpPathText = new Text(settingsInfoComposite, SWT.NONE); - - } +// private void buildSettingsComposite(Composite parent) { +// +// // settingsInfoComposite = new Group(parent, SWT.NONE); +// // settingsInfoComposite.setText("Settings"); +// // settingsInfoComposite.setLayout(new GridLayout(2,false)); +// // +// // +// // //the test suite to launch +// // Label testSuiteLabel = new Label(settingsInfoComposite, SWT.NONE); +// // testSuiteLabel.setText("Test suite to run:"); +// // //testSuiteLabel.setLayoutData(new GridData()) +// // Text testSuiteText = new Text(settingsInfoComposite, SWT.NONE); +// // +// // //the path to php +// // Label phpPathLabel = new Label(settingsInfoComposite, SWT.NONE); +// // phpPathLabel.setText("php Path:"); +// // //testSuiteLabel.setLayoutData(new GridData()) +// // Text phpPathText = new Text(settingsInfoComposite, SWT.NONE); +// +// } private void setActions() { diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/codemanipulation/StubUtility.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/codemanipulation/StubUtility.java index 8b8c9f4..3459e75 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/codemanipulation/StubUtility.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/codemanipulation/StubUtility.java @@ -5,7 +5,7 @@ package net.sourceforge.phpdt.internal.corext.codemanipulation; import java.util.Arrays; -import java.util.Comparator; +//import java.util.Comparator; import java.util.List; import java.util.StringTokenizer; @@ -467,23 +467,23 @@ public class StubUtility { // return result; // } - private static String getSeeTag(String declaringClassQualifiedName, - String methodName, String[] parameterTypesQualifiedNames) { - StringBuffer buf = new StringBuffer(); - buf.append("@see "); //$NON-NLS-1$ - buf.append(declaringClassQualifiedName); - buf.append('#'); - buf.append(methodName); - buf.append('('); - for (int i = 0; i < parameterTypesQualifiedNames.length; i++) { - if (i > 0) { - buf.append(", "); //$NON-NLS-1$ - } - buf.append(parameterTypesQualifiedNames[i]); - } - buf.append(')'); - return buf.toString(); - } +// private static String getSeeTag(String declaringClassQualifiedName, +// String methodName, String[] parameterTypesQualifiedNames) { +// StringBuffer buf = new StringBuffer(); +// buf.append("@see "); //$NON-NLS-1$ +// buf.append(declaringClassQualifiedName); +// buf.append('#'); +// buf.append(methodName); +// buf.append('('); +// for (int i = 0; i < parameterTypesQualifiedNames.length; i++) { +// if (i > 0) { +// buf.append(", "); //$NON-NLS-1$ +// } +// buf.append(parameterTypesQualifiedNames[i]); +// } +// buf.append(')'); +// return buf.toString(); +// } private static String getSeeTag(IMethod overridden) throws JavaModelException { @@ -915,21 +915,21 @@ public class StubUtility { * * @return The found method or null, if nothing found */ - private static IMethod findMethod(IMethod method, List allMethods) - throws JavaModelException { - String name = method.getElementName(); - String[] paramTypes = method.getParameterTypes(); - boolean isConstructor = method.isConstructor(); - - for (int i = allMethods.size() - 1; i >= 0; i--) { - IMethod curr = (IMethod) allMethods.get(i); - if (JavaModelUtil.isSameMethodSignature(name, paramTypes, - isConstructor, curr)) { - return curr; - } - } - return null; - } +// private static IMethod findMethod(IMethod method, List allMethods) +// throws JavaModelException { +// String name = method.getElementName(); +// String[] paramTypes = method.getParameterTypes(); +// boolean isConstructor = method.isConstructor(); +// +// for (int i = allMethods.size() - 1; i >= 0; i--) { +// IMethod curr = (IMethod) allMethods.get(i); +// if (JavaModelUtil.isSameMethodSignature(name, paramTypes, +// isConstructor, curr)) { +// return curr; +// } +// } +// return null; +// } /** * Creates needed constructors for a type. @@ -1335,22 +1335,22 @@ public class StubUtility { // name, dimensions, excluded); //$NON-NLS-1$ // return sortByLength(res); // longest first // } - private static String[] sortByLength(String[] proposals) { - Arrays.sort(proposals, new Comparator() { - public int compare(Object o1, Object o2) { - return ((String) o2).length() - ((String) o1).length(); - } - }); - return proposals; - } - - private static String workaround38111(String baseName) { +// private static String[] sortByLength(String[] proposals) { +// Arrays.sort(proposals, new Comparator() { +// public int compare(Object o1, Object o2) { +// return ((String) o2).length() - ((String) o1).length(); +// } +// }); +// return proposals; +// } + +/* private static String workaround38111(String baseName) { if (BASE_TYPES.contains(baseName)) return baseName; return Character.toUpperCase(baseName.charAt(0)) + baseName.substring(1); } - +*/ private static final List BASE_TYPES = Arrays .asList(new String[] { "boolean", "byte", "char", "double", "float", "int", "long", "short" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/template/php/JavaContext.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/template/php/JavaContext.java index 0102646..c51573a 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/template/php/JavaContext.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/corext/template/php/JavaContext.java @@ -10,22 +10,22 @@ *******************************************************************************/ package net.sourceforge.phpdt.internal.corext.template.php; -import java.lang.reflect.InvocationTargetException; +//import java.lang.reflect.InvocationTargetException; import net.sourceforge.phpdt.core.ICompilationUnit; -import net.sourceforge.phpdt.internal.corext.Assert; -import net.sourceforge.phpdt.internal.corext.template.php.CompilationUnitCompletion.LocalVariable; +//import net.sourceforge.phpdt.internal.corext.Assert; +//import net.sourceforge.phpdt.internal.corext.template.php.CompilationUnitCompletion.LocalVariable; import net.sourceforge.phpdt.internal.corext.util.Strings; import net.sourceforge.phpdt.internal.ui.preferences.CodeFormatterPreferencePage; import net.sourceforge.phpdt.internal.ui.text.template.contentassist.MultiVariable; -import net.sourceforge.phpdt.internal.ui.util.ExceptionHandler; +//import net.sourceforge.phpdt.internal.ui.util.ExceptionHandler; import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.ui.WebUI; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.MessageDialog; +//import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Document; @@ -37,7 +37,7 @@ import org.eclipse.jface.text.templates.TemplateContextType; import org.eclipse.jface.text.templates.TemplateException; import org.eclipse.jface.text.templates.TemplateTranslator; import org.eclipse.jface.text.templates.TemplateVariable; -import org.eclipse.swt.widgets.Shell; +//import org.eclipse.swt.widgets.Shell; /** * A context for java source. @@ -275,19 +275,19 @@ public class JavaContext extends CompilationUnitContext { } } - private static void handleException(Shell shell, Exception e) { - String title = JavaTemplateMessages - .getString("JavaContext.error.title"); //$NON-NLS-1$ - if (e instanceof CoreException) - ExceptionHandler.handle((CoreException) e, shell, title, null); - else if (e instanceof InvocationTargetException) - ExceptionHandler.handle((InvocationTargetException) e, shell, - title, null); - else { - PHPeclipsePlugin.log(e); - MessageDialog.openError(shell, title, e.getMessage()); - } - } +// private static void handleException(Shell shell, Exception e) { +// String title = JavaTemplateMessages +// .getString("JavaContext.error.title"); //$NON-NLS-1$ +// if (e instanceof CoreException) +// ExceptionHandler.handle((CoreException) e, shell, title, null); +// else if (e instanceof InvocationTargetException) +// ExceptionHandler.handle((InvocationTargetException) e, shell, +// title, null); +// else { +// PHPeclipsePlugin.log(e); +// MessageDialog.openError(shell, title, e.getMessage()); +// } +// } // private CompilationUnitCompletion getCompletion() { // ICompilationUnit compilationUnit= getCompilationUnit(); @@ -334,12 +334,12 @@ public class JavaContext extends CompilationUnitContext { // public String guessArrayType() { // return firstOrNull(guessArrayTypes()); // } - private String firstOrNull(String[] strings) { - if (strings.length > 0) - return strings[0]; - else - return null; - } +// private String firstOrNull(String[] strings) { +// if (strings.length > 0) +// return strings[0]; +// else +// return null; +// } /** * Returns the name of the type of a local array, null if no @@ -378,57 +378,57 @@ public class JavaContext extends CompilationUnitContext { // // return (String[]) ret.toArray(new String[ret.size()]); // } - private String getArrayTypeFromLocalArray( - CompilationUnitCompletion completion, LocalVariable array) { - String arrayTypeName = array.typeName; - String typeName = getScalarType(arrayTypeName); - int dimension = getArrayDimension(arrayTypeName) - 1; - Assert.isTrue(dimension >= 0); - - String qualifiedName = createQualifiedTypeName(array.typePackageName, - typeName); - String innerTypeName = completion.simplifyTypeName(qualifiedName); - - return innerTypeName == null ? createArray(typeName, dimension) - : createArray(innerTypeName, dimension); - } - - private static String createArray(String type, int dimension) { - StringBuffer buffer = new StringBuffer(type); - for (int i = 0; i < dimension; i++) - buffer.append("[]"); //$NON-NLS-1$ - return buffer.toString(); - } - - private static String getScalarType(String type) { - return type.substring(0, type.indexOf('[')); - } - - private static int getArrayDimension(String type) { - - int dimension = 0; - int index = type.indexOf('['); - - while (index != -1) { - dimension++; - index = type.indexOf('[', index + 1); - } - - return dimension; - } - - private static String createQualifiedTypeName(String packageName, - String className) { - StringBuffer buffer = new StringBuffer(); - - if (packageName.length() != 0) { - buffer.append(packageName); - buffer.append('.'); - } - buffer.append(className); - - return buffer.toString(); - } +// private String getArrayTypeFromLocalArray( +// CompilationUnitCompletion completion, LocalVariable array) { +// String arrayTypeName = array.typeName; +// String typeName = getScalarType(arrayTypeName); +// int dimension = getArrayDimension(arrayTypeName) - 1; +// Assert.isTrue(dimension >= 0); +// +// String qualifiedName = createQualifiedTypeName(array.typePackageName, +// typeName); +// String innerTypeName = completion.simplifyTypeName(qualifiedName); +// +// return innerTypeName == null ? createArray(typeName, dimension) +// : createArray(innerTypeName, dimension); +// } + +// private static String createArray(String type, int dimension) { +// StringBuffer buffer = new StringBuffer(type); +// for (int i = 0; i < dimension; i++) +// buffer.append("[]"); //$NON-NLS-1$ +// return buffer.toString(); +// } + +// private static String getScalarType(String type) { +// return type.substring(0, type.indexOf('[')); +// } + +// private static int getArrayDimension(String type) { +// +// int dimension = 0; +// int index = type.indexOf('['); +// +// while (index != -1) { +// dimension++; +// index = type.indexOf('[', index + 1); +// } +// +// return dimension; +// } + +// private static String createQualifiedTypeName(String packageName, +// String className) { +// StringBuffer buffer = new StringBuffer(); +// +// if (packageName.length() != 0) { +// buffer.append(packageName); +// buffer.append('.'); +// } +// buffer.append(className); +// +// return buffer.toString(); +// } /** * Returns a proposal for a variable name of a local array element, diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/PHPUiImages.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/PHPUiImages.java index 14bd288..1d5e62b 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/PHPUiImages.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/PHPUiImages.java @@ -883,25 +883,25 @@ public class PHPUiImages { } } - private static ImageDescriptor createManaged(String prefix, String name, - String key) { - try { - ImageDescriptor result = ImageDescriptor - .createFromURL(makeIconFileURL(prefix, name - .substring(NAME_PREFIX_LENGTH))); - if (fgAvoidSWTErrorMap == null) { - fgAvoidSWTErrorMap = new HashMap(); - } - fgAvoidSWTErrorMap.put(key, result); - if (fgImageRegistry != null) { - WebUI - .logErrorMessage("Image registry already defined"); //$NON-NLS-1$ - } - return result; - } catch (MalformedURLException e) { - return ImageDescriptor.getMissingImageDescriptor(); - } - } +// private static ImageDescriptor createManaged(String prefix, String name, +// String key) { +// try { +// ImageDescriptor result = ImageDescriptor +// .createFromURL(makeIconFileURL(prefix, name +// .substring(NAME_PREFIX_LENGTH))); +// if (fgAvoidSWTErrorMap == null) { +// fgAvoidSWTErrorMap = new HashMap(); +// } +// fgAvoidSWTErrorMap.put(key, result); +// if (fgImageRegistry != null) { +// WebUI +// .logErrorMessage("Image registry already defined"); //$NON-NLS-1$ +// } +// return result; +// } catch (MalformedURLException e) { +// return ImageDescriptor.getMissingImageDescriptor(); +// } +// } protected static ImageDescriptor create(String prefix, String name) { try { diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/CodeAssistConfigurationBlock.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/CodeAssistConfigurationBlock.java index 4917d8f..ecdf64d 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/CodeAssistConfigurationBlock.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/CodeAssistConfigurationBlock.java @@ -395,28 +395,28 @@ class CodeAssistConfigurationBlock implements IPreferenceConfigurationBlock { return contentAssistComposite; } - private void createDependency(final Button master, String masterKey, - final Control slave) { - indent(slave); - boolean masterState = fStore.getBoolean(masterKey); - slave.setEnabled(masterState); - SelectionListener listener = new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - slave.setEnabled(master.getSelection()); - } - - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - master.addSelectionListener(listener); - fMasterSlaveListeners.add(listener); - } - - private static void indent(Control control) { - GridData gridData = new GridData(); - gridData.horizontalIndent = 20; - control.setLayoutData(gridData); - } +// private void createDependency(final Button master, String masterKey, +// final Control slave) { +// indent(slave); +// boolean masterState = fStore.getBoolean(masterKey); +// slave.setEnabled(masterState); +// SelectionListener listener = new SelectionListener() { +// public void widgetSelected(SelectionEvent e) { +// slave.setEnabled(master.getSelection()); +// } +// +// public void widgetDefaultSelected(SelectionEvent e) { +// } +// }; +// master.addSelectionListener(listener); +// fMasterSlaveListeners.add(listener); +// } + +// private static void indent(Control control) { +// GridData gridData = new GridData(); +// gridData.horizontalIndent = 20; +// control.setLayoutData(gridData); +// } private static Text getTextControl(Control[] labelledTextField) { return (Text) labelledTextField[1]; @@ -475,40 +475,40 @@ class CodeAssistConfigurationBlock implements IPreferenceConfigurationBlock { return new Control[] { labelControl, textControl }; } - private void addCompletionRadioButtons(Composite contentAssistComposite) { - Composite completionComposite = new Composite(contentAssistComposite, - SWT.NONE); - GridData ccgd = new GridData(); - ccgd.horizontalSpan = 2; - completionComposite.setLayoutData(ccgd); - GridLayout ccgl = new GridLayout(); - ccgl.marginWidth = 0; - ccgl.numColumns = 2; - completionComposite.setLayout(ccgl); - - // SelectionListener completionSelectionListener= new SelectionAdapter() - // { - // public void widgetSelected(SelectionEvent e) { - // boolean insert= fCompletionInsertsRadioButton.getSelection(); - // fStore.setValue(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, - // insert); - // } - // }; - // - // fCompletionInsertsRadioButton= new Button(completionComposite, - // SWT.RADIO | SWT.LEFT); - // fCompletionInsertsRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionInserts")); - // //$NON-NLS-1$ - // fCompletionInsertsRadioButton.setLayoutData(new GridData()); - // fCompletionInsertsRadioButton.addSelectionListener(completionSelectionListener); - // - // fCompletionOverwritesRadioButton= new Button(completionComposite, - // SWT.RADIO | SWT.LEFT); - // fCompletionOverwritesRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionOverwrites")); - // //$NON-NLS-1$ - // fCompletionOverwritesRadioButton.setLayoutData(new GridData()); - // fCompletionOverwritesRadioButton.addSelectionListener(completionSelectionListener); - } +// private void addCompletionRadioButtons(Composite contentAssistComposite) { +// Composite completionComposite = new Composite(contentAssistComposite, +// SWT.NONE); +// GridData ccgd = new GridData(); +// ccgd.horizontalSpan = 2; +// completionComposite.setLayoutData(ccgd); +// GridLayout ccgl = new GridLayout(); +// ccgl.marginWidth = 0; +// ccgl.numColumns = 2; +// completionComposite.setLayout(ccgl); +// +// // SelectionListener completionSelectionListener= new SelectionAdapter() +// // { +// // public void widgetSelected(SelectionEvent e) { +// // boolean insert= fCompletionInsertsRadioButton.getSelection(); +// // fStore.setValue(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, +// // insert); +// // } +// // }; +// // +// // fCompletionInsertsRadioButton= new Button(completionComposite, +// // SWT.RADIO | SWT.LEFT); +// // fCompletionInsertsRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionInserts")); +// // //$NON-NLS-1$ +// // fCompletionInsertsRadioButton.setLayoutData(new GridData()); +// // fCompletionInsertsRadioButton.addSelectionListener(completionSelectionListener); +// // +// // fCompletionOverwritesRadioButton= new Button(completionComposite, +// // SWT.RADIO | SWT.LEFT); +// // fCompletionOverwritesRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionOverwrites")); +// // //$NON-NLS-1$ +// // fCompletionOverwritesRadioButton.setLayoutData(new GridData()); +// // fCompletionOverwritesRadioButton.addSelectionListener(completionSelectionListener); +// } public void initialize() { initializeFields(); diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaEditorPreferencePage.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaEditorPreferencePage.java index baa56e2..b8acbe1 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaEditorPreferencePage.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaEditorPreferencePage.java @@ -13,15 +13,15 @@ package net.sourceforge.phpdt.internal.ui.preferences; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import java.text.Collator; +//import java.text.Collator; import java.util.ArrayList; -import java.util.Comparator; +//import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.SortedSet; +//import java.util.SortedSet; import java.util.StringTokenizer; -import java.util.TreeSet; +//import java.util.TreeSet; import net.sourceforge.phpdt.core.JavaCore; import net.sourceforge.phpdt.internal.ui.IJavaHelpContextIds; @@ -1301,40 +1301,40 @@ public class JavaEditorPreferencePage extends PreferencePage implements // }); // return composite; // } - private String[][] createAnnotationTypeListModel( - MarkerAnnotationPreferences preferences) { - ArrayList listModelItems = new ArrayList(); - SortedSet sortedPreferences = new TreeSet(new Comparator() { - /* - * @see java.util.Comparator#compare(java.lang.Object, - * java.lang.Object) - */ - public int compare(Object o1, Object o2) { - if (!(o2 instanceof AnnotationPreference)) - return -1; - if (!(o1 instanceof AnnotationPreference)) - return 1; - AnnotationPreference a1 = (AnnotationPreference) o1; - AnnotationPreference a2 = (AnnotationPreference) o2; - return Collator.getInstance().compare(a1.getPreferenceLabel(), - a2.getPreferenceLabel()); - } - }); - sortedPreferences.addAll(preferences.getAnnotationPreferences()); - Iterator e = sortedPreferences.iterator(); - while (e.hasNext()) { - AnnotationPreference info = (AnnotationPreference) e.next(); - listModelItems.add(new String[] { info.getPreferenceLabel(), - info.getColorPreferenceKey(), info.getTextPreferenceKey(), - info.getOverviewRulerPreferenceKey(), - info.getHighlightPreferenceKey(), - info.getVerticalRulerPreferenceKey(), - info.getTextStylePreferenceKey() }); - } - String[][] items = new String[listModelItems.size()][]; - listModelItems.toArray(items); - return items; - } +// private String[][] createAnnotationTypeListModel( +// MarkerAnnotationPreferences preferences) { +// ArrayList listModelItems = new ArrayList(); +// SortedSet sortedPreferences = new TreeSet(new Comparator() { +// /* +// * @see java.util.Comparator#compare(java.lang.Object, +// * java.lang.Object) +// */ +// public int compare(Object o1, Object o2) { +// if (!(o2 instanceof AnnotationPreference)) +// return -1; +// if (!(o1 instanceof AnnotationPreference)) +// return 1; +// AnnotationPreference a1 = (AnnotationPreference) o1; +// AnnotationPreference a2 = (AnnotationPreference) o2; +// return Collator.getInstance().compare(a1.getPreferenceLabel(), +// a2.getPreferenceLabel()); +// } +// }); +// sortedPreferences.addAll(preferences.getAnnotationPreferences()); +// Iterator e = sortedPreferences.iterator(); +// while (e.hasNext()) { +// AnnotationPreference info = (AnnotationPreference) e.next(); +// listModelItems.add(new String[] { info.getPreferenceLabel(), +// info.getColorPreferenceKey(), info.getTextPreferenceKey(), +// info.getOverviewRulerPreferenceKey(), +// info.getHighlightPreferenceKey(), +// info.getVerticalRulerPreferenceKey(), +// info.getTextStylePreferenceKey() }); +// } +// String[][] items = new String[listModelItems.size()][]; +// listModelItems.toArray(items); +// return items; +// } private Control createTypingPage(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); @@ -1449,13 +1449,13 @@ public class JavaEditorPreferencePage extends PreferencePage implements return composite; } - private void addFiller(Composite composite) { - Label filler = new Label(composite, SWT.LEFT); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - gd.heightHint = convertHeightInCharsToPixels(1) / 2; - filler.setLayoutData(gd); - } +// private void addFiller(Composite composite) { +// Label filler = new Label(composite, SWT.LEFT); +// GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); +// gd.horizontalSpan = 2; +// gd.heightHint = convertHeightInCharsToPixels(1) / 2; +// filler.setLayoutData(gd); +// } private static void indent(Control control) { GridData gridData = new GridData(); @@ -1476,40 +1476,40 @@ public class JavaEditorPreferencePage extends PreferencePage implements }); } - private void addCompletionRadioButtons(Composite contentAssistComposite) { - Composite completionComposite = new Composite(contentAssistComposite, - SWT.NONE); - GridData ccgd = new GridData(); - ccgd.horizontalSpan = 2; - completionComposite.setLayoutData(ccgd); - GridLayout ccgl = new GridLayout(); - ccgl.marginWidth = 0; - ccgl.numColumns = 2; - completionComposite.setLayout(ccgl); - // SelectionListener completionSelectionListener= new SelectionAdapter() - // { - // public void widgetSelected(SelectionEvent e) { - // boolean insert= fCompletionInsertsRadioButton.getSelection(); - // fOverlayStore.setValue(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, - // insert); - // } - // }; - // - // fCompletionInsertsRadioButton= new Button(completionComposite, - // SWT.RADIO - // | SWT.LEFT); - // fCompletionInsertsRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionInserts")); - // //$NON-NLS-1$ - // fCompletionInsertsRadioButton.setLayoutData(new GridData()); - // fCompletionInsertsRadioButton.addSelectionListener(completionSelectionListener); - // - // fCompletionOverwritesRadioButton= new Button(completionComposite, - // SWT.RADIO | SWT.LEFT); - // fCompletionOverwritesRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionOverwrites")); - // //$NON-NLS-1$ - // fCompletionOverwritesRadioButton.setLayoutData(new GridData()); - // fCompletionOverwritesRadioButton.addSelectionListener(completionSelectionListener); - } +// private void addCompletionRadioButtons(Composite contentAssistComposite) { +// Composite completionComposite = new Composite(contentAssistComposite, +// SWT.NONE); +// GridData ccgd = new GridData(); +// ccgd.horizontalSpan = 2; +// completionComposite.setLayoutData(ccgd); +// GridLayout ccgl = new GridLayout(); +// ccgl.marginWidth = 0; +// ccgl.numColumns = 2; +// completionComposite.setLayout(ccgl); +// // SelectionListener completionSelectionListener= new SelectionAdapter() +// // { +// // public void widgetSelected(SelectionEvent e) { +// // boolean insert= fCompletionInsertsRadioButton.getSelection(); +// // fOverlayStore.setValue(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, +// // insert); +// // } +// // }; +// // +// // fCompletionInsertsRadioButton= new Button(completionComposite, +// // SWT.RADIO +// // | SWT.LEFT); +// // fCompletionInsertsRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionInserts")); +// // //$NON-NLS-1$ +// // fCompletionInsertsRadioButton.setLayoutData(new GridData()); +// // fCompletionInsertsRadioButton.addSelectionListener(completionSelectionListener); +// // +// // fCompletionOverwritesRadioButton= new Button(completionComposite, +// // SWT.RADIO | SWT.LEFT); +// // fCompletionOverwritesRadioButton.setText(PreferencesMessages.getString("JavaEditorPreferencePage.completionOverwrites")); +// // //$NON-NLS-1$ +// // fCompletionOverwritesRadioButton.setLayoutData(new GridData()); +// // fCompletionOverwritesRadioButton.addSelectionListener(completionSelectionListener); +// } private Control createNavigationPage(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); @@ -1652,11 +1652,11 @@ public class JavaEditorPreferencePage extends PreferencePage implements } } - private IStatus getBrowserLikeLinksKeyModifierStatus() { - if (fBrowserLikeLinksKeyModifierStatus == null) - fBrowserLikeLinksKeyModifierStatus = new StatusInfo(); - return fBrowserLikeLinksKeyModifierStatus; - } +// private IStatus getBrowserLikeLinksKeyModifierStatus() { +// if (fBrowserLikeLinksKeyModifierStatus == null) +// fBrowserLikeLinksKeyModifierStatus = new StatusInfo(); +// return fBrowserLikeLinksKeyModifierStatus; +// } /** * Computes the state mask for the given modifier string. @@ -1940,9 +1940,9 @@ public class JavaEditorPreferencePage extends PreferencePage implements textLimit, indentation, isNumber)); } - private static Label getLabelControl(Control[] labelledTextField) { - return (Label) labelledTextField[0]; - } +// private static Label getLabelControl(Control[] labelledTextField) { +// return (Label) labelledTextField[0]; +// } private static Text getTextControl(Control[] labelledTextField) { return (Text) labelledTextField[1]; diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaPreferencesSettings.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaPreferencesSettings.java index bbb7687..f827ba5 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaPreferencesSettings.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/JavaPreferencesSettings.java @@ -10,7 +10,7 @@ *******************************************************************************/ package net.sourceforge.phpdt.internal.ui.preferences; -import java.util.StringTokenizer; +//import java.util.StringTokenizer; import net.sourceforge.phpdt.internal.corext.codemanipulation.CodeGenerationSettings; import net.sourceforge.phpdt.internal.corext.util.CodeFormatterUtil; @@ -51,14 +51,14 @@ public class JavaPreferencesSettings { // return new String[0]; // } - private static String[] unpackList(String str, String separator) { - StringTokenizer tok = new StringTokenizer(str, separator); //$NON-NLS-1$ - int nTokens = tok.countTokens(); - String[] res = new String[nTokens]; - for (int i = 0; i < nTokens; i++) { - res[i] = tok.nextToken().trim(); - } - return res; - } +// private static String[] unpackList(String str, String separator) { +// StringTokenizer tok = new StringTokenizer(str, separator); //$NON-NLS-1$ +// int nTokens = tok.countTokens(); +// String[] res = new String[nTokens]; +// for (int i = 0; i < nTokens; i++) { +// res[i] = tok.nextToken().trim(); +// } +// return res; +// } } diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java index 713d9de..cda6161 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/preferences/MarkOccurrencesConfigurationBlock.java @@ -17,7 +17,7 @@ import java.util.Iterator; import java.util.Map; import net.sourceforge.phpdt.internal.ui.dialogs.StatusInfo; -import net.sourceforge.phpdt.internal.ui.util.PixelConverter; +//import net.sourceforge.phpdt.internal.ui.util.PixelConverter; import net.sourceforge.phpdt.ui.PreferenceConstants; import org.eclipse.core.runtime.IStatus; @@ -32,7 +32,7 @@ import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; +//import org.eclipse.swt.widgets.Label; /** * Configures Java Editor hover preferences. @@ -210,15 +210,15 @@ class MarkOccurrencesConfigurationBlock implements return composite; } - private void addFiller(Composite composite) { - PixelConverter pixelConverter = new PixelConverter(composite); - - Label filler = new Label(composite, SWT.LEFT); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gd.horizontalSpan = 2; - gd.heightHint = pixelConverter.convertHeightInCharsToPixels(1) / 2; - filler.setLayoutData(gd); - } +// private void addFiller(Composite composite) { +// PixelConverter pixelConverter = new PixelConverter(composite); +// +// Label filler = new Label(composite, SWT.LEFT); +// GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); +// gd.horizontalSpan = 2; +// gd.heightHint = pixelConverter.convertHeightInCharsToPixels(1) / 2; +// filler.setLayoutData(gd); +// } private Button addCheckBox(Composite parent, String label, String key, int indentation) { diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaIndenter.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaIndenter.java index 9f90b1e..a98eacd 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaIndenter.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/JavaIndenter.java @@ -1467,41 +1467,41 @@ public class JavaIndenter { return 1; // sensible default } - private boolean prefIndentBracesForBlocks() { - Plugin plugin = JavaCore.getPlugin(); - if (plugin != null) { - String option = JavaCore - .getOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK); - return option - .equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED); - } - - return false; // sensible default - } - - private boolean prefIndentBracesForArrays() { - Plugin plugin = JavaCore.getPlugin(); - if (plugin != null) { - String option = JavaCore - .getOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER); - return option - .equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED); - } - - return false; // sensible default - } - - private boolean prefIndentBracesForMethods() { - Plugin plugin = JavaCore.getPlugin(); - if (plugin != null) { - String option = JavaCore - .getOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION); - return option - .equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED); - } - - return false; // sensible default - } +// private boolean prefIndentBracesForBlocks() { +// Plugin plugin = JavaCore.getPlugin(); +// if (plugin != null) { +// String option = JavaCore +// .getOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_BLOCK); +// return option +// .equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED); +// } +// +// return false; // sensible default +// } + +// private boolean prefIndentBracesForArrays() { +// Plugin plugin = JavaCore.getPlugin(); +// if (plugin != null) { +// String option = JavaCore +// .getOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER); +// return option +// .equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED); +// } +// +// return false; // sensible default +// } + +// private boolean prefIndentBracesForMethods() { +// Plugin plugin = JavaCore.getPlugin(); +// if (plugin != null) { +// String option = JavaCore +// .getOption(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION); +// return option +// .equals(DefaultCodeFormatterConstants.NEXT_LINE_SHIFTED); +// } +// +// return false; // sensible default +// } private int prefContinuationIndent() { Plugin plugin = JavaCore.getPlugin(); diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/JavaDocAutoIndentStrategy.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/JavaDocAutoIndentStrategy.java index 708a7b6..1995a11 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/JavaDocAutoIndentStrategy.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/JavaDocAutoIndentStrategy.java @@ -14,7 +14,7 @@ package net.sourceforge.phpdt.internal.ui.text.phpdoc; import java.text.BreakIterator; import net.sourceforge.phpdt.core.ICompilationUnit; -import net.sourceforge.phpdt.core.IJavaElement; +//import net.sourceforge.phpdt.core.IJavaElement; import net.sourceforge.phpdt.core.IMethod; import net.sourceforge.phpdt.core.ISourceRange; import net.sourceforge.phpdt.core.IType; @@ -150,26 +150,26 @@ public class JavaDocAutoIndentStrategy extends } } - private String createJavaDocTags(IDocument document, - DocumentCommand command, String indentation, String lineDelimiter, - ICompilationUnit unit) throws CoreException, BadLocationException { - IJavaElement element = unit.getElementAt(command.offset); - if (element == null) - return null; - - switch (element.getElementType()) { - case IJavaElement.TYPE: - return createTypeTags(document, command, indentation, - lineDelimiter, (IType) element); - - case IJavaElement.METHOD: - return createMethodTags(document, command, indentation, - lineDelimiter, (IMethod) element); - - default: - return null; - } - } +// private String createJavaDocTags(IDocument document, +// DocumentCommand command, String indentation, String lineDelimiter, +// ICompilationUnit unit) throws CoreException, BadLocationException { +// IJavaElement element = unit.getElementAt(command.offset); +// if (element == null) +// return null; +// +// switch (element.getElementType()) { +// case IJavaElement.TYPE: +// return createTypeTags(document, command, indentation, +// lineDelimiter, (IType) element); +// +// case IJavaElement.METHOD: +// return createMethodTags(document, command, indentation, +// lineDelimiter, (IMethod) element); +// +// default: +// return null; +// } +// } /* * Removes start and end of a comment and corrects indentation and line diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/PHPDocCompletionProcessor.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/PHPDocCompletionProcessor.java index 8053a3a..06342b2 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/PHPDocCompletionProcessor.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/text/phpdoc/PHPDocCompletionProcessor.java @@ -30,14 +30,14 @@ import org.eclipse.ui.IEditorPart; */ public class PHPDocCompletionProcessor implements IContentAssistProcessor { - private static class PHPDocCompletionProposalComparator implements - Comparator { - public int compare(Object o1, Object o2) { - ICompletionProposal c1 = (ICompletionProposal) o1; - ICompletionProposal c2 = (ICompletionProposal) o2; - return c1.getDisplayString().compareTo(c2.getDisplayString()); - } - }; +// private static class PHPDocCompletionProposalComparator implements +// Comparator { +// public int compare(Object o1, Object o2) { +// ICompletionProposal c1 = (ICompletionProposal) o1; +// ICompletionProposal c2 = (ICompletionProposal) o2; +// return c1.getDisplayString().compareTo(c2.getDisplayString()); +// } +// }; // private IEditorPart fEditor; // private IWorkingCopyManager fManager; diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/viewsupport/JavaElementImageProvider.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/viewsupport/JavaElementImageProvider.java index 6aae6fe..78d9636 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/viewsupport/JavaElementImageProvider.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/internal/ui/viewsupport/JavaElementImageProvider.java @@ -376,10 +376,10 @@ public class JavaElementImageProvider { return false; } - private static boolean confirmSynchronized(IJavaElement member) { - // Synchronized types are allowed but meaningless. - return member.getElementType() != IJavaElement.TYPE; - } +// private static boolean confirmSynchronized(IJavaElement member) { +// // Synchronized types are allowed but meaningless. +// return member.getElementType() != IJavaElement.TYPE; +// } public static ImageDescriptor getMethodImageDescriptor( boolean isInInterface, int flags) { diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/ui/actions/GenerateActionGroup.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/ui/actions/GenerateActionGroup.java index d1a2f88..bb14a3c 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/ui/actions/GenerateActionGroup.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpdt/ui/actions/GenerateActionGroup.java @@ -360,21 +360,21 @@ public class GenerateActionGroup extends ActionGroup { } } - private int appendToGroup(IMenuManager menu, IAction action) { - if (action != null && action.isEnabled()) { - menu.appendToGroup(fGroupName, action); - return 1; - } - return 0; - } - - private int addAction(IMenuManager menu, IAction action) { - if (action != null && action.isEnabled()) { - menu.add(action); - return 1; - } - return 0; - } +// private int appendToGroup(IMenuManager menu, IAction action) { +// if (action != null && action.isEnabled()) { +// menu.appendToGroup(fGroupName, action); +// return 1; +// } +// return 0; +// } + +// private int addAction(IMenuManager menu, IAction action) { +// if (action != null && action.isEnabled()) { +// menu.add(action); +// return 1; +// } +// return 0; +// } private int addEditorAction(IMenuManager menu, String actionID) { if (fEditor == null) diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenAllIncludesEditorAction.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenAllIncludesEditorAction.java index 2cc2121..1d1e9b1 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenAllIncludesEditorAction.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenAllIncludesEditorAction.java @@ -20,7 +20,7 @@ import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; +//import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; @@ -33,7 +33,7 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.ui.IEditorActionDelegate; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.IWorkbenchPage; +//import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.actions.ActionDelegate; import org.eclipse.ui.dialogs.ListSelectionDialog; @@ -67,12 +67,12 @@ public class PHPOpenAllIncludesEditorAction extends ActionDelegate implements } } - private IWorkbenchPage getActivePage() { - IWorkbenchWindow workbenchWindow = fEditor.getEditorSite() - .getWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - return page; - } +// private IWorkbenchPage getActivePage() { +// IWorkbenchWindow workbenchWindow = fEditor.getEditorSite() +// .getWorkbenchWindow(); +// IWorkbenchPage page = workbenchWindow.getActivePage(); +// return page; +// } public IContainer getWorkingLocation(IFileEditorInput editorInput) { if (editorInput == null || editorInput.getFile() == null) { @@ -81,31 +81,31 @@ public class PHPOpenAllIncludesEditorAction extends ActionDelegate implements return editorInput.getFile().getParent(); } - private IFile getIncludeFile(IProject project, - IFileEditorInput editorInput, String relativeFilename) { - IContainer container = getWorkingLocation(editorInput); - String fullPath = project.getFullPath().toString(); - IFile file = null; - if (relativeFilename.startsWith("../")) { - Path path = new Path(relativeFilename); - file = container.getFile(path); - return file; - } - int index = relativeFilename.lastIndexOf('/'); - - if (index >= 0) { - Path path = new Path(relativeFilename); - file = project.getFile(path); - if (file.exists()) { - return file; - } - } - - Path path = new Path(relativeFilename); - file = container.getFile(path); - - return file; - } +// private IFile getIncludeFile(IProject project, +// IFileEditorInput editorInput, String relativeFilename) { +// IContainer container = getWorkingLocation(editorInput); +// String fullPath = project.getFullPath().toString(); +// IFile file = null; +// if (relativeFilename.startsWith("../")) { +// Path path = new Path(relativeFilename); +// file = container.getFile(path); +// return file; +// } +// int index = relativeFilename.lastIndexOf('/'); +// +// if (index >= 0) { +// Path path = new Path(relativeFilename); +// file = project.getFile(path); +// if (file.exists()) { +// return file; +// } +// } +// +// Path path = new Path(relativeFilename); +// file = container.getFile(path); +// +// return file; +// } public void run(IAction action) { if (fEditor == null) { diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorAction.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorAction.java index d800960..11af2f6 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorAction.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/actions/PHPOpenDeclarationEditorAction.java @@ -13,7 +13,7 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; +//import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IEditorActionDelegate; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchWindow; @@ -40,11 +40,11 @@ public class PHPOpenDeclarationEditorAction extends ActionDelegate implements } } - private boolean checkEnabled(IStructuredSelection selection) { - if (selection.isEmpty()) - return false; - return true; - } +// private boolean checkEnabled(IStructuredSelection selection) { +// if (selection.isEmpty()) +// return false; +// return true; +// } public void run(IAction action) { if (fEditor == null) { diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/obfuscator/ObfuscatorIgnoreSet.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/obfuscator/ObfuscatorIgnoreSet.java index 3c323aa..402a8bd 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/obfuscator/ObfuscatorIgnoreSet.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/obfuscator/ObfuscatorIgnoreSet.java @@ -154,11 +154,11 @@ public class ObfuscatorIgnoreSet { } } - private String getAttributeValue(NamedNodeMap attributes, String name) { - Node node = attributes.getNamedItem(name); - - return node == null ? null : node.getNodeValue(); - } +// private String getAttributeValue(NamedNodeMap attributes, String name) { +// Node node = attributes.getNamedItem(name); +// +// return node == null ? null : node.getNodeValue(); +// } /** * Convenience method for saving to a file. diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/JavaSelectMarkerRulerAction2.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/JavaSelectMarkerRulerAction2.java index 5b3abd8..0e9b0bc 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/JavaSelectMarkerRulerAction2.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/JavaSelectMarkerRulerAction2.java @@ -88,10 +88,10 @@ public class JavaSelectMarkerRulerAction2 extends SelectAnnotationRulerAction { * the annotation * @return true iff the annotation is an override annotation */ - private boolean isOverrideIndicator(Annotation annotation) { - return false; // annotation instanceof - // OverrideIndicatorManager.OverrideIndicator; - } +// private boolean isOverrideIndicator(Annotation annotation) { +// return false; // annotation instanceof +// // OverrideIndicatorManager.OverrideIndicator; +// } /** * @param annotation @@ -105,10 +105,10 @@ public class JavaSelectMarkerRulerAction2 extends SelectAnnotationRulerAction { } - private boolean isQuickFixTarget(Annotation a) { - return false; // JavaCorrectionProcessor.hasCorrections(a) || a - // instanceof AssistAnnotation; - } +// private boolean isQuickFixTarget(Annotation a) { +// return false; // JavaCorrectionProcessor.hasCorrections(a) || a +// // instanceof AssistAnnotation; +// } private void triggerAction(String actionID) { IAction action = getTextEditor().getAction(actionID); diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java index a2701d2..9c43782 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPDocumentProvider.java @@ -617,10 +617,10 @@ public class PHPDocumentProvider extends TextFileDocumentProvider implements // } } - private boolean indicateQuixFixableProblems() { - return PreferenceConstants.getPreferenceStore().getBoolean( - PreferenceConstants.EDITOR_CORRECTION_INDICATION); - } +// private boolean indicateQuixFixableProblems() { +// return PreferenceConstants.getPreferenceStore().getBoolean( +// PreferenceConstants.EDITOR_CORRECTION_INDICATION); +// } /* * @see Annotation#paint diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java index 4c14b95..14e4ef3 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPEditor.java @@ -5603,9 +5603,9 @@ public abstract class PHPEditor extends AbstractDecoratedTextEditor implements * is true * @since 3.0 */ - private boolean getBoolean(IPreferenceStore store, String key) { - return key != null && store.getBoolean(key); - } +// private boolean getBoolean(IPreferenceStore store, String key) { +// return key != null && store.getBoolean(key); +// } protected boolean isPrefQuickDiffAlwaysOn() { return false; // never show change ruler for the non-editable java diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPSyntaxRdr.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPSyntaxRdr.java index 01c578e..4932717 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPSyntaxRdr.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPSyntaxRdr.java @@ -28,7 +28,7 @@ import net.sourceforge.phpeclipse.phpeditor.php.PHPType; import net.sourceforge.phpeclipse.ui.WebUI; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; +//import org.eclipse.core.runtime.IPath; import org.eclipse.jface.preference.IPreferenceStore; import org.w3c.dom.Attr; import org.w3c.dom.Document; @@ -229,11 +229,11 @@ public class PHPSyntaxRdr { return userdefsyntaxdata; } - private static File getSyntaxFile() { - IPath path = PHPeclipsePlugin.getDefault().getStateLocation(); - path = path.append(PHPSYNTAX_FILE); - return path.toFile(); - } +// private static File getSyntaxFile() { +// IPath path = PHPeclipsePlugin.getDefault().getStateLocation(); +// path = path.append(PHPSYNTAX_FILE); +// return path.toFile(); +// } private static String getAttributeValue(NamedNodeMap attributes, String name) { Node node = attributes.getNamedItem(name); diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java index c8991c4..ddcc77a 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/PHPUnitEditor.java @@ -58,7 +58,7 @@ import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.IMessageProvider; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.preference.PreferenceConverter; +//import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.IAutoEditStrategy; @@ -962,15 +962,15 @@ public class PHPUnitEditor extends PHPEditor { // implements } } - private static class BracketLevel { - int fOffset; - - int fLength; - - LinkedPositionManager fManager; - - LinkedPositionUI fEditor; - }; +// private static class BracketLevel { +// int fOffset; +// +// int fLength; +// +// LinkedPositionManager fManager; +// +// LinkedPositionUI fEditor; +// }; private class BracketInserter implements VerifyKeyListener, LinkedPositionUI.ExitListener { @@ -1012,21 +1012,21 @@ public class PHPUnitEditor extends PHPEditor { // implements } } - private boolean hasIdentifierToTheLeft(IDocument document, int offset) { - try { - int start = offset; - IRegion startLine = document.getLineInformationOfOffset(start); - int minStart = startLine.getOffset(); - while (start != minStart - && Character.isWhitespace(document.getChar(start - 1))) - --start; - return start != minStart - && Scanner.isPHPIdentifierPart(document - .getChar(start - 1)); - } catch (BadLocationException e) { - return true; - } - } +// private boolean hasIdentifierToTheLeft(IDocument document, int offset) { +// try { +// int start = offset; +// IRegion startLine = document.getLineInformationOfOffset(start); +// int minStart = startLine.getOffset(); +// while (start != minStart +// && Character.isWhitespace(document.getChar(start - 1))) +// --start; +// return start != minStart +// && Scanner.isPHPIdentifierPart(document +// .getChar(start - 1)); +// } catch (BadLocationException e) { +// return true; +// } +// } private boolean hasCharacterToTheLeft(IDocument document, int offset, char character) { @@ -1884,10 +1884,10 @@ public class PHPUnitEditor extends PHPEditor { // implements return store.getBoolean(SPACES_FOR_TABS); } - private Color getColor(String key) { - RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), key); - return getColor(rgb); - } +// private Color getColor(String key) { +// RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), key); +// return getColor(rgb); +// } private Color getColor(RGB rgb) { JavaTextTools textTools = WebUI.getDefault() @@ -2121,19 +2121,19 @@ public class PHPUnitEditor extends PHPEditor { // implements // IVerticalRuler ruler, int styles) { // return new AdaptedSourceViewer(parent, ruler, styles); // } - private boolean isValidSelection(int offset, int length) { - IDocumentProvider provider = getDocumentProvider(); - if (provider != null) { - IDocument document = provider.getDocument(getEditorInput()); - if (document != null) { - int end = offset + length; - int documentLength = document.getLength(); - return 0 <= offset && offset <= documentLength && 0 <= end - && end <= documentLength; - } - } - return false; - } +// private boolean isValidSelection(int offset, int length) { +// IDocumentProvider provider = getDocumentProvider(); +// if (provider != null) { +// IDocument document = provider.getDocument(getEditorInput()); +// if (document != null) { +// int end = offset + length; +// int documentLength = document.getLength(); +// return 0 <= offset && offset <= documentLength && 0 <= end +// && end <= documentLength; +// } +// } +// return false; +// } /* * @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor#getInputElement() @@ -2563,43 +2563,43 @@ public class PHPUnitEditor extends PHPEditor { // implements /** * Returns the updated java element for the old java element. */ - private IJavaElement findElement(IJavaElement element) { - if (element == null) - return null; - IWorkingCopyManager manager = WebUI.getDefault() - .getWorkingCopyManager(); - ICompilationUnit unit = manager.getWorkingCopy(getEditorInput()); - if (unit != null) { - try { - synchronized (unit) { - unit.reconcile(); - } - IJavaElement[] findings = unit.findElements(element); - if (findings != null && findings.length > 0) - return findings[0]; - } catch (JavaModelException x) { - PHPeclipsePlugin.log(x.getStatus()); - // nothing found, be tolerant and go on - } - } - return null; - } +// private IJavaElement findElement(IJavaElement element) { +// if (element == null) +// return null; +// IWorkingCopyManager manager = WebUI.getDefault() +// .getWorkingCopyManager(); +// ICompilationUnit unit = manager.getWorkingCopy(getEditorInput()); +// if (unit != null) { +// try { +// synchronized (unit) { +// unit.reconcile(); +// } +// IJavaElement[] findings = unit.findElements(element); +// if (findings != null && findings.length > 0) +// return findings[0]; +// } catch (JavaModelException x) { +// PHPeclipsePlugin.log(x.getStatus()); +// // nothing found, be tolerant and go on +// } +// } +// return null; +// } /** * Returns the offset of the given Java element. */ - private int getOffset(IJavaElement element) { - if (element instanceof ISourceReference) { - ISourceReference sr = (ISourceReference) element; - try { - ISourceRange srcRange = sr.getSourceRange(); - if (srcRange != null) - return srcRange.getOffset(); - } catch (JavaModelException e) { - } - } - return -1; - } +// private int getOffset(IJavaElement element) { +// if (element instanceof ISourceReference) { +// ISourceReference sr = (ISourceReference) element; +// try { +// ISourceRange srcRange = sr.getSourceRange(); +// if (srcRange != null) +// return srcRange.getOffset(); +// } catch (JavaModelException e) { +// } +// } +// return -1; +// } /* * @see AbstractTextEditor#restoreSelection() diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/php/HTMLPartitionScanner.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/php/HTMLPartitionScanner.java index d844a7b..69330ae 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/php/HTMLPartitionScanner.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/phpeditor/php/HTMLPartitionScanner.java @@ -10,7 +10,7 @@ */ package net.sourceforge.phpeclipse.phpeditor.php; -import java.util.ArrayList; +//import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -21,7 +21,7 @@ import net.sourceforge.phpdt.internal.ui.text.IPHPPartitions; import org.eclipse.core.runtime.Assert; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITypedRegion; +//import org.eclipse.jface.text.ITypedRegion; import org.eclipse.jface.text.rules.ICharacterScanner; import org.eclipse.jface.text.rules.IPartitionTokenScanner; import org.eclipse.jface.text.rules.IToken; @@ -433,12 +433,12 @@ public class HTMLPartitionScanner implements IPartitionTokenScanner { * @return true if the current offset is in a string else * returns false. */ - private boolean isInString(String contentType) { - if (fContentType == contentType) - return (fInString || fInDoubString); - else - return false; - } +// private boolean isInString(String contentType) { +// if (fContentType == contentType) +// return (fInString || fInDoubString); +// else +// return false; +// } /** * Returns the previouse partition stack for the given offset. @@ -448,27 +448,27 @@ public class HTMLPartitionScanner implements IPartitionTokenScanner { * * @return The stack as a string array. */ - private String[] getPartitionStack(int offset) { - ArrayList types = new ArrayList(); - int tmpOffset = 0; - try { - ITypedRegion region = fDocument.getPartition(offset); - tmpOffset = region.getOffset(); - while (tmpOffset - 1 > 0) { - region = fDocument.getPartition(tmpOffset - 1); - tmpOffset = region.getOffset(); - types.add(0, region.getType()); - } - } catch (BadLocationException e) { - if (DEBUG) { - e.printStackTrace(); - } - } - - String[] retVal = new String[types.size()]; - - retVal = (String[]) types.toArray(retVal); - return retVal; - } +// private String[] getPartitionStack(int offset) { +// ArrayList types = new ArrayList(); +// int tmpOffset = 0; +// try { +// ITypedRegion region = fDocument.getPartition(offset); +// tmpOffset = region.getOffset(); +// while (tmpOffset - 1 > 0) { +// region = fDocument.getPartition(tmpOffset - 1); +// tmpOffset = region.getOffset(); +// types.add(0, region.getType()); +// } +// } catch (BadLocationException e) { +// if (DEBUG) { +// e.printStackTrace(); +// } +// } +// +// String[] retVal = new String[types.size()]; +// +// retVal = (String[]) types.toArray(retVal); +// return retVal; +// } } diff --git a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/MultiViewPartitioner.java b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/MultiViewPartitioner.java index f7cfe37..5c8d6de 100644 --- a/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/MultiViewPartitioner.java +++ b/net.sourceforge.phpeclipse.ui/src/net/sourceforge/phpeclipse/ui/text/rules/MultiViewPartitioner.java @@ -520,26 +520,26 @@ public abstract class MultiViewPartitioner extends AbstractPartitioner { return (TypedRegion[]) list.toArray(new TypedRegion[list.size()]); } - private void showList(List list) { - try { - throw new NullPointerException(); - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(">>>>>List start"); - TypedRegion temp; - for (int i = 0; i < list.size(); i++) { - temp = (TypedRegion) list.get(i); - System.out.print("Offset: "); - System.out.print(temp.getOffset()); - System.out.print(", Length: "); - System.out.print(temp.getLength()); - System.out.print(", Type: "); - System.out.print(temp.getType()); - System.out.println(""); - } - System.out.println("<<<<>>>>List start"); +// TypedRegion temp; +// for (int i = 0; i < list.size(); i++) { +// temp = (TypedRegion) list.get(i); +// System.out.print("Offset: "); +// System.out.print(temp.getOffset()); +// System.out.print(", Length: "); +// System.out.print(temp.getLength()); +// System.out.print(", Type: "); +// System.out.print(temp.getType()); +// System.out.println(""); +// } +// System.out.println("<<<<true if this element is the main type of its diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/DeltaProcessor.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/DeltaProcessor.java index 911476e..11028bb 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/DeltaProcessor.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/DeltaProcessor.java @@ -29,10 +29,10 @@ import net.sourceforge.phpdt.core.JavaCore; import net.sourceforge.phpdt.core.JavaModelException; import net.sourceforge.phpdt.internal.core.builder.PHPBuilder; import net.sourceforge.phpdt.internal.core.util.Util; -import net.sourceforge.phpdt.internal.core.util.PHPFileUtil; +//import net.sourceforge.phpdt.internal.core.util.PHPFileUtil; import net.sourceforge.phpeclipse.PHPeclipsePlugin; -import org.eclipse.core.resources.IFile; +//import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceChangeEvent; @@ -1345,35 +1345,35 @@ public class DeltaProcessor implements IResourceChangeListener { * Returns whether the given resource is in one of the given output folders * and if it is filtered out from this output folder. */ - private boolean isResFilteredFromOutput(OutputsInfo info, IResource res, - int elementType) { - if (info != null) { - IPath resPath = res.getFullPath(); - for (int i = 0; i < info.outputCount; i++) { - if (info.paths[i].isPrefixOf(resPath)) { - if (info.traverseModes[i] != IGNORE) { - // case of bin=src - if (info.traverseModes[i] == SOURCE - && elementType == IJavaElement.CLASS_FILE) { - return true; - } else { - // case of .class file under project and no source - // folder - // proj=bin - if (elementType == IJavaElement.JAVA_PROJECT - && res instanceof IFile - && PHPFileUtil.isPHPFile((IFile) res)) { - return true; - } - } - } else { - return true; - } - } - } - } - return false; - } +// private boolean isResFilteredFromOutput(OutputsInfo info, IResource res, +// int elementType) { +// if (info != null) { +// IPath resPath = res.getFullPath(); +// for (int i = 0; i < info.outputCount; i++) { +// if (info.paths[i].isPrefixOf(resPath)) { +// if (info.traverseModes[i] != IGNORE) { +// // case of bin=src +// if (info.traverseModes[i] == SOURCE +// && elementType == IJavaElement.CLASS_FILE) { +// return true; +// } else { +// // case of .class file under project and no source +// // folder +// // proj=bin +// if (elementType == IJavaElement.JAVA_PROJECT +// && res instanceof IFile +// && PHPFileUtil.isPHPFile((IFile) res)) { +// return true; +// } +// } +// } else { +// return true; +// } +// } +// } +// } +// return false; +// } /* * Merges all awaiting deltas. diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/InternalNamingConventions.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/InternalNamingConventions.java index 3e4ffde..4094898 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/InternalNamingConventions.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/InternalNamingConventions.java @@ -214,23 +214,23 @@ public class InternalNamingConventions { } } - private static char[] computeBaseTypeNames(char firstName, - char[][] excludedNames) { - char[] name = new char[] { firstName }; - - for (int i = 0; i < excludedNames.length; i++) { - if (CharOperation.equals(name, excludedNames[i], false)) { - name[0]++; - if (name[0] > 'z') - name[0] = 'a'; - if (name[0] == firstName) - return null; - i = 0; - } - } - - return name; - } +// private static char[] computeBaseTypeNames(char firstName, +// char[][] excludedNames) { +// char[] name = new char[] { firstName }; +// +// for (int i = 0; i < excludedNames.length; i++) { +// if (CharOperation.equals(name, excludedNames[i], false)) { +// name[0]++; +// if (name[0] > 'z') +// name[0] = 'a'; +// if (name[0] == firstName) +// return null; +// i = 0; +// } +// } +// +// return name; +// } private static char[][] computeNames(char[] sourceName) { char[][] names = new char[5][]; diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/PackageFragmentRootInfo.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/PackageFragmentRootInfo.java index 45bdc6b..428728f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/PackageFragmentRootInfo.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/PackageFragmentRootInfo.java @@ -19,7 +19,7 @@ import net.sourceforge.phpdt.internal.core.util.Util; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; +//import org.eclipse.core.runtime.IPath; /** * The element info for PackageFragmentRoots. @@ -178,16 +178,16 @@ class PackageFragmentRootInfo extends OpenableElementInfo { // protected synchronized SourceMapper getSourceMapper() { // return this.sourceMapper; // } - private static boolean isClasspathEntry(IPath path, - IClasspathEntry[] resolvedClasspath) { - for (int i = 0, length = resolvedClasspath.length; i < length; i++) { - IClasspathEntry entry = resolvedClasspath[i]; - if (entry.getPath().equals(path)) { - return true; - } - } - return false; - } +// private static boolean isClasspathEntry(IPath path, +// IClasspathEntry[] resolvedClasspath) { +// for (int i = 0, length = resolvedClasspath.length; i < length; i++) { +// IClasspathEntry entry = resolvedClasspath[i]; +// if (entry.getPath().equals(path)) { +// return true; +// } +// } +// return false; +// } /** * Set the fNonJavaResources to res value diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SetClasspathOperation.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SetClasspathOperation.java index 4a5b35a..6c96e82 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SetClasspathOperation.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/SetClasspathOperation.java @@ -613,30 +613,30 @@ public class SetClasspathOperation extends JavaModelOperation { * source paths. Returns either F_SOURCEATTACHED, F_SOURCEDETACHED, * F_SOURCEATTACHED | F_SOURCEDETACHED or 0 if there is no difference. */ - private int getSourceAttachmentDeltaFlag(IPath oldPath, IPath newPath, - IPath sourcePath) { - if (oldPath == null) { - if (newPath != null) { - return IJavaElementDelta.F_SOURCEATTACHED; - } else { - if (sourcePath != null) { - // if source path is specified and no root path, it needs to - // be recomputed dynamically - return IJavaElementDelta.F_SOURCEATTACHED - | IJavaElementDelta.F_SOURCEDETACHED; - } else { - return 0; - } - } - } else if (newPath == null) { - return IJavaElementDelta.F_SOURCEDETACHED; - } else if (!oldPath.equals(newPath)) { - return IJavaElementDelta.F_SOURCEATTACHED - | IJavaElementDelta.F_SOURCEDETACHED; - } else { - return 0; - } - } +// private int getSourceAttachmentDeltaFlag(IPath oldPath, IPath newPath, +// IPath sourcePath) { +// if (oldPath == null) { +// if (newPath != null) { +// return IJavaElementDelta.F_SOURCEATTACHED; +// } else { +// if (sourcePath != null) { +// // if source path is specified and no root path, it needs to +// // be recomputed dynamically +// return IJavaElementDelta.F_SOURCEATTACHED +// | IJavaElementDelta.F_SOURCEDETACHED; +// } else { +// return 0; +// } +// } +// } else if (newPath == null) { +// return IJavaElementDelta.F_SOURCEDETACHED; +// } else if (!oldPath.equals(newPath)) { +// return IJavaElementDelta.F_SOURCEATTACHED +// | IJavaElementDelta.F_SOURCEDETACHED; +// } else { +// return 0; +// } +// } /* * Returns the source attachment flag for the delta between the 2 give diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/NameEnvironment.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/NameEnvironment.java index c8f6dd3..3a97ad7 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/NameEnvironment.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/NameEnvironment.java @@ -25,7 +25,7 @@ import net.sourceforge.phpdt.internal.core.JavaProject; import net.sourceforge.phpdt.internal.core.util.SimpleLookupTable; import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFolder; +//import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IWorkspaceRoot; @@ -290,12 +290,12 @@ public class NameEnvironment implements INameEnvironment { // binaryLocations[i].cleanup(); } - private void createFolder(IContainer folder) throws CoreException { - if (!folder.exists()) { - createFolder(folder.getParent()); - ((IFolder) folder).create(true, true, null); - } - } +// private void createFolder(IContainer folder) throws CoreException { +// if (!folder.exists()) { +// createFolder(folder.getParent()); +// ((IFolder) folder).create(true, true, null); +// } +// } private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeName) { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/State.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/State.java index 4d60110..e5f273f 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/State.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/builder/State.java @@ -320,18 +320,18 @@ public class State { return newState; } - private static char[][] readNames(DataInputStream in) throws IOException { - int length = in.readInt(); - char[][] names = new char[length][]; - for (int i = 0; i < length; i++) { - int nLength = in.readInt(); - char[] name = new char[nLength]; - for (int j = 0; j < nLength; j++) - name[j] = in.readChar(); - names[i] = name; - } - return names; - } +// private static char[][] readNames(DataInputStream in) throws IOException { +// int length = in.readInt(); +// char[][] names = new char[length][]; +// for (int i = 0; i < length; i++) { +// int nLength = in.readInt(); +// char[] name = new char[nLength]; +// for (int j = 0; j < nLength; j++) +// name[j] = in.readChar(); +// names[i] = name; +// } +// return names; +// } void tagAsNoopBuild() { this.buildNumber = -1; // tag the project since it has no source @@ -548,18 +548,18 @@ public class State { // } } - private void writeNames(char[][] names, DataOutputStream out) - throws IOException { - int length = names == null ? 0 : names.length; - out.writeInt(length); - for (int i = 0; i < length; i++) { - char[] name = names[i]; - int nLength = name.length; - out.writeInt(nLength); - for (int j = 0; j < nLength; j++) - out.writeChar(name[j]); - } - } +// private void writeNames(char[][] names, DataOutputStream out) +// throws IOException { +// int length = names == null ? 0 : names.length; +// out.writeInt(length); +// for (int i = 0; i < length; i++) { +// char[] name = names[i]; +// int nLength = name.length; +// out.writeInt(nLength); +// for (int j = 0; j < nLength; j++) +// out.writeChar(name[j]); +// } +// } /** * Returns a string representation of the receiver. diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/util/Util.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/util/Util.java index 48fb3e2..cb88c85 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/util/Util.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/core/util/Util.java @@ -36,7 +36,7 @@ import net.sourceforge.phpdt.internal.core.PackageFragmentRoot; import net.sourceforge.phpdt.internal.core.util.PHPFileUtil; import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; +//import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; @@ -592,24 +592,24 @@ public class Util { return sig.substring(i + 1); } - private static IFile findFirstClassFile(IFolder folder) { - try { - IResource[] members = folder.members(); - for (int i = 0, max = members.length; i < max; i++) { - IResource member = members[i]; - if (member.getType() == IResource.FOLDER) { - return findFirstClassFile((IFolder) member); - // } else if - // (net.sourceforge.phpdt.internal.compiler.util.Util.isClassFileName(member.getName())) - // { - // return (IFile) member; - } - } - } catch (CoreException e) { - // ignore - } - return null; - } +// private static IFile findFirstClassFile(IFolder folder) { +// try { +// IResource[] members = folder.members(); +// for (int i = 0, max = members.length; i < max; i++) { +// IResource member = members[i]; +// if (member.getType() == IResource.FOLDER) { +// return findFirstClassFile((IFolder) member); +// // } else if +// // (net.sourceforge.phpdt.internal.compiler.util.Util.isClassFileName(member.getName())) +// // { +// // return (IFile) member; +// } +// } +// } catch (CoreException e) { +// // ignore +// } +// return null; +// } /** * Finds the first line separator used by the given text. diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/CodeFormatterUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/CodeFormatterUtil.java index bd39503..00bc0ea 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/CodeFormatterUtil.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/CodeFormatterUtil.java @@ -10,7 +10,7 @@ *******************************************************************************/ package net.sourceforge.phpdt.internal.corext.util; -import java.util.Map; +//import java.util.Map; import net.sourceforge.phpdt.core.ToolFactory; import net.sourceforge.phpdt.core.formatter.DefaultCodeFormatterConstants; @@ -23,10 +23,10 @@ import org.eclipse.jface.text.BadPositionCategoryException; import org.eclipse.jface.text.DefaultPositionUpdater; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.Position; -import org.eclipse.text.edits.DeleteEdit; -import org.eclipse.text.edits.InsertEdit; -import org.eclipse.text.edits.MultiTextEdit; -import org.eclipse.text.edits.ReplaceEdit; +//import org.eclipse.text.edits.DeleteEdit; +//import org.eclipse.text.edits.InsertEdit; +//import org.eclipse.text.edits.MultiTextEdit; +//import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.text.edits.TextEdit; public class CodeFormatterUtil { @@ -107,27 +107,27 @@ public class CodeFormatterUtil { // return getOldAPICompatibleResult(string, edit, indentationLevel, // positions, lineSeparator, options); // } - private static String getOldAPICompatibleResult(String string, - TextEdit edit, int indentationLevel, int[] positions, - String lineSeparator, Map options) { - Position[] p = null; - - if (positions != null) { - p = new Position[positions.length]; - for (int i = 0; i < positions.length; i++) { - p[i] = new Position(positions[i], 0); - } - } - String res = evaluateFormatterEdit(string, edit, p); - - if (positions != null) { - for (int i = 0; i < positions.length; i++) { - Position curr = p[i]; - positions[i] = curr.getOffset(); - } - } - return res; - } +// private static String getOldAPICompatibleResult(String string, +// TextEdit edit, int indentationLevel, int[] positions, +// String lineSeparator, Map options) { +// Position[] p = null; +// +// if (positions != null) { +// p = new Position[positions.length]; +// for (int i = 0; i < positions.length; i++) { +// p[i] = new Position(positions[i], 0); +// } +// } +// String res = evaluateFormatterEdit(string, edit, p); +// +// if (positions != null) { +// for (int i = 0; i < positions.length; i++) { +// Position curr = p[i]; +// positions[i] = curr.getOffset(); +// } +// } +// return res; +// } /** * Evaluates the edit on the given string. @@ -275,32 +275,32 @@ public class CodeFormatterUtil { // } // return edit; // } - private static TextEdit shifEdit(TextEdit oldEdit, int diff) { - TextEdit newEdit; - if (oldEdit instanceof ReplaceEdit) { - ReplaceEdit edit = (ReplaceEdit) oldEdit; - newEdit = new ReplaceEdit(edit.getOffset() - diff, - edit.getLength(), edit.getText()); - } else if (oldEdit instanceof InsertEdit) { - InsertEdit edit = (InsertEdit) oldEdit; - newEdit = new InsertEdit(edit.getOffset() - diff, edit.getText()); - } else if (oldEdit instanceof DeleteEdit) { - DeleteEdit edit = (DeleteEdit) oldEdit; - newEdit = new DeleteEdit(edit.getOffset() - diff, edit.getLength()); - } else if (oldEdit instanceof MultiTextEdit) { - newEdit = new MultiTextEdit(); - } else { - return null; // not supported - } - TextEdit[] children = oldEdit.getChildren(); - for (int i = 0; i < children.length; i++) { - TextEdit shifted = shifEdit(children[i], diff); - if (shifted != null) { - newEdit.addChild(shifted); - } - } - return newEdit; - } +// private static TextEdit shifEdit(TextEdit oldEdit, int diff) { +// TextEdit newEdit; +// if (oldEdit instanceof ReplaceEdit) { +// ReplaceEdit edit = (ReplaceEdit) oldEdit; +// newEdit = new ReplaceEdit(edit.getOffset() - diff, +// edit.getLength(), edit.getText()); +// } else if (oldEdit instanceof InsertEdit) { +// InsertEdit edit = (InsertEdit) oldEdit; +// newEdit = new InsertEdit(edit.getOffset() - diff, edit.getText()); +// } else if (oldEdit instanceof DeleteEdit) { +// DeleteEdit edit = (DeleteEdit) oldEdit; +// newEdit = new DeleteEdit(edit.getOffset() - diff, edit.getLength()); +// } else if (oldEdit instanceof MultiTextEdit) { +// newEdit = new MultiTextEdit(); +// } else { +// return null; // not supported +// } +// TextEdit[] children = oldEdit.getChildren(); +// for (int i = 0; i < children.length; i++) { +// TextEdit shifted = shifEdit(children[i], diff); +// if (shifted != null) { +// newEdit.addChild(shifted); +// } +// } +// return newEdit; +// } private static Document createDocument(String string, Position[] positions) throws IllegalArgumentException { diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java index b17b195..8946aaa 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/util/JavaModelUtil.java @@ -234,14 +234,14 @@ public class JavaModelUtil { return type.getTypeQualifiedName('.'); } - private static void getTypeQualifiedName(IType type, StringBuffer buf) { - IType outerType = type.getDeclaringType(); - if (outerType != null) { - getTypeQualifiedName(outerType, buf); - buf.append('.'); - } - buf.append(type.getElementName()); - } +// private static void getTypeQualifiedName(IType type, StringBuffer buf) { +// IType outerType = type.getDeclaringType(); +// if (outerType != null) { +// getTypeQualifiedName(outerType, buf); +// buf.append('.'); +// } +// buf.append(type.getElementName()); +// } /** * Returns the fully qualified name of the given type using '.' as diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java index d209db0..3be2d55 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/formatter/CodeFormatter.java @@ -1322,106 +1322,106 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { * @param token * the token of which the priority is requested */ - private static int getTokenPriority(int token) { - switch (token) { - case TokenNameextends: - // case TokenNameimplements : - // case TokenNamethrows : - return 10; - case TokenNameSEMICOLON: - // ; - return 20; - case TokenNameCOMMA: - // , - return 25; - case TokenNameEQUAL: - // = - return 30; - case TokenNameAND_AND: - // && - case TokenNameOR_OR: - // || - return 40; - case TokenNameQUESTION: - // ? - case TokenNameCOLON: - // : - return 50; // it's better cutting on ?: than on ; - case TokenNameEQUAL_EQUAL: - // == - case TokenNameEQUAL_EQUAL_EQUAL: - // === - case TokenNameNOT_EQUAL: - // != - case TokenNameNOT_EQUAL_EQUAL: - // != - return 60; - case TokenNameLESS: - // < - case TokenNameLESS_EQUAL: - // <= - case TokenNameGREATER: - // > - case TokenNameGREATER_EQUAL: - // >= - // case TokenNameinstanceof : // instanceof - return 70; - case TokenNamePLUS: - // + - case TokenNameMINUS: - // - - return 80; - case TokenNameMULTIPLY: - // * - case TokenNameDIVIDE: - // / - case TokenNameREMAINDER: - // % - return 90; - case TokenNameLEFT_SHIFT: - // << - case TokenNameRIGHT_SHIFT: - // >> - // case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> - return 100; - case TokenNameAND: - // & - case TokenNameOR: - // | - case TokenNameXOR: - // ^ - return 110; - case TokenNameMULTIPLY_EQUAL: - // *= - case TokenNameDIVIDE_EQUAL: - // /= - case TokenNameREMAINDER_EQUAL: - // %= - case TokenNamePLUS_EQUAL: - // += - case TokenNameMINUS_EQUAL: - // -= - case TokenNameLEFT_SHIFT_EQUAL: - // <<= - case TokenNameRIGHT_SHIFT_EQUAL: - // >>= - // case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>= - case TokenNameAND_EQUAL: - // &= - case TokenNameXOR_EQUAL: - // ^= - case TokenNameOR_EQUAL: - // .= - case TokenNameDOT_EQUAL: - // |= - return 120; - case TokenNameDOT: - // . - return 130; - default: - return Integer.MAX_VALUE; - } - } +// private static int getTokenPriority(int token) { +// switch (token) { +// case TokenNameextends: +// // case TokenNameimplements : +// // case TokenNamethrows : +// return 10; +// case TokenNameSEMICOLON: +// // ; +// return 20; +// case TokenNameCOMMA: +// // , +// return 25; +// case TokenNameEQUAL: +// // = +// return 30; +// case TokenNameAND_AND: +// // && +// case TokenNameOR_OR: +// // || +// return 40; +// case TokenNameQUESTION: +// // ? +// case TokenNameCOLON: +// // : +// return 50; // it's better cutting on ?: than on ; +// case TokenNameEQUAL_EQUAL: +// // == +// case TokenNameEQUAL_EQUAL_EQUAL: +// // === +// case TokenNameNOT_EQUAL: +// // != +// case TokenNameNOT_EQUAL_EQUAL: +// // != +// return 60; +// case TokenNameLESS: +// // < +// case TokenNameLESS_EQUAL: +// // <= +// case TokenNameGREATER: +// // > +// case TokenNameGREATER_EQUAL: +// // >= +// // case TokenNameinstanceof : // instanceof +// return 70; +// case TokenNamePLUS: +// // + +// case TokenNameMINUS: +// // - +// return 80; +// case TokenNameMULTIPLY: +// // * +// case TokenNameDIVIDE: +// // / +// case TokenNameREMAINDER: +// // % +// return 90; +// case TokenNameLEFT_SHIFT: +// // << +// case TokenNameRIGHT_SHIFT: +// // >> +// // case TokenNameUNSIGNED_RIGHT_SHIFT : // >>> +// return 100; +// case TokenNameAND: +// // & +// case TokenNameOR: +// // | +// case TokenNameXOR: +// // ^ +// return 110; +// case TokenNameMULTIPLY_EQUAL: +// // *= +// case TokenNameDIVIDE_EQUAL: +// // /= +// case TokenNameREMAINDER_EQUAL: +// // %= +// case TokenNamePLUS_EQUAL: +// // += +// case TokenNameMINUS_EQUAL: +// // -= +// case TokenNameLEFT_SHIFT_EQUAL: +// // <<= +// case TokenNameRIGHT_SHIFT_EQUAL: +// // >>= +// // case TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL : // >>>= +// case TokenNameAND_EQUAL: +// // &= +// case TokenNameXOR_EQUAL: +// // ^= +// case TokenNameOR_EQUAL: +// // .= +// case TokenNameDOT_EQUAL: +// // |= +// return 120; +// case TokenNameDOT: +// // . +// return 130; +// default: +// return Integer.MAX_VALUE; +// } +// } /** * Handles the exception raised when an invalid token is encountered. @@ -2065,16 +2065,16 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { * Pops the top statement of the stack if it is a BLOCK or a * NONINDENT_BLOCK. */ - private int popBlock() { - int delta = 0; - if ((constructionsCount > 0) - && ((constructions[constructionsCount - 1] == BLOCK) || (constructions[constructionsCount - 1] == NONINDENT_BLOCK))) { - if (constructions[constructionsCount - 1] == BLOCK) - delta--; - constructionsCount--; - } - return delta; - } +// private int popBlock() { +// int delta = 0; +// if ((constructionsCount > 0) +// && ((constructions[constructionsCount - 1] == BLOCK) || (constructions[constructionsCount - 1] == NONINDENT_BLOCK))) { +// if (constructions[constructionsCount - 1] == BLOCK) +// delta--; +// constructionsCount--; +// } +// return delta; +// } /** * Pops elements until the stack is empty or the top element is @@ -2084,16 +2084,16 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { * @param token * the token to be left as the top of the stack */ - private int popExclusiveUntil(int token) { - int delta = 0; - int startCount = constructionsCount; - for (int i = startCount - 1; i >= 0 && constructions[i] != token; i--) { - if (constructions[i] != NONINDENT_BLOCK) - delta--; - constructionsCount--; - } - return delta; - } +// private int popExclusiveUntil(int token) { +// int delta = 0; +// int startCount = constructionsCount; +// for (int i = startCount - 1; i >= 0 && constructions[i] != token; i--) { +// if (constructions[i] != NONINDENT_BLOCK) +// delta--; +// constructionsCount--; +// } +// return delta; +// } /** * Pops elements until the stack is empty or the top element is a @@ -2211,16 +2211,16 @@ public class CodeFormatter implements ITerminalSymbols, ICodeFormatter { return 1; } - private static boolean separateFirstArgumentOn(int currentToken) { - // return (currentToken == TokenNameCOMMA || currentToken == - // TokenNameSEMICOLON); - return currentToken != TokenNameif && currentToken != TokenNameLPAREN - && currentToken != TokenNameNOT - && currentToken != TokenNamewhile - && currentToken != TokenNamefor - && currentToken != TokenNameforeach - && currentToken != TokenNameswitch; - } +// private static boolean separateFirstArgumentOn(int currentToken) { +// // return (currentToken == TokenNameCOMMA || currentToken == +// // TokenNameSEMICOLON); +// return currentToken != TokenNameif && currentToken != TokenNameLPAREN +// && currentToken != TokenNameNOT +// && currentToken != TokenNamewhile +// && currentToken != TokenNamefor +// && currentToken != TokenNameforeach +// && currentToken != TokenNameswitch; +// } /** * Set the positions to map. The mapped positions should be retrieved using