diff options
| author | Lars Vogel | 2016-03-08 09:50:32 +0000 |
|---|---|---|
| committer | Lars Vogel | 2016-03-08 22:51:30 +0000 |
| commit | a8bb64969eaa785ef4f53675aa2db4db3f507a04 (patch) | |
| tree | df3487dbe546cdce6eff012ae11f24b0d4f72984 | |
| parent | 8878eeea77635ec09b82c5705f8f3e748e4fa32a (diff) | |
| download | eclipse.pde.ui-a8bb64969eaa785ef4f53675aa2db4db3f507a04.tar.gz eclipse.pde.ui-a8bb64969eaa785ef4f53675aa2db4db3f507a04.tar.xz eclipse.pde.ui-a8bb64969eaa785ef4f53675aa2db4db3f507a04.zip | |
Bug 487988 - Retire useless DefaultTableProvider
Second bunch of changes
Change-Id: I23b21ed94ea17fe7ab6fb32a48b15e3c12f153b7
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
8 files changed, 28 insertions, 45 deletions
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilityChoicesDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilityChoicesDialog.java index aece5a4a3c..dbff98fb7f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilityChoicesDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilityChoicesDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 @@ -7,16 +7,17 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487988 *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.feature; import java.util.StringTokenizer; import java.util.Vector; -import org.eclipse.jface.dialogs.*; import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.dialogs.TrayDialog; import org.eclipse.jface.viewers.*; import org.eclipse.pde.internal.ui.*; -import org.eclipse.pde.internal.ui.elements.DefaultTableProvider; import org.eclipse.pde.internal.ui.parts.WizardCheckboxTablePart; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; @@ -31,7 +32,7 @@ public class PortabilityChoicesDialog extends TrayDialog { private CheckboxTableViewer choiceViewer; private WizardCheckboxTablePart checkboxTablePart; - class ContentProvider extends DefaultTableProvider { + class ContentProvider implements IStructuredContentProvider { @Override public Object[] getElements(Object parent) { return choices; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExecutionEnvironmentSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExecutionEnvironmentSection.java index 559ab7b54e..1c36b2af78 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExecutionEnvironmentSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExecutionEnvironmentSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487988 *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.plugin; @@ -30,7 +31,6 @@ import org.eclipse.pde.internal.core.text.bundle.*; import org.eclipse.pde.internal.ui.*; import org.eclipse.pde.internal.ui.editor.*; import org.eclipse.pde.internal.ui.editor.context.InputContextManager; -import org.eclipse.pde.internal.ui.elements.DefaultTableProvider; import org.eclipse.pde.internal.ui.parts.EditableTablePart; import org.eclipse.pde.internal.ui.parts.TablePart; import org.eclipse.swt.SWT; @@ -80,7 +80,7 @@ public class ExecutionEnvironmentSection extends TableSection { } } - class ContentProvider extends DefaultTableProvider { + class ContentProvider implements IStructuredContentProvider { @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IBundleModel) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageSection.java index 77a4443c4e..314d3511e6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2016 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 @@ -9,6 +9,7 @@ * IBM Corporation - initial API and implementation * Remy Chi Jian Suen <remy.suen@gmail.com> - bug 200756 * Joern Dinkla <devnull@dinkla.com> - bug 200757 + * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487988 *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.plugin; @@ -36,7 +37,6 @@ import org.eclipse.pde.internal.core.util.PDEJavaHelper; import org.eclipse.pde.internal.ui.*; import org.eclipse.pde.internal.ui.editor.*; import org.eclipse.pde.internal.ui.editor.context.InputContextManager; -import org.eclipse.pde.internal.ui.elements.DefaultTableProvider; import org.eclipse.pde.internal.ui.parts.ConditionalListSelectionDialog; import org.eclipse.pde.internal.ui.parts.TablePart; import org.eclipse.pde.internal.ui.search.dependencies.CalculateUsesAction; @@ -59,7 +59,7 @@ public class ExportPackageSection extends TableSection { private static final int PROPERTIES_INDEX = 2; private static final int CALCULATE_USE_INDEX = 3; - class ExportPackageContentProvider extends DefaultTableProvider { + class ExportPackageContentProvider implements IStructuredContentProvider { @Override public Object[] getElements(Object parent) { if (fHeader == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultTableProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultTableProvider.java deleted file mode 100644 index 09aa963248..0000000000 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultTableProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2016 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487943 - *******************************************************************************/ -package org.eclipse.pde.internal.ui.elements; - -import org.eclipse.jface.viewers.IStructuredContentProvider; - -public abstract class DefaultTableProvider implements IStructuredContentProvider { -} diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/SelfHostingPropertyPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/SelfHostingPropertyPage.java index a61b6c8107..7f63d71c9f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/SelfHostingPropertyPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/SelfHostingPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2015 IBM Corporation and others. + * Copyright (c) 2003, 2016 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 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487988 *******************************************************************************/ package org.eclipse.pde.internal.ui.properties; @@ -23,7 +24,6 @@ import org.eclipse.jface.viewers.*; import org.eclipse.pde.internal.core.ICoreConstants; import org.eclipse.pde.internal.core.PDECore; import org.eclipse.pde.internal.ui.*; -import org.eclipse.pde.internal.ui.elements.DefaultTableProvider; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; @@ -39,7 +39,7 @@ public class SelfHostingPropertyPage extends PropertyPage { private Image fImage; private CheckboxTableViewer fViewer; - class ContentProvider extends DefaultTableProvider { + class ContentProvider implements IStructuredContentProvider { @Override public Object[] getElements(Object input) { return getOutputFolders(); @@ -54,7 +54,7 @@ public class SelfHostingPropertyPage extends PropertyPage { } private String[] getOutputFolders() { - IProject project = (IProject) getElement().getAdapter(IProject.class); + IProject project = getElement().getAdapter(IProject.class); ArrayList<String> list = new ArrayList<>(); try { if (project.hasNature(JavaCore.NATURE_ID)) { @@ -127,7 +127,7 @@ public class SelfHostingPropertyPage extends PropertyPage { private void initialize() { fViewer.setAllChecked(true); - Preferences pref = getPreferences((IProject) getElement().getAdapter(IProject.class)); + Preferences pref = getPreferences(getElement().getAdapter(IProject.class)); if (pref != null) { String binExcludes = pref.get(ICoreConstants.SELFHOSTING_BIN_EXCLUDES, ""); //$NON-NLS-1$ StringTokenizer tokenizer = new StringTokenizer(binExcludes, ","); //$NON-NLS-1$ @@ -149,7 +149,7 @@ public class SelfHostingPropertyPage extends PropertyPage { @Override public boolean performOk() { - Preferences pref = getPreferences((IProject) getElement().getAdapter(IProject.class)); + Preferences pref = getPreferences(getElement().getAdapter(IProject.class)); StringBuffer buffer = new StringBuffer(); for (int i = 0; i < fViewer.getTable().getItemCount(); i++) { Object object = fViewer.getElementAt(i); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedImportsDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedImportsDialog.java index 5470539346..9d4c076f05 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedImportsDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedImportsDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 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 @@ -7,17 +7,16 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487988 *******************************************************************************/ package org.eclipse.pde.internal.ui.search.dependencies; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TrayDialog; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.*; import org.eclipse.pde.core.plugin.IPluginModelBase; import org.eclipse.pde.internal.core.text.bundle.ImportPackageObject; import org.eclipse.pde.internal.ui.*; -import org.eclipse.pde.internal.ui.elements.DefaultTableProvider; import org.eclipse.pde.internal.ui.parts.WizardCheckboxTablePart; import org.eclipse.pde.internal.ui.wizards.ListUtil.PluginComparator; import org.eclipse.swt.SWT; @@ -45,7 +44,7 @@ public class UnusedImportsDialog extends TrayDialog { } } - class ContentProvider extends DefaultTableProvider { + class ContentProvider implements IStructuredContentProvider { @Override public Object[] getElements(Object parent) { return unused; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportFinishDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportFinishDialog.java index a4998b9d83..7781c10422 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportFinishDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportFinishDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. + * Copyright (c) 2008, 2016 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 @@ -7,14 +7,15 @@ * * Contributors: * Bartosz Michalik <bartosz.michalik@gmail.com> - bug 212758 + * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487988 *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.imports; import java.util.List; import org.eclipse.jface.dialogs.*; +import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.pde.internal.ui.*; -import org.eclipse.pde.internal.ui.elements.DefaultTableProvider; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; @@ -73,8 +74,7 @@ public class PluginImportFinishDialog extends TitleAreaDialog { fPluginList = pluginList; } - static private class PluginImportTableContentProvider extends DefaultTableProvider { - + static private class PluginImportTableContentProvider implements IStructuredContentProvider { @Override public Object[] getElements(Object inputElement) { return ((List<?>) inputElement).toArray(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionContentPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionContentPage.java index dad1be2200..760ac9a027 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionContentPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionContentPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 IBM Corporation and others. + * Copyright (c) 2009, 2016 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 @@ -8,6 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Simon Scholz <simon.scholz@vogella.com> - bug 440275 + * Lars Vogel <Lars.Vogel@vogella.com> - Bug 487988 *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.target; @@ -34,7 +35,6 @@ import org.eclipse.pde.internal.core.PDECore; import org.eclipse.pde.internal.core.util.VMUtil; import org.eclipse.pde.internal.ui.*; import org.eclipse.pde.internal.ui.dialogs.PluginSelectionDialog; -import org.eclipse.pde.internal.ui.elements.DefaultTableProvider; import org.eclipse.pde.internal.ui.shared.target.*; import org.eclipse.pde.internal.ui.util.LocaleUtil; import org.eclipse.swt.SWT; @@ -646,7 +646,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { gd.heightHint = 250; fElementViewer.getControl().setLayoutData(gd); fElementViewer.getControl().setFont(container.getFont()); - fElementViewer.setContentProvider(new DefaultTableProvider() { + fElementViewer.setContentProvider(new IStructuredContentProvider() { @Override public Object[] getElements(Object inputElement) { ITargetDefinition target = getTargetDefinition(); |
