Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-04-18 07:45:47 -0400
committerAlexander Kurtakov2018-04-18 07:45:47 -0400
commit8b69a4c5b85a4d0b56b91c14a61a434298849456 (patch)
tree828ff6f4cace68f942e5b1191fefe13af11821f2 /org.eclipse.debug.ui/ui/org/eclipse/debug/ui
parent13ff8430aaf8568f5fb6f2f326d87222ba0e0ef6 (diff)
downloadeclipse.platform.debug-8b69a4c5b85a4d0b56b91c14a61a434298849456.tar.gz
eclipse.platform.debug-8b69a4c5b85a4d0b56b91c14a61a434298849456.tar.xz
eclipse.platform.debug-8b69a4c5b85a4d0b56b91c14a61a434298849456.zip
Bug 533751 - Direct use of IStructuredSelection
Instead of getSelection and cast. Remove useless @see comments in touched files too. Change-Id: I60d49967e9e56ccaf047817a1ac25d9add2075da Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeTab.java66
3 files changed, 9 insertions, 158 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
index fbe25e6a9..b0aa4abcd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 Keith Seitz and others.
+ * Copyright (c) 2000, 2018 Keith Seitz 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
@@ -196,9 +196,6 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
setHelpContextId(IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
- */
@Override
public void createControl(Composite parent) {
// Create main composite
@@ -294,7 +291,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
* @param event the selection change event
*/
protected void handleTableSelectionChanged(SelectionChangedEvent event) {
- int size = ((IStructuredSelection)event.getSelection()).size();
+ int size = event.getStructuredSelection().size();
envEditButton.setEnabled(size == 1);
envRemoveButton.setEnabled(size > 0);
}
@@ -434,7 +431,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
* Creates an editor for the value of the selected environment variable.
*/
private void handleEnvEditButtonSelected() {
- IStructuredSelection sel= (IStructuredSelection) environmentTable.getSelection();
+ IStructuredSelection sel = environmentTable.getStructuredSelection();
EnvironmentVariable var= (EnvironmentVariable) sel.getFirstElement();
if (var == null) {
return;
@@ -470,7 +467,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
* Removes the selected environment variable from the table.
*/
private void handleEnvRemoveButtonSelected() {
- IStructuredSelection sel = (IStructuredSelection) environmentTable.getSelection();
+ IStructuredSelection sel = environmentTable.getStructuredSelection();
try {
environmentTable.getControl().setRedraw(false);
for (Iterator<?> i = sel.iterator(); i.hasNext();) {
@@ -492,17 +489,11 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
environmentTable.setInput(configuration);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
configuration.removeAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
boolean append= true;
@@ -563,9 +554,6 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
@Override
public String getName() {
return LaunchConfigurationsMessages.EnvironmentTab_Environment_7;
@@ -581,25 +569,16 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
return "org.eclipse.debug.ui.environmentTab"; //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
@Override
public Image getImage() {
return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when activated
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when deactivated
@@ -629,41 +608,26 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
setShowSelectAllButtons(true);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
- */
@Override
protected String getDialogSettingsId() {
return IDebugUIConstants.PLUGIN_ID + ".ENVIRONMENT_TAB.NATIVE_ENVIROMENT_DIALOG"; //$NON-NLS-1$
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
- */
@Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_NATIVE_ENVIRONMENT_DIALOG;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
- */
@Override
protected Object getViewerInput() {
return fInput;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
- */
@Override
protected String getViewerLabel() {
return LaunchConfigurationsMessages.EnvironmentTab_19;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
- */
@Override
protected IBaseLabelProvider getLabelProvider() {
return new ILabelProvider() {
@@ -693,9 +657,6 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
};
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
- */
@Override
protected IContentProvider getContentProvider() {
return new IStructuredContentProvider() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
index a31300078..c20265f64 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2018 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
@@ -91,9 +91,6 @@ public class InspectPopupDialog extends DebugPopup {
fExpression = expression;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, parent.getStyle());
@@ -128,7 +125,7 @@ public class InspectPopupDialog extends DebugPopup {
fTree.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
- fDetailPane.display((IStructuredSelection)fViewer.getSelection());
+ fDetailPane.display(fViewer.getStructuredSelection());
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {}
@@ -195,9 +192,6 @@ public class InspectPopupDialog extends DebugPopup {
fSashForm.setWeights(DEFAULT_SASH_WEIGHTS);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#saveDialogBounds(org.eclipse.swt.widgets.Shell)
- */
@Override
protected void saveDialogBounds(Shell shell) {
super.saveDialogBounds(shell);
@@ -224,24 +218,15 @@ public class InspectPopupDialog extends DebugPopup {
*
*/
private class TreeRoot extends ElementContentProvider {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
@Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return 1;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
- */
@Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return new Object[] { fExpression };
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
- */
@Override
protected boolean supportsContextId(String id) {
return true;
@@ -269,9 +254,6 @@ public class InspectPopupDialog extends DebugPopup {
return variablesView;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#close()
- */
@Override
public boolean close() {
if (!wasPersisted()) {
@@ -282,17 +264,11 @@ public class InspectPopupDialog extends DebugPopup {
return super.close();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#getActionText()
- */
@Override
protected String getActionText() {
return DebugUIViewsMessages.InspectPopupDialog_0;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.DebugPopup#persist()
- */
@Override
protected void persist() {
super.persist();
@@ -311,9 +287,6 @@ public class InspectPopupDialog extends DebugPopup {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getInitialSize()
- */
@Override
protected Point getInitialSize() {
Point initialSize = super.getInitialSize();
@@ -322,9 +295,6 @@ public class InspectPopupDialog extends DebugPopup {
return initialSize;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.PopupDialog#getBackgroundColorExclusions()
- */
@Override
protected List<Control> getBackgroundColorExclusions() {
List<Control> list = super.getBackgroundColorExclusions();
@@ -338,49 +308,31 @@ public class InspectPopupDialog extends DebugPopup {
*/
private class DetailPaneContainer implements IDetailPaneContainer{
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentPaneID()
- */
@Override
public String getCurrentPaneID() {
return fDetailPane.getCurrentPaneID();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentSelection()
- */
@Override
public IStructuredSelection getCurrentSelection() {
- return (IStructuredSelection)fViewer.getSelection();
+ return fViewer.getStructuredSelection();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents()
- */
@Override
public void refreshDetailPaneContents() {
fDetailPane.display(getCurrentSelection());
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getParentComposite()
- */
@Override
public Composite getParentComposite() {
return fDetailPaneComposite;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getWorkbenchPartSite()
- */
@Override
public IWorkbenchPartSite getWorkbenchPartSite() {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#paneChanged(java.lang.String)
- */
@Override
public void paneChanged(String newPaneID) {
if (newPaneID.equals(DefaultDetailPane.ID)){
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeTab.java
index 97fae077f..155c968fe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 Obeo.
+ * Copyright (c) 2017,2018 Obeo 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
@@ -113,12 +113,6 @@ public class PrototypeTab extends AbstractLaunchConfigurationTab {
setHelpContextId(IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_PROTOTYPE_TAB);
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.
- * swt.widgets.Composite)
- */
@Override
public void createControl(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
@@ -377,43 +371,21 @@ public class PrototypeTab extends AbstractLaunchConfigurationTab {
columnValue.getColumn().setText(PROTOTYPE_VALUE);
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.
- * debug.core.ILaunchConfiguration)
- */
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
initialize(configuration);
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#dispose()
- */
@Override
public void dispose() {
super.dispose();
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.
- * core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
initialize(workingCopy);
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.
- * debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
}
@@ -486,12 +458,6 @@ public class PrototypeTab extends AbstractLaunchConfigurationTab {
});
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.
- * core.ILaunchConfiguration)
- */
@Override
public boolean isValid(ILaunchConfiguration config) {
setMessage(null);
@@ -504,30 +470,14 @@ public class PrototypeTab extends AbstractLaunchConfigurationTab {
return !config.isPrototype();
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.
- * debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
}
- /*
- * (non-Javadoc)
- * @see
- * org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.
- * debug.core.ILaunchConfigurationWorkingCopy)
- */
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#postApply()
- */
@Override
public void postApply() {
super.postApply();
@@ -537,19 +487,11 @@ public class PrototypeTab extends AbstractLaunchConfigurationTab {
}
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
- */
@Override
public String getName() {
return LaunchConfigurationsMessages.PrototypeTab_Prototype_1;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
- */
@Override
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_OBJS_PROTO_TAB);
@@ -564,10 +506,6 @@ public class PrototypeTab extends AbstractLaunchConfigurationTab {
return PROTOTYPE_TAB_ID;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
- */
@Override
public boolean canSave() {
return true;
@@ -755,7 +693,7 @@ public class PrototypeTab extends AbstractLaunchConfigurationTab {
@Override
public void run() {
- IStructuredSelection selection = (IStructuredSelection) fAttributesTreeViewer.getSelection();
+ IStructuredSelection selection = fAttributesTreeViewer.getStructuredSelection();
try {
ILaunchConfigurationWorkingCopy workingCopy = getWorkingCopy();
for (Object element : selection.toList()) {

Back to the top