diff options
author | Mike Rennie | 2013-07-31 16:44:16 +0000 |
---|---|---|
committer | Mike Rennie | 2013-07-31 16:44:16 +0000 |
commit | d975f27f12707ae6598994c5e3c6bd5e271d46c4 (patch) | |
tree | c7d1b2b1a202e19c0c2ccaaff959f4dd25286f0d /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution | |
parent | 4fcde1ffaf34791bd406d47ce72d17e2801432a3 (diff) | |
download | eclipse.platform.debug-d975f27f12707ae6598994c5e3c6bd5e271d46c4.tar.gz eclipse.platform.debug-d975f27f12707ae6598994c5e3c6bd5e271d46c4.tar.xz eclipse.platform.debug-d975f27f12707ae6598994c5e3c6bd5e271d46c4.zip |
Bug 352626 - Move platform debug to Java 1.6 BREE
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution')
12 files changed, 31 insertions, 13 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java index 418c69f23..558376095 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java @@ -22,6 +22,7 @@ public class FilePrompt extends PromptingResolver { * Prompts the user to choose a file * @see PromptExpanderBase#prompt() */ + @Override public void prompt() { FileDialog dialog = new FileDialog(getShell()); dialog.setText(dialogMessage); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java index 861fcebe8..76dc24657 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java @@ -22,6 +22,7 @@ public class FolderPrompt extends PromptingResolver { * Prompts the user to choose a folder. * @see PromptExpanderBase#prompt() */ + @Override public void prompt() { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setText(dialogMessage); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java index e535d9185..1eb238f69 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java @@ -33,6 +33,7 @@ public class PasswordPrompt extends PromptingResolver { /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.stringsubstitution.PromptingResolver#prompt() */ + @Override public void prompt() { Dialog dialog = new Dialog((Shell)null){ private Text text; @@ -40,6 +41,7 @@ public class PasswordPrompt extends PromptingResolver { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createDialogArea(Composite parent) { // create composite Composite composite = (Composite) super.createDialogArea(parent); @@ -68,6 +70,7 @@ public class PasswordPrompt extends PromptingResolver { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int) */ + @Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { returnValue = text.getText(); @@ -80,6 +83,7 @@ public class PasswordPrompt extends PromptingResolver { /* (non-Javadoc) * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell) */ + @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText(StringSubstitutionMessages.StringPromptExpander_0); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java index fc00f409e..2aa1aaaac 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 Matt Conway and others. + * Copyright (c) 2000, 2013 Matt Conway and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,8 +11,6 @@ *******************************************************************************/ package org.eclipse.debug.internal.ui.stringsubstitution; -import com.ibm.icu.text.MessageFormat; - import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -22,6 +20,8 @@ import org.eclipse.debug.core.DebugException; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.swt.widgets.Shell; +import com.ibm.icu.text.MessageFormat; + /** * Base implementation for variable resolvers that prompt the user * for their value. @@ -80,7 +80,7 @@ abstract class PromptingResolver implements IDynamicVariableResolver { } if (promptHint != null) { - dialogMessage = MessageFormat.format(StringSubstitutionMessages.PromptExpanderBase_0, new String[] {promptHint}); + dialogMessage = MessageFormat.format(StringSubstitutionMessages.PromptExpanderBase_0, new Object[] { promptHint }); } else { dialogMessage = StringSubstitutionMessages.PromptExpanderBase_1; } @@ -89,11 +89,13 @@ abstract class PromptingResolver implements IDynamicVariableResolver { /* (non-Javadoc) * @see org.eclipse.debug.internal.core.stringsubstitution.IContextVariableResolver#resolveValue(org.eclipse.debug.internal.core.stringsubstitution.IContextVariable, java.lang.String) */ + @Override public String resolveValue(IDynamicVariable variable, String argument) throws CoreException { String value = null; setupDialog(argument); DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() { + @Override public void run() { prompt(); } @@ -103,7 +105,7 @@ abstract class PromptingResolver implements IDynamicVariableResolver { lastValue = dialogResultString; } else { // dialogResultString == null means prompt was cancelled - throw new DebugException(new Status(IStatus.CANCEL, DebugUIPlugin.getUniqueIdentifier(), IStatus.CANCEL, MessageFormat.format(StringSubstitutionMessages.PromptingResolver_0, new String[] { variable.getName() }), null)); + throw new DebugException(new Status(IStatus.CANCEL, DebugUIPlugin.getUniqueIdentifier(), IStatus.CANCEL, MessageFormat.format(StringSubstitutionMessages.PromptingResolver_0, new Object[] { variable.getName() }), null)); } return value; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java index edc465e1a..d58cf76ea 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java @@ -26,6 +26,7 @@ public class ResourceSelector implements IArgumentSelector { /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector#selectArgument(org.eclipse.debug.internal.core.stringsubstitution.IStringVariable) */ + @Override public String selectArgument(IStringVariable variable, Shell shell) { ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(shell, ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE | IResource.FOLDER | IResource.PROJECT); dialog.setTitle(StringSubstitutionMessages.ResourceSelector_0); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java index 842af04e7..dce7853fa 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2007 IBM Corporation and others. + * Copyright (c) 2000, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -72,6 +72,7 @@ public class SelectedResourceManager { else { final IStructuredSelection[] selection = new IStructuredSelection[1]; DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() { + @Override public void run() { selection[0] = getCurrentSelection0(); } @@ -126,6 +127,7 @@ public class SelectedResourceManager { else { final IResource[] resource = new IResource[1]; DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() { + @Override public void run() { resource[0] = getSelectedResource0(); } @@ -160,7 +162,7 @@ public class SelectedResourceManager { if(selection instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) selection; if(!ss.isEmpty()) { - Iterator iterator = ss.iterator(); + Iterator<?> iterator = ss.iterator(); while (iterator.hasNext() && resource == null) { Object next = iterator.next(); resource = (IResource) Platform.getAdapterManager().getAdapter(next, IResource.class); @@ -188,6 +190,7 @@ public class SelectedResourceManager { else { final String[] text = new String[1]; DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() { + @Override public void run() { text[0] = getSelectedText0(); } @@ -239,6 +242,7 @@ public class SelectedResourceManager { else { final IWorkbenchWindow[] window = new IWorkbenchWindow[1]; DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() { + @Override public void run() { window[0] = DebugUIPlugin.getActiveWorkbenchWindow(); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java index 0fcedc27a..a0b379925 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,12 +28,13 @@ public class SelectedResourceResolver extends ResourceResolver implements IDynam /* (non-Javadoc) * @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String) */ + @Override public String resolveValue(IDynamicVariable variable, String argument) throws CoreException { IResource resource = SelectedResourceManager.getDefault().getSelectedResource(); if (resource != null) { return translateToValue(resource, variable); } - abort(MessageFormat.format(StringSubstitutionMessages.SelectedResourceResolver_0, new String[]{getReferenceExpression(variable, argument)}), null); + abort(MessageFormat.format(StringSubstitutionMessages.SelectedResourceResolver_0, new Object[] { getReferenceExpression(variable, argument) }), null); return null; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java index e2726b883..31acde4b6 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java @@ -24,6 +24,7 @@ public class SelectedTextResolver implements IDynamicVariableResolver { /* (non-Javadoc) * @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String) */ + @Override public String resolveValue(IDynamicVariable variable, String argument) { String selection = selectedResourceManager.getSelectedText(); String selectedText = argument; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java index da44ec551..12066063b 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java @@ -23,6 +23,7 @@ public class StringPrompt extends PromptingResolver { * Prompts the user to input a string. * @see PromptExpanderBase#prompt() */ + @Override public void prompt() { InputDialog dialog = new InputDialog(null, StringSubstitutionMessages.StringPromptExpander_0, dialogMessage, defaultValue == null ? lastValue : defaultValue, null); int dialogResult = dialog.open(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java index ca12e4196..3c8f6d12a 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java @@ -19,6 +19,7 @@ public class StringVariableLabelProvider extends LabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { if (element instanceof IStringVariable) { IStringVariable variable = (IStringVariable)element; diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java index c3c87ae66..d649557fa 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java @@ -49,7 +49,7 @@ public class StringVariablePresentationManager { * Table of configuration elements for variable presentations, * keyed by variable name. */ - private Map fConfigurations; + private Map<String, IConfigurationElement> fConfigurations; /** * Returns the singleton string variable presentation manager. @@ -71,7 +71,7 @@ public class StringVariablePresentationManager { * @return argument selector or <code>null</code> */ public IArgumentSelector getArgumentSelector(IStringVariable variable) { - IConfigurationElement element = (IConfigurationElement) fConfigurations.get(variable.getName()); + IConfigurationElement element = fConfigurations.get(variable.getName()); if (element != null) { try { return (IArgumentSelector)element.createExecutableExtension(ATTR_ARGUMENT_SELECTOR); @@ -93,14 +93,14 @@ public class StringVariablePresentationManager { * Load extensions */ private void initialize() { - fConfigurations = new HashMap(); + fConfigurations = new HashMap<String, IConfigurationElement>(); IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS); IConfigurationElement elements[]= point.getConfigurationElements(); for (int i = 0; i < elements.length; i++) { IConfigurationElement element = elements[i]; String name= element.getAttribute(ATTR_NAME); if (name == null) { - DebugUIPlugin.logErrorMessage(MessageFormat.format("String variable presentation extension missing required 'variableName' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()})); //$NON-NLS-1$ + DebugUIPlugin.logErrorMessage(MessageFormat.format("String variable presentation extension missing required 'variableName' attribute: {0}", new Object[] { element.getDeclaringExtension().getLabel() })); //$NON-NLS-1$ continue; } fConfigurations.put(name, element); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java index 4f5d2157b..8b805b7f5 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java @@ -27,6 +27,7 @@ public class SystemPropertyArgumentSelector implements IArgumentSelector { /* (non-Javadoc) * @see org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector#selectArgument(org.eclipse.core.variables.IStringVariable, org.eclipse.swt.widgets.Shell) */ + @Override public String selectArgument(IStringVariable variable, Shell shell) { ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider()); dialog.setElements(System.getProperties().keySet().toArray()); |