diff options
author | Lars Vogel | 2015-07-24 09:59:23 +0000 |
---|---|---|
committer | Lars Vogel | 2015-07-24 16:06:48 +0000 |
commit | 4383dfde8ff3d3489f3e0ef87ae5a4bfc2743ffc (patch) | |
tree | 42b0a259a97b99c90188242438690ef8d2dbe90c | |
parent | 36e3335063f59129775c97fcd12f2ba0de2991b6 (diff) | |
download | eclipse.pde.ui-4383dfde8ff3d3489f3e0ef87ae5a4bfc2743ffc.tar.gz eclipse.pde.ui-4383dfde8ff3d3489f3e0ef87ae5a4bfc2743ffc.tar.xz eclipse.pde.ui-4383dfde8ff3d3489f3e0ef87ae5a4bfc2743ffc.zip |
Bug 458060 - Add missing annotations to org.eclipse.pde.ui
Change-Id: I1ed19a81ba22f47bbf9d7573fb7ff510a8c3b70a
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
820 files changed, 4853 insertions, 807 deletions
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDELabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDELabelProvider.java index 44b9ccc644..ceca0b5119 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDELabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDELabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -51,6 +51,7 @@ public class PDELabelProvider extends SharedLabelProvider { public PDELabelProvider() { } + @Override public String getText(Object obj) { if (obj instanceof IPluginModelBase) { return getObjectText(((IPluginModelBase) obj).getPluginBase()); @@ -354,6 +355,7 @@ public class PDELabelProvider extends SharedLabelProvider { return status.getMessage(); } + @Override public Image getImage(Object obj) { if (obj instanceof IPlugin) { return getObjectImage((IPlugin) obj); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPerspective.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPerspective.java index 9aa9ec6654..58d26e16ac 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPerspective.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPerspective.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -22,6 +22,7 @@ public class PDEPerspective implements IPerspectiveFactory { super(); } + @Override public void createInitialLayout(IPageLayout factory) { this.factory = factory; addViews(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPlugin.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPlugin.java index e3514d62a3..57f3e792be 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPlugin.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -159,6 +159,7 @@ public class PDEPlugin extends AbstractUIPlugin implements IPDEUIConstants { Display display = SWTUtil.getStandardDisplay(); final IStatus fstatus = status; display.asyncExec(new Runnable() { + @Override public void run() { ErrorDialog.openError(null, title, null, fstatus); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/ShowErrorInStackTraceConsoleAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/ShowErrorInStackTraceConsoleAction.java index 13e17f49ac..b07b787e04 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/ShowErrorInStackTraceConsoleAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/ShowErrorInStackTraceConsoleAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -30,12 +30,14 @@ public class ShowErrorInStackTraceConsoleAction implements IViewActionDelegate { /* (non-Javadoc) * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) */ + @Override public void init(IViewPart view) { } /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ + @Override public void run(IAction action) { if (fSelectedStack != null) { if (fFactory == null) { @@ -48,6 +50,7 @@ public class ShowErrorInStackTraceConsoleAction implements IViewActionDelegate { /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(IAction action, ISelection selection) { fSelectedStack = null; action.setEnabled(false); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BaseBuildAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BaseBuildAction.java index 8992f3e4d4..aa85310cdb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BaseBuildAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BaseBuildAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -43,6 +43,7 @@ public abstract class BaseBuildAction extends AbstractHandler { protected IFile fManifestFile; + @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); if (selection instanceof IStructuredSelection) { @@ -67,8 +68,10 @@ public abstract class BaseBuildAction extends AbstractHandler { } IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { IWorkspaceRunnable wop = new IWorkspaceRunnable() { + @Override public void run(IProgressMonitor monitor) throws CoreException { try { doBuild(monitor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BuildSiteAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BuildSiteAction.java index e4280459bf..bd030047b0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BuildSiteAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/BuildSiteAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -52,6 +52,7 @@ public class BuildSiteAction implements IObjectActionDelegate { * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, * org.eclipse.ui.IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { } @@ -60,6 +61,7 @@ public class BuildSiteAction implements IObjectActionDelegate { * * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ + @Override public void run(IAction action) { if (fModel == null) return; @@ -91,6 +93,7 @@ public class BuildSiteAction implements IObjectActionDelegate { return list.toArray(new IFeatureModel[list.size()]); } + @Override public void selectionChanged(IAction action, ISelection selection) { if (selection instanceof IStructuredSelection) { Object obj = ((IStructuredSelection) selection).getFirstElement(); @@ -116,6 +119,7 @@ public class BuildSiteAction implements IObjectActionDelegate { if (editor != null && editor.isDirty()) { try { IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { editor.doSave(monitor); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GenerateFeatureBuildFileAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GenerateFeatureBuildFileAction.java index 5e143b81a0..6043ec246a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GenerateFeatureBuildFileAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GenerateFeatureBuildFileAction.java @@ -28,6 +28,7 @@ public class GenerateFeatureBuildFileAction extends BaseBuildAction { private IFeatureModel fFeatureModel; + @Override protected void makeScripts(IProgressMonitor monitor) throws InvocationTargetException, CoreException { IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager().getModels(); @@ -82,6 +83,7 @@ public class GenerateFeatureBuildFileAction extends BaseBuildAction { } } + @Override protected void refreshLocal(IProgressMonitor monitor) throws CoreException { super.refreshLocal(monitor); refreshLocal(fFeatureModel.getFeature(), monitor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GeneratePluginBuildFileAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GeneratePluginBuildFileAction.java index e7ad19d04a..d2bde77841 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GeneratePluginBuildFileAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/GeneratePluginBuildFileAction.java @@ -32,6 +32,7 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; */ public class GeneratePluginBuildFileAction extends BaseBuildAction { + @Override protected void makeScripts(IProgressMonitor monitor) throws InvocationTargetException, CoreException { IProject project = fManifestFile.getProject(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java index 3a6fbe7de9..e41241bf36 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -82,6 +82,7 @@ public class RuntimeInstallJob extends Job { /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected IStatus run(IProgressMonitor monitor) { try { ProvisioningSession session = ui.getSession(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerDialog.java index cd6b7dfc16..e52787e198 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -39,11 +39,13 @@ public class CommandComposerDialog extends FormDialog { fCCP.setSnapshotContext(snapshot); } + @Override protected void createFormContent(IManagedForm mform) { ScrolledForm form = mform.getForm(); mform.getToolkit().decorateFormHeading(form.getForm()); initializeDialogUnits(form); fCCP.createCC(form, mform.getToolkit(), new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateOkButtonEnablement(event.getSelection()); } @@ -54,6 +56,7 @@ public class CommandComposerDialog extends FormDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) */ + @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); // Update the button enablement only after the button is created @@ -105,17 +108,20 @@ public class CommandComposerDialog extends FormDialog { } } + @Override protected void configureShell(Shell newShell) { newShell.setText(PDEUIMessages.CommandSerializerPart_name); super.configureShell(newShell); PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IHelpContextIds.COMMAND_COMPOSER_DIALOG); } + @Override public void okPressed() { fPC = fCCP.getParameterizedCommand(); super.okPressed(); } + @Override public boolean close() { fCCP.dispose(); return super.close(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerPart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerPart.java index cdbdd6fa4a..934a45a735 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerPart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandComposerPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -179,6 +179,7 @@ public class CommandComposerPart implements ISelectionChangedListener { return comp; } + @Override public void selectionChanged(SelectionChangedEvent event) { // Clear the previous error message (if any) // Field input value is lost on selection any way diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandCopyFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandCopyFilter.java index 4604295cba..d0e488b31e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandCopyFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandCopyFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -57,18 +57,22 @@ public abstract class CommandCopyFilter { } public static final CommandCopyFilter NONE = new CommandCopyFilter() { + @Override public String getLabelText() { return PDEUIMessages.CommandCopyFilter_noFilter; } + @Override public String getToolTipText() { return PDEUIMessages.CommandCopyFilter_noFilterDesc; } + @Override protected String escape(String serializedCommand) { return serializedCommand; } + @Override protected String markup(String escapedSerializedCommand, String markupLabel) { return escapedSerializedCommand; } @@ -76,19 +80,23 @@ public abstract class CommandCopyFilter { }; public static final CommandCopyFilter HELP = new CommandCopyFilter() { + @Override public String getLabelText() { return PDEUIMessages.CommandCopyFilter_help; } + @Override public String getToolTipText() { return PDEUIMessages.CommandCopyFilter_helpDesc; } + @Override protected String escape(String serializedCommand) { // TODO: escape for Help return serializedCommand; } + @Override protected String markup(String escapedSerializedCommand, String markupLabel) { StringBuffer sb = new StringBuffer(); @@ -105,19 +113,23 @@ public abstract class CommandCopyFilter { }; public static final CommandCopyFilter CHEATSHEET = new CommandCopyFilter() { + @Override public String getLabelText() { return PDEUIMessages.CommandCopyFilter_cheatsheet; } + @Override public String getToolTipText() { return PDEUIMessages.CommandCopyFilter_cheatsheetDesc; } + @Override protected String escape(String serializedCommand) { // TODO: escape for Cheatsheets return serializedCommand; } + @Override protected String markup(String escapedSerializedCommand, String markupLabel) { StringBuffer sb = new StringBuffer(); @@ -131,19 +143,23 @@ public abstract class CommandCopyFilter { }; public static final CommandCopyFilter INTRO = new CommandCopyFilter() { + @Override public String getLabelText() { return PDEUIMessages.CommandCopyFilter_intro; } + @Override public String getToolTipText() { return PDEUIMessages.CommandCopyFilter_introDesc; } + @Override protected String escape(String serializedCommand) { // TODO: escape for Intro return serializedCommand; } + @Override protected String markup(String escapedSerializedCommand, String markupLabel) { StringBuffer sb = new StringBuffer(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandDetails.java index 6e2b30f279..0c378b83f4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -111,6 +111,7 @@ public class CommandDetails { fExecLink.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); fExecLink.setVisible(false); fExecLink.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { execImage.dispose(); } @@ -125,6 +126,7 @@ public class CommandDetails { fCopyLink.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); fCopyLink.setVisible(false); fCopyLink.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { clipImage.dispose(); } @@ -138,6 +140,7 @@ public class CommandDetails { fSurroundCopyText = fToolkit.createButton(preLabelComp, PDEUIMessages.CommandDetails_includeMarkup, SWT.CHECK); fSurroundCopyText.setToolTipText(PDEUIMessages.CommandDetails_markupTooltip); fSurroundCopyText.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updatePreviewText(); } @@ -149,6 +152,7 @@ public class CommandDetails { fFilterCombo.add(filters[i].getLabelText()); fFilterCombo.select(CommandCopyFilter.indexOf(CommandCopyFilter.NONE)); fFilterCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updatePreviewText(); } @@ -177,6 +181,7 @@ public class CommandDetails { } private class ExecCommand extends HyperlinkAdapter { + @Override public void linkActivated(HyperlinkEvent e) { ParameterizedCommand pCommand = buildParameterizedCommand(); try { @@ -223,6 +228,7 @@ public class CommandDetails { } private class CopyToClipboard extends HyperlinkAdapter { + @Override public void linkActivated(HyperlinkEvent e) { String filteredCommand = getFilteredCommand(); @@ -265,12 +271,14 @@ public class CommandDetails { } // clear button pressed + @Override public void widgetSelected(SelectionEvent e) { fValuesCombo.deselectAll(); fParameterToValue.remove(fParameter); } // values combo changed + @Override public void modifyText(ModifyEvent e) { String key = fValuesCombo.getText(); String value = (String) fValues.get(key); @@ -311,6 +319,7 @@ public class CommandDetails { } } + @Override public void modifyText(ModifyEvent e) { String text = fParameterText.getText(); if ((text == null) || (text.trim().equals(""))) //$NON-NLS-1$ @@ -369,6 +378,7 @@ public class CommandDetails { } } + @Override public void modifyText(ModifyEvent e) { String text = fParameterText.getText(); if ((text == null) || (text.trim().equals(""))) //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandList.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandList.java index a567a4c40c..34346fdac5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandList.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandList.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -228,6 +228,7 @@ public class CommandList { clearButton.setImage(hoverImg); clearButton.setToolTipText(PDEUIMessages.CommandList_clearTooltip); clearButton.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { hoverImg.dispose(); } @@ -241,6 +242,7 @@ public class CommandList { clearButton.setVisible(false); fFilterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fTreeViewer.refresh(); clearButton.setVisible(fFilterText.getText().length() > 0); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandTreeContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandTreeContentProvider.java index c64097f87b..ad3224eb47 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandTreeContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandTreeContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -38,6 +38,7 @@ public class CommandTreeContentProvider implements ITreeContentProvider { private void init() { fCatMap = new TreeMap<Category, ArrayList<Command>>(new Comparator<Object>() { + @Override public int compare(Object arg0, Object arg1) { String comA = CommandList.getText(arg0); String comB = CommandList.getText(arg1); @@ -70,6 +71,7 @@ public class CommandTreeContentProvider implements ITreeContentProvider { } } + @Override public Object getParent(Object element) { if (element instanceof Command) try { @@ -81,11 +83,13 @@ public class CommandTreeContentProvider implements ITreeContentProvider { return null; } + @Override public void dispose() { fCatMap.clear(); fConMap.clear(); } + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof Category) { ArrayList<?> list = fCatMap.get(parentElement); @@ -95,6 +99,7 @@ public class CommandTreeContentProvider implements ITreeContentProvider { return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof Category) { ArrayList<?> list = fCatMap.get(element); @@ -104,6 +109,7 @@ public class CommandTreeContentProvider implements ITreeContentProvider { return false; } + @Override public Object[] getElements(Object inputElement) { switch (fCurContent) { case F_CAT_CONTENT : @@ -114,6 +120,7 @@ public class CommandTreeContentProvider implements ITreeContentProvider { return null; } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { fViewer = viewer; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandView.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandView.java index 63c2d8f789..fb2da6bb9f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandView.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/CommandView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -21,6 +21,7 @@ public class CommandView extends ViewPart implements ISelectionChangedListener { private CommandComposerPart fCSP; + @Override public void createPartControl(Composite parent) { fCSP = new CommandComposerPart(); } @@ -38,15 +39,18 @@ public class CommandView extends ViewPart implements ISelectionChangedListener { return fCSP.getTagManager(); } + @Override public void setFocus() { fCSP.setFocus(); } + @Override public void dispose() { fCSP.dispose(); super.dispose(); } + @Override public void selectionChanged(SelectionChangedEvent event) { fCSP.selectionChanged(event); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByObjectSelection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByObjectSelection.java index 06638281ee..085d023c01 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByObjectSelection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByObjectSelection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -36,6 +36,7 @@ public class QueryByObjectSelection extends QueryControl { super(csp, comp); } + @Override protected void createGroupContents(Group parent) { Composite comp = fToolkit.createComposite(parent); GridLayout layout = new GridLayout(2, false); @@ -55,6 +56,7 @@ public class QueryByObjectSelection extends QueryControl { } parent.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { if (fSelectionTracker != null) { fSelectionTracker.dispose(); @@ -63,6 +65,7 @@ public class QueryByObjectSelection extends QueryControl { }); } + @Override protected String getName() { return "Query Commands by selected object"; //$NON-NLS-1$ } @@ -76,6 +79,7 @@ public class QueryByObjectSelection extends QueryControl { _selectionService.addSelectionListener(this); } + @Override public void selectionChanged(IWorkbenchPart part, ISelection selection) { if (selection instanceof IStructuredSelection) { Object selected = ((IStructuredSelection) selection).getFirstElement(); @@ -115,6 +119,7 @@ public class QueryByObjectSelection extends QueryControl { return false; } + @Override protected Command[] getCommands() { Object objectSelection = fObjectSelection; if (objectSelection == null) @@ -134,6 +139,7 @@ public class QueryByObjectSelection extends QueryControl { return hitList.toArray(new Command[hitList.size()]); } + @Override protected void enable(boolean enable) { fGroup.setEnabled(enable); fLabel.setEnabled(enable); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByTag.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByTag.java index 553f231457..9fff1b72a0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByTag.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryByTag.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -27,6 +27,7 @@ public class QueryByTag extends QueryControl { super(csp, comp); } + @Override protected void createGroupContents(Group parent) { fTagManager = fCSP.getTagManager(); @@ -38,6 +39,7 @@ public class QueryByTag extends QueryControl { fCSP.getTagManager().addListener(fTagManagerListener); parent.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { if (fTagManagerListener != null) { fTagManager.removeListener(fTagManagerListener); @@ -46,6 +48,7 @@ public class QueryByTag extends QueryControl { }); } + @Override protected String getName() { return "Query Commands by Tags"; //$NON-NLS-1$ } @@ -59,16 +62,19 @@ public class QueryByTag extends QueryControl { } private class TagManagerListener implements TagManager.Listener { + @Override public void tagManagerChanged() { refreshTags(); } } + @Override protected Command[] getCommands() { String tagText = fTagsCombo.getText(); return fCSP.getTagManager().getCommands(tagText); } + @Override protected void enable(boolean enable) { fGroup.setEnabled(enable); fTagsCombo.setEnabled(enable); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryControl.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryControl.java index f7ee207501..de8926d3b3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryControl.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/commands/QueryControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -40,6 +40,7 @@ public abstract class QueryControl { private Group createGroup(Composite parent) { fRadioButton = fToolkit.createButton(parent, "", SWT.RADIO); //$NON-NLS-1$ fRadioButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { enable(fRadioButton.getSelection()); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewer.java index 82a2e10485..9ba033698e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class ManifestContentMergeViewer extends TextMergeViewer { super(parent, SWT.LEFT_TO_RIGHT, configuration); } + @Override protected void configureTextViewer(TextViewer textViewer) { if (textViewer instanceof SourceViewer) { if (fColorManager == null) @@ -43,18 +44,22 @@ public class ManifestContentMergeViewer extends TextMergeViewer { } } + @Override protected IDocumentPartitioner getDocumentPartitioner() { return new FastPartitioner(new ManifestPartitionScanner(), ManifestPartitionScanner.PARTITIONS); } + @Override protected String getDocumentPartitioning() { return ManifestPartitionScanner.MANIFEST_FILE_PARTITIONING; } + @Override public String getTitle() { return PDEUIMessages.ManifestContentMergeViewer_title; } + @Override protected void handleDispose(DisposeEvent event) { super.handleDispose(event); if (fColorManager != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewerCreator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewerCreator.java index 4c587695e8..0f7d17da0d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewerCreator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestContentMergeViewerCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.Composite; public class ManifestContentMergeViewerCreator implements IViewerCreator { + @Override public Viewer createViewer(Composite parent, CompareConfiguration config) { return new ManifestContentMergeViewer(parent, config); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureCreator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureCreator.java index ef1656bf59..61fb21f87d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureCreator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -33,27 +33,33 @@ public class ManifestStructureCreator extends StructureCreator { } } + @Override public String getName() { return this.getId(); } + @Override public String getType() { return "MF2"; //$NON-NLS-1$ } + @Override public Image getImage() { return CompareUI.getImage(getType()); } } + @Override public String getName() { return PDEUIMessages.ManifestStructureCreator_name; } + @Override public IStructureComparator locate(Object path, Object input) { return null; } + @Override public String getContents(Object node, boolean ignoreWhitespace) { if (node instanceof IStreamContentAccessor) { IStreamContentAccessor sca = (IStreamContentAccessor) node; @@ -200,14 +206,17 @@ public class ManifestStructureCreator extends StructureCreator { return null; } + @Override protected IDocumentPartitioner getDocumentPartitioner() { return new FastPartitioner(new ManifestPartitionScanner(), ManifestPartitionScanner.PARTITIONS); } + @Override protected String getDocumentPartitioning() { return ManifestPartitionScanner.MANIFEST_FILE_PARTITIONING; } + @Override protected IStructureComparator createStructureComparator(Object input, IDocument document, ISharedDocumentAdapter adapter, IProgressMonitor monitor) throws CoreException { final boolean isEditable; @@ -217,6 +226,7 @@ public class ManifestStructureCreator extends StructureCreator { isEditable = false; DocumentRangeNode rootNode = new StructureRootNode(document, input, this, adapter) { + @Override public boolean isEditable() { return isEditable; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureMergeViewerCreator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureMergeViewerCreator.java index 5385ca8fff..933ecd863d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureMergeViewerCreator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/ManifestStructureMergeViewerCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -18,6 +18,7 @@ import org.eclipse.swt.widgets.Composite; public class ManifestStructureMergeViewerCreator implements IViewerCreator { + @Override public Viewer createViewer(Composite parent, CompareConfiguration config) { StructureDiffViewer diffViewer = new StructureDiffViewer(parent, config); diffViewer.setStructureCreator(new ManifestStructureCreator()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewer.java index aa6d77d5bd..d2c53a3416 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -40,17 +40,20 @@ public class PluginContentMergeViewer extends TextMergeViewer { super(parent, SWT.LEFT_TO_RIGHT, config); } + @Override protected void configureTextViewer(final TextViewer textViewer) { if (textViewer instanceof SourceViewer) { if (fColorManager == null) fColorManager = ColorManager.getDefault(); final XMLConfiguration configuration = new XMLConfiguration(fColorManager); textViewer.getControl().addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { configuration.dispose(); } }); IPropertyChangeListener propertyChangedListener = new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { // the configuration will test if the properties affect the presentation also, // but checking it here allows us to prevent the viewer from being invalidated @@ -73,18 +76,22 @@ public class PluginContentMergeViewer extends TextMergeViewer { } } + @Override protected IDocumentPartitioner getDocumentPartitioner() { return new FastPartitioner(new XMLPartitionScanner(), XMLPartitionScanner.PARTITIONS); } + @Override protected String getDocumentPartitioning() { return XMLDocumentSetupParticpant.XML_PARTITIONING; } + @Override public String getTitle() { return PDEUIMessages.PluginContentMergeViewer_title; } + @Override protected void handleDispose(DisposeEvent event) { super.handleDispose(event); if (fColorManager != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewerCreator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewerCreator.java index d90c17f89c..94e87c4a2c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewerCreator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginContentMergeViewerCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2007 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.Composite; public class PluginContentMergeViewerCreator implements IViewerCreator { + @Override public Viewer createViewer(Composite parent, CompareConfiguration config) { return new PluginContentMergeViewer(parent, config); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureCreator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureCreator.java index 02c9de1c6c..ace9a95671 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureCreator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -43,14 +43,17 @@ public class PluginStructureCreator extends StructureCreator { } } + @Override public String getName() { return this.getId(); } + @Override public String getType() { return "PLUGIN2"; //$NON-NLS-1$ } + @Override public Image getImage() { return image; } @@ -60,6 +63,7 @@ public class PluginStructureCreator extends StructureCreator { // Nothing to do } + @Override protected IStructureComparator createStructureComparator(Object input, IDocument document, ISharedDocumentAdapter adapter, IProgressMonitor monitor) throws CoreException { final boolean isEditable; if (input instanceof IEditableContent) @@ -75,10 +79,12 @@ public class PluginStructureCreator extends StructureCreator { // managers reference it. final ResourceManager resources = new LocalResourceManager(JFaceResources.getResources()); DocumentRangeNode rootNode = new StructureRootNode(document, input, this, adapter) { + @Override public boolean isEditable() { return isEditable; } + @Override public void dispose() { // Dispose the label provider and the local resource manager labelProvider.dispose(); @@ -97,6 +103,7 @@ public class PluginStructureCreator extends StructureCreator { return rootNode; } + @Override public String getContents(Object node, boolean ignoreWhitespace) { if (node instanceof IStreamContentAccessor) { IStreamContentAccessor sca = (IStreamContentAccessor) node; @@ -108,6 +115,7 @@ public class PluginStructureCreator extends StructureCreator { return null; } + @Override public String getName() { return PDEUIMessages.PluginStructureCreator_name; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureViewerCreator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureViewerCreator.java index a91ba76d9e..256c6173ec 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureViewerCreator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/compare/PluginStructureViewerCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -22,10 +22,12 @@ public class PluginStructureViewerCreator implements IViewerCreator { // Nothing to do } + @Override public Viewer createViewer(Composite parent, CompareConfiguration config) { StructureDiffViewer viewer = new StructureDiffViewer(parent, config); viewer.setStructureCreator(new PluginStructureCreator()); viewer.setComparator(new ViewerComparator() { + @Override public int compare(Viewer viewer, Object e1, Object e2) { if (e1 instanceof DiffNode) { if (e2 instanceof DiffNode) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractManifestMarkerResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractManifestMarkerResolution.java index 6fe0068e44..734cb05f75 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractManifestMarkerResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractManifestMarkerResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -22,6 +22,7 @@ public abstract class AbstractManifestMarkerResolution extends AbstractPDEMarker protected abstract void createChange(BundleModel model); + @Override protected void createChange(IBaseModel model) { if (model instanceof IBundlePluginModelBase) model = ((IBundlePluginModelBase) model).getBundleModel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractPDEMarkerResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractPDEMarkerResolution.java index 27275d67c9..b6e54ee1b3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractPDEMarkerResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractPDEMarkerResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -36,6 +36,7 @@ public abstract class AbstractPDEMarkerResolution implements IMarkerResolution2 fType = type; } + @Override public Image getImage() { return null; } @@ -44,13 +45,16 @@ public abstract class AbstractPDEMarkerResolution implements IMarkerResolution2 return fType; } + @Override public String getDescription() { return getLabel(); } + @Override public void run(IMarker marker) { fResource = marker.getResource(); ModelModification modification = new ModelModification((IFile) marker.getResource()) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { createChange(model); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractXMLMarkerResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractXMLMarkerResolution.java index fcc8f08ba1..4c2df9df97 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractXMLMarkerResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AbstractXMLMarkerResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -36,6 +36,7 @@ public abstract class AbstractXMLMarkerResolution extends AbstractPDEMarkerResol protected abstract void createChange(IPluginModelBase model); + @Override protected void createChange(IBaseModel model) { if (model instanceof IPluginModelBase) createChange((IPluginModelBase) model); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddActivationHeaderResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddActivationHeaderResolution.java index ad94f513df..a5e639fded 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddActivationHeaderResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddActivationHeaderResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -29,6 +29,7 @@ public class AddActivationHeaderResolution extends AbstractManifestMarkerResolut fHeader = currentHeader; } + @Override protected void createChange(BundleModel model) { IBundle bundle = model.getBundle(); IManifestHeader header = bundle.getManifestHeader(fHeader); @@ -55,6 +56,7 @@ public class AddActivationHeaderResolution extends AbstractManifestMarkerResolut } + @Override public String getLabel() { String header = (TargetPlatformHelper.getTargetVersion() >= 3.4) ? Constants.BUNDLE_ACTIVATIONPOLICY : ICoreConstants.ECLIPSE_LAZYSTART; return NLS.bind(PDEUIMessages.AddActivationHeaderResolution_label, header); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBuildEntryResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBuildEntryResolution.java index 4a919d0796..646616a471 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBuildEntryResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBuildEntryResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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,10 +28,12 @@ public class AddBuildEntryResolution extends BuildEntryMarkerResolution { fToken = value; } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.AddBuildEntryResolution_add, fToken, fEntry); } + @Override protected void createChange(Build build) { try { BuildModel buildModel = build.getModel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java index ab5bfa0d24..27019238fe 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleClassPathMarkerResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -25,10 +25,12 @@ public class AddBundleClassPathMarkerResolution extends AbstractManifestMarkerRe this.fValue = value; } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.AddBundleClassPathResolution_add, fValue); } + @Override protected void createChange(BundleModel model) { IBundle bundle = model.getBundle(); if (bundle instanceof Bundle) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleManifestVersionResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleManifestVersionResolution.java index d97330859d..81b5bff57a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleManifestVersionResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddBundleManifestVersionResolution.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.correction;
import org.eclipse.pde.internal.core.text.bundle.BundleModel;
@@ -24,14 +24,17 @@ public class AddBundleManifestVersionResolution extends AbstractManifestMarkerRe super(AbstractPDEMarkerResolution.CREATE_TYPE);
}
+ @Override
public String getLabel() {
return PDEUIMessages.AddBundleManifestVersionResolution_label;
}
+ @Override
public String getDescription() {
return PDEUIMessages.AddBundleManifestVersionResolution_description;
}
+ @Override
protected void createChange(BundleModel model) {
// Add the Bundle-ManifestVersion header.
model.getBundle().setHeader(Constants.BUNDLE_MANIFESTVERSION, String.valueOf(2));
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java index 3c6eb24c1e..462d558a41 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddDefaultExecutionEnvironmentResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -29,6 +29,7 @@ public class AddDefaultExecutionEnvironmentResolution extends AbstractManifestMa this.id = id; } + @Override protected void createChange(BundleModel model) { IManifestHeader header = model.getBundle().getManifestHeader(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT); @@ -46,6 +47,7 @@ public class AddDefaultExecutionEnvironmentResolution extends AbstractManifestMa } } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.AddDefaultExecutionEnvironment_label, id); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddExportPackageMarkerResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddExportPackageMarkerResolution.java index 685bcd8f8c..c53c5f7522 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddExportPackageMarkerResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddExportPackageMarkerResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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,10 +28,12 @@ public class AddExportPackageMarkerResolution extends AbstractManifestMarkerReso this.fValues = values; } + @Override public String getLabel() { return PDEUIMessages.AddExportPackageResolution_Label; } + @Override protected void createChange(BundleModel model) { IBundle bundle = model.getBundle(); if (bundle instanceof Bundle) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java index b2d085e894..05ad5104e5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionPointResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -26,10 +26,12 @@ public class AddNewExtensionPointResolution extends AbstractPDEMarkerResolution super(type); } + @Override public String getLabel() { return PDEUIMessages.AddNewExtensionPointResolution_description; } + @Override protected void createChange(IBaseModel model) { IEditorPart part = PDEPlugin.getActivePage().getActiveEditor(); if (part instanceof ManifestEditor) { @@ -38,6 +40,7 @@ public class AddNewExtensionPointResolution extends AbstractPDEMarkerResolution if (base instanceof IBundlePluginModelBase) { IBundlePluginModelBase pluginModel = (IBundlePluginModelBase) base; NewExtensionPointWizard wizard = new NewExtensionPointWizard(pluginModel.getUnderlyingResource().getProject(), pluginModel, editor) { + @Override public boolean performFinish() { return super.performFinish(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java index bf1ea27e03..69eb8b8aac 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddNewExtensionResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -26,10 +26,12 @@ public class AddNewExtensionResolution extends AbstractPDEMarkerResolution { super(type); } + @Override public String getLabel() { return PDEUIMessages.AddNewExtensionResolution_description; } + @Override protected void createChange(IBaseModel model) { IEditorPart part = PDEPlugin.getActivePage().getActiveEditor(); if (part instanceof ManifestEditor) { @@ -38,6 +40,7 @@ public class AddNewExtensionResolution extends AbstractPDEMarkerResolution { if (base instanceof IBundlePluginModelBase) { IBundlePluginModelBase pluginModel = (IBundlePluginModelBase) base; NewExtensionWizard wizard = new NewExtensionWizard(pluginModel.getUnderlyingResource().getProject(), pluginModel, editor) { + @Override public boolean performFinish() { return super.performFinish(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSingletonToSymbolicName.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSingletonToSymbolicName.java index 2cd8130103..ce2cdde3e5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSingletonToSymbolicName.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSingletonToSymbolicName.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -26,18 +26,21 @@ public class AddSingletonToSymbolicName extends AbstractManifestMarkerResolution fisDirective = directive; } + @Override public String getDescription() { if (fisDirective) return PDEUIMessages.AddSingleon_dir_desc; return PDEUIMessages.AddSingleon_att_desc; } + @Override public String getLabel() { if (fisDirective) return PDEUIMessages.AddSingleon_dir_label; return PDEUIMessages.AddSingleon_att_label; } + @Override protected void createChange(BundleModel model) { IBundle bundle = model.getBundle(); if (bundle instanceof Bundle) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSourceBuildEntryResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSourceBuildEntryResolution.java index 848169f0c4..e37dd80387 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSourceBuildEntryResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AddSourceBuildEntryResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -29,10 +29,12 @@ public class AddSourceBuildEntryResolution extends BuildEntryMarkerResolution { super(type, marker); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.AddSourceBuildEntryResolution_label, fEntry); } + @Override protected void createChange(Build build) { try { BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AppendSeperatorBuildEntryResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AppendSeperatorBuildEntryResolution.java index a1909e7ed2..0b3e4c2baa 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AppendSeperatorBuildEntryResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/AppendSeperatorBuildEntryResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,6 +23,7 @@ public class AppendSeperatorBuildEntryResolution extends BuildEntryMarkerResolut super(type, marker); } + @Override protected void createChange(Build build) { try { BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry); @@ -31,6 +32,7 @@ public class AppendSeperatorBuildEntryResolution extends BuildEntryMarkerResolut } } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.AppendSeperatorBuildEntryResolution_label, fToken); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/BuildEntryMarkerResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/BuildEntryMarkerResolution.java index 7b2300a8ed..f3d4396dd0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/BuildEntryMarkerResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/BuildEntryMarkerResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -33,6 +33,7 @@ public abstract class BuildEntryMarkerResolution extends AbstractPDEMarkerResolu protected abstract void createChange(Build build); + @Override protected void createChange(IBaseModel model) { if (model instanceof BuildModel) createChange((Build) ((BuildModel) model).getBuild()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseClassXMLResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseClassXMLResolution.java index 50e4626cb0..d86deb2959 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseClassXMLResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseClassXMLResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class ChooseClassXMLResolution extends AbstractXMLMarkerResolution { super(resolutionType, marker); } + @Override protected void createChange(IPluginModelBase model) { Object object = findNode(model); if (!(object instanceof PluginAttribute)) @@ -35,10 +36,12 @@ public class ChooseClassXMLResolution extends AbstractXMLMarkerResolution { element.setXMLAttribute(attrib.getName(), type); } + @Override public String getDescription() { return getLabel(); } + @Override public String getLabel() { return PDEUIMessages.ChooseClassXMLResolution_label; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseManifestClassResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseManifestClassResolution.java index e67c91ea2a..1b6360eec2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseManifestClassResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ChooseManifestClassResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -26,6 +26,7 @@ public class ChooseManifestClassResolution extends AbstractManifestMarkerResolut fHeader = headerName; } + @Override protected void createChange(BundleModel model) { IManifestHeader header = model.getBundle().getManifestHeader(fHeader); String type = PDEJavaHelperUI.selectType(fResource, IJavaElementSearchConstants.CONSIDER_CLASSES); @@ -33,6 +34,7 @@ public class ChooseManifestClassResolution extends AbstractManifestMarkerResolut header.setValue(type); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.ChooseManifestClassResolution_label, fHeader); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateClassXMLResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateClassXMLResolution.java index 2dd1bb4e67..746ee6b0fa 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateClassXMLResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateClassXMLResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class CreateClassXMLResolution extends AbstractXMLMarkerResolution { } // create class code copied from org.eclipse.pde.internal.ui.editor.plugin.rows.ClassAttributeRow + @Override protected void createChange(IPluginModelBase model) { Object object = findNode(model); if (!(object instanceof PluginAttribute)) @@ -68,6 +69,7 @@ public class CreateClassXMLResolution extends AbstractXMLMarkerResolution { return schemaElement.getAttribute(attr.getName()); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.CreateClassXMLResolution_label, getNameOfNode()); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateJREBundleHeaderResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateJREBundleHeaderResolution.java index 02a22736c9..6eda5c1888 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateJREBundleHeaderResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateJREBundleHeaderResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -20,14 +20,17 @@ public class CreateJREBundleHeaderResolution extends AbstractManifestMarkerResol super(type); } + @Override public String getDescription() { return PDEUIMessages.CreateJREBundleHeaderResolution_desc; } + @Override public String getLabel() { return PDEUIMessages.CreateJREBundleHeaderResolution_label; } + @Override protected void createChange(BundleModel model) { model.getBundle().setHeader(ICoreConstants.ECLIPSE_JREBUNDLE, Boolean.toString(true)); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateManifestClassResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateManifestClassResolution.java index 79bc296b6c..09d99e5fcc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateManifestClassResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/CreateManifestClassResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -30,6 +30,7 @@ public class CreateManifestClassResolution extends AbstractManifestMarkerResolut fHeader = headerName; } + @Override protected void createChange(BundleModel model) { IManifestHeader header = model.getBundle().getManifestHeader(fHeader); @@ -46,6 +47,7 @@ public class CreateManifestClassResolution extends AbstractManifestMarkerResolut header.setValue(name); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.CreateManifestClassResolution_label, fHeader); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java index d600f67766..1eb0301edb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/DeletePluginBaseResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -30,10 +30,12 @@ public class DeletePluginBaseResolution extends AbstractPDEMarkerResolution { super(type); } + @Override public String getLabel() { return PDEUIMessages.RemoveUselessPluginFile_description; } + @Override public void run(final IMarker marker) { try { marker.delete(); @@ -56,6 +58,7 @@ public class DeletePluginBaseResolution extends AbstractPDEMarkerResolution { } } + @Override protected void createChange(IBaseModel model) { // handled by run } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeResolution.java index 0e89f2a3a5..9f0cba792f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -40,6 +40,7 @@ public class ExternalizeResolution extends AbstractXMLMarkerResolution { super(resolutionType, marker); } + @Override protected void createChange(IPluginModelBase model) { Object node = findNode(model); ModelChange change = new ModelChange(model, true); @@ -77,6 +78,7 @@ public class ExternalizeResolution extends AbstractXMLMarkerResolution { } } + @Override public String getLabel() { if (isAttrNode()) return NLS.bind(PDEUIMessages.ExternalizeResolution_attrib, getNameOfNode()); @@ -95,6 +97,7 @@ public class ExternalizeResolution extends AbstractXMLMarkerResolution { } } + @Override public void run(IMarker marker) { fResource = marker.getResource(); IFile file = ((IFile) marker.getResource()); @@ -104,6 +107,7 @@ public class ExternalizeResolution extends AbstractXMLMarkerResolution { IFile manifest = PDEProject.getManifest(file.getProject()); if (manifest.exists()) { modification = new ModelModification(manifest, file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { createChange(model); } @@ -112,6 +116,7 @@ public class ExternalizeResolution extends AbstractXMLMarkerResolution { } if (modification == null) { modification = new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { createChange(model); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeStringsResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeStringsResolution.java index 5bfc91d877..8cbe450763 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeStringsResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ExternalizeStringsResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -25,8 +25,10 @@ public class ExternalizeStringsResolution extends AbstractPDEMarkerResolution { super(type); } + @Override public void run(final IMarker marker) { BusyIndicator.showWhile(SWTUtil.getStandardDisplay(), new Runnable() { + @Override public void run() { GetNonExternalizedStringsAction fGetExternAction = new GetNonExternalizedStringsAction(); IStructuredSelection selection = new StructuredSelection(marker.getResource().getProject()); @@ -35,14 +37,17 @@ public class ExternalizeStringsResolution extends AbstractPDEMarkerResolution { }); } + @Override protected void createChange(IBaseModel model) { // nothin to do - all handled by run } + @Override public String getDescription() { return PDEUIMessages.ExternalizeStringsResolution_desc; } + @Override public String getLabel() { return PDEUIMessages.ExternalizeStringsResolution_label; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/MultiFixResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/MultiFixResolution.java index 225e4aecfd..8f847274d4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/MultiFixResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/MultiFixResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -57,18 +57,22 @@ public class MultiFixResolution extends WorkbenchMarkerResolution { return relatedMarkers.toArray(new IMarker[relatedMarkers.size()]); } + @Override public String getDescription() { return getLabel(); } + @Override public Image getImage() { return PDEPluginImages.DESC_ADD_ATT.createImage(); } + @Override public String getLabel() { return fLabel; } + @Override public void run(IMarker marker) { IResource resource = marker.getResource(); IMarker[] markers = new IMarker[0]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/NoLineTerminationResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/NoLineTerminationResolution.java index b5eae2c54d..6845f338e1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/NoLineTerminationResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/NoLineTerminationResolution.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.correction;
import org.eclipse.jface.text.*;
@@ -42,6 +42,7 @@ public class NoLineTerminationResolution extends AbstractManifestMarkerResolutio *
* <p>The post-condition will be that the manifest ends with a line delimiter.</p>
*/
+ @Override
protected void createChange(BundleModel model) {
if (getType() == AbstractPDEMarkerResolution.REMOVE_TYPE) {
// indicates last line is purely whitespace; we need to delete the whitespace.
@@ -66,6 +67,7 @@ public class NoLineTerminationResolution extends AbstractManifestMarkerResolutio }
}
+ @Override
public String getDescription() {
if (getType() == AbstractPDEMarkerResolution.REMOVE_TYPE) {
return PDEUIMessages.NoLineTerminationResolutionRemove_description;
@@ -73,6 +75,7 @@ public class NoLineTerminationResolution extends AbstractManifestMarkerResolutio return PDEUIMessages.NoLineTerminationResolutionCreate_description;
}
+ @Override
public String getLabel() {
if (getType() == AbstractPDEMarkerResolution.REMOVE_TYPE) {
return PDEUIMessages.NoLineTerminationResolutionRemove_label;
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalImportPackageResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalImportPackageResolution.java index ff7a175529..8357766ca4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalImportPackageResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalImportPackageResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class OptionalImportPackageResolution extends AbstractManifestMarkerResol fPackageName = packageName; } + @Override protected void createChange(BundleModel model) { Bundle bundle = (Bundle) model.getBundle(); ImportPackageHeader header = (ImportPackageHeader) bundle.getManifestHeader(Constants.IMPORT_PACKAGE); @@ -34,10 +35,12 @@ public class OptionalImportPackageResolution extends AbstractManifestMarkerResol } } + @Override public String getDescription() { return NLS.bind(PDEUIMessages.OptionalImportPkgResolution_description, fPackageName); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.OptionalImportPkgResolution_label, fPackageName); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalRequireBundleResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalRequireBundleResolution.java index c7942bc231..57ad87c879 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalRequireBundleResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OptionalRequireBundleResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class OptionalRequireBundleResolution extends AbstractManifestMarkerResol fBundleId = bundleId; } + @Override protected void createChange(BundleModel model) { Bundle bundle = (Bundle) model.getBundle(); RequireBundleHeader header = (RequireBundleHeader) bundle.getManifestHeader(Constants.REQUIRE_BUNDLE); @@ -36,10 +37,12 @@ public class OptionalRequireBundleResolution extends AbstractManifestMarkerResol } } + @Override public String getDescription() { return NLS.bind(PDEUIMessages.OptionalRequireBundleResolution_description, fBundleId); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.OptionalRequireBundleResolution_label, fBundleId); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeExportPackageResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeExportPackageResolution.java index c2375f4922..4af8dd5366 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeExportPackageResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeExportPackageResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -20,14 +20,17 @@ public class OrganizeExportPackageResolution extends AbstractManifestMarkerResol super(type); } + @Override protected void createChange(BundleModel model) { OrganizeManifest.organizeExportPackages(model.getBundle(), fResource.getProject(), true, true); } + @Override public String getDescription() { return PDEUIMessages.OrganizeExportPackageResolution_Description; } + @Override public String getLabel() { return PDEUIMessages.OrganizeExportPackageResolution_Label; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeImportPackageResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeImportPackageResolution.java index 3f87bcf803..2560e576c3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeImportPackageResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeImportPackageResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,14 +23,17 @@ public class OrganizeImportPackageResolution extends AbstractManifestMarkerResol fRemoveImports = removeImports; } + @Override protected void createChange(BundleModel model) { OrganizeManifest.organizeImportPackages(model.getBundle(), fRemoveImports); } + @Override public String getDescription() { return PDEUIMessages.OrganizeImportPackageResolution_Description; } + @Override public String getLabel() { return PDEUIMessages.OrganizeImportPackageResolution_Label; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeRequireBundleResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeRequireBundleResolution.java index 57557e3f78..d8c389336c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeRequireBundleResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/OrganizeRequireBundleResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,14 +23,17 @@ public class OrganizeRequireBundleResolution extends AbstractManifestMarkerResol fRemoveImports = removeImports; } + @Override protected void createChange(BundleModel model) { OrganizeManifest.organizeRequireBundles(model.getBundle(), fRemoveImports); } + @Override public String getDescription() { return PDEUIMessages.OrganizeRequireBundleResolution_Description; } + @Override public String getLabel() { return PDEUIMessages.OrganizeRequireBundleResolution_Label; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveBuildEntryResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveBuildEntryResolution.java index 044a3c0eb9..8db76e283e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveBuildEntryResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveBuildEntryResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,12 +23,14 @@ public class RemoveBuildEntryResolution extends BuildEntryMarkerResolution { super(type, marker); } + @Override public String getLabel() { if (fToken == null) return NLS.bind(PDEUIMessages.RemoveBuildEntryResolution_removeEntry, fEntry); return NLS.bind(PDEUIMessages.RemoveBuildEntryResolution_removeToken, fToken, fEntry); } + @Override protected void createChange(Build build) { try { BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveExportPackageResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveExportPackageResolution.java index 52ba5f8d47..f09757d282 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveExportPackageResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveExportPackageResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class RemoveExportPackageResolution extends AbstractManifestMarkerResolut header.removePackage(fPackage); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.RemoveExportPkgs_label, fPackage); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportExportServicesResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportExportServicesResolution.java index c7d13e08ec..1b18d1e1e6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportExportServicesResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportExportServicesResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -33,6 +33,7 @@ public class RemoveImportExportServicesResolution extends AbstractManifestMarker bundle.setHeader(fServiceHeader, null); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.RemoveImportExportServices_label, fServiceHeader); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportPackageResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportPackageResolution.java index 7157fa5673..de12c3f12f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportPackageResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveImportPackageResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class RemoveImportPackageResolution extends AbstractManifestMarkerResolut fPkgName = packageName; } + @Override protected void createChange(BundleModel model) { Bundle bundle = (Bundle) model.getBundle(); ImportPackageHeader header = (ImportPackageHeader) bundle.getManifestHeader(Constants.IMPORT_PACKAGE); @@ -31,10 +32,12 @@ public class RemoveImportPackageResolution extends AbstractManifestMarkerResolut header.removePackage(fPkgName); } + @Override public String getDescription() { return NLS.bind(PDEUIMessages.RemoveImportPkgResolution_description, fPkgName); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.RemoveImportPkgResolution_label, fPkgName); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveInternalDirectiveEntryResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveInternalDirectiveEntryResolution.java index ace85376b5..718286efbe 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveInternalDirectiveEntryResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveInternalDirectiveEntryResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -24,6 +24,7 @@ public class RemoveInternalDirectiveEntryResolution extends AbstractManifestMark fPackageName = packageName; } + @Override protected void createChange(BundleModel model) { IManifestHeader header = model.getBundle().getManifestHeader(Constants.EXPORT_PACKAGE); if (header instanceof ExportPackageHeader) { @@ -33,10 +34,12 @@ public class RemoveInternalDirectiveEntryResolution extends AbstractManifestMark } } + @Override public String getLabel() { return PDEUIMessages.RemoveInternalDirective_label; } + @Override public String getDescription() { return PDEUIMessages.RemoveInternalDirective_desc; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveLazyLoadingDirectiveResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveLazyLoadingDirectiveResolution.java index ca6e0efcb4..9f8b508423 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveLazyLoadingDirectiveResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveLazyLoadingDirectiveResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -23,10 +23,12 @@ public class RemoveLazyLoadingDirectiveResolution extends AbstractManifestMarker fHeader = currentHeader; } + @Override protected void createChange(BundleModel model) { model.getBundle().setHeader(fHeader, null); } + @Override public String getLabel() { return PDEUIMessages.RemoveLazyLoadingDirectiveResolution_remove; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveNodeXMLResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveNodeXMLResolution.java index 26b4431693..d0fcef721a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveNodeXMLResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveNodeXMLResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class RemoveNodeXMLResolution extends AbstractXMLMarkerResolution { super(resolutionType, marker); } + @Override protected void createChange(IPluginModelBase model) { Object node = findNode(model); if (!(node instanceof IPluginObject)) @@ -44,6 +45,7 @@ public class RemoveNodeXMLResolution extends AbstractXMLMarkerResolution { } } + @Override public String getLabel() { if (isAttrNode()) return NLS.bind(PDEUIMessages.RemoveNodeXMLResolution_attrLabel, getNameOfNode()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveRequireBundleResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveRequireBundleResolution.java index 6b8da50318..054c7d7f4b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveRequireBundleResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveRequireBundleResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class RemoveRequireBundleResolution extends AbstractManifestMarkerResolut fBundleId = bundleID; } + @Override protected void createChange(BundleModel model) { Bundle bundle = (Bundle) model.getBundle(); RequireBundleHeader header = (RequireBundleHeader) bundle.getManifestHeader(Constants.REQUIRE_BUNDLE); @@ -31,10 +32,12 @@ public class RemoveRequireBundleResolution extends AbstractManifestMarkerResolut header.removeBundle(fBundleId); } + @Override public String getDescription() { return NLS.bind(PDEUIMessages.RemoveRequireBundleResolution_description, fBundleId); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.RemoveRequireBundleResolution_label, fBundleId); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveSeperatorBuildEntryResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveSeperatorBuildEntryResolution.java index d943b8c698..4cc0309fcc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveSeperatorBuildEntryResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveSeperatorBuildEntryResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,6 +23,7 @@ public class RemoveSeperatorBuildEntryResolution extends BuildEntryMarkerResolut super(type, marker); } + @Override protected void createChange(Build build) { try { BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry); @@ -31,6 +32,7 @@ public class RemoveSeperatorBuildEntryResolution extends BuildEntryMarkerResolut } } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.RemoveSeperatorBuildEntryResolution_label, fToken, fEntry); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveStaticProjectReferences.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveStaticProjectReferences.java index 66f4c2b8b3..28be2f586f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveStaticProjectReferences.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveStaticProjectReferences.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -21,14 +21,17 @@ public class RemoveStaticProjectReferences extends AbstractPDEMarkerResolution { super(type); } + @Override public String getDescription() { return PDEUIMessages.RemoveBuildOrderEntries_desc; } + @Override public String getLabel() { return PDEUIMessages.RemoveBuildOrderEntries_label; } + @Override public void run(IMarker marker) { try { IProject project = marker.getResource().getProject(); @@ -43,6 +46,7 @@ public class RemoveStaticProjectReferences extends AbstractPDEMarkerResolution { } } + @Override protected void createChange(IBaseModel model) { // overridden run method handles everything } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveUnknownExecEnvironments.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveUnknownExecEnvironments.java index 0bc8ee98c7..1fae83813e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveUnknownExecEnvironments.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RemoveUnknownExecEnvironments.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,6 +23,7 @@ public class RemoveUnknownExecEnvironments extends AbstractManifestMarkerResolut super(type); } + @Override protected void createChange(BundleModel model) { IManifestHeader header = model.getBundle().getManifestHeader(Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT); if (header instanceof RequiredExecutionEnvironmentHeader) { @@ -43,6 +44,7 @@ public class RemoveUnknownExecEnvironments extends AbstractManifestMarkerResolut } } + @Override public String getLabel() { return PDEUIMessages.RemoveUnknownExecEnvironments_label; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RenameProvidePackageResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RenameProvidePackageResolution.java index e1a854132a..4d8153b47f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RenameProvidePackageResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/RenameProvidePackageResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -22,14 +22,17 @@ public class RenameProvidePackageResolution extends AbstractManifestMarkerResolu super(type); } + @Override public String getDescription() { return PDEUIMessages.RenameProvidePackageResolution_desc; } + @Override public String getLabel() { return PDEUIMessages.RenameProvidePackageResolution_label; } + @Override protected void createChange(BundleModel model) { model.getBundle().renameHeader(ICoreConstants.PROVIDE_PACKAGE, Constants.EXPORT_PACKAGE); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ReplaceBuildEntryResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ReplaceBuildEntryResolution.java index dd649c4cae..edbbbf8b49 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ReplaceBuildEntryResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ReplaceBuildEntryResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -23,10 +23,12 @@ public class ReplaceBuildEntryResolution extends BuildEntryMarkerResolution { super(type, marker); } + @Override public String getLabel() { return NLS.bind(PDEUIMessages.ReplaceBuildEntryResolution_replaceToken, fToken, fEntry); } + @Override protected void createChange(Build build) { try { BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java index 443fdcc4af..818df9fb35 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java @@ -32,6 +32,7 @@ public class ResolutionGenerator implements IMarkerResolutionGenerator2 { * (non-Javadoc) * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker) */ + @Override public IMarkerResolution[] getResolutions(IMarker marker) { int problemID = getProblemId(marker); switch (problemID) { @@ -214,6 +215,7 @@ public class ResolutionGenerator implements IMarkerResolutionGenerator2 { * (non-Javadoc) * @see org.eclipse.ui.IMarkerResolutionGenerator2#hasResolutions(org.eclipse.core.resources.IMarker) */ + @Override public boolean hasResolutions(IMarker marker) { return getProblemId(marker) > 0; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UnsupportedSingletonDirectiveResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UnsupportedSingletonDirectiveResolution.java index 4c3e329ab3..9f8eafcd9f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UnsupportedSingletonDirectiveResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UnsupportedSingletonDirectiveResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -22,14 +22,17 @@ public class UnsupportedSingletonDirectiveResolution extends AbstractManifestMar super(type); } + @Override public String getDescription() { return PDEUIMessages.RevertUnsupportSingletonResolution_desc; } + @Override public String getLabel() { return PDEUIMessages.RevertUnsupportSingletonResolution_desc; } + @Override protected void createChange(BundleModel model) { IBundle bundle = model.getBundle(); if (bundle instanceof Bundle) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateActivationResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateActivationResolution.java index 4004cbdc05..7a7105f2ed 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateActivationResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateActivationResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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,6 +28,7 @@ public class UpdateActivationResolution extends AbstractManifestMarkerResolution fHeader = currentHeader; } + @Override protected void createChange(BundleModel model) { if (TargetPlatformHelper.getTargetVersion() >= 3.4) { // get the header we wish to replace @@ -65,12 +66,14 @@ public class UpdateActivationResolution extends AbstractManifestMarkerResolution } } + @Override public String getDescription() { if (TargetPlatformHelper.getTargetVersion() >= 3.4) return PDEUIMessages.UpdateActivationResolution_bundleActivationPolicy_label; return PDEUIMessages.UpdateActivationResolution_lazyStart_label; } + @Override public String getLabel() { if (TargetPlatformHelper.getTargetVersion() >= 3.4) return NLS.bind(PDEUIMessages.UpdateActivationResolution_bundleActivationPolicy_desc, fHeader); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateClasspathResolution.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateClasspathResolution.java index ef5d8bb504..e0c13c501b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateClasspathResolution.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/UpdateClasspathResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -25,10 +25,12 @@ public class UpdateClasspathResolution extends AbstractPDEMarkerResolution { super(type); } + @Override public String getLabel() { return PDEUIMessages.UpdateClasspathResolution_label; } + @Override public void run(IMarker marker) { IProject project = marker.getResource().getProject(); IPluginModelBase model = PluginRegistry.findModel(project); @@ -38,6 +40,7 @@ public class UpdateClasspathResolution extends AbstractPDEMarkerResolution { } } + @Override protected void createChange(IBaseModel model) { // handled by run } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/FindClassResolutionsOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/FindClassResolutionsOperation.java index 9dbb650023..50c0741a12 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/FindClassResolutionsOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/FindClassResolutionsOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -101,6 +101,7 @@ public class FindClassResolutionsOperation implements IRunnableWithProgress { * (non-Javadoc) * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void run(IProgressMonitor monitor) { int idx = fClassName.lastIndexOf('.'); String packageName = idx != -1 ? fClassName.substring(0, idx) : null; @@ -215,6 +216,7 @@ public class FindClassResolutionsOperation implements IRunnableWithProgress { final Map<String, IPackageFragment> packages = new HashMap<String, IPackageFragment>(); SearchRequestor requestor = new SearchRequestor() { + @Override public void acceptSearchMatch(SearchMatch aMatch) throws CoreException { Object element = aMatch.getElement(); if (element instanceof IType) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/JavaResolutionFactory.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/JavaResolutionFactory.java index 94fb2f2ad0..7382cea741 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/JavaResolutionFactory.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/JavaResolutionFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -95,6 +95,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#isValid(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException { return RefactoringStatus.create(Status.OK_STATUS); } @@ -102,6 +103,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#getModifiedElement() */ + @Override public Object getModifiedElement() { return getProject(); } @@ -109,6 +111,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#initializeValidationData(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void initializeValidationData(IProgressMonitor pm) { } } @@ -126,8 +129,10 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public Change perform(IProgressMonitor pm) throws CoreException { PDEModelUtility.modifyModel(new ModelModification(getProject()) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IPluginModelBase)) return; @@ -148,6 +153,7 @@ public class JavaResolutionFactory { if (!isUndo()) return new RequireBundleManifestChange(getProject(), (ExportPackageDescription) getChangeObject()) { + @Override public boolean isUndo() { return true; } @@ -159,6 +165,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getImage() */ + @Override public Image getImage() { return PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_REQ_PLUGIN_OBJ); } @@ -167,6 +174,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getDescription() */ + @Override public String getDescription() { return PDEUIMessages.UnresolvedImportFixProcessor_2; } @@ -175,6 +183,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#getName() */ + @Override public String getName() { if (!isUndo()) { return MessageFormat.format(PDEUIMessages.UnresolvedImportFixProcessor_0, new Object[] {((ExportPackageDescription) getChangeObject()).getExporter().getName()}); @@ -186,6 +195,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getModifiedElement() */ + @Override public Object getModifiedElement() { IFile[] files = new IFile[] {PDEProject.getManifest(getProject()), PDEProject.getPluginXml(getProject())}; for (int i = 0; i < files.length; i++) { @@ -210,8 +220,10 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public Change perform(IProgressMonitor pm) throws CoreException { PDEModelUtility.modifyModel(new ModelModification(getProject()) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IBundlePluginModelBase)) return; @@ -237,6 +249,7 @@ public class JavaResolutionFactory { if (!isUndo()) return new ImportPackageManifestChange(getProject(), (ExportPackageDescription) getChangeObject()) { + @Override public boolean isUndo() { return true; } @@ -248,6 +261,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getDescription() */ + @Override public String getDescription() { return PDEUIMessages.UnresolvedImportFixProcessor_5; } @@ -256,6 +270,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getImage() */ + @Override public Image getImage() { return PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_BUNDLE_OBJ); } @@ -264,6 +279,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#getName() */ + @Override public String getName() { if (!isUndo()) { return MessageFormat.format(PDEUIMessages.UnresolvedImportFixProcessor_3, new Object[] {((ExportPackageDescription) getChangeObject()).getName()}); @@ -275,6 +291,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getModifiedElement() */ + @Override public Object getModifiedElement() { IFile file = PDEProject.getManifest(getProject()); if (file.exists()) @@ -294,8 +311,10 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#perform(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public Change perform(IProgressMonitor pm) throws CoreException { ModelModification mod = new ModelModification(getProject()) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) { IBundle bundle = ((IBundlePluginModelBase) model).getBundleModel().getBundle(); @@ -318,6 +337,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.ltk.core.refactoring.Change#getName() */ + @Override public String getName() { return NLS.bind(PDEUIMessages.ForbiddenAccessProposal_quickfixMessage, new String[] {((IPackageFragment) getChangeObject()).getElementName(), getProject().getName()}); } @@ -326,6 +346,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getImage() */ + @Override public Image getImage() { return PDEPluginImages.get(PDEPluginImages.OBJ_DESC_BUNDLE); } @@ -334,6 +355,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getModifiedElement() */ + @Override public Object getModifiedElement() { IFile file = PDEProject.getManifest(getProject()); if (file.exists()) @@ -345,6 +367,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.JavaResolutionFactory.AbstractManifestChange#getDescription() */ + @Override public String getDescription() { // No plans to use as ClasspathFixProposal, therefore we don't have to implement a description return null; @@ -423,6 +446,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.ClasspathFixProcessor.ClasspathFixProposal#createChange(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public Change createChange(IProgressMonitor monitor) throws CoreException { return change; } @@ -430,6 +454,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.ClasspathFixProcessor.ClasspathFixProposal#getAdditionalProposalInfo() */ + @Override public String getAdditionalProposalInfo() { return change.getDescription(); } @@ -437,6 +462,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.ClasspathFixProcessor.ClasspathFixProposal#getDisplayString() */ + @Override public String getDisplayString() { return change.getName(); } @@ -444,6 +470,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.ClasspathFixProcessor.ClasspathFixProposal#getImage() */ + @Override public Image getImage() { return change.getImage(); } @@ -451,6 +478,7 @@ public class JavaResolutionFactory { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.ClasspathFixProcessor.ClasspathFixProposal#getRelevance() */ + @Override public int getRelevance() { return relevance; } @@ -472,6 +500,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.IJavaCompletionProposal#getRelevance() */ + @Override public int getRelevance() { return relevance; } @@ -480,6 +509,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposal#apply(org.eclipse.jface.text.IDocument) */ + @Override public void apply(IDocument document) { try { change.perform(new NullProgressMonitor()); @@ -491,6 +521,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getAdditionalProposalInfo() */ + @Override public String getAdditionalProposalInfo() { return change.getDescription(); } @@ -499,6 +530,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getContextInformation() */ + @Override public IContextInformation getContextInformation() { return null; } @@ -507,6 +539,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getDisplayString() */ + @Override public String getDisplayString() { return change.getName(); } @@ -515,6 +548,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getImage() */ + @Override public Image getImage() { return change.getImage(); } @@ -523,6 +557,7 @@ public class JavaResolutionFactory { * (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposal#getSelection(org.eclipse.jface.text.IDocument) */ + @Override public Point getSelection(IDocument document) { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/QuickFixProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/QuickFixProcessor.java index 6653361c6e..d3d5d53e1d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/QuickFixProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/QuickFixProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -32,6 +32,7 @@ public class QuickFixProcessor implements IQuickFixProcessor { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.IQuickFixProcessor#getCorrections(org.eclipse.jdt.ui.text.java.IInvocationContext, org.eclipse.jdt.ui.text.java.IProblemLocation[]) */ + @Override public IJavaCompletionProposal[] getCorrections(IInvocationContext context, IProblemLocation[] locations) throws CoreException { ArrayList<Object> results = new ArrayList<Object>(); @@ -300,6 +301,7 @@ public class QuickFixProcessor implements IQuickFixProcessor { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.IQuickFixProcessor#hasCorrections(org.eclipse.jdt.core.ICompilationUnit, int) */ + @Override public boolean hasCorrections(ICompilationUnit unit, int problemId) { switch (problemId) { case IProblem.ForbiddenReference : diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/SearchRepositoriesForIUProposal.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/SearchRepositoriesForIUProposal.java index 2ad6e73465..55158a4a17 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/SearchRepositoriesForIUProposal.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/SearchRepositoriesForIUProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 EclipseSource Corporation and others. + * Copyright (c) 2010, 2015 EclipseSource 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 @@ -31,10 +31,12 @@ public class SearchRepositoriesForIUProposal implements IJavaCompletionProposal fPackageName = packageName; } + @Override public int getRelevance() { return 0; } + @Override public void apply(IDocument document) { try { IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class); @@ -55,22 +57,27 @@ public class SearchRepositoriesForIUProposal implements IJavaCompletionProposal } } + @Override public String getAdditionalProposalInfo() { return NLS.bind(PDEUIMessages.SearchRepositoriesForIUProposal_description, fPackageName); } + @Override public IContextInformation getContextInformation() { return null; } + @Override public String getDisplayString() { return NLS.bind(PDEUIMessages.SearchRepositoriesForIUProposal_message, fPackageName); } + @Override public Image getImage() { return PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_SITE_OBJ); } + @Override public Point getSelection(IDocument document) { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/UnresolvedImportFixProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/UnresolvedImportFixProcessor.java index ed173038eb..ed85965028 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/UnresolvedImportFixProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/correction/java/UnresolvedImportFixProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -37,6 +37,7 @@ public class UnresolvedImportFixProcessor extends ClasspathFixProcessor { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.correction.java.FindClassResolutionsOperation.AbstractClassResolutionCollector#addResolutionModification(org.eclipse.core.resources.IProject, org.eclipse.osgi.service.resolver.ExportPackageDescription) */ + @Override public void addResolutionModification(IProject project, ExportPackageDescription desc) { if (desc.getSupplier() == null) return; @@ -57,6 +58,7 @@ public class UnresolvedImportFixProcessor extends ClasspathFixProcessor { /* (non-Javadoc) * @see org.eclipse.jdt.ui.text.java.ClasspathFixProcessor#getFixImportProposals(org.eclipse.jdt.core.IJavaProject, java.lang.String) */ + @Override public ClasspathFixProposal[] getFixImportProposals(IJavaProject project, String name) throws CoreException { if (!WorkspaceModelManager.isPluginProject(project.getProject())) return new ClasspathFixProposal[0]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FeatureSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FeatureSelectionDialog.java index d9e731965f..a519144499 100755 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FeatureSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FeatureSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -103,6 +103,7 @@ public class FeatureSelectionDialog extends FilteredItemsSelectionDialog { private class FeatureSearchComparator implements Comparator<Object> { + @Override public int compare(Object o1, Object o2) { int id1 = getId(o1); int id2 = getId(o2); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FolderSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FolderSelectionDialog.java index ae7a9c44aa..00b74ef170 100755 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FolderSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/FolderSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -39,6 +39,7 @@ public class FolderSelectionDialog extends ElementTreeSelectionDialog implements /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.FOLDER_SELECTION_DIALOG); @@ -47,6 +48,7 @@ public class FolderSelectionDialog extends ElementTreeSelectionDialog implements /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createDialogArea(Composite parent) { Composite result = (Composite) super.createDialogArea(parent); @@ -55,6 +57,7 @@ public class FolderSelectionDialog extends ElementTreeSelectionDialog implements fNewFolderButton = new Button(result, SWT.PUSH); fNewFolderButton.setText(PDEUIMessages.BuildEditor_SourceFolderSelectionDialog_button); fNewFolderButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { newFolderButtonPressed(); } @@ -96,6 +99,7 @@ public class FolderSelectionDialog extends ElementTreeSelectionDialog implements /* (non-Javadoc) * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void selectionChanged(SelectionChangedEvent event) { updateNewFolderButtonState(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/PluginSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/PluginSelectionDialog.java index c4aecc61c5..a603671229 100755 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/PluginSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/dialogs/PluginSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -64,6 +64,7 @@ public class PluginSelectionDialog extends FilteredItemsSelectionDialog { private class PluginSearchComparator implements Comparator<Object> { + @Override public int compare(Object o1, Object o2) { int id1 = getId(o1); int id2 = getId(o2); @@ -111,11 +112,13 @@ public class PluginSelectionDialog extends FilteredItemsSelectionDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IHelpContextIds.PLUGIN_SELECTION); } + @Override public boolean close() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); return super.close(); @@ -207,14 +210,17 @@ public class PluginSelectionDialog extends FilteredItemsSelectionDialog { return null; } + @Override protected Control createExtendedContentArea(Composite parent) { return null; } + @Override protected ItemsFilter createFilter() { return new PluginSearchItemsFilter(); } + @Override protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException { for (int i = 0; i < fModels.length; i++) { contentProvider.add(fModels[i], itemsFilter); @@ -223,6 +229,7 @@ public class PluginSelectionDialog extends FilteredItemsSelectionDialog { progressMonitor.done(); } + @Override protected IDialogSettings getDialogSettings() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS); @@ -233,6 +240,7 @@ public class PluginSelectionDialog extends FilteredItemsSelectionDialog { return settings; } + @Override public String getElementName(Object item) { if (item instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) item; @@ -241,6 +249,7 @@ public class PluginSelectionDialog extends FilteredItemsSelectionDialog { return null; } + @Override protected Comparator<?> getItemsComparator() { return new PluginSearchComparator(); } @@ -248,6 +257,7 @@ public class PluginSelectionDialog extends FilteredItemsSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#validateItem(java.lang.Object) */ + @Override protected IStatus validateItem(Object item) { return new Status(IStatus.OK, IPDEUIConstants.PLUGIN_ID, 0, "", null); //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/AbstractFoldingStructureProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/AbstractFoldingStructureProvider.java index cb1a76ef88..88e2c3b122 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/AbstractFoldingStructureProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/AbstractFoldingStructureProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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,14 +72,17 @@ public abstract class AbstractFoldingStructureProvider implements IFoldingStruct return deletions.toArray(new Annotation[deletions.size()]); } + @Override public void initialize() { update(); } + @Override public void modelChanged(IModelChangedEvent event) { update(); } + @Override public void reconciled(IDocument document) { update(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/EmptyOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/EmptyOutlinePage.java index 471a1a020f..9d11604910 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/EmptyOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/EmptyOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -35,6 +35,7 @@ public class EmptyOutlinePage implements ISortableContentOutlinePage { /* (non-Javadoc) * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { control = new Composite(parent, SWT.NULL); } @@ -42,12 +43,14 @@ public class EmptyOutlinePage implements ISortableContentOutlinePage { /* (non-Javadoc) * @see org.eclipse.ui.part.IPage#dispose() */ + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.ui.part.IPage#getControl() */ + @Override public Control getControl() { return control; } @@ -55,26 +58,31 @@ public class EmptyOutlinePage implements ISortableContentOutlinePage { /* (non-Javadoc) * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars) */ + @Override public void setActionBars(IActionBars actionBars) { } /* (non-Javadoc) * @see org.eclipse.ui.part.IPage#setFocus() */ + @Override public void setFocus() { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) */ + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection() */ + @Override public ISelection getSelection() { return new ISelection() { + @Override public boolean isEmpty() { return true; } @@ -84,18 +92,21 @@ public class EmptyOutlinePage implements ISortableContentOutlinePage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) */ + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection) */ + @Override public void setSelection(ISelection selection) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.ISortable#sort(boolean) */ + @Override public void sort(boolean sorting) { } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormEntryAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormEntryAdapter.java index 49e4335eb6..76f4c318d4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormEntryAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormEntryAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -31,6 +31,7 @@ public class FormEntryAdapter implements IFormEntryListener { this.actionBars = actionBars; } + @Override public void focusGained(FormEntry entry) { ITextSelection selection = new TextSelection(1, 1); contextPart.getPage().getPDEEditor().getContributor().updateSelectableActions(selection); @@ -39,6 +40,7 @@ public class FormEntryAdapter implements IFormEntryListener { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.newparts.IFormEntryListener#textDirty(org.eclipse.pde.internal.ui.newparts.FormEntry) */ + @Override public void textDirty(FormEntry entry) { contextPart.fireSaveNeeded(); } @@ -46,18 +48,21 @@ public class FormEntryAdapter implements IFormEntryListener { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.newparts.IFormEntryListener#textValueChanged(org.eclipse.pde.internal.ui.newparts.FormEntry) */ + @Override public void textValueChanged(FormEntry entry) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.newparts.IFormEntryListener#browseButtonSelected(org.eclipse.pde.internal.ui.newparts.FormEntry) */ + @Override public void browseButtonSelected(FormEntry entry) { } /* (non-Javadoc) * @see org.eclipse.ui.forms.events.HyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkEntered(HyperlinkEvent e) { if (actionBars == null) return; @@ -68,6 +73,7 @@ public class FormEntryAdapter implements IFormEntryListener { /* (non-Javadoc) * @see org.eclipse.ui.forms.events.HyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkExited(HyperlinkEvent e) { if (actionBars == null) return; @@ -78,9 +84,11 @@ public class FormEntryAdapter implements IFormEntryListener { /* (non-Javadoc) * @see org.eclipse.ui.forms.events.HyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkActivated(HyperlinkEvent e) { } + @Override public void selectionChanged(FormEntry entry) { ITextSelection selection = new TextSelection(1, 1); contextPart.getPage().getPDEEditor().getContributor().updateSelectableActions(selection); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormOutlinePage.java index 65c56bd5f4..c8e72276fe 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/FormOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -30,18 +30,22 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList private boolean fSorted; public class BasicContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object obj) { return getPages(); } + @Override public Object[] getChildren(Object obj) { return FormOutlinePage.this.getChildren(obj); } + @Override public boolean hasChildren(Object obj) { return getChildren(obj).length > 0; } + @Override public Object getParent(Object obj) { return null; } @@ -54,12 +58,14 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList fWrappedLabelProvider = ilp; } + @Override public String getText(Object obj) { if (obj instanceof IFormPage) return ((IFormPage) obj).getTitle(); return fWrappedLabelProvider.getText(obj); } + @Override public Image getImage(Object obj) { if (obj instanceof IFormPage) return PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_PAGE_OBJ); @@ -71,6 +77,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerSorter#category(java.lang.Object) */ + @Override public int category(Object element) { Object[] pages = getPages(); for (int i = 0; i < pages.length; i++) { @@ -98,6 +105,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList return new BasicComparator(); } + @Override public void createControl(Composite parent) { Tree widget = new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); fTreeViewer = new TreeViewer(widget); @@ -121,6 +129,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList return new BasicLabelProvider(PDEPlugin.getDefault().getLabelProvider()); } + @Override public void dispose() { IBaseModel model = fEditor.getAggregateModel(); if (model instanceof IModelChangeProvider) @@ -128,6 +137,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList super.dispose(); } + @Override public Control getControl() { return fTreeViewer != null ? fTreeViewer.getControl() : null; } @@ -142,6 +152,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList return formPages.toArray(); } + @Override public void modelChanged(IModelChangedEvent event) { IFormPage page = fEditor.getActivePageInstance(); fStale = true; @@ -155,6 +166,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList if (control == null || control.isDisposed()) return; control.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (!fTreeViewer.getControl().isDisposed()) { fTreeViewer.refresh(); @@ -187,6 +199,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList revealPage.selectReveal(item); } + @Override public void selectionChanged(SelectionChangedEvent event) { if (fEditorSelection) return; @@ -204,17 +217,20 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList } } + @Override public void setFocus() { if (fTreeViewer != null) fTreeViewer.getTree().setFocus(); } + @Override public ISelection getSelection() { if (fTreeViewer == null) return StructuredSelection.EMPTY; return fTreeViewer.getSelection(); } + @Override public void sort(boolean sorting) { fSorted = sorting; if (fTreeViewer != null) @@ -227,6 +243,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList /* * (non-Javadoc) Method declared on ISelectionProvider. */ + @Override public void setSelection(ISelection selection) { if (fOutlineSelection) return; @@ -255,6 +272,7 @@ public class FormOutlinePage extends PDEOutlinePage implements IModelChangedList } } + @Override protected TreeViewer getTreeViewer() { return fTreeViewer; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/GenericSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/GenericSourcePage.java index b41c944461..10d7b434df 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/GenericSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/GenericSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,6 +28,7 @@ public class GenericSourcePage extends PDESourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.PDESourcePage#createOutlineLabelProvider() */ + @Override public ILabelProvider createOutlineLabelProvider() { return null; } @@ -35,6 +36,7 @@ public class GenericSourcePage extends PDESourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.PDESourcePage#createOutlineContentProvider() */ + @Override public ITreeContentProvider createOutlineContentProvider() { return null; } @@ -42,6 +44,7 @@ public class GenericSourcePage extends PDESourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.PDESourcePage#createOutlineContentProvider() */ + @Override public ViewerComparator createOutlineComparator() { return null; } @@ -49,10 +52,12 @@ public class GenericSourcePage extends PDESourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.PDESourcePage#outlineSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void updateSelection(SelectionChangedEvent e) { // NO-OP } + @Override protected ISortableContentOutlinePage createOutlinePage() { return null; } @@ -60,6 +65,7 @@ public class GenericSourcePage extends PDESourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#updateSelection(java.lang.Object) */ + @Override public void updateSelection(Object object) { // NO-OP } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryEditorInput.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryEditorInput.java index eb85b6aaf5..9a29f71307 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryEditorInput.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryEditorInput.java @@ -46,6 +46,7 @@ public class JarEntryEditorInput implements IStorageEditorInput { /* * @see IEditorInput#getPersistable() */ + @Override public IPersistableElement getPersistable() { return null; } @@ -53,6 +54,7 @@ public class JarEntryEditorInput implements IStorageEditorInput { /* * @see IEditorInput#getName() */ + @Override public String getName() { return fJarEntryFile.getName(); } @@ -74,6 +76,7 @@ public class JarEntryEditorInput implements IStorageEditorInput { /* * @see IEditorInput#getToolTipText() */ + @Override public String getToolTipText() { File file = fJarEntryFile.getAdapter(File.class); if (file != null) @@ -84,6 +87,7 @@ public class JarEntryEditorInput implements IStorageEditorInput { /* * @see IEditorInput#getImageDescriptor() */ + @Override public ImageDescriptor getImageDescriptor() { IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); return registry.getImageDescriptor(fJarEntryFile.getFullPath().getFileExtension()); @@ -92,6 +96,7 @@ public class JarEntryEditorInput implements IStorageEditorInput { /* * @see IEditorInput#exists() */ + @Override public boolean exists() { // JAR entries can't be deleted return true; @@ -100,6 +105,7 @@ public class JarEntryEditorInput implements IStorageEditorInput { /* * @see IAdaptable#getAdapter(Class) */ + @Override @SuppressWarnings("unchecked") public <T> T getAdapter(Class<T> adapter) { if (adapter.equals(File.class)) @@ -110,6 +116,7 @@ public class JarEntryEditorInput implements IStorageEditorInput { /* * see IStorageEditorInput#getStorage() */ + @Override public IStorage getStorage() { return fJarEntryFile; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryFile.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryFile.java index 87225936a6..ae79573bdc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryFile.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/JarEntryFile.java @@ -31,6 +31,7 @@ public class JarEntryFile extends PlatformObject implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#getContents() */ + @Override public InputStream getContents() throws CoreException { try { ZipEntry zipEntry = fZipFile.getEntry(fEntryName); @@ -43,6 +44,7 @@ public class JarEntryFile extends PlatformObject implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#getFullPath() */ + @Override public IPath getFullPath() { return new Path(fEntryName); } @@ -50,6 +52,7 @@ public class JarEntryFile extends PlatformObject implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#getName() */ + @Override public String getName() { return getFullPath().lastSegment(); } @@ -57,6 +60,7 @@ public class JarEntryFile extends PlatformObject implements IStorage { /* (non-Javadoc) * @see org.eclipse.core.resources.IStorage#isReadOnly() */ + @Override public boolean isReadOnly() { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/KeyValueSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/KeyValueSourcePage.java index 5f1866839e..564cb26897 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/KeyValueSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/KeyValueSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -26,8 +26,10 @@ public abstract class KeyValueSourcePage extends PDEProjectionSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.PDESourcePage#createViewerSorter() */ + @Override public ViewerComparator createDefaultOutlineComparator() { return new ViewerComparator() { + @Override public int compare(Viewer viewer, Object e1, Object e2) { if ((e1 instanceof IDocumentKey) && (e2 instanceof IDocumentKey)) { IDocumentKey key1 = (IDocumentKey) e1; @@ -63,6 +65,7 @@ public abstract class KeyValueSourcePage extends PDEProjectionSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#createOutlineSorter() */ + @Override public ViewerComparator createOutlineComparator() { return new ViewerComparator(); } @@ -70,6 +73,7 @@ public abstract class KeyValueSourcePage extends PDEProjectionSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEProjectionSourcePage#isQuickOutlineEnabled() */ + @Override public boolean isQuickOutlineEnabled() { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LaunchShortcutOverviewPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LaunchShortcutOverviewPage.java index f7a0aa9278..6bfe2cceb0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LaunchShortcutOverviewPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LaunchShortcutOverviewPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -51,6 +51,7 @@ public abstract class LaunchShortcutOverviewPage extends PDEFormPage implements * * @see org.eclipse.ui.forms.events.HyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkActivated(HyperlinkEvent e) { // target href takes the form of launchShortcut.<mode>.<id> String href = (String) e.getHref(); @@ -71,6 +72,7 @@ public abstract class LaunchShortcutOverviewPage extends PDEFormPage implements * * @see org.eclipse.ui.forms.events.HyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkEntered(HyperlinkEvent e) { IStatusLineManager mng = getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(e.getLabel()); @@ -81,6 +83,7 @@ public abstract class LaunchShortcutOverviewPage extends PDEFormPage implements * * @see org.eclipse.ui.forms.events.HyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkExited(HyperlinkEvent e) { IStatusLineManager mng = getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(null); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LinkSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LinkSection.java index 75f7364c1e..09d6631251 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LinkSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/LinkSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,14 +43,17 @@ public class LinkSection extends PDESection { private LinkHandler linkHandler; class LinkHandler implements IHyperlinkListener { + @Override public void linkActivated(HyperlinkEvent e) { doLinkActivated((Hyperlink) e.widget); } + @Override public void linkEntered(HyperlinkEvent e) { doEnter((Hyperlink) e.widget); } + @Override public void linkExited(HyperlinkEvent e) { doExit((Hyperlink) e.widget); } @@ -74,6 +77,7 @@ public class LinkSection extends PDESection { * @see org.eclipse.pde.internal.ui.neweditor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, * org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { container = toolkit.createComposite(section); GridLayout layout = new GridLayout(); @@ -93,8 +97,10 @@ public class LinkSection extends PDESection { moreButton = getManagedForm().getToolkit().createButton(container, "More...", //$NON-NLS-1$ SWT.PUSH); moreButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { BusyIndicator.showWhile(getSection().getDisplay(), new Runnable() { + @Override public void run() { getPage().getEditor().setActivePage(morePageId); } @@ -160,6 +166,7 @@ public class LinkSection extends PDESection { reflow(); } + @Override public void refresh() { // dispose old links Control[] children = linkContainer.getChildren(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelDataTransfer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelDataTransfer.java index ecc745fe29..ca2787e0e7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelDataTransfer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelDataTransfer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,6 +43,7 @@ public class ModelDataTransfer extends ByteArrayTransfer { /* (non-Javadoc) * Method declared on Transfer. */ + @Override protected int[] getTypeIds() { return new int[] {TYPEID}; } @@ -52,6 +53,7 @@ public class ModelDataTransfer extends ByteArrayTransfer { * * @return the list of type names */ + @Override protected String[] getTypeNames() { return new String[] {TYPE_NAME}; } @@ -59,6 +61,7 @@ public class ModelDataTransfer extends ByteArrayTransfer { /* (non-Javadoc) * Method declared on Transfer. */ + @Override protected void javaToNative(Object data, TransferData transferData) { if (!(data instanceof Object[])) { return; @@ -93,6 +96,7 @@ public class ModelDataTransfer extends ByteArrayTransfer { /* (non-Javadoc) * Method declared on Transfer. */ + @Override protected Object nativeToJava(TransferData transferData) { byte[] bytes = (byte[]) super.nativeToJava(transferData); if (bytes == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelUndoManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelUndoManager.java index 2398f61fae..4a1d415fa3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelUndoManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ModelUndoManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang /* * @see IModelUndoManager#connect(IModelChangeProvider) */ + @Override public void connect(IModelChangeProvider provider) { provider.addModelChangedListener(this); if (operations == null) @@ -44,6 +45,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang /* * @see IModelUndoManager#disconnect(IModelChangeProvider) */ + @Override public void disconnect(IModelChangeProvider provider) { provider.removeModelChangedListener(this); } @@ -57,6 +59,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang /* * @see IModelUndoManager#isUndoable() */ + @Override public boolean isUndoable() { return cursor >= 0; } @@ -64,6 +67,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang /* * @see IModelUndoManager#isRedoable() */ + @Override public boolean isRedoable() { if (operations == null) initialize(); @@ -73,6 +77,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang /* * @see IModelUndoManager#undo() */ + @Override public void undo() { IModelChangedEvent op = getCurrentOperation(); if (op == null) @@ -88,6 +93,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang /* * @see IModelUndoManager#redo() */ + @Override public void redo() { cursor++; IModelChangedEvent op = getCurrentOperation(); @@ -118,6 +124,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang /* * @see IModelChangedListener#modelChanged(IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent event) { if (ignoreChanges) return; @@ -156,6 +163,7 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang updateActions(); } + @Override public void setActions(IAction undoAction, IAction redoAction) { this.undoAction = undoAction; this.redoAction = redoAction; @@ -203,10 +211,12 @@ public abstract class ModelUndoManager implements IModelUndoManager, IModelChang return opText; } + @Override public void setUndoLevelLimit(int limit) { this.undoLevelLimit = limit; } + @Override public void setIgnoreChanges(boolean ignore) { this.ignoreChanges = ignore; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OpenManifestHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OpenManifestHandler.java index 0c0f91d034..eb938b3d91 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OpenManifestHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OpenManifestHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2012, 2015 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 @@ -43,6 +43,7 @@ public class OpenManifestHandler extends AbstractHandler { /* (non-Javadoc) * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) */ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { final HashSet<IProject> projects = new HashSet<IProject>(); if (HandlerUtil.getActivePart(event) instanceof IEditorPart) { @@ -88,6 +89,7 @@ public class OpenManifestHandler extends AbstractHandler { } if (projects.size() > 0) { BusyIndicator.showWhile(PDEPlugin.getActiveWorkbenchShell().getDisplay(), new Runnable() { + @Override public void run() { Iterator<IProject> it = projects.iterator(); while (it.hasNext()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OrientableBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OrientableBlock.java index cf8b00f0b2..57aff91194 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OrientableBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/OrientableBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -24,10 +24,12 @@ public abstract class OrientableBlock extends PDEMasterDetailsBlock { super(page); } + @Override protected void createToolBarActions(IManagedForm managedForm) { final ScrolledForm form = managedForm.getForm(); Action haction = new Action("hor", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$ + @Override public void run() { sashForm.setOrientation(SWT.HORIZONTAL); form.reflow(true); @@ -39,6 +41,7 @@ public abstract class OrientableBlock extends PDEMasterDetailsBlock { haction.setDisabledImageDescriptor(PDEPluginImages.DESC_HORIZONTAL_DISABLED); Action vaction = new Action("ver", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$ + @Override public void run() { sashForm.setOrientation(SWT.VERTICAL); form.reflow(true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetails.java index 4a82289dae..8c1f7f335c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -52,6 +52,7 @@ public abstract class PDEDetails extends AbstractFormPart implements IDetailsPag spacer.setLayoutData(gd); } + @Override public void cancelEdit() { super.refresh(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetailsSections.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetailsSections.java index ed1207d8c5..9f5316a51a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetailsSections.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDetailsSections.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,6 +28,7 @@ public abstract class PDEDetailsSections extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite) */ + @Override public void createContents(Composite parent) { sections = createSections(getPage(), parent); parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1)); @@ -36,19 +37,23 @@ public abstract class PDEDetailsSections extends PDEDetails { } } + @Override public void dispose() { for (int i = 0; i < sections.length; i++) { sections[i].dispose(); } } + @Override public void fireSaveNeeded() { markDirty(); getPage().getPDEEditor().fireSaveNeeded(getContextId(), false); } + @Override public abstract String getContextId(); + @Override public PDEFormPage getPage() { return (PDEFormPage) getManagedForm().getContainer(); } @@ -58,6 +63,7 @@ public abstract class PDEDetailsSections extends PDEDetails { * * @see org.eclipse.ui.forms.AbstractFormPart#isDirty() */ + @Override public boolean isDirty() { for (int i = 0; i < sections.length; i++) { if (sections[i].isDirty()) { @@ -67,6 +73,7 @@ public abstract class PDEDetailsSections extends PDEDetails { return super.isDirty(); } + @Override public boolean isEditable() { return getPage().getPDEEditor().getAggregateModel().isEditable(); } @@ -76,6 +83,7 @@ public abstract class PDEDetailsSections extends PDEDetails { * * @see org.eclipse.ui.forms.AbstractFormPart#isStale() */ + @Override public boolean isStale() { for (int i = 0; i < sections.length; i++) { if (sections[i].isStale()) { @@ -90,6 +98,7 @@ public abstract class PDEDetailsSections extends PDEDetails { * * @see org.eclipse.pde.core.IModelChangedListener#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent event) { } @@ -98,6 +107,7 @@ public abstract class PDEDetailsSections extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#inputChanged(org.eclipse.jface.viewers.IStructuredSelection) */ + @Override public void selectionChanged(IFormPart masterPart, ISelection selection) { } @@ -106,6 +116,7 @@ public abstract class PDEDetailsSections extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#setFocus() */ + @Override public void setFocus() { if (sections.length > 0) { sections[0].setFocus(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDragAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDragAdapter.java index 6601000025..efb1a9c7ef 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDragAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDragAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -44,6 +44,7 @@ public class PDEDragAdapter implements DragSourceListener, IPDESourceParticipant /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDESourceParticipant#getSourceObjects() */ + @Override public Object[] getSourceObjects() { return fSourceObjects; } @@ -77,6 +78,7 @@ public class PDEDragAdapter implements DragSourceListener, IPDESourceParticipant /* (non-Javadoc) * @see org.eclipse.swt.dnd.DragSourceListener#dragFinished(org.eclipse.swt.dnd.DragSourceEvent) */ + @Override public void dragFinished(DragSourceEvent event) { // Nothing to do if drag event is not enabled if (event.doit == false) { @@ -143,6 +145,7 @@ public class PDEDragAdapter implements DragSourceListener, IPDESourceParticipant /* (non-Javadoc) * @see org.eclipse.swt.dnd.DragSourceListener#dragSetData(org.eclipse.swt.dnd.DragSourceEvent) */ + @Override public void dragSetData(DragSourceEvent event) { // Check to see if the drag event is valid if (event.doit == false) { @@ -203,6 +206,7 @@ public class PDEDragAdapter implements DragSourceListener, IPDESourceParticipant /* (non-Javadoc) * @see org.eclipse.swt.dnd.DragSourceListener#dragStart(org.eclipse.swt.dnd.DragSourceEvent) */ + @Override public void dragStart(DragSourceEvent event) { // Clear the previous source objects // New drag starting diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDropAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDropAdapter.java index 3b3b0ac2f1..d19064674d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDropAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEDropAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -45,6 +45,7 @@ public class PDEDropAdapter extends ViewerDropAdapter { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object) */ + @Override public boolean performDrop(Object data) { // Clear the last valid operation for the next drop event resetLastValidOperation(); @@ -81,6 +82,7 @@ public class PDEDropAdapter extends ViewerDropAdapter { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData) */ + @Override public boolean validateDrop(Object targetObject, int operation, TransferData transferType) { // Current operation listed is not set until after the drop is validated // i.e. This method call diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditor.java index 591087b68a..27f9b28e49 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditor.java @@ -86,6 +86,7 @@ public abstract class PDEFormEditor extends FormEditor implements IInputContextL /* * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void selectionChanged(SelectionChangedEvent event) { if (PDEPlugin.getDefault().getPreferenceStore().getBoolean("ToggleLinkWithEditorAction.isChecked")) //$NON-NLS-1$ if (getFormOutline() != null) { @@ -238,6 +239,7 @@ public abstract class PDEFormEditor extends FormEditor implements IInputContextL clipboard = new Clipboard(getContainer().getDisplay()); MenuManager manager = new MenuManager(); IMenuListener listener = new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { contextMenuAboutToShow(manager); } @@ -646,6 +648,7 @@ public abstract class PDEFormEditor extends FormEditor implements IInputContextL final InputContext context = fInputContextManager.getContext(input); if (!context.validateEdit()) { getSite().getShell().getDisplay().asyncExec(new Runnable() { + @Override public void run() { doRevert(context.getInput()); context.setValidated(false); @@ -668,6 +671,7 @@ public abstract class PDEFormEditor extends FormEditor implements IInputContextL return section; } + @Override public void gotoMarker(IMarker marker) { IResource resource = marker.getResource(); InputContext context = fInputContextManager.findContext(resource); @@ -914,6 +918,7 @@ public abstract class PDEFormEditor extends FormEditor implements IInputContextL /* (non-Javadoc) * @see org.eclipse.search.ui.text.ISearchEditorAccess#getDocument(org.eclipse.search.ui.text.Match) */ + @Override public IDocument getDocument(Match match) { InputContext context = getInputContext(match.getElement()); return context == null ? null : context.getDocumentProvider().getDocument(context.getInput()); @@ -922,6 +927,7 @@ public abstract class PDEFormEditor extends FormEditor implements IInputContextL /* (non-Javadoc) * @see org.eclipse.search.ui.text.ISearchEditorAccess#getAnnotationModel(org.eclipse.search.ui.text.Match) */ + @Override public IAnnotationModel getAnnotationModel(Match match) { InputContext context = getInputContext(match.getElement()); return context == null ? null : context.getDocumentProvider().getAnnotationModel(context.getInput()); @@ -944,6 +950,7 @@ public abstract class PDEFormEditor extends FormEditor implements IInputContextL protected abstract void addEditorPages(); + @Override public final void contextAdded(InputContext context) { if (fError) { removePage(0); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditorContributor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditorContributor.java index 7ee6a75e21..5307f56649 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditorContributor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormEditorContributor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2014 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -54,11 +54,13 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo this.id = id; } + @Override public void run() { fEditor.performGlobalAction(id); updateSelectableActions(fEditor.getSelection()); } + @Override public void update() { getActionBars().updateActionBars(); } @@ -90,6 +92,7 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo setActionDefinitionId(ActionFactory.CUT.getCommandId()); } + @Override public void selectionChanged(ISelection selection) { setEnabled(isEditable() && fEditor.canCut(selection)); } @@ -104,6 +107,7 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo setActionDefinitionId(ActionFactory.COPY.getCommandId()); } + @Override public void selectionChanged(ISelection selection) { setEnabled(fEditor.canCopy(selection)); } @@ -118,6 +122,7 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo setActionDefinitionId(ActionFactory.PASTE.getCommandId()); } + @Override public void selectionChanged(ISelection selection) { setEnabled(isEditable() && fEditor.canPasteFromClipboard()); } @@ -136,11 +141,13 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo public SaveAction() { } + @Override public void run() { if (fEditor != null) PDEPlugin.getActivePage().saveEditor(fEditor, false); } + @Override public void update() { setEnabled(fEditor != null ? fEditor.isDirty() : false); } @@ -150,11 +157,13 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo public RevertAction() { } + @Override public void run() { if (fEditor != null) fEditor.doRevert(); } + @Override public void update() { setEnabled(fEditor != null ? fEditor.isDirty() : false); } @@ -195,15 +204,19 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo mng.add(fSaveAction); } + @Override public void contributeToMenu(IMenuManager mm) { } + @Override public void contributeToStatusLine(IStatusLineManager slm) { } + @Override public void contributeToToolBar(IToolBarManager tbm) { } + @Override public void contributeToCoolBar(ICoolBarManager cbm) { } @@ -253,6 +266,7 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo addGlobalAction(ActionFactory.REVERT.getId(), fRevertAction); } + @Override public void setActiveEditor(IEditorPart targetEditor) { if (targetEditor instanceof PDESourcePage) { // Fixing the 'goto line' problem - @@ -272,6 +286,7 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo updateSelectableActions(fEditor.getSelection()); } + @Override public void setActivePage(IEditorPart newEditor) { if (fEditor == null) return; @@ -302,6 +317,7 @@ public class PDEFormEditorContributor extends MultiPageEditorActionBarContributo return null; } + @Override public void init(IActionBars bars) { super.init(bars); makeActions(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormPage.java index 0aae6b1b18..ebb243a6bc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormPage.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
+ * Copyright (c) 2003, 2015 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,7 +8,7 @@ * Contributors:
* IBM Corporation - initial API and implementation
* Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 251339
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.editor;
import java.io.PrintWriter;
@@ -47,6 +47,7 @@ public abstract class PDEFormPage extends FormPage { fLastFocusControl = null;
}
+ @Override
public void dispose() {
Control c = getPartControl();
if (c != null && !c.isDisposed()) {
@@ -71,6 +72,7 @@ public abstract class PDEFormPage extends FormPage { }
}
+ @Override
protected void createFormContent(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
@@ -83,6 +85,7 @@ public abstract class PDEFormPage extends FormPage { final String helpContextID = getHelpResource();
if (helpContextID != null) {
Action helpAction = new Action("help") { //$NON-NLS-1$
+ @Override
public void run() {
PlatformUI.getWorkbench().getHelpSystem().displayHelp(helpContextID);
}
@@ -259,6 +262,7 @@ public abstract class PDEFormPage extends FormPage { /* (non-Javadoc)
* @see org.eclipse.ui.forms.editor.FormPage#createPartControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Dynamically add focus listeners to all the forms children in order
@@ -308,10 +312,12 @@ public abstract class PDEFormPage extends FormPage { */
private void addLastFocusListener(final Control control) {
control.addFocusListener(new FocusListener() {
+ @Override
public void focusGained(FocusEvent e) {
// NO-OP
}
+ @Override
public void focusLost(FocusEvent e) {
fLastFocusControl = control;
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormTextEditorContributor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormTextEditorContributor.java index e06e980e05..abd5df673e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormTextEditorContributor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEFormTextEditorContributor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -32,6 +32,7 @@ public class PDEFormTextEditorContributor extends PDEFormEditorContributor { private SubActionBars fSourceActionBars; class PDETextEditorActionContributor extends TextEditorActionContributor { + @Override public void contributeToMenu(IMenuManager mm) { super.contributeToMenu(mm); IMenuManager editMenu = mm.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT); @@ -44,12 +45,14 @@ public class PDEFormTextEditorContributor extends PDEFormEditorContributor { } } + @Override public void contributeToToolBar(IToolBarManager toolBarManager) { super.contributeToToolBar(toolBarManager); if (fHyperlinkAction != null) toolBarManager.add(fHyperlinkAction); } + @Override public void setActiveEditor(IEditorPart part) { super.setActiveEditor(part); IActionBars actionBars = getActionBars(); @@ -106,16 +109,19 @@ public class PDEFormTextEditorContributor extends PDEFormEditorContributor { return false; } + @Override public IEditorActionBarContributor getSourceContributor() { return fSourceContributor; } + @Override public void init(IActionBars bars) { super.init(bars); fSourceActionBars = new SubActionBars(bars); fSourceContributor.init(fSourceActionBars); } + @Override public void dispose() { fSourceActionBars.dispose(); fSourceContributor.dispose(); @@ -164,6 +170,7 @@ public class PDEFormTextEditorContributor extends PDEFormEditorContributor { getActionBars().setGlobalActionHandler(id, action); } + @Override public void setActivePage(IEditorPart newEditor) { if (fEditor == null) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEHyperlinkDetector.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEHyperlinkDetector.java index 23f20b1db7..6edd41cd4d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEHyperlinkDetector.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEHyperlinkDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -29,6 +29,7 @@ public abstract class PDEHyperlinkDetector implements IHyperlinkDetector { /* (non-Javadoc) * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion, boolean) */ + @Override public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { if (region == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDELauncherFormEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDELauncherFormEditor.java index 5e1bbfe7f8..c4c9df3536 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDELauncherFormEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDELauncherFormEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -107,6 +107,7 @@ public abstract class PDELauncherFormEditor extends MultiSourceEditor { protected Runnable getPreLaunchRunnable() { return new Runnable() { + @Override public void run() { getLauncherHelper().preLaunch(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMasterDetailsBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMasterDetailsBlock.java index ce6fd2f91a..978ee01c2e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMasterDetailsBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMasterDetailsBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -27,6 +27,7 @@ public abstract class PDEMasterDetailsBlock extends MasterDetailsBlock { return fPage; } + @Override protected void createMasterPart(final IManagedForm managedForm, Composite parent) { Composite container = managedForm.getToolkit().createComposite(parent); container.setLayout(FormLayoutFactory.createMasterGridLayout(false, 1)); @@ -38,11 +39,13 @@ public abstract class PDEMasterDetailsBlock extends MasterDetailsBlock { section.setLayoutData(new GridData(GridData.FILL_BOTH)); } + @Override protected void createToolBarActions(IManagedForm managedForm) { } protected abstract PDESection createMasterSection(IManagedForm managedForm, Composite parent); + @Override public void createContent(IManagedForm managedForm) { super.createContent(managedForm); managedForm.getForm().getBody().setLayout(FormLayoutFactory.createFormGridLayout(false, 1)); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMultiPageContentOutline.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMultiPageContentOutline.java index 2f89606bfe..4a4f21ab73 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMultiPageContentOutline.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEMultiPageContentOutline.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -46,6 +46,7 @@ public class PDEMultiPageContentOutline extends Page implements IContentOutlineP public void addFocusListener(FocusListener listener) { } + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { listeners.add(listener); } @@ -92,6 +93,7 @@ public class PDEMultiPageContentOutline extends Page implements IContentOutlineP return pagebook; } + @Override public ISelection getSelection() { return selection; } @@ -103,10 +105,12 @@ public class PDEMultiPageContentOutline extends Page implements IContentOutlineP public void removeFocusListener(FocusListener listener) { } + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { listeners.remove(listener); } + @Override public void selectionChanged(SelectionChangedEvent event) { setSelection(event.getSelection()); } @@ -165,6 +169,7 @@ public class PDEMultiPageContentOutline extends Page implements IContentOutlineP /** * Set the selection. */ + @Override public void setSelection(ISelection selection) { this.selection = selection; if (listeners == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEOutlinePage.java index 78b574c6d4..59ea875272 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -29,10 +29,12 @@ public abstract class PDEOutlinePage extends ContentOutlinePage { public PDEOutlinePage() { } + @Override public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { MenuManager popupMenuManager = new MenuManager(); IMenuListener listener = new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { ISelection selection = getSelection(); PluginSearchActionGroup actionGroup = new PluginSearchActionGroup(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionSourcePage.java index d9b60de6f6..7bdd8b8004 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -85,6 +85,7 @@ public abstract class PDEProjectionSourcePage extends PDESourcePage implements I } + @Override public void projectionEnabled() { IBaseModel model = getInputContext().getModel(); if (model instanceof IEditingModel) { @@ -104,6 +105,7 @@ public abstract class PDEProjectionSourcePage extends PDESourcePage implements I return null; } + @Override public void projectionDisabled() { fFoldingStructureProvider = null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionViewer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionViewer.java index f312d5fb04..cc6f4d3f4c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionViewer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEProjectionViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -48,6 +48,7 @@ public class PDEProjectionViewer extends ProjectionViewer { /* (non-Javadoc) * @see org.eclipse.jface.text.source.projection.ProjectionViewer#doOperation(int) */ + @Override public void doOperation(int operation) { // Ensure underlying text widget is defined if ((getTextWidget() == null) || getTextWidget().isDisposed()) { @@ -67,6 +68,7 @@ public class PDEProjectionViewer extends ProjectionViewer { /* (non-Javadoc) * @see org.eclipse.jface.text.source.projection.ProjectionViewer#canDoOperation(int) */ + @Override public boolean canDoOperation(int operation) { // Verify quick outline operation if (operation == QUICK_OUTLINE) { @@ -82,6 +84,7 @@ public class PDEProjectionViewer extends ProjectionViewer { /* (non-Javadoc) * @see org.eclipse.jface.text.source.SourceViewer#configure(org.eclipse.jface.text.source.SourceViewerConfiguration) */ + @Override public void configure(SourceViewerConfiguration configuration) { // Ensure underlying text widget is defined if ((getTextWidget() == null) || getTextWidget().isDisposed()) { @@ -103,6 +106,7 @@ public class PDEProjectionViewer extends ProjectionViewer { /* (non-Javadoc) * @see org.eclipse.jface.text.source.SourceViewer#unconfigure() */ + @Override public void unconfigure() { // Unconfigure quick outline operation if (fOutlinePresenter != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESection.java index 8321f30bf7..bd4728a782 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESection.java @@ -38,6 +38,7 @@ public abstract class PDESection extends SectionPart implements IContextPart, IA protected abstract void createClient(Section section, FormToolkit toolkit); + @Override public PDEFormPage getPage() { return fPage; } @@ -50,21 +51,25 @@ public abstract class PDESection extends SectionPart implements IContextPart, IA return false; } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) markStale(); } + @Override public String getContextId() { return null; } + @Override public void fireSaveNeeded() { markDirty(); if (getContextId() != null) getPage().getPDEEditor().fireSaveNeeded(getContextId(), false); } + @Override public boolean isEditable() { // getAggregateModel() can (though never should) return null IBaseModel model = getPage().getPDEEditor().getAggregateModel(); @@ -85,10 +90,12 @@ public abstract class PDESection extends SectionPart implements IContextPart, IA return false; } + @Override public void cancelEdit() { super.refresh(); } + @Override public <T> T getAdapter(Class<T> adapter) { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESourcePage.java index cac1a4dc72..220921e891 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDESourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -90,6 +90,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void selectionChanged(SelectionChangedEvent event) { handleSelectionChangedSourcePage(event); } @@ -143,6 +144,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#initialize(org.eclipse.ui.forms.editor.FormEditor) */ + @Override public void initialize(FormEditor editor) { fEditor = (PDEFormEditor) editor; } @@ -166,21 +168,25 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineContentCreator#createOutlineLabelProvider() */ + @Override public abstract ILabelProvider createOutlineLabelProvider(); /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineContentCreator#createOutlineContentProvider() */ + @Override public abstract ITreeContentProvider createOutlineContentProvider(); /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineContentCreator#createOutlineComparator() */ + @Override public abstract ViewerComparator createOutlineComparator(); /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineSelectionHandler#updateSelection(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void updateSelection(SelectionChangedEvent event) { ISelection sel = event.getSelection(); if (sel instanceof IStructuredSelection) { @@ -192,11 +198,13 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineSelectionHandler#updateSelection(java.lang.Object) */ + @Override public abstract void updateSelection(Object object); /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineContentCreator#createDefaultOutlineComparator() */ + @Override public ViewerComparator createDefaultOutlineComparator() { return null; } @@ -205,6 +213,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo SourceOutlinePage sourceOutlinePage = new SourceOutlinePage(fEditor, (IEditingModel) getInputContext().getModel(), createOutlineLabelProvider(), createOutlineContentProvider(), createDefaultOutlineComparator(), createOutlineComparator()); fOutlinePage = sourceOutlinePage; fOutlineSelectionChangedListener = new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateSelection(event); } @@ -219,6 +228,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineSelectionHandler#getContentOutline() */ + @Override public ISortableContentOutlinePage getContentOutline() { if (fOutlinePage == null) fOutlinePage = createOutlinePage(); @@ -228,6 +238,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#getEditor() */ + @Override public FormEditor getEditor() { return fEditor; } @@ -235,6 +246,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#getManagedForm() */ + @Override public IManagedForm getManagedForm() { // not a form page return null; @@ -251,6 +263,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#setActive(boolean) */ + @Override public void setActive(boolean active) { fInputContext.setSourceEditingMode(active); // Update the text selection if this page is being activated @@ -259,6 +272,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo } } + @Override public boolean canLeaveThePage() { return true; } @@ -266,6 +280,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#isActive() */ + @Override public boolean isActive() { return this.equals(fEditor.getActivePageInstance()); } @@ -282,6 +297,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#getPartControl() */ + @Override public Control getPartControl() { return fControl; } @@ -289,6 +305,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#getId() */ + @Override public String getId() { return fId; } @@ -296,6 +313,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#getIndex() */ + @Override public int getIndex() { return fIndex; } @@ -303,6 +321,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#setIndex(int) */ + @Override public void setIndex(int index) { fIndex = index; } @@ -310,6 +329,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#isSource() */ + @Override public boolean isEditor() { return true; } @@ -332,6 +352,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.IFormPage#focusOn(java.lang.Object) */ + @Override public boolean selectReveal(Object object) { if (object instanceof IMarker) { IDE.gotoMarker(this, (IMarker) object); @@ -419,6 +440,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo setAction(PDEActionConstants.COMMAND_ID_QUICK_OUTLINE, action); } + @Override public final void selectionChanged(SelectionChangedEvent event) { if (event.getSource() == getSelectionProvider()) return; @@ -515,6 +537,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.outline.IOutlineContentCreator#getOutlineInput() */ + @Override public Object getOutlineInput() { return getInputContext().getModel(); } @@ -686,6 +709,7 @@ public abstract class PDESourcePage extends TextEditor implements IFormPage, IGo */ protected IShowInTargetList getShowInTargetList() { return new IShowInTargetList() { + @Override public String[] getShowInTargetIds() { return new String[] {JavaUI.ID_PACKAGES, IPageLayout.ID_RES_NAV}; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEStorageDocumentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEStorageDocumentProvider.java index 7b15d5ffe4..b3ff57eff9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEStorageDocumentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/PDEStorageDocumentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,6 +33,7 @@ public class PDEStorageDocumentProvider extends StorageDocumentProvider { // we need to override this method when dealing with IURIEditorInput's... // is there a better way to do this? + @Override protected boolean setDocumentContent(IDocument document, IEditorInput editorInput, String encoding) throws CoreException { boolean set = super.setDocumentContent(document, editorInput, encoding); if (!set) { @@ -47,6 +48,7 @@ public class PDEStorageDocumentProvider extends StorageDocumentProvider { return set; } + @Override protected void setupDocument(Object element, IDocument document) { if (document != null && fSetupParticipant != null) { fSetupParticipant.setup(document); @@ -56,6 +58,7 @@ public class PDEStorageDocumentProvider extends StorageDocumentProvider { /* * @see AbstractDocumentProvider#createAnnotationModel(Object) */ + @Override protected IAnnotationModel createAnnotationModel(Object element) throws CoreException { if (element instanceof IAdaptable) { IAdaptable input = (IAdaptable) element; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SourceOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SourceOutlinePage.java index 8e5bfabb7f..caa7520534 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SourceOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SourceOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -55,6 +55,7 @@ public class SourceOutlinePage extends PDEOutlinePage implements IReconcilingPar /** * Creates the control for this outline page. */ + @Override public void createControl(Composite parent) { super.createControl(parent); viewer = getTreeViewer(); @@ -71,6 +72,7 @@ public class SourceOutlinePage extends PDEOutlinePage implements IReconcilingPar /* (non-Javadoc) * @see org.eclipse.ui.views.contentoutline.ContentOutlinePage#init(org.eclipse.ui.part.IPageSite) */ + @Override public void init(IPageSite pageSite) { super.init(pageSite); } @@ -78,11 +80,13 @@ public class SourceOutlinePage extends PDEOutlinePage implements IReconcilingPar /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.text.IReconcilingParticipant#reconciled(org.eclipse.jface.text.IDocument) */ + @Override public void reconciled(IDocument document) { final Control control = getControl(); if (control == null || control.isDisposed()) return; control.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (control.isDisposed()) return; @@ -103,6 +107,7 @@ public class SourceOutlinePage extends PDEOutlinePage implements IReconcilingPar /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.ISortableContentOutlinePage#sort(boolean) */ + @Override public void sort(boolean sorting) { sorted = sorting; if (isViewerDefined()) { @@ -156,6 +161,7 @@ public class SourceOutlinePage extends PDEOutlinePage implements IReconcilingPar /* (non-Javadoc) * @see org.eclipse.ui.views.contentoutline.ContentOutlinePage#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) */ + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { // Add the listener to our private list fListenerList.add(listener); @@ -165,6 +171,7 @@ public class SourceOutlinePage extends PDEOutlinePage implements IReconcilingPar /* (non-Javadoc) * @see org.eclipse.ui.views.contentoutline.ContentOutlinePage#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) */ + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { // Remove the listener from our private list fListenerList.remove(listener); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/StructuredViewerSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/StructuredViewerSection.java index 4cf66e4df4..eb1b1e8e2e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/StructuredViewerSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/StructuredViewerSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -52,6 +52,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE fViewerPart.createControl(parent, style, span, toolkit); MenuManager popupMenuManager = new MenuManager(); IMenuListener listener = new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager mng) { fillContextMenu(mng); } @@ -113,6 +114,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#canPaste(org.eclipse.swt.dnd.Clipboard) */ + @Override public boolean canPaste(Clipboard clipboard) { // TODO: MP: CCP: Checking clipboard data done incorrectly. See Bug 37223 ISelection selection = getViewerSelection(); @@ -142,6 +144,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE return false; } + @Override public void setFocus() { fViewerPart.getControl().setFocus(); } @@ -181,6 +184,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDragParticipant#canDragCopy(java.lang.Object[]) */ + @Override public boolean canDragCopy(Object[] sourceObjects) { return false; } @@ -188,6 +192,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDragParticipant#canDragLink(java.lang.Object[]) */ + @Override public boolean canDragLink(Object[] sourceObjects) { return false; } @@ -195,6 +200,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDragParticipant#canDragMove(java.lang.Object[]) */ + @Override public boolean canDragMove(Object[] sourceObjects) { return false; } @@ -202,6 +208,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDropParticipant#canDropCopy(java.lang.Object, java.lang.Object[], int) */ + @Override public boolean canDropCopy(Object targetObject, Object[] sourceObjects, int targetLocation) { return false; } @@ -209,6 +216,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDropParticipant#canDropLink(java.lang.Object, java.lang.Object[], int) */ + @Override public boolean canDropLink(Object targetObject, Object[] sourceObjects, int targetLocation) { return false; } @@ -216,6 +224,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDropParticipant#canDropMove(java.lang.Object, java.lang.Object[], int) */ + @Override public boolean canDropMove(Object targetObject, Object[] sourceObjects, int targetLocation) { return false; } @@ -223,6 +232,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDropParticipant#doDropCopy(java.lang.Object, java.lang.Object[], int) */ + @Override public void doDropCopy(Object targetObject, Object[] sourceObjects, int targetLocation) { // NO-OP // Sub-classes to override @@ -231,6 +241,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDropParticipant#doDropLink(java.lang.Object, java.lang.Object[], int) */ + @Override public void doDropLink(Object targetObject, Object[] sourceObjects, int targetLocation) { // NO-OP // Sub-classes to override @@ -239,6 +250,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDropParticipant#doDropMove(java.lang.Object, java.lang.Object[], int) */ + @Override public void doDropMove(Object targetObject, Object[] sourceObjects, int targetLocation) { // NO-OP // Sub-classes to override @@ -247,6 +259,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDragParticipant#doDragRemove(java.lang.Object[]) */ + @Override public void doDragRemove(Object[] sourceObjects) { // NO-OP // Sub-classes to override @@ -255,6 +268,7 @@ public abstract class StructuredViewerSection extends PDESection implements IPDE /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IPDEDragParticipant#getSupportedDNDOperations() */ + @Override public int getSupportedDNDOperations() { return DND.DROP_MOVE; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SystemFileMarkerAnnotationModel.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SystemFileMarkerAnnotationModel.java index b9335ad68f..9c776d7cf1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SystemFileMarkerAnnotationModel.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/SystemFileMarkerAnnotationModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -23,16 +23,20 @@ import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; */ public class SystemFileMarkerAnnotationModel extends AbstractMarkerAnnotationModel { + @Override protected IMarker[] retrieveMarkers() throws CoreException { return null; } + @Override protected void deleteMarkers(IMarker[] markers) throws CoreException { } + @Override protected void listenToMarkerChanges(boolean listen) { } + @Override protected boolean isAcceptable(IMarker marker) { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TableSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TableSection.java index c7e0d72ff9..a518df291f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TableSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TableSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,25 +33,30 @@ public abstract class TableSection extends StructuredViewerSection { super(buttonLabels); } + @Override public void entryModified(Object entry, String value) { TableSection.this.entryModified(entry, value); } + @Override public void selectionChanged(IStructuredSelection selection) { getManagedForm().fireSelectionChanged(TableSection.this, selection); TableSection.this.selectionChanged(selection); } + @Override public void handleDoubleClick(IStructuredSelection selection) { TableSection.this.handleDoubleClick(selection); } + @Override public void buttonSelected(Button button, int index) { TableSection.this.buttonSelected(index); if (fHandleDefaultButton) button.getShell().setDefaultButton(null); } + @Override protected void createButtons(Composite parent, FormToolkit toolkit) { super.createButtons(parent, toolkit); enableButtons(); @@ -63,6 +68,7 @@ public abstract class TableSection extends StructuredViewerSection { fCount.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); fCount.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); getTablePart().getTableViewer().getTable().addPaintListener(new PaintListener() { + @Override public void paintControl(PaintEvent e) { updateLabel(); } @@ -94,6 +100,7 @@ public abstract class TableSection extends StructuredViewerSection { super(formPage, parent, style, titleBar, buttonLabels); } + @Override protected StructuredViewerPart createViewerPart(String[] buttonLabels) { return new PartAdapter(buttonLabels); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ToggleLinkWithEditorAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ToggleLinkWithEditorAction.java index a35bad1056..2649051e34 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ToggleLinkWithEditorAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/ToggleLinkWithEditorAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public class ToggleLinkWithEditorAction extends Action { setDisabledImageDescriptor(PDEPluginImages.DESC_LINK_WITH_EDITOR_DISABLED); } + @Override public void run() { PDEPlugin.getDefault().getPreferenceStore().setValue("ToggleLinkWithEditorAction.isChecked", isChecked()); //$NON-NLS-1$ if (isChecked()) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TreeSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TreeSection.java index e1e28c1fdc..9d8450f856 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TreeSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/TreeSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,21 +28,25 @@ public abstract class TreeSection extends StructuredViewerSection { super(buttonLabels); } + @Override public void selectionChanged(IStructuredSelection selection) { getManagedForm().fireSelectionChanged(TreeSection.this, selection); TreeSection.this.selectionChanged(selection); } + @Override public void handleDoubleClick(IStructuredSelection selection) { TreeSection.this.handleDoubleClick(selection); } + @Override public void buttonSelected(Button button, int index) { TreeSection.this.buttonSelected(index); if (fHandleDefaultButton) button.getShell().setDefaultButton(null); } + @Override protected void createButtons(Composite parent, FormToolkit toolkit) { super.createButtons(parent, toolkit); enableButtons(); @@ -52,6 +56,7 @@ public abstract class TreeSection extends StructuredViewerSection { } } + @Override protected TreeViewer createTreeViewer(Composite parent, int style) { return TreeSection.this.createTreeViewer(parent, style); } @@ -66,6 +71,7 @@ public abstract class TreeSection extends StructuredViewerSection { super(formPage, parent, style, buttonLabels); } + @Override protected StructuredViewerPart createViewerPart(String[] buttonLabels) { return new PartAdapter(buttonLabels); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/XMLSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/XMLSourcePage.java index bc225c704b..b7a640fd26 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/XMLSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/XMLSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -22,10 +22,12 @@ public abstract class XMLSourcePage extends PDEProjectionSourcePage { setRangeIndicator(new DefaultRangeIndicator()); } + @Override public boolean canLeaveThePage() { return true; } + @Override protected String[] collectContextMenuPreferencePages() { String[] ids = super.collectContextMenuPreferencePages(); String[] more = new String[ids.length + 1]; @@ -34,6 +36,7 @@ public abstract class XMLSourcePage extends PDEProjectionSourcePage { return more; } + @Override protected ChangeAwareSourceViewerConfiguration createSourceViewerConfiguration(IColorManager colorManager) { if (getEditor() instanceof ManifestEditor) return new PluginXMLConfiguration(colorManager, this); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ActionMenu.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ActionMenu.java index 7a209696a8..891b2af901 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ActionMenu.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ActionMenu.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -37,6 +37,7 @@ public class ActionMenu extends Action implements IMenuCreator { /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { if (!fActions.isEmpty()) fActions.get(0).run(); @@ -45,6 +46,7 @@ public class ActionMenu extends Action implements IMenuCreator { /* (non-Javadoc) * @see org.eclipse.jface.action.IMenuCreator#dispose() */ + @Override public void dispose() { if (fMenu != null) { fMenu.dispose(); @@ -55,6 +57,7 @@ public class ActionMenu extends Action implements IMenuCreator { /* (non-Javadoc) * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control) */ + @Override public Menu getMenu(Control parent) { if (fMenu != null) fMenu.dispose(); @@ -69,6 +72,7 @@ public class ActionMenu extends Action implements IMenuCreator { /* (non-Javadoc) * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu) */ + @Override public Menu getMenu(Menu parent) { return null; } @@ -81,6 +85,7 @@ public class ActionMenu extends Action implements IMenuCreator { public void updateActionOrder(final List<String> orderedLauncherIds) { if (!fActions.isEmpty()) { Collections.sort(fActions, new Comparator<LauncherAction>() { + @Override public int compare(LauncherAction o1, LauncherAction o2) { // Entries in the recent launcher list go first String id1 = o1.getConfigurationElement().getAttribute("id"); //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/CollapseAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/CollapseAction.java index b72a8c293f..098e71d168 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/CollapseAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/CollapseAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -60,6 +60,7 @@ public class CollapseAction extends Action { /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { if (fTreeViewer == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FilterRelatedExtensionsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FilterRelatedExtensionsAction.java index c8fe398f0d..ec7502be6c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FilterRelatedExtensionsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FilterRelatedExtensionsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2015 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 @@ -41,6 +41,7 @@ public class FilterRelatedExtensionsAction extends Action { fFilteredTree = filteredTree; } + @Override public void run() { String filterPattern = ExtensionsFilterUtil.getFilterRelatedPattern((IStructuredSelection) fExtensionTree.getSelection()); Text filterControl = fFilteredTree.getFilterControl(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatAction.java index 868cd2d63d..aee9c7d7db 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -27,10 +27,12 @@ public class FormatAction extends Action { setText(PDEUIMessages.FormatManifestAction_actionText); } + @Override public void runWithEvent(Event event) { run(); } + @Override public void run() { if (fTextEditor == null || fTextEditor.getEditorInput() == null) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatOperation.java index fb03f245c8..12139bb330 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/FormatOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -37,6 +37,7 @@ public class FormatOperation implements IRunnableWithProgress { fObjects = objects; } + @Override public void run(IProgressMonitor mon) throws InvocationTargetException, InterruptedException { mon.beginTask(PDEUIMessages.FormatManifestOperation_task, fObjects.length); for (int i = 0; !mon.isCanceled() && i < fObjects.length; i++) { @@ -53,6 +54,7 @@ public class FormatOperation implements IRunnableWithProgress { public static void format(IFile file, IProgressMonitor mon) { PDEModelUtility.modifyModel(new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) { IBundleModel bundleModel = ((IBundlePluginModelBase) model).getBundleModel(); @@ -65,6 +67,7 @@ public class FormatOperation implements IRunnableWithProgress { } } + @Override public boolean saveOpenEditor() { return false; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/HyperlinkAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/HyperlinkAction.java index 67eea5dffb..6fff4b13d3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/HyperlinkAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/HyperlinkAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -35,6 +35,7 @@ public class HyperlinkAction extends Action implements MouseListener, KeyListene setEnabled(false); } + @Override public void run() { if (fLink != null) fLink.open(); @@ -117,24 +118,29 @@ public class HyperlinkAction extends Action implements MouseListener, KeyListene setToolTipText(text); } + @Override public void mouseDoubleClick(MouseEvent e) { // Ignore } + @Override public void mouseDown(MouseEvent e) { // Ignore } + @Override public void mouseUp(MouseEvent e) { setEnabled(detectHyperlink()); generateActionText(); } + @Override public void keyPressed(KeyEvent e) { setEnabled(detectHyperlink()); generateActionText(); } + @Override public void keyReleased(KeyEvent e) { // Ignore } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/OpenSchemaAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/OpenSchemaAction.java index 26dee04759..3fbc8f13f1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/OpenSchemaAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/OpenSchemaAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -166,6 +166,7 @@ public class OpenSchemaAction extends Action { /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { // Ensure the schema is defined if (fSchema == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/SortAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/SortAction.java index a57dac0238..ba2e1c64a5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/SortAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/SortAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 SortAction extends Action { /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { // Toggle sorting on/off if (fSorted) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ToggleExpandStateAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ToggleExpandStateAction.java index 4155a16ec6..c50a248432 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ToggleExpandStateAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/actions/ToggleExpandStateAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2015 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 @@ -41,6 +41,7 @@ public class ToggleExpandStateAction extends Action { fFilteredTree = filteredTree; } + @Override public void run() { StructuredSelection selection = (StructuredSelection) fExtensionTree.getSelection(); if (fExtensionTree.getTree().getSelectionCount() > 0) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/AddLibraryDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/AddLibraryDialog.java index 30890c6ff7..513e10cdd9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/AddLibraryDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/AddLibraryDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -60,6 +60,7 @@ public class AddLibraryDialog extends SelectionStatusDialog { } class TableContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object input) { if (input instanceof IPluginModelBase) { return ((IPluginModelBase) input).getPluginBase().getLibraries(); @@ -69,10 +70,12 @@ public class AddLibraryDialog extends SelectionStatusDialog { } class TableLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { return ((IPluginLibrary) obj).getName(); } + @Override public Image getColumnImage(Object obj, int index) { return libImage; } @@ -101,6 +104,7 @@ public class AddLibraryDialog extends SelectionStatusDialog { this.libraries = libraries; } + @Override protected Control createDialogArea(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -117,6 +121,7 @@ public class AddLibraryDialog extends SelectionStatusDialog { text = new Text(container, SWT.SINGLE | SWT.BORDER); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { updateStatus(validator.validate(text.getText())); } @@ -132,6 +137,7 @@ public class AddLibraryDialog extends SelectionStatusDialog { libraryViewer.setContentProvider(new TableContentProvider()); libraryViewer.setLabelProvider(new TableLabelProvider()); libraryViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent e) { ISelection sel = e.getSelection(); IPluginLibrary obj = (IPluginLibrary) ((IStructuredSelection) sel).getFirstElement(); @@ -146,17 +152,20 @@ public class AddLibraryDialog extends SelectionStatusDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.BUILD_ADD_LIBRARY_DIALOG); } + @Override public int open() { text.setText(init); text.selectAll(); return super.open(); } + @Override protected void computeResult() { } @@ -168,6 +177,7 @@ public class AddLibraryDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ + @Override protected void okPressed() { newName = text.getText(); super.okPressed(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildClasspathSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildClasspathSection.java index 7e91eae926..6a5848b30c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildClasspathSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildClasspathSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -71,6 +71,7 @@ public class BuildClasspathSection extends TableSection { /* * @see org.eclipse.ui.dialogs.ISelectionValidator#isValid(java.lang.Object) */ + @Override public IStatus validate(Object[] elements) { if (isValid(elements)) { return new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, "", //$NON-NLS-1$ @@ -109,6 +110,7 @@ public class BuildClasspathSection extends TableSection { } class TableContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (parent instanceof IBuildModel) { IBuild build = ((IBuildModel) parent).getBuild(); @@ -122,10 +124,12 @@ public class BuildClasspathSection extends TableSection { } class TableLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { return obj.toString(); } + @Override public Image getColumnImage(Object obj, int index) { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); return sharedImages.getImage(ISharedImages.IMG_OBJ_FILE); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildContentsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildContentsSection.java index 4a58fae5ed..78d6e0108c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildContentsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildContentsSection.java @@ -43,6 +43,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso public class TreeContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object parent) { if (parent instanceof IContainer) { try { @@ -57,6 +58,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso /** * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ + @Override public Object[] getChildren(Object parent) { try { if (parent instanceof IFolder) @@ -89,6 +91,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso /** * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) */ + @Override public Object getParent(Object element) { if (element != null && element instanceof IResource) { return ((IResource) element).getParent(); @@ -99,6 +102,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso /** * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ + @Override public boolean hasChildren(Object element) { if (element instanceof IFolder) return getChildren(element).length > 0; @@ -110,6 +114,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso protected void createViewerPartControl(Composite parent, int style, int span, FormToolkit toolkit) { MenuManager popupMenuManager = new MenuManager(); IMenuListener listener = new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager mng) { fillContextMenu(mng); } @@ -153,10 +158,12 @@ public abstract class BuildContentsSection extends TableSection implements IReso fTreeViewer.setAutoExpandLevel(0); fTreeViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(final CheckStateChangedEvent event) { final Object element = event.getElement(); BusyIndicator.showWhile(section.getDisplay(), new Runnable() { + @Override public void run() { if (element instanceof IFile) { IFile file = (IFile) event.getElement(); @@ -252,10 +259,12 @@ public abstract class BuildContentsSection extends TableSection implements IReso protected void initializeCheckState(final IBuildEntry includes, final IBuildEntry excludes) { fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() { + @Override public void run() { // found slight improvements using Display.getCurrent() instead of fTreeViewer.getTree().getDisplay() BusyIndicator.showWhile(Display.getCurrent(), new Runnable() { + @Override public void run() { if (fTreeViewer.getTree().isDisposed()) return; @@ -479,6 +488,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso } } + @Override public void resourceChanged(IResourceChangeEvent event) { if (fTreeViewer.getControl().isDisposed()) return; @@ -495,6 +505,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso } } + @Override public boolean visit(IResourceDelta delta) throws CoreException { IResource resource = delta.getResource(); IProject project = fBuildModel.getUnderlyingResource().getProject(); @@ -515,6 +526,7 @@ public abstract class BuildContentsSection extends TableSection implements IReso if (!control.isDisposed()) { control.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (!fTreeViewer.getControl().isDisposed()) { fTreeViewer.refresh(true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditor.java index 31e25c24de..33acea4321 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditor.java @@ -57,6 +57,7 @@ public class BuildEditor extends MultiSourceEditor { return manager; } + @Override public void monitoredFileAdded(IFile file) { if (fInputContextManager == null) return; @@ -69,6 +70,7 @@ public class BuildEditor extends MultiSourceEditor { } } + @Override public boolean monitoredFileRemoved(IFile file) { //TODO may need to check with the user if there //are unsaved changes in the model for the @@ -81,6 +83,7 @@ public class BuildEditor extends MultiSourceEditor { addSourcePage(context.getId()); } + @Override public void contextRemoved(InputContext context) { close(false); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditorContributor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditorContributor.java index c65e391a0b..3610d101d8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditorContributor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildEditorContributor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -23,10 +23,12 @@ public class BuildEditorContributor extends PDEFormTextEditorContributor { return true; } + @Override public boolean supportsHyperlinking() { return true; } + @Override public boolean supportsCorrectionAssist() { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildHyperlinkDetector.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildHyperlinkDetector.java index e2af51bdc1..faa9ba7fa7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildHyperlinkDetector.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildHyperlinkDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -35,6 +35,7 @@ public class BuildHyperlinkDetector implements IHyperlinkDetector { /* * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion, boolean) */ + @Override public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { if (region == null) return null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContext.java index f0f3394e97..2d16e31568 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -40,10 +40,12 @@ public class BuildInputContext extends InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#getCharSet() */ + @Override protected String getDefaultCharset() { return "ISO-8859-1"; //$NON-NLS-1$ } + @Override protected IBaseModel createModel(IEditorInput input) throws CoreException { BuildModel model = null; if (input instanceof IStorageEditorInput) { @@ -72,6 +74,7 @@ public class BuildInputContext extends InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -79,6 +82,7 @@ public class BuildInputContext extends InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#addTextEditOperation(java.util.ArrayList, org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { Object[] objects = event.getChangedObjects(); for (int i = 0; i < objects.length; i++) { @@ -129,6 +133,7 @@ public class BuildInputContext extends InputContext { } } + @Override public void doRevert() { fEditOperations.clear(); fOperationTable.clear(); @@ -136,6 +141,7 @@ public class BuildInputContext extends InputContext { model.reconciled(model.getDocument()); } + @Override protected String getPartitionName() { return "___build_partition"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContextManager.java index a77f7630b4..1cd9a7de54 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildInputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -23,6 +23,7 @@ public class BuildInputContextManager extends InputContextManager { super(editor); } + @Override public IBaseModel getAggregateModel() { return findBuildModel(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildOutlinePage.java index f00e41f549..9c200cce40 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -21,6 +21,7 @@ public class BuildOutlinePage extends FormOutlinePage { super(editor); } + @Override protected Object[] getChildren(Object parent) { if (parent instanceof PDEFormPage) { PDEFormPage page = (PDEFormPage) parent; @@ -34,6 +35,7 @@ public class BuildOutlinePage extends FormOutlinePage { return new Object[0]; } + @Override protected String getParentPageId(Object item) { String pageId = null; if (item instanceof IBuildEntry) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildPage.java index ce8a73456c..1a43f8773c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -45,10 +45,12 @@ public class BuildPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.BUILD_PAGE; } + @Override protected void createFormContent(IManagedForm mform) { super.createFormContent(mform); FormToolkit toolkit = mform.getToolkit(); @@ -64,6 +66,7 @@ public class BuildPage extends PDEFormPage { label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fCustomButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean isCustom = fCustomButton.getSelection(); IBuildEntry customEntry = getCustomBuildEntry(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourcePage.java index 06d5d3f3b0..6bc8e6fb90 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -35,20 +35,24 @@ import org.eclipse.ui.texteditor.ChainedPreferenceStore; public class BuildSourcePage extends KeyValueSourcePage { class BuildOutlineContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parent) { return new Object[0]; } + @Override public boolean hasChildren(Object parent) { return false; } + @Override public Object getParent(Object child) { if (child instanceof IBuildEntry) return ((IBuildEntry) child).getModel(); return null; } + @Override public Object[] getElements(Object parent) { if (parent instanceof IBuildModel) { IBuildModel model = (IBuildModel) parent; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourceViewerConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourceViewerConfiguration.java index 84e0a390e4..6c7ee3e663 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourceViewerConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildSourceViewerConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -37,6 +37,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi private abstract class AbstractJavaScanner extends BasePDEScanner { + @Override public void adaptToPreferenceChange(PropertyChangeEvent event) { String property = event.getProperty(); if (affectsTextPresentation(property)) { @@ -54,6 +55,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi } } + @Override protected TextAttribute createTextAttribute(String property) { Color color = fColorManager.getColor(property); int style = SWT.NORMAL; @@ -79,14 +81,17 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi initialize(); } + @Override public boolean affectsTextPresentation(String property) { return property.startsWith(fProperty); } + @Override protected Token getTokenAffected(PropertyChangeEvent event) { return (Token) fDefaultReturnToken; } + @Override protected void initialize() { setDefaultReturnToken(new Token(createTextAttribute(fProperty))); } @@ -96,6 +101,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi public class AssignmentDetector implements IWordDetector { + @Override public boolean isWordStart(char c) { if ('=' != c && ':' != c || fDocument == null) return false; @@ -112,6 +118,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi } } + @Override public boolean isWordPart(char c) { return false; } @@ -125,10 +132,12 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi initialize(); } + @Override public boolean affectsTextPresentation(String property) { return property.startsWith(PreferenceConstants.PROPERTIES_FILE_COLORING_VALUE) || property.startsWith(PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT) || property.startsWith(PreferenceConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT); } + @Override protected Token getTokenAffected(PropertyChangeEvent event) { String property = event.getProperty(); if (property.startsWith(PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT)) @@ -138,6 +147,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi return (Token) fDefaultReturnToken; } + @Override protected void initialize() { IRule[] rules = new IRule[3]; fArgumentToken = new Token(createTextAttribute(PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT)); @@ -147,6 +157,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi rules[1] = new WordRule(new AssignmentDetector(), fAssignmentToken); rules[2] = new WhitespaceRule(new IWhitespaceDetector() { + @Override public boolean isWhitespace(char c) { return Character.isWhitespace(c); } @@ -167,6 +178,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi fCommentScanner = new SingleTokenJavaScanner(PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT); } + @Override public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { PresentationReconciler reconciler = new PresentationReconciler(); reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); @@ -186,6 +198,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi return reconciler; } + @Override public void adaptToPreferenceChange(PropertyChangeEvent event) { if (affectsColorPresentation(event)) fColorManager.handlePropertyChangeEvent(event); @@ -194,6 +207,7 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi fPropertyValueScanner.adaptToPreferenceChange(event); } + @Override public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { int length = PARTITIONS.length; String[] contentTypes = new String[length + 1]; @@ -204,15 +218,18 @@ public class BuildSourceViewerConfiguration extends ChangeAwareSourceViewerConfi return contentTypes; } + @Override public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) { return PROPERTIES_FILE_PARTITIONING; } + @Override public boolean affectsTextPresentation(PropertyChangeEvent event) { String property = event.getProperty(); return fCommentScanner.affectsTextPresentation(property) || fPropertyKeyScanner.affectsTextPresentation(property) || fPropertyValueScanner.affectsTextPresentation(property); } + @Override public boolean affectsColorPresentation(PropertyChangeEvent event) { String property = event.getProperty(); return property.equals(PreferenceConstants.PROPERTIES_FILE_COLORING_VALUE) || property.equals(PreferenceConstants.PROPERTIES_FILE_COLORING_ARGUMENT) || property.equals(PreferenceConstants.PROPERTIES_FILE_COLORING_ASSIGNMENT) || property.equals(PreferenceConstants.PROPERTIES_FILE_COLORING_KEY) || property.equals(PreferenceConstants.PROPERTIES_FILE_COLORING_COMMENT); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildUndoManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildUndoManager.java index e4d89fbaf5..f7f295036a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildUndoManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/BuildUndoManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -26,12 +26,14 @@ public class BuildUndoManager extends ModelUndoManager { setUndoLevelLimit(30); } + @Override protected String getPageId(Object obj) { if (obj instanceof IBuildEntry) return BuildPage.PAGE_ID; return null; } + @Override protected void execute(IModelChangedEvent event, boolean undo) { Object[] elements = event.getChangedObjects(); int type = event.getChangeType(); @@ -102,6 +104,7 @@ public class BuildUndoManager extends ModelUndoManager { } } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.CHANGE) { Object obj = event.getChangedObjects()[0]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/JARFileFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/JARFileFilter.java index 945283b9f2..fbd66bf156 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/JARFileFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/JARFileFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ public class JARFileFilter extends ViewerFilter { fPaths = names; } + @Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IFile) return isFileValid(((IFile) element).getProjectRelativePath()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/RuntimeInfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/RuntimeInfoSection.java index c5d467abd5..58dbcf994d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/RuntimeInfoSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/build/RuntimeInfoSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -108,6 +108,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo public class LibraryContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (parent instanceof IBuildModel) { IBuild build = ((IBuildModel) parent).getBuild(); @@ -133,6 +134,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo } public class LibraryLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { String name = ((IBuildEntry) obj).getName(); if (name.startsWith(IBuildEntry.JAR_PREFIX)) @@ -140,6 +142,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo return name; } + @Override public Image getColumnImage(Object obj, int index) { PDELabelProvider provider = PDEPlugin.getDefault().getLabelProvider(); return provider.get(PDEPluginImages.DESC_JAVA_LIB_OBJ); @@ -158,16 +161,19 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo } public class FolderContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { return (parent instanceof IBuildEntry) ? ((IBuildEntry) parent).getTokens() : new Object[0]; } } public class FolderLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { return obj.toString(); } + @Override public Image getColumnImage(Object obj, int index) { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); return sharedImages.getImage(ISharedImages.IMG_OBJ_FOLDER); @@ -320,6 +326,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { fillLibraryContextMenu(manager); } @@ -345,6 +352,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { fillFolderViewerContextMenu(manager); } @@ -504,6 +512,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo String oldName = entry.getName().substring(7); RenameDialog dialog = new RenameDialog(fLibraryViewer.getControl().getShell(), true, getLibraryNames(), oldName); dialog.setInputValidator(new IInputValidator() { + @Override public String isValid(String newText) { if (newText.indexOf(' ') != -1) return PDEUIMessages.AddLibraryDialog_nospaces; @@ -624,6 +633,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo final IPluginModelBase pluginModelBase = (pmodel instanceof IPluginModelBase) ? (IPluginModelBase) pmodel : null; BusyIndicator.showWhile(fLibraryViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { IBuildModel buildModel = getBuildModel(); IBuild build = buildModel.getBuild(); @@ -796,6 +806,7 @@ public class RuntimeInfoSection extends PDESection implements IBuildPropertiesCo dialog.setMessage(message); dialog.setValidator(new ISelectionStatusValidator() { + @Override public IStatus validate(Object[] selection) { String id = PDEPlugin.getPluginId(); if (selection == null || selection.length != 1 || !(selection[0] instanceof IFolder)) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryDetailsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryDetailsSection.java index 20aac99a20..5850e07204 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryDetailsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryDetailsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2013 EclipseSource and others. All rights reserved. This +* Copyright (c) 2013, 2015 EclipseSource 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 @@ -263,6 +263,7 @@ public class CategoryDetailsSection extends PDESection implements IPartSelection super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryEditor.java index ad9203ac04..6f5fea2443 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 EclipseSource and others. All rights reserved. This + * Copyright (c) 2009, 2015 EclipseSource 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 @@ -31,36 +31,44 @@ public class CategoryEditor extends PDEFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#getEditorID() */ + @Override protected String getEditorID() { return IPDEUIConstants.CATEGORY_EDITOR_ID; } + @Override protected void createResourceContexts(InputContextManager manager, IFileEditorInput input) { manager.putContext(input, new CategoryInputContext(this, input, true)); manager.monitorFile(input.getFile()); } + @Override protected InputContextManager createInputContextManager() { CategoryInputContextManager contextManager = new CategoryInputContextManager(this); contextManager.setUndoManager(new CategoryUndoManager(this)); return contextManager; } + @Override public void monitoredFileAdded(IFile file) { // do nothing } + @Override public boolean monitoredFileRemoved(IFile file) { return true; } + @Override public void editorContextAdded(InputContext context) { } + @Override public void contextRemoved(InputContext context) { close(false); } + @Override protected void createSystemFileContexts(InputContextManager manager, FileStoreEditorInput input) { try { IFileStore store = EFS.getStore(input.getURI()); @@ -71,14 +79,17 @@ public class CategoryEditor extends PDEFormEditor { } } + @Override protected void createStorageContexts(InputContextManager manager, IStorageEditorInput input) { manager.putContext(input, new CategoryInputContext(this, input, true)); } + @Override protected void contextMenuAboutToShow(IMenuManager manager) { super.contextMenuAboutToShow(manager); } + @Override protected void addEditorPages() { try { addPage(new IUsPage(this)); @@ -88,10 +99,12 @@ public class CategoryEditor extends PDEFormEditor { } } + @Override protected String computeInitialPageId() { return IUsPage.PAGE_ID; } + @Override protected ISortableContentOutlinePage createContentOutline() { return new CategoryOutlinePage(this); } @@ -100,6 +113,7 @@ public class CategoryEditor extends PDEFormEditor { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#getInputContext(java.lang.Object) */ + @Override protected InputContext getInputContext(Object object) { InputContext context = null; if (object instanceof ISiteObject) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContext.java index 071e9c128c..3ef9e3b130 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009, 2012 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -42,6 +42,7 @@ public class CategoryInputContext extends XMLInputContext { create(); } + @Override protected IBaseModel createModel(IEditorInput input) { IBaseModel model = null; InputStream is = null; @@ -94,6 +95,7 @@ public class CategoryInputContext extends XMLInputContext { return model; } + @Override public void dispose() { ISiteModel model = (ISiteModel) getModel(); if (storageModel) { @@ -102,6 +104,7 @@ public class CategoryInputContext extends XMLInputContext { super.dispose(); } + @Override protected void flushModel(IDocument doc) { // if model is dirty, flush its content into // the document so that the source editor will @@ -127,6 +130,7 @@ public class CategoryInputContext extends XMLInputContext { } } + @Override protected boolean synchronizeModel(IDocument doc) { ISiteModel model = (ISiteModel) getModel(); boolean cleanModel = true; @@ -153,6 +157,7 @@ public class CategoryInputContext extends XMLInputContext { * * @see org.eclipse.pde.internal.ui.neweditor.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -163,15 +168,18 @@ public class CategoryInputContext extends XMLInputContext { * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#addTextEditOperation(java.util.ArrayList, * org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.XMLInputContext#reorderInsertEdits(java.util.ArrayList) */ + @Override protected void reorderInsertEdits(ArrayList<TextEdit> ops) { } + @Override protected String getPartitionName() { return "___category_partition"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContextManager.java index adf72f4718..db3ce888eb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryInputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -22,6 +22,7 @@ public class CategoryInputContextManager extends InputContextManager { super(editor); } + @Override public IBaseModel getAggregateModel() { return findSiteModel(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryLabelProvider.java index 7be997ae87..8d068bbd9f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009, 2013 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -42,6 +42,7 @@ class CategoryLabelProvider extends LabelProvider { fSharedProvider.connect(this); } + @Override public Image getImage(Object element) { if (element instanceof ISiteCategoryDefinition) return fCatDefImage; @@ -62,6 +63,7 @@ class CategoryLabelProvider extends LabelProvider { return fSharedProvider.getImage(element); } + @Override public String getText(Object element) { if (element instanceof ISiteCategoryDefinition) return ((ISiteCategoryDefinition) element).getName(); @@ -81,6 +83,7 @@ class CategoryLabelProvider extends LabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.BaseLabelProvider#dispose() */ + @Override public void dispose() { fSharedProvider.disconnect(this); // Dispose of images diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryOutlinePage.java index 821cd8be96..3ddc5466e4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009, 2013 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -28,6 +28,7 @@ public class CategoryOutlinePage extends FormOutlinePage { super(editor); } + @Override protected Object[] getChildren(Object parent) { if (parent instanceof PDEFormPage) { PDEFormPage page = (PDEFormPage) parent; @@ -85,6 +86,7 @@ public class CategoryOutlinePage extends FormOutlinePage { return new Object[0]; } + @Override protected String getParentPageId(Object item) { String pageId = null; if (item instanceof ISiteCategoryDefinition || item instanceof SiteFeatureAdapter || item instanceof SiteBundleAdapter) @@ -99,6 +101,7 @@ public class CategoryOutlinePage extends FormOutlinePage { * * @see org.eclipse.pde.internal.ui.editor.FormOutlinePage#createLabelProvider() */ + @Override public ILabelProvider createLabelProvider() { fLabelProvider = new CategoryLabelProvider(); return fLabelProvider; @@ -109,6 +112,7 @@ public class CategoryOutlinePage extends FormOutlinePage { * * @see org.eclipse.pde.internal.ui.editor.FormOutlinePage#dispose() */ + @Override public void dispose() { super.dispose(); if (fLabelProvider != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategorySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategorySection.java index 8d48bc0fa0..70867bcaa3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategorySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategorySection.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009, 2013 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -55,6 +55,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene private LabelProvider fSiteLabelProvider; class CategoryContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object inputElement) { // model = (ISite) inputElement; ArrayList<IWritable> result = new ArrayList<IWritable>(); @@ -75,6 +76,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return result.toArray(); } + @Override public Object[] getChildren(Object parent) { if (parent instanceof ISiteCategoryDefinition) { ISiteCategoryDefinition catDef = (ISiteCategoryDefinition) parent; @@ -102,10 +104,12 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return new Object[0]; } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof ISiteCategoryDefinition) { ISiteCategoryDefinition catDef = (ISiteCategoryDefinition) element; @@ -144,6 +148,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @see org.eclipse.update.ui.forms.internal.FormSection#createClient(org.eclipse.swt.widgets.Composite, * org.eclipse.update.ui.forms.internal.FormWidgetFactory) */ + @Override public void createClient(Section section, FormToolkit toolkit) { fModel = (ISiteModel) getPage().getModel(); fModel.addModelChangedListener(this); @@ -161,6 +166,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene Transfer[] transfers = new Transfer[] {ModelDataTransfer.getInstance()}; if (isEditable()) { fCategoryViewer.addDropSupport(ops, transfers, new ViewerDropAdapter(fCategoryViewer) { + @Override public void dragEnter(DropTargetEvent event) { Object target = determineTarget(event); if (target == null && event.detail == DND.DROP_COPY) { @@ -174,6 +180,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * * @see org.eclipse.jface.viewers.ViewerDropAdapter#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent) */ + @Override public void dragOperationChanged(DropTargetEvent event) { Object target = determineTarget(event); if (target == null && event.detail == DND.DROP_COPY) { @@ -187,6 +194,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * * @see org.eclipse.jface.viewers.ViewerDropAdapter#dragOver(org.eclipse.swt.dnd.DropTargetEvent) */ + @Override public void dragOver(DropTargetEvent event) { Object target = determineTarget(event); if (target == null && event.detail == DND.DROP_COPY) { @@ -206,6 +214,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @return one of the <code>LOCATION_* </code> * constants defined in this class */ + @Override protected int determineLocation(DropTargetEvent event) { if (!(event.item instanceof Item)) { return LOCATION_NONE; @@ -222,6 +231,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return LOCATION_ON; } + @Override public boolean performDrop(Object data) { if (!(data instanceof Object[])) return false; @@ -248,6 +258,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return false; } + @Override public boolean validateDrop(Object target, int operation, TransferData transferType) { return (target instanceof ISiteCategoryDefinition || target == null); } @@ -256,6 +267,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } fCategoryViewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY, transfers, new DragSourceListener() { + @Override public void dragStart(DragSourceEvent event) { IStructuredSelection ssel = (IStructuredSelection) fCategoryViewer.getSelection(); if (ssel == null || ssel.isEmpty() || !(ssel.getFirstElement() instanceof SiteFeatureAdapter || ssel.getFirstElement() instanceof SiteBundleAdapter)) { @@ -263,11 +275,13 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override public void dragSetData(DragSourceEvent event) { IStructuredSelection ssel = (IStructuredSelection) fCategoryViewer.getSelection(); event.data = ssel.toArray(); } + @Override public void dragFinished(DragSourceEvent event) { } }); @@ -375,6 +389,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override protected void buttonSelected(int index) { switch (index) { case BUTTON_ADD_CATEGORY : @@ -389,6 +404,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override protected void handleDoubleClick(IStructuredSelection ssel) { super.handleDoubleClick(ssel); Object selected = ssel.getFirstElement(); @@ -400,6 +416,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override protected void selectionChanged(IStructuredSelection selection) { getPage().getPDEEditor().setSelection(selection); } @@ -572,6 +589,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return null; } + @Override public void dispose() { super.dispose(); FeatureModelManager mng = PDECore.getDefault().getFeatureModelManager(); @@ -581,8 +599,10 @@ public class CategorySection extends TreeSection implements IFeatureModelListene fSiteLabelProvider.dispose(); } + @Override protected void fillContextMenu(IMenuManager manager) { Action removeAction = new Action(PDEUIMessages.CategorySection_remove) { + @Override public void run() { doGlobalAction(ActionFactory.DELETE.getId()); } @@ -592,6 +612,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene getPage().getPDEEditor().getContributor().contextMenuAboutToShow(manager); } + @Override public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.CUT.getId())) { handleRemove(); @@ -611,11 +632,13 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return false; } + @Override public void refresh() { fCategoryViewer.refresh(); super.refresh(); } + @Override public void modelChanged(IModelChangedEvent e) { markStale(); } @@ -632,6 +655,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doPaste(java.lang.Object, * java.lang.Object[]) */ + @Override protected void doPaste(Object target, Object[] objects) { try { for (int i = 0; i < objects.length; i++) { @@ -653,6 +677,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canPaste(java.lang.Object, * java.lang.Object[]) */ + @Override protected boolean canPaste(Object target, Object[] objects) { if (target == null || target instanceof ISiteCategoryDefinition) { for (int i = 0; i < objects.length; i++) { @@ -696,6 +721,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene private void handleNewFeature() { final Control control = fCategoryViewer.getControl(); BusyIndicator.showWhile(control.getDisplay(), new Runnable() { + @Override public void run() { IFeatureModel[] allModels = PDECore.getDefault().getFeatureModelManager().getModels(); ArrayList<IFeatureModel> newModels = new ArrayList<IFeatureModel>(); @@ -720,6 +746,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene private void handleNewBundle() { final Control control = fCategoryViewer.getControl(); BusyIndicator.showWhile(control.getDisplay(), new Runnable() { + @Override public void run() { IPluginModelBase[] allModels = PluginRegistry.getAllModels(); ArrayList<IPluginModelBase> newModels = new ArrayList<IPluginModelBase>(); @@ -904,6 +931,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#setFormInput(java.lang.Object) */ + @Override public boolean setFormInput(Object input) { if (input instanceof ISiteCategoryDefinition) { fCategoryViewer.setSelection(new StructuredSelection(input), true); @@ -934,6 +962,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } + @Override public void modelsChanged(IFeatureModelDelta delta) { markStale(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryUndoManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryUndoManager.java index e20868e0fb..909750240d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryUndoManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/CategoryUndoManager.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009, 2013 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -24,6 +24,7 @@ public class CategoryUndoManager extends ModelUndoManager { setUndoLevelLimit(30); } + @Override protected String getPageId(Object obj) { if (obj instanceof ISiteFeature || obj instanceof ISiteBundle || obj instanceof ISiteCategory || obj instanceof ISiteCategoryDefinition) { return IUsPage.PAGE_ID; @@ -36,6 +37,7 @@ public class CategoryUndoManager extends ModelUndoManager { /* * @see IModelUndoManager#execute(ModelUndoOperation) */ + @Override protected void execute(IModelChangedEvent event, boolean undo) { IModelChangeProvider model = event.getChangeProvider(); Object[] elements = event.getChangedObjects(); @@ -138,6 +140,7 @@ public class CategoryUndoManager extends ModelUndoManager { } } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.CHANGE) { Object object = event.getChangedObjects()[0]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/DownloadStatsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/DownloadStatsSection.java index 30907da8f4..098ba28c87 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/DownloadStatsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/DownloadStatsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Rapicorp Corporation and others. + * Copyright (c) 2014, 2015 Rapicorp 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 @@ -49,6 +49,7 @@ public class DownloadStatsSection extends TableSection { private ISiteModel fModel; class ArtifactsContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object inputElement) { // model = (IStatsInfo) inputElement; ArrayList<IWritable> result = new ArrayList<IWritable>(); @@ -82,6 +83,7 @@ public class DownloadStatsSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { fModel = (ISiteModel) getPage().getModel(); fModel.addModelChangedListener(this); @@ -103,6 +105,7 @@ public class DownloadStatsSection extends TableSection { IActionBars actionBars = getPage().getPDEEditor().getEditorSite().getActionBars(); fURLEntry = new FormEntry(urlContainer, toolkit, PDEUIMessages.StatsSection_url, SWT.NONE); fURLEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { getStatsInfo().setURL(entry.getValue()); @@ -145,6 +148,7 @@ public class DownloadStatsSection extends TableSection { section.setDescription(PDEUIMessages.StatsSection_description); } + @Override protected void buttonSelected(int index) { switch (index) { case 0 : @@ -209,6 +213,7 @@ public class DownloadStatsSection extends TableSection { updateButtons(); } + @Override protected void handleDoubleClick(IStructuredSelection ssel) { super.handleDoubleClick(ssel); Object selected = ssel.getFirstElement(); @@ -255,6 +260,7 @@ public class DownloadStatsSection extends TableSection { private void handleNewFeature() { final Control control = fArtifactTable.getControl(); BusyIndicator.showWhile(control.getDisplay(), new Runnable() { + @Override public void run() { IFeatureModel[] allModels = PDECore.getDefault().getFeatureModelManager().getModels(); ArrayList<IFeatureModel> newModels = new ArrayList<IFeatureModel>(); @@ -279,6 +285,7 @@ public class DownloadStatsSection extends TableSection { private void handleNewBundle() { final Control control = fArtifactTable.getControl(); BusyIndicator.showWhile(control.getDisplay(), new Runnable() { + @Override public void run() { IPluginModelBase[] allModels = PluginRegistry.getAllModels(); ArrayList<IPluginModelBase> newModels = new ArrayList<IPluginModelBase>(); @@ -412,6 +419,7 @@ public class DownloadStatsSection extends TableSection { } } + @Override protected void selectionChanged(IStructuredSelection selection) { getPage().getPDEEditor().setSelection(selection); updateButtons(); @@ -421,6 +429,7 @@ public class DownloadStatsSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { IStatsInfo info = getStatsInfo(); fURLEntry.setValue(info.getURL(), true); @@ -428,11 +437,13 @@ public class DownloadStatsSection extends TableSection { super.refresh(); } + @Override public void commit(boolean onSave) { fURLEntry.commit(); super.commit(onSave); } + @Override public void cancelEdit() { fURLEntry.cancelEdit(); super.cancelEdit(); @@ -459,6 +470,7 @@ public class DownloadStatsSection extends TableSection { return fModel.getSite(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -470,6 +482,7 @@ public class DownloadStatsSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here fArtifactTable.setInput(getStatsInfo()); @@ -480,6 +493,7 @@ public class DownloadStatsSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { ISiteModel model = getModel(); if (model != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/IUsPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/IUsPage.java index c0f2b75f7c..99f3572834 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/IUsPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/IUsPage.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009, 2013 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -28,13 +28,16 @@ public class IUsPage extends PDEFormPage { super(IUsPage.this); } + @Override protected PDESection createMasterSection(IManagedForm managedForm, Composite parent) { fCategorySection = new CategorySection(getPage(), parent); return fCategorySection; } + @Override protected void registerPages(DetailsPart detailsPart) { detailsPart.setPageProvider(new IDetailsPageProvider() { + @Override public Object getPageKey(Object object) { if (object instanceof SiteFeatureAdapter) return SiteFeatureAdapter.class; @@ -46,6 +49,7 @@ public class IUsPage extends PDEFormPage { return object.getClass(); } + @Override public IDetailsPage getPage(Object key) { if (key.equals(ISiteCategoryDefinition.class)) return createCategoryDetails(); @@ -60,6 +64,7 @@ public class IUsPage extends PDEFormPage { fBlock = new SiteFeaturesBlock(); } + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -72,16 +77,19 @@ public class IUsPage extends PDEFormPage { private IDetailsPage createCategoryDetails() { return new PDEDetailsSections() { + @Override protected PDESection[] createSections(PDEFormPage page, Composite parent) { return new PDESection[] {new CategoryDetailsSection(getPage(), parent)}; } + @Override public String getContextId() { return CategoryInputContext.CONTEXT_ID; } }; } + @Override protected String getHelpResource() { return IHelpContextIds.CATEGORY_EDITOR; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryMetadataPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryMetadataPage.java index 7bb7336071..f9c31d2c5c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryMetadataPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryMetadataPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Rapicorp Corporation and others. + * Copyright (c) 2014, 2015 Rapicorp 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 @@ -31,6 +31,7 @@ public class RepositoryMetadataPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.UPDATES_PAGE; } @@ -38,6 +39,7 @@ public class RepositoryMetadataPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryReferenceSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryReferenceSection.java index 1a5440cd80..5bf22ff05b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryReferenceSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/RepositoryReferenceSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Rapicorp Corporation and others. + * Copyright (c) 2014, 2015 Rapicorp 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 @@ -48,6 +48,7 @@ public class RepositoryReferenceSection extends TableSection { setTitle(PDEUIMessages.RepositorySection_title); } + @Override protected Control createDialogArea(Composite parent) { Composite comp = (Composite) super.createDialogArea(parent); ((GridLayout) comp.getLayout()).numColumns = 2; @@ -60,6 +61,7 @@ public class RepositoryReferenceSection extends TableSection { target.setTransfer(new Transfer[] {URLTransfer.getInstance(), FileTransfer.getInstance()}); target.addDropListener(new TextURLDropAdapter(fLocation, true)); fLocation.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validate(); } @@ -95,6 +97,7 @@ public class RepositoryReferenceSection extends TableSection { updateStatus(Status.OK_STATUS); } + @Override protected void okPressed() { try { if (fEdit != null) { @@ -117,6 +120,7 @@ public class RepositoryReferenceSection extends TableSection { } } + @Override protected Control createHelpControl(Composite parent) { return parent; } @@ -139,6 +143,7 @@ public class RepositoryReferenceSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof ISite) { return ((ISite) inputElement).getRepositoryReferences(); @@ -149,24 +154,28 @@ public class RepositoryReferenceSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } private class LabelProvider extends PDELabelProvider { + @Override public Image getColumnImage(Object obj, int index) { if (index == 0) return get(PDEPluginImages.DESC_REPOSITORY_OBJ); return null; } + @Override public String getColumnText(Object obj, int index) { IRepositoryReference repo = (IRepositoryReference) obj; switch (index) { @@ -238,9 +247,11 @@ public class RepositoryReferenceSection extends TableSection { table.addControlListener(new ControlListener() { + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { int size = table.getSize().x; locationColumn.setWidth(size / 6 * 5); @@ -404,6 +415,7 @@ public class RepositoryReferenceSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.core.IPluginModelListener#modelsChanged(org.eclipse.pde.internal.core.PluginModelDelta) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here fRepositoryTable.setInput(getSite()); @@ -437,6 +449,7 @@ public class RepositoryReferenceSection extends TableSection { fEnabledColumnEditor.minimumWidth = 50; table.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { showControls(); } @@ -463,6 +476,7 @@ public class RepositoryReferenceSection extends TableSection { combo.setText(item.getText(1)); combo.pack(); combo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { item.setText(1, combo.getText()); try { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteBundleAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteBundleAdapter.java index 26a1c07965..0dbfc4a29b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteBundleAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteBundleAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2013 Red Hat Inc. and others. All rights reserved. This +* Copyright (c) 2013, 2015 Red Hat Inc. 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 @@ -30,6 +30,7 @@ public class SiteBundleAdapter implements Serializable, IWritable { /* (non-Javadoc) * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter) */ + @Override public void write(String indent, PrintWriter writer) { bundle.write(indent, writer); } @@ -40,6 +41,7 @@ public class SiteBundleAdapter implements Serializable, IWritable { * * @see java.lang.Object#equals(java.lang.Object) */ + @Override public boolean equals(Object obj) { if (obj instanceof SiteBundleAdapter) { SiteBundleAdapter adapter = (SiteBundleAdapter) obj; @@ -60,6 +62,7 @@ public class SiteBundleAdapter implements Serializable, IWritable { /* (non-Javadoc) * @see java.lang.Object#hashCode() */ + @Override public int hashCode() { if (bundle.getId() == null) { return super.hashCode(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteFeatureAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteFeatureAdapter.java index 2e3ad94148..cf6df1e103 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteFeatureAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/category/SiteFeatureAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -29,6 +29,7 @@ public class SiteFeatureAdapter implements Serializable, IWritable { /* (non-Javadoc) * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter) */ + @Override public void write(String indent, PrintWriter writer) { feature.write(indent, writer); } @@ -39,6 +40,7 @@ public class SiteFeatureAdapter implements Serializable, IWritable { * * @see java.lang.Object#equals(java.lang.Object) */ + @Override public boolean equals(Object obj) { if (obj instanceof SiteFeatureAdapter) { SiteFeatureAdapter adapter = (SiteFeatureAdapter) obj; @@ -59,6 +61,7 @@ public class SiteFeatureAdapter implements Serializable, IWritable { /* (non-Javadoc) * @see java.lang.Object#hashCode() */ + @Override public int hashCode() { if (feature.getId() == null) { return super.hashCode(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeCompletionProposal.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeCompletionProposal.java index 0c5a7f18ec..021dc181cc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeCompletionProposal.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeCompletionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -112,6 +112,7 @@ public class TypeCompletionProposal extends AbstractJavaCompletionProposal imple /* (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension4#isAutoInsertable() */ + @Override public boolean isAutoInsertable() { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposal.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposal.java index 705c42c6b9..702dc50bc2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposal.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -34,6 +34,7 @@ public class TypeContentProposal implements IContentProposal { /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getContent() */ + @Override public String getContent() { return fContent; } @@ -41,6 +42,7 @@ public class TypeContentProposal implements IContentProposal { /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getCursorPosition() */ + @Override public int getCursorPosition() { if (fContent != null) { return fContent.length(); @@ -51,6 +53,7 @@ public class TypeContentProposal implements IContentProposal { /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getDescription() */ + @Override public String getDescription() { return fDescription; } @@ -58,6 +61,7 @@ public class TypeContentProposal implements IContentProposal { /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposal#getLabel() */ + @Override public String getLabel() { return fLabel; } @@ -69,6 +73,7 @@ public class TypeContentProposal implements IContentProposal { /* (non-Javadoc) * @see java.lang.Object#toString() */ + @Override public String toString() { return fLabel; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalListener.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalListener.java index 95d2daa12e..e6f4a271a7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalListener.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -29,6 +29,7 @@ public class TypeContentProposalListener implements IContentProposalListener, IC /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposalListener#proposalAccepted(org.eclipse.jface.fieldassist.IContentProposal) */ + @Override public void proposalAccepted(IContentProposal proposal) { // NO-OP } @@ -36,6 +37,7 @@ public class TypeContentProposalListener implements IContentProposalListener, IC /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposalListener2#proposalPopupClosed(org.eclipse.jface.fieldassist.ContentProposalAdapter) */ + @Override public void proposalPopupClosed(ContentProposalAdapter adapter) { IContentProposalProvider provider = adapter.getContentProposalProvider(); if (provider instanceof TypeContentProposalProvider) { @@ -47,6 +49,7 @@ public class TypeContentProposalListener implements IContentProposalListener, IC /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposalListener2#proposalPopupOpened(org.eclipse.jface.fieldassist.ContentProposalAdapter) */ + @Override public void proposalPopupOpened(ContentProposalAdapter adapter) { // NO-OP } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalProvider.java index c1a7608997..23cf04c8c5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeContentProposalProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -48,6 +48,7 @@ public class TypeContentProposalProvider extends TypePackageCompletionProcessor /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ + @Override public int compare(Object arg0, Object arg1) { String proposalSortKey1 = ((IContentProposal) arg0).getLabel(); String proposalSortKey2 = ((IContentProposal) arg1).getLabel(); @@ -58,6 +59,7 @@ public class TypeContentProposalProvider extends TypePackageCompletionProcessor /* (non-Javadoc) * @see org.eclipse.jface.fieldassist.IContentProposalProvider#getProposals(java.lang.String, int) */ + @Override public IContentProposal[] getProposals(String contents, int position) { // Generate a list of proposals based on the current contents ArrayList<Object> currentContentProposals = null; @@ -96,6 +98,7 @@ public class TypeContentProposalProvider extends TypePackageCompletionProcessor /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.contentassist.TypePackageCompletionProcessor#addProposalToCollection(java.util.Collection, int, int, java.lang.String, java.lang.String, org.eclipse.swt.graphics.Image) */ + @Override protected void addProposalToCollection(Collection<Object> collection, int startOffset, int length, String label, String content, Image image) { // Create content proposals for field assist // start offset and length not required diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypePackageCompletionProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypePackageCompletionProcessor.java index 70d61bc6de..61526dd975 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypePackageCompletionProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypePackageCompletionProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -40,26 +40,32 @@ public abstract class TypePackageCompletionProcessor implements IContentAssistPr fSearchEngine = new SearchEngine(); } + @Override public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { return null; } + @Override public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) { return null; } + @Override public char[] getCompletionProposalAutoActivationCharacters() { return null; } + @Override public char[] getContextInformationAutoActivationCharacters() { return null; } + @Override public IContextInformationValidator getContextInformationValidator() { return null; } + @Override public String getErrorMessage() { return fErrorMessage; } @@ -86,6 +92,7 @@ public abstract class TypePackageCompletionProcessor implements IContentAssistPr setIgnored(CompletionProposal.TYPE_REF, false); } + @Override public void accept(CompletionProposal proposal) { if (proposal.getKind() == CompletionProposal.PACKAGE_REF) { String pkgName = new String(proposal.getCompletion()); @@ -180,6 +187,7 @@ public abstract class TypePackageCompletionProcessor implements IContentAssistPr try { TypeNameRequestor req = new TypeNameRequestor() { + @Override public void acceptType(int modifiers, char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path) { // Accept search results from the JDT SearchEngine String cName = new String(simpleTypeName); @@ -212,6 +220,7 @@ public abstract class TypePackageCompletionProcessor implements IContentAssistPr /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ + @Override public int compare(Object arg0, Object arg1) { if (arg0 instanceof ICompletionProposal && arg1 instanceof ICompletionProposal) { ICompletionProposal p1 = (ICompletionProposal) arg0; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeProposalLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeProposalLabelProvider.java index 0c126c2854..b6a45d736d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeProposalLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/TypeProposalLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -30,6 +30,7 @@ public class TypeProposalLabelProvider extends LabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { if (element instanceof TypeContentProposal) { return ((TypeContentProposal) element).getImage(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/VirtualSchemaObject.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/VirtualSchemaObject.java index 162c109ded..2e3b665fca 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/VirtualSchemaObject.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/VirtualSchemaObject.java @@ -35,6 +35,7 @@ public class VirtualSchemaObject implements ISchemaObject { fType = type; } + @Override public String getDescription() { if (fDescription instanceof String) { return (String) fDescription; @@ -50,25 +51,31 @@ public class VirtualSchemaObject implements ISchemaObject { return null; } + @Override public String getName() { return fName; } + @Override public ISchemaObject getParent() { return null; } + @Override public ISchema getSchema() { return null; } + @Override public void setParent(ISchemaObject parent) { } + @Override public <T> T getAdapter(Class<T> adapter) { return null; } + @Override public void write(String indent, PrintWriter writer) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLCompletionProposal.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLCompletionProposal.java index 6da3deb80e..f03468750f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLCompletionProposal.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLCompletionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -62,6 +62,7 @@ public class XMLCompletionProposal implements ICompletionProposal, ICompletionPr fProcessor = processor; } + @Override public void apply(IDocument document) { ITextSelection sel = fProcessor.getCurrentSelection(); if (sel == null) { @@ -452,6 +453,7 @@ public class XMLCompletionProposal implements ICompletionProposal, ICompletionPr return indBuff.toString(); } + @Override public String getAdditionalProposalInfo() { if (fAddInfo == null) { if (fSchemaObject == null) @@ -473,10 +475,12 @@ public class XMLCompletionProposal implements ICompletionProposal, ICompletionPr return fAddInfo; } + @Override public IContextInformation getContextInformation() { return null; } + @Override public String getDisplayString() { if (fSchemaObject instanceof VirtualSchemaObject) { switch (((VirtualSchemaObject) fSchemaObject).getVType()) { @@ -497,6 +501,7 @@ public class XMLCompletionProposal implements ICompletionProposal, ICompletionPr return null; } + @Override public Image getImage() { if (fSchemaObject instanceof VirtualSchemaObject) return fProcessor.getImage(((VirtualSchemaObject) fSchemaObject).getVType()); @@ -507,19 +512,23 @@ public class XMLCompletionProposal implements ICompletionProposal, ICompletionPr return null; } + @Override public Point getSelection(IDocument document) { if (fSelOffset == -1) return null; return new Point(fSelOffset, fSelLen); } + @Override public Object getAdditionalProposalInfo(IProgressMonitor monitor) { return getAdditionalProposalInfo(); } + @Override public IInformationControlCreator getInformationControlCreator() { if (fCreator == null) { fCreator = new AbstractReusableInformationControlCreator() { + @Override public IInformationControl doCreateInformationControl(Shell parent) { if (BrowserInformationControl.isAvailable(parent)) return new BrowserInformationControl(parent, JFaceResources.DIALOG_FONT, false); @@ -530,10 +539,12 @@ public class XMLCompletionProposal implements ICompletionProposal, ICompletionPr return fCreator; } + @Override public int getPrefixCompletionStart(IDocument document, int completionOffset) { return 0; } + @Override public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) { return null; } @@ -541,6 +552,7 @@ public class XMLCompletionProposal implements ICompletionProposal, ICompletionPr /* (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension4#isAutoInsertable() */ + @Override public boolean isAutoInsertable() { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistProcessor.java index cee9300c9f..ebe5125d69 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -633,6 +633,7 @@ public class XMLContentAssistProcessor extends TypePackageCompletionProcessor im return proposals; } + @Override public void assistSessionEnded(ContentAssistEvent event) { fRange = null; @@ -647,10 +648,12 @@ public class XMLContentAssistProcessor extends TypePackageCompletionProcessor im fDocLen = -1; } + @Override public void assistSessionStarted(ContentAssistEvent event) { fAssistSessionStarted = true; } + @Override public void selectionChanged(ICompletionProposal proposal, boolean smartToggle) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistText.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistText.java index b221b99c96..1bbde1bb80 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistText.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLContentAssistText.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -130,6 +130,7 @@ public class XMLContentAssistText { /* (non-Javadoc) * @see java.lang.Object#toString() */ + @Override public String toString() { return "Start Offset: " + fStartOffset + " Text: |" + fText + "|\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLElementProposalComparator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLElementProposalComparator.java index 966973fc4b..17ccab4df8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLElementProposalComparator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/XMLElementProposalComparator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -23,6 +23,7 @@ public class XMLElementProposalComparator implements Comparator<Object> { /* (non-Javadoc) * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) */ + @Override public int compare(Object object1, Object object2) { String proposal1 = getSortKey((ISchemaElement) object1); String proposal2 = getSortKey((ISchemaElement) object2); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/display/JavaDocCommentReader.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/display/JavaDocCommentReader.java index addb35bf58..10ab8c7985 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/display/JavaDocCommentReader.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/contentassist/display/JavaDocCommentReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -44,6 +44,7 @@ public class JavaDocCommentReader extends SingleCharReader { /** * @see java.io.Reader#read() */ + @Override public int read() { if (fCurrPos < fEndPos) { char ch; @@ -73,6 +74,7 @@ public class JavaDocCommentReader extends SingleCharReader { /** * @see java.io.Reader#close() */ + @Override public void close() { fBuffer = null; } @@ -80,6 +82,7 @@ public class JavaDocCommentReader extends SingleCharReader { /** * @see java.io.Reader#reset() */ + @Override public void reset() { fCurrPos = fStartPos; fWasNewLine = true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContext.java index ba24e67c4f..ea9737b072 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -57,24 +57,29 @@ public abstract class InputContext { private boolean fMustSynchronize; class ElementListener implements IElementStateListener { + @Override public void elementContentAboutToBeReplaced(Object element) { } + @Override public void elementContentReplaced(Object element) { if (element != null && element.equals(fEditorInput)) doRevert(); } + @Override public void elementDeleted(Object element) { if (element != null && element.equals(fEditorInput)) dispose(); } + @Override public void elementDirtyStateChanged(Object element, boolean isDirty) { if (element != null && element.equals(fEditorInput)) fMustSynchronize = true; } + @Override public void elementMoved(Object originalElement, Object movedElement) { if (originalElement != null && originalElement.equals(fEditorInput)) { dispose(); @@ -116,6 +121,7 @@ public abstract class InputContext { protected IDocumentSetupParticipant getDocumentSetupParticipant() { return new IDocumentSetupParticipant() { + @Override public void setup(IDocument document) { } }; @@ -134,6 +140,7 @@ public abstract class InputContext { fModel = createModel(fEditorInput); if (fModel instanceof IModelChangeProvider) { fModelListener = new IModelChangedListener() { + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() != IModelChangedEvent.WORLD_CHANGED) { if (!fEditor.getLastDirtyState()) @@ -524,6 +531,7 @@ public abstract class InputContext { private WorkspaceModifyOperation createWorkspaceModifyOperation(final IEditorInput newInput) { WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { + @Override public void execute(final IProgressMonitor monitor) throws CoreException { // Save the old editor input content to the new editor input // location diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContextManager.java index 0d797fe574..acd648f9cb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/InputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -205,11 +205,13 @@ public abstract class InputContextManager implements IResourceChangeListener { /* (non-Javadoc) * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) */ + @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); try { delta.accept(new IResourceDeltaVisitor() { + @Override public boolean visit(IResourceDelta delta) { int kind = delta.getKind(); IResource resource = delta.getResource(); @@ -235,6 +237,7 @@ public abstract class InputContextManager implements IResourceChangeListener { Display display = shell != null ? shell.getDisplay() : Display.getDefault(); display.asyncExec(new Runnable() { + @Override public void run() { structureChanged(file, added); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/ManifestDocumentSetupParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/ManifestDocumentSetupParticipant.java index 40b29dc79c..f7d2e54443 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/ManifestDocumentSetupParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/ManifestDocumentSetupParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -18,6 +18,7 @@ import org.eclipse.pde.internal.ui.editor.text.ManifestPartitionScanner; public class ManifestDocumentSetupParticipant implements IDocumentSetupParticipant { + @Override public void setup(IDocument document) { IDocumentPartitioner partitioner = createDocumentPartitioner(); if (partitioner != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/UTF8InputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/UTF8InputContext.java index 55d8081993..93eb952cd3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/UTF8InputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/UTF8InputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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,6 +28,7 @@ public abstract class UTF8InputContext extends InputContext { super(editor, input, primary); } + @Override protected String getDefaultCharset() { return "UTF-8"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLDocumentSetupParticpant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLDocumentSetupParticpant.java index 3b61ffbd10..e2178209eb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLDocumentSetupParticpant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLDocumentSetupParticpant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class XMLDocumentSetupParticpant implements IDocumentSetupParticipant { public static final String XML_PARTITIONING = "_pde_xml_partitioning"; //$NON-NLS-1$ + @Override public void setup(IDocument document) { IDocumentPartitioner partitioner = createDocumentPartitioner(); if (partitioner != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLInputContext.java index 1d33578aa1..0e8808912a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/context/XMLInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -32,6 +32,7 @@ public abstract class XMLInputContext extends UTF8InputContext { super(editor, input, primary); } + @Override protected IDocumentSetupParticipant getDocumentSetupParticipant() { return new XMLDocumentSetupParticpant(); } @@ -39,6 +40,7 @@ public abstract class XMLInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#addTextEditOperation(java.util.ArrayList, org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { Object[] objects = event.getChangedObjects(); if (objects != null) { @@ -451,6 +453,7 @@ public abstract class XMLInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#flushModel(org.eclipse.jface.text.IDocument) */ + @Override protected void flushModel(IDocument doc) { removeUnnecessaryOperations(); if (fOperationTable.size() == 1) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/Choice.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/Choice.java index 6996816c69..f357f9b0c2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/Choice.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/Choice.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -27,6 +27,7 @@ public class Choice { return label; } + @Override public String toString() { return label; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/DataPortabilitySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/DataPortabilitySection.java index e9963a49db..a5ec462fc4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/DataPortabilitySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/DataPortabilitySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -163,6 +163,7 @@ public class DataPortabilitySection extends PDESection implements IPartSelection @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fOsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getOSChoices(); openPortabilityChoiceDialog(IEnvironment.P_OS, fOsText, choices); @@ -188,6 +189,7 @@ public class DataPortabilitySection extends PDESection implements IPartSelection @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fWsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getWSChoices(); openPortabilityChoiceDialog(IEnvironment.P_WS, fWsText, choices); @@ -214,6 +216,7 @@ public class DataPortabilitySection extends PDESection implements IPartSelection @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fNlText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getNLChoices(); openPortabilityChoiceDialog(IEnvironment.P_NL, fNlText, choices); @@ -239,6 +242,7 @@ public class DataPortabilitySection extends PDESection implements IPartSelection @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fArchText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getArchChoices(); openPortabilityChoiceDialog(IEnvironment.P_ARCH, fArchText, choices); @@ -332,6 +336,7 @@ public class DataPortabilitySection extends PDESection implements IPartSelection super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/EditorBuildFeatureAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/EditorBuildFeatureAction.java index ff5ccb18ca..f0dcdb083a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/EditorBuildFeatureAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/EditorBuildFeatureAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -37,6 +37,7 @@ public class EditorBuildFeatureAction extends Action { if (activeEditor.isDirty()) { try { IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { activeEditor.doSave(monitor); } @@ -50,6 +51,7 @@ public class EditorBuildFeatureAction extends Action { } } + @Override public void run() { ensureContentSaved(); FeatureExportWizard wizard = new FeatureExportWizard(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureDependenciesPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureDependenciesPage.java index 09db0b534b..015ea29be5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureDependenciesPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureDependenciesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -42,10 +42,12 @@ public class FeatureDependenciesPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_FEATURE_DEPENDENCIES; } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditor.java index 4d240d2b41..d00b2adf0d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditor.java @@ -123,6 +123,7 @@ public class FeatureEditor extends MultiSourceEditor implements IShowEditorInput return manager; } + @Override public void monitoredFileAdded(IFile file) { if (fInputContextManager == null) return; @@ -141,6 +142,7 @@ public class FeatureEditor extends MultiSourceEditor implements IShowEditorInput } } + @Override public boolean monitoredFileRemoved(IFile file) { // TODO may need to check with the user if there // are unsaved changes in the model for the @@ -153,6 +155,7 @@ public class FeatureEditor extends MultiSourceEditor implements IShowEditorInput addSourcePage(context.getId()); } + @Override public void contextRemoved(InputContext context) { if (context.isPrimary()) { close(true); @@ -354,6 +357,7 @@ public class FeatureEditor extends MultiSourceEditor implements IShowEditorInput return false; } + @Override public void showEditorInput(IEditorInput editorInput) { String name = editorInput.getName(); if (name.equals(ICoreConstants.FEATURE_FILENAME_DESCRIPTOR)) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorContributor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorContributor.java index 639a315c8f..8a150a4d0b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorContributor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorContributor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -27,6 +27,7 @@ public class FeatureEditorContributor extends PDEFormTextEditorContributor { super("&Feature"); //$NON-NLS-1$ } + @Override public void contextMenuAboutToShow(IMenuManager mng) { super.contextMenuAboutToShow(mng); mng.add(new Separator()); @@ -46,6 +47,7 @@ public class FeatureEditorContributor extends PDEFormTextEditorContributor { return fNewSiteAction; } + @Override protected void makeActions() { super.makeActions(); fBuildAction = new EditorBuildFeatureAction(); @@ -53,6 +55,7 @@ public class FeatureEditorContributor extends PDEFormTextEditorContributor { fNewSiteAction = new OpenProjectWizardAction(); } + @Override public void setActiveEditor(IEditorPart targetEditor) { super.setActiveEditor(targetEditor); if (targetEditor instanceof FeatureEditor) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorMatchingStrategy.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorMatchingStrategy.java index 2645049f05..899a855217 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorMatchingStrategy.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureEditorMatchingStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -18,6 +18,7 @@ import org.eclipse.ui.ide.ResourceUtil; public class FeatureEditorMatchingStrategy implements IEditorMatchingStrategy { + @Override public boolean matches(IEditorReference editorRef, IEditorInput input) { if (!(input instanceof IFileEditorInput)) return false; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureFormPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureFormPage.java index f9673973e3..51ffb338b4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureFormPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureFormPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,10 +44,12 @@ public class FeatureFormPage extends PDEFormPage implements IHyperlinkListener { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_FEATURE_OVERVIEW; } + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -174,6 +176,7 @@ public class FeatureFormPage extends PDEFormPage implements IHyperlinkListener { * * @see org.eclipse.ui.forms.events.HyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkActivated(HyperlinkEvent e) { String href = (String) e.getHref(); // try page references @@ -191,6 +194,7 @@ public class FeatureFormPage extends PDEFormPage implements IHyperlinkListener { getEditor().setActivePage(FeatureReferencePage.PAGE_ID); final FeatureEditorContributor contributor = (FeatureEditorContributor) getPDEEditor().getContributor(); BusyIndicator.showWhile(e.display, new Runnable() { + @Override public void run() { contributor.getSynchronizeAction().run(); } @@ -201,6 +205,7 @@ public class FeatureFormPage extends PDEFormPage implements IHyperlinkListener { getEditor().doSave(null); final FeatureEditorContributor contributor = (FeatureEditorContributor) getPDEEditor().getContributor(); BusyIndicator.showWhile(e.display, new Runnable() { + @Override public void run() { contributor.getNewSiteAction().run(); } @@ -213,6 +218,7 @@ public class FeatureFormPage extends PDEFormPage implements IHyperlinkListener { * * @see org.eclipse.ui.forms.events.HyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkEntered(HyperlinkEvent e) { IStatusLineManager mng = getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(e.getLabel()); @@ -223,6 +229,7 @@ public class FeatureFormPage extends PDEFormPage implements IHyperlinkListener { * * @see org.eclipse.ui.forms.events.HyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkExited(HyperlinkEvent e) { IStatusLineManager mng = getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(null); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureIncludesPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureIncludesPage.java index eaadd8629f..2eb755acb6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureIncludesPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureIncludesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,10 +43,12 @@ public class FeatureIncludesPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_FEATURE_ADVANCED; } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContext.java index 3b111cb2ec..9484a99e5c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -49,6 +49,7 @@ public class FeatureInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -56,6 +57,7 @@ public class FeatureInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#createModel(org.eclipse.ui.IEditorInput) */ + @Override protected IBaseModel createModel(IEditorInput input) throws CoreException { if (input instanceof IFileEditorInput) return createResourceModel((IFileEditorInput) input); @@ -111,9 +113,11 @@ public class FeatureInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#addTextEditOperation(java.util.ArrayList, org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { } + @Override protected void flushModel(IDocument doc) { // if model is dirty, flush its content into // the document so that the source editor will @@ -137,6 +141,7 @@ public class FeatureInputContext extends XMLInputContext { } } + @Override protected boolean synchronizeModel(IDocument doc) { IFeatureModel model = (IFeatureModel) getModel(); @@ -162,9 +167,11 @@ public class FeatureInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.XMLInputContext#reorderInsertEdits(java.util.ArrayList) */ + @Override protected void reorderInsertEdits(ArrayList<TextEdit> ops) { } + @Override protected String getPartitionName() { return "___feature_partition"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContextManager.java index 6358905103..2fc7b74b86 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureInputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -29,6 +29,7 @@ public class FeatureInputContextManager extends InputContextManager { super(editor); } + @Override public IBaseModel getAggregateModel() { return findFeatureModel(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureOutlinePage.java index 0cfe649a92..1e67b0c25a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -25,6 +25,7 @@ import org.eclipse.ui.forms.editor.IFormPage; public class FeatureOutlinePage extends FormOutlinePage { class ContentProvider extends BasicContentProvider { + @Override public Object[] getChildren(Object parent) { IFeatureModel model = (IFeatureModel) fEditor.getAggregateModel(); if (model != null && model.isValid()) { @@ -50,6 +51,7 @@ public class FeatureOutlinePage extends FormOutlinePage { return super.getChildren(parent); } + @Override public Object getParent(Object child) { String pageId = getParentPageId(child); if (pageId != null) @@ -66,10 +68,12 @@ public class FeatureOutlinePage extends FormOutlinePage { fDiscoveryUrls = new NamedElement(PDEUIMessages.FeatureOutlinePage_discoverUrls, folderImage); } + @Override public ITreeContentProvider createContentProvider() { return new ContentProvider(); } + @Override public String getParentPageId(Object item) { if (item instanceof IFeaturePlugin) return FeatureReferencePage.PAGE_ID; @@ -131,6 +135,7 @@ public class FeatureOutlinePage extends FormOutlinePage { return fEditor.findPage(getParentPageId(object)); } + @Override public void modelChanged(IModelChangedEvent event) { if (fTreeViewer.getControl().isDisposed()) { return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureReferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureReferencePage.java index 495802260d..af2b26bd4d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureReferencePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureReferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,10 +43,12 @@ public class FeatureReferencePage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_FEATURE_CONTENT; } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); FormToolkit toolkit = managedForm.getToolkit(); @@ -91,6 +93,7 @@ public class FeatureReferencePage extends PDEFormPage { super.createFormContent(managedForm); } + @Override public void setFocus() { fPluginSection.setFocus(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSourcePage.java index 2c470aa32a..cc65bbec00 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -19,10 +19,12 @@ public class FeatureSourcePage extends XMLSourcePage { super(editor, id, title); } + @Override public ILabelProvider createOutlineLabelProvider() { return null; } + @Override public ITreeContentProvider createOutlineContentProvider() { return null; } @@ -32,6 +34,7 @@ public class FeatureSourcePage extends XMLSourcePage { * * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#createOutlineSorter() */ + @Override public ViewerComparator createOutlineComparator() { return null; } @@ -39,10 +42,12 @@ public class FeatureSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#updateSelection(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void updateSelection(SelectionChangedEvent e) { // NO-OP } + @Override protected ISortableContentOutlinePage createOutlinePage() { // TODO remove this method when the above three stubs // are implemented @@ -52,6 +57,7 @@ public class FeatureSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEProjectionSourcePage#isQuickOutlineEnabled() */ + @Override public boolean isQuickOutlineEnabled() { return false; } @@ -59,6 +65,7 @@ public class FeatureSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#updateSelection(java.lang.Object) */ + @Override public void updateSelection(Object object) { // NO-OP } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSpecSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSpecSection.java index a3af7d32ea..6f349a0525 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSpecSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureSpecSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -63,6 +63,7 @@ public class FeatureSpecSection extends PDESection { createClient(getSection(), page.getManagedForm().getToolkit()); } + @Override public void commit(boolean onSave) { fTitleText.commit(); fProviderText.commit(); @@ -192,6 +193,7 @@ public class FeatureSpecSection extends PDESection { return fPatch; } + @Override public void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); @@ -216,6 +218,7 @@ public class FeatureSpecSection extends PDESection { fIdText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_id, null, false); fIdText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { try { feature.setId(text.getValue().trim()); @@ -227,6 +230,7 @@ public class FeatureSpecSection extends PDESection { fVersionText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_version, null, false); fVersionText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { if (verifySetVersion(feature, text.getValue()) == false) { warnBadVersionFormat(text.getValue()); @@ -237,6 +241,7 @@ public class FeatureSpecSection extends PDESection { fTitleText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_name, null, false); fTitleText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { try { feature.setLabel(text.getValue()); @@ -249,6 +254,7 @@ public class FeatureSpecSection extends PDESection { }); fProviderText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_provider, null, false); fProviderText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { try { String value = text.getValue(); @@ -262,6 +268,7 @@ public class FeatureSpecSection extends PDESection { fPluginText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_plugin, PDEUIMessages.GeneralInfoSection_browse, isEditable()); fPluginText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { try { String value = text.getValue(); @@ -271,6 +278,7 @@ public class FeatureSpecSection extends PDESection { } } + @Override public void linkActivated(HyperlinkEvent e) { String plugin = fPluginText.getValue(); if (PluginRegistry.findModel(plugin) == null) { @@ -279,6 +287,7 @@ public class FeatureSpecSection extends PDESection { ManifestEditor.openPluginEditor(fPluginText.getValue()); } + @Override public void browseButtonSelected(FormEntry entry) { handleOpenDialog(); } @@ -303,6 +312,7 @@ public class FeatureSpecSection extends PDESection { if (isPatch()) { fPatchedIdText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_patchedId, null, false); fPatchedIdText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { try { IFeatureImport patchImport = getPatchedFeature(); @@ -317,6 +327,7 @@ public class FeatureSpecSection extends PDESection { fPatchedVersionText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_patchedVersion, null, false); fPatchedVersionText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { IFeatureImport patchImport = getPatchedFeature(); if (patchImport != null) { @@ -332,6 +343,7 @@ public class FeatureSpecSection extends PDESection { fUpdateSiteUrlText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_updateUrl, null, false); fUpdateSiteUrlText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { String url = text.getValue() != null ? text.getValue() : ""; //$NON-NLS-1$ if (url.length() > 0 && !verifySiteUrl(feature, url)) { @@ -345,6 +357,7 @@ public class FeatureSpecSection extends PDESection { fUpdateSiteNameText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_SpecSection_updateUrlLabel, null, false); fUpdateSiteNameText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { String name = text.getValue() != null ? text.getValue() : ""; //$NON-NLS-1$ commitSiteName(name); @@ -396,6 +409,7 @@ public class FeatureSpecSection extends PDESection { MessageDialog.openError(PDEPlugin.getActiveWorkbenchShell(), PDEUIMessages.FeatureEditor_SpecSection_badUrlTitle, PDEUIMessages.FeatureEditor_SpecSection_badUrlMessage); } + @Override public void dispose() { IFeatureModel model = (IFeatureModel) getPage().getModel(); if (model != null) @@ -422,6 +436,7 @@ public class FeatureSpecSection extends PDESection { model.addModelChangedListener(this); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); @@ -448,6 +463,7 @@ public class FeatureSpecSection extends PDESection { } } + @Override public void setFocus() { if (fIdText != null) fIdText.getText().setFocus(); @@ -459,6 +475,7 @@ public class FeatureSpecSection extends PDESection { } } + @Override public void refresh() { IFeatureModel model = (IFeatureModel) getPage().getModel(); IFeature feature = model.getFeature(); @@ -515,6 +532,7 @@ public class FeatureSpecSection extends PDESection { fUpdateSiteNameText.setValue(updateSiteLabel != null ? updateSiteLabel : "", true); //$NON-NLS-1$ } + @Override public void cancelEdit() { fIdText.cancelEdit(); fTitleText.cancelEdit(); @@ -533,6 +551,7 @@ public class FeatureSpecSection extends PDESection { /** * @see org.eclipse.update.ui.forms.internal.FormSection#canPaste(Clipboard) */ + @Override public boolean canPaste(Clipboard clipboard) { TransferData[] types = clipboard.getAvailableTypes(); Transfer[] transfers = new Transfer[] {TextTransfer.getInstance(), RTFTransfer.getInstance()}; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureUndoManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureUndoManager.java index 9674ab4b73..a73616593c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureUndoManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/FeatureUndoManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -25,6 +25,7 @@ public class FeatureUndoManager extends ModelUndoManager { setUndoLevelLimit(30); } + @Override protected String getPageId(Object obj) { if (obj instanceof IFeature || obj instanceof IFeatureURL) return FeatureFormPage.PAGE_ID; @@ -35,6 +36,7 @@ public class FeatureUndoManager extends ModelUndoManager { return null; } + @Override protected void execute(IModelChangedEvent event, boolean undo) { Object[] elements = event.getChangedObjects(); int type = event.getChangeType(); @@ -113,6 +115,7 @@ public class FeatureUndoManager extends ModelUndoManager { } } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.CHANGE) { Object obj = event.getChangedObjects()[0]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesDetailsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesDetailsSection.java index a79c1d6390..a36f2b0894 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesDetailsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesDetailsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -222,6 +222,7 @@ public class IncludedFeaturesDetailsSection extends PDESection implements IPartS super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesPortabilitySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesPortabilitySection.java index b40cf999fb..a049e06937 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesPortabilitySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesPortabilitySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -163,6 +163,7 @@ public class IncludedFeaturesPortabilitySection extends PDESection implements IP @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fOsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getOSChoices(); openPortabilityChoiceDialog(IEnvironment.P_OS, fOsText, choices); @@ -188,6 +189,7 @@ public class IncludedFeaturesPortabilitySection extends PDESection implements IP @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fWsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getWSChoices(); openPortabilityChoiceDialog(IEnvironment.P_WS, fWsText, choices); @@ -214,6 +216,7 @@ public class IncludedFeaturesPortabilitySection extends PDESection implements IP @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fNlText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getNLChoices(); openPortabilityChoiceDialog(IEnvironment.P_NL, fNlText, choices); @@ -239,6 +242,7 @@ public class IncludedFeaturesPortabilitySection extends PDESection implements IP @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fArchText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getArchChoices(); openPortabilityChoiceDialog(IEnvironment.P_ARCH, fArchText, choices); @@ -332,6 +336,7 @@ public class IncludedFeaturesPortabilitySection extends PDESection implements IP super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesSection.java index ea8d801435..5fafbd229e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/IncludedFeaturesSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -62,6 +62,7 @@ public class IncludedFeaturesSection extends TableSection implements IFeatureMod private SortAction fSortAction; class IncludedFeaturesContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (parent instanceof IFeature) { return ((IFeature) parent).getIncludedFeatures(); @@ -193,6 +194,7 @@ public class IncludedFeaturesSection extends TableSection implements IFeatureMod private void handleNew() { BusyIndicator.showWhile(fIncludesViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { IFeatureModel[] allModels = PDECore.getDefault().getFeatureModelManager().getModels(); ArrayList<IFeatureModel> newModels = new ArrayList<IFeatureModel>(); @@ -306,6 +308,7 @@ public class IncludedFeaturesSection extends TableSection implements IFeatureMod public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.DELETE.getId())) { BusyIndicator.showWhile(fIncludesViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -314,6 +317,7 @@ public class IncludedFeaturesSection extends TableSection implements IFeatureMod } if (actionId.equals(ActionFactory.SELECT_ALL.getId())) { BusyIndicator.showWhile(fIncludesViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleSelectAll(); } @@ -384,6 +388,7 @@ public class IncludedFeaturesSection extends TableSection implements IFeatureMod @Override public void run() { BusyIndicator.showWhile(fIncludesViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -395,8 +400,10 @@ public class IncludedFeaturesSection extends TableSection implements IFeatureMod fOpenAction = new OpenReferenceAction(fIncludesViewer); } + @Override public void modelsChanged(final IFeatureModelDelta delta) { getSection().getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (getSection().isDisposed()) { return; @@ -533,6 +540,7 @@ public class IncludedFeaturesSection extends TableSection implements IFeatureMod return true; } + @Override public void propertyChange(PropertyChangeEvent event) { if (fSortAction.equals(event.getSource()) && IAction.RESULT.equals(event.getProperty())) { updateButtons(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoFormPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoFormPage.java index 0ef22073c6..62fc9fd778 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoFormPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoFormPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -39,10 +39,12 @@ public class InfoFormPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_FEATURE_INFO; } + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -58,6 +60,7 @@ public class InfoFormPage extends PDEFormPage { initialize(); } + @Override public void dispose() { colorManager.dispose(); super.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoSection.java index dc498bd3ae..f74209a201 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/InfoSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -75,11 +75,13 @@ public class InfoSection extends PDESection { createClient(getSection(), page.getManagedForm().getToolkit()); } + @Override public void commit(boolean onSave) { handleApply(); super.commit(onSave); } + @Override public void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); @@ -103,6 +105,7 @@ public class InfoSection extends PDESection { fTabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, new int[] {100}, true); fTabFolder.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateTabSelection(); } @@ -164,6 +167,7 @@ public class InfoSection extends PDESection { label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); fUrlText = toolkit.createText(page, null, SWT.SINGLE); fUrlText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { infoModified(); } @@ -179,6 +183,7 @@ public class InfoSection extends PDESection { fSourceViewer.configure(fSourceConfiguration); fSourceViewer.setDocument(fDocument); fSourceViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateSelection(event.getSelection()); } @@ -229,6 +234,7 @@ public class InfoSection extends PDESection { getPage().getPDEEditor().setSelection(selection); } + @Override public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.CUT.getId())) { fSourceViewer.doOperation(ITextOperationTarget.CUT); @@ -254,6 +260,7 @@ public class InfoSection extends PDESection { return false; } + @Override public boolean setFormInput(Object input) { if (input instanceof IFeatureInfo) { IFeatureInfo info = (IFeatureInfo) input; @@ -319,10 +326,12 @@ public class InfoSection extends PDESection { public void initialize() { IFeatureModel featureModel = (IFeatureModel) getPage().getModel(); fDocument.addDocumentListener(new IDocumentListener() { + @Override public void documentChanged(DocumentEvent e) { infoModified(); } + @Override public void documentAboutToBeChanged(DocumentEvent e) { } }); @@ -335,6 +344,7 @@ public class InfoSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { // Dispose of the source configuration if (fSourceConfiguration != null) { @@ -353,12 +363,14 @@ public class InfoSection extends PDESection { } } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); } } + @Override public void refresh() { IFeatureModel model = (IFeatureModel) getPage().getModel(); int index = fTabFolder.getSelectionIndex(); @@ -425,6 +437,7 @@ public class InfoSection extends PDESection { fNotebook.layout(); } + @Override public void setFocus() { fSourceViewer.getTextWidget().setFocus(); updateSelection(fSourceViewer.getSelection()); @@ -481,6 +494,7 @@ public class InfoSection extends PDESection { fIgnoreChange = false; } + @Override public boolean canPaste(Clipboard clipboard) { return fSourceViewer.canDoOperation(ITextOperationTarget.PASTE); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/LicenseFeatureSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/LicenseFeatureSection.java index 0be106fc73..386aba4e48 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/LicenseFeatureSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/LicenseFeatureSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 IBM Corporation and others. + * Copyright (c) 2010, 2015 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 LicenseFeatureSection extends PDESection { * @param toolkit * @param parent */ + @Override public void createClient(Section section, FormToolkit toolkit) { Composite page = toolkit.createComposite(section); final StackLayout stackLayout = new StackLayout(); @@ -111,6 +112,7 @@ public class LicenseFeatureSection extends PDESection { fLicenseFeatureIDText = toolkit.createText(licenseFeatureComposite, null, SWT.SINGLE); fLicenseFeatureIDText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { infoModified(); } @@ -122,6 +124,7 @@ public class LicenseFeatureSection extends PDESection { fLicenseButton = toolkit.createButton(licenseFeatureComposite, PDEUIMessages.FeatureEditor_licenseFeatureSection_browse, SWT.PUSH); fLicenseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleSelect(); } @@ -132,6 +135,7 @@ public class LicenseFeatureSection extends PDESection { fLicenseFeatureVersionText = toolkit.createText(licenseFeatureComposite, null, SWT.SINGLE); fLicenseFeatureVersionText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { infoModified(); } @@ -160,6 +164,7 @@ public class LicenseFeatureSection extends PDESection { fUrlText = toolkit.createText(localLicenseComposite, null, SWT.SINGLE); fUrlText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { infoModified(); } @@ -177,6 +182,7 @@ public class LicenseFeatureSection extends PDESection { fSourceViewer.configure(fSourceConfiguration); fSourceViewer.setDocument(fDocument); fSourceViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateSelection(event.getSelection()); } @@ -186,10 +192,12 @@ public class LicenseFeatureSection extends PDESection { styledText.setMenu(getPage().getPDEEditor().getContextMenu()); styledText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); fDocument.addDocumentListener(new IDocumentListener() { + @Override public void documentChanged(DocumentEvent e) { infoModified(); } + @Override public void documentAboutToBeChanged(DocumentEvent e) { } }); @@ -204,6 +212,7 @@ public class LicenseFeatureSection extends PDESection { styledText.setLayoutData(gd); fSharedLicenseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (((Button) e.widget).getSelection()) { stackLayout.topControl = licenseFeatureComposite; @@ -212,6 +221,7 @@ public class LicenseFeatureSection extends PDESection { } }); fLocalLicenseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (((Button) e.widget).getSelection()) { stackLayout.topControl = localLicenseComposite; @@ -241,6 +251,7 @@ public class LicenseFeatureSection extends PDESection { private void handleSelect() { BusyIndicator.showWhile(fLicenseFeatureIDText.getDisplay(), new Runnable() { + @Override public void run() { IFeatureModel[] allModels = PDECore.getDefault().getFeatureModelManager().getModels(); ArrayList<IFeatureModel> newModels = new ArrayList<IFeatureModel>(); @@ -286,6 +297,7 @@ public class LicenseFeatureSection extends PDESection { } } + @Override public void refresh() { fIgnoreChange = true; IFeatureModel model = (IFeatureModel) getPage().getModel(); @@ -305,6 +317,7 @@ public class LicenseFeatureSection extends PDESection { fIgnoreChange = false; } + @Override public void commit(boolean onSave) { IFeatureModel featureModel = (IFeatureModel) getPage().getModel(); IFeature feature = featureModel.getFeature(); @@ -337,6 +350,7 @@ public class LicenseFeatureSection extends PDESection { super.commit(onSave); } + @Override public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.CUT.getId())) { fSourceViewer.doOperation(ITextOperationTarget.CUT); @@ -362,6 +376,7 @@ public class LicenseFeatureSection extends PDESection { return false; } + @Override public boolean canPaste(Clipboard clipboard) { return fSourceViewer.canDoOperation(ITextOperationTarget.PASTE); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/OpenReferenceAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/OpenReferenceAction.java index d3908bba31..2a5ac95d9c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/OpenReferenceAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/OpenReferenceAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ public class OpenReferenceAction extends SelectionProviderAction { super(provider, PDEUIMessages.Actions_open_label); } + @Override public void run() { IStructuredSelection sel = (IStructuredSelection) getSelection(); Object obj = sel.getFirstElement(); @@ -61,6 +62,7 @@ public class OpenReferenceAction extends SelectionProviderAction { } } + @Override public void selectionChanged(IStructuredSelection selection) { setEnabled(!selection.isEmpty()); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java index b23f4442b7..937e1c28b1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginDetailsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -192,6 +192,7 @@ public class PluginDetailsSection extends PDESection implements IPartSelectionLi super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { IStructuredSelection s = ((IStructuredSelection) selection); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginReference.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginReference.java index 0f63068636..b4fdea70bc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginReference.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginReference.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -63,6 +63,7 @@ public class PluginReference { reference = newReference; } + @Override public String toString() { String name = model.getPluginBase().getName(); return model.getResourceString(name); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java index f6c9963d32..1e1704cc26 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PluginSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -61,6 +61,7 @@ public class PluginSection extends TableSection implements IPluginModelListener private SortAction fSortAction; class PluginContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (parent instanceof IFeature) { return ((IFeature) parent).getPlugins(); @@ -172,6 +173,7 @@ public class PluginSection extends TableSection implements IPluginModelListener private void handleNew() { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { IPluginModelBase[] allModels = PluginRegistry.getActiveModels(); ArrayList<IPluginModelBase> newModels = new ArrayList<IPluginModelBase>(); @@ -255,6 +257,7 @@ public class PluginSection extends TableSection implements IPluginModelListener private void handleSynchronize() { final FeatureEditorContributor contributor = (FeatureEditorContributor) getPage().getPDEEditor().getContributor(); BusyIndicator.showWhile(fPluginViewer.getControl().getDisplay(), new Runnable() { + @Override public void run() { contributor.getSynchronizeAction().run(); } @@ -265,6 +268,7 @@ public class PluginSection extends TableSection implements IPluginModelListener public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.DELETE.getId())) { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -283,6 +287,7 @@ public class PluginSection extends TableSection implements IPluginModelListener } if (actionId.equals(ActionFactory.SELECT_ALL.getId())) { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleSelectAll(); } @@ -352,6 +357,7 @@ public class PluginSection extends TableSection implements IPluginModelListener @Override public void run() { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -363,8 +369,10 @@ public class PluginSection extends TableSection implements IPluginModelListener fOpenAction = new OpenReferenceAction(fPluginViewer); } + @Override public void modelsChanged(final PluginModelDelta delta) { getSection().getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (getSection().isDisposed()) { return; 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 de37aacc85..c144972640 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, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -32,16 +32,19 @@ public class PortabilityChoicesDialog extends TrayDialog { private WizardCheckboxTablePart checkboxTablePart; class ContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object parent) { return choices; } } class ChoiceLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { return ((Choice) obj).getLabel(); } + @Override public Image getColumnImage(Object obj, int index) { return null; } @@ -55,12 +58,14 @@ public class PortabilityChoicesDialog extends TrayDialog { checkboxTablePart = new WizardCheckboxTablePart(PDEUIMessages.FeatureEditor_PortabilityChoicesDialog_choices); } + @Override protected void createButtonsForButtonBar(Composite parent) { // create OK and Cancel buttons by default createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } + @Override protected Control createDialogArea(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -115,6 +120,7 @@ public class PortabilityChoicesDialog extends TrayDialog { return null; } + @Override protected void okPressed() { value = computeNewValue(); super.okPressed(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilitySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilitySection.java index 04a8e5ecbd..978469e01e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilitySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/PortabilitySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,6 +91,7 @@ public class PortabilitySection extends PDESection { feature.setArch(value); } + @Override public void cancelEdit() { fOsText.cancelEdit(); fWsText.cancelEdit(); @@ -99,6 +100,7 @@ public class PortabilitySection extends PDESection { super.cancelEdit(); } + @Override public boolean canPaste(Clipboard clipboard) { TransferData[] types = clipboard.getAvailableTypes(); Transfer[] transfers = new Transfer[] {TextTransfer.getInstance(), RTFTransfer.getInstance()}; @@ -111,6 +113,7 @@ public class PortabilitySection extends PDESection { return false; } + @Override public void commit(boolean onSave) { fOsText.commit(); fWsText.commit(); @@ -119,6 +122,7 @@ public class PortabilitySection extends PDESection { super.commit(onSave); } + @Override public void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); @@ -135,8 +139,10 @@ public class PortabilitySection extends PDESection { fOsText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_PortabilitySection_os, editLabel, false); fOsText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fOsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getOSChoices(); openPortabilityChoiceDialog(IEnvironment.P_OS, fOsText, choices); @@ -144,6 +150,7 @@ public class PortabilitySection extends PDESection { }); } + @Override public void textValueChanged(FormEntry text) { try { applyValue(IEnvironment.P_OS, text.getValue()); @@ -158,8 +165,10 @@ public class PortabilitySection extends PDESection { fWsText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_PortabilitySection_ws, editLabel, false); fWsText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fWsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getWSChoices(); openPortabilityChoiceDialog(IEnvironment.P_WS, fWsText, choices); @@ -167,6 +176,7 @@ public class PortabilitySection extends PDESection { }); } + @Override public void textValueChanged(FormEntry text) { try { applyValue(IEnvironment.P_WS, text.getValue()); @@ -182,8 +192,10 @@ public class PortabilitySection extends PDESection { fNlText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fNlText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getNLChoices(); openPortabilityChoiceDialog(IEnvironment.P_NL, fNlText, choices); @@ -191,6 +203,7 @@ public class PortabilitySection extends PDESection { }); } + @Override public void textValueChanged(FormEntry text) { try { applyValue(IEnvironment.P_NL, text.getValue()); @@ -205,8 +218,10 @@ public class PortabilitySection extends PDESection { fArchText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_PortabilitySection_arch, editLabel, false); fArchText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fArchText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getArchChoices(); openPortabilityChoiceDialog(IEnvironment.P_ARCH, fArchText, choices); @@ -214,6 +229,7 @@ public class PortabilitySection extends PDESection { }); } + @Override public void textValueChanged(FormEntry text) { try { applyValue(IEnvironment.P_ARCH, text.getValue()); @@ -230,6 +246,7 @@ public class PortabilitySection extends PDESection { section.setClient(container); } + @Override public void dispose() { IFeatureModel model = (IFeatureModel) getPage().getModel(); if (model != null) @@ -242,6 +259,7 @@ public class PortabilitySection extends PDESection { * * @see org.eclipse.ui.forms.AbstractFormPart#initialize(org.eclipse.ui.forms.IManagedForm) */ + @Override public void initialize(IManagedForm form) { IFeatureModel model = (IFeatureModel) getPage().getModel(); if (model != null) @@ -254,6 +272,7 @@ public class PortabilitySection extends PDESection { gd.widthHint = 30; } + @Override public void modelChanged(IModelChangedEvent e) { markStale(); } @@ -277,6 +296,7 @@ public class PortabilitySection extends PDESection { } } + @Override public void refresh() { setValue(IEnvironment.P_OS); setValue(IEnvironment.P_WS); @@ -285,6 +305,7 @@ public class PortabilitySection extends PDESection { super.refresh(); } + @Override public void setFocus() { if (fOsText != null) fOsText.getText().setFocus(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/RequiresSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/RequiresSection.java index 3d67fb2eaa..c6b35a923f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/RequiresSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/RequiresSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -66,6 +66,7 @@ public class RequiresSection extends TableSection implements IPluginModelListene private Action fOpenAction; class ImportContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (parent instanceof IFeature) { IFeatureImport[] imports = ((IFeature) parent).getImports(); @@ -187,6 +188,7 @@ public class RequiresSection extends TableSection implements IPluginModelListene private void handleNewPlugin() { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { IPluginModelBase[] allModels = PluginRegistry.getActiveModels(); ArrayList<IPluginModelBase> newModels = new ArrayList<IPluginModelBase>(); @@ -233,6 +235,7 @@ public class RequiresSection extends TableSection implements IPluginModelListene private void handleNewFeature() { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { IFeatureModel[] allModels = PDECore.getDefault().getFeatureModelManager().getModels(); ArrayList<IFeatureModel> newModels = new ArrayList<IFeatureModel>(); @@ -358,6 +361,7 @@ public class RequiresSection extends TableSection implements IPluginModelListene public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.DELETE.getId())) { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -376,6 +380,7 @@ public class RequiresSection extends TableSection implements IPluginModelListene } if (actionId.equals(ActionFactory.SELECT_ALL.getId())) { BusyIndicator.showWhile(fPluginViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleSelectAll(); } @@ -482,8 +487,10 @@ public class RequiresSection extends TableSection implements IPluginModelListene } } + @Override public void modelsChanged(final PluginModelDelta delta) { getSection().getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (getSection().isDisposed()) { return; @@ -503,8 +510,10 @@ public class RequiresSection extends TableSection implements IPluginModelListene return entries.length > 0; } + @Override public void modelsChanged(final IFeatureModelDelta delta) { getSection().getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (getSection().isDisposed()) { return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsAction.java index c49c4f9396..d3b961bad5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ public class SynchronizeVersionsAction extends Action { if (activeEditor.isDirty()) { try { IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { activeEditor.doSave(monitor); } @@ -43,6 +44,7 @@ public class SynchronizeVersionsAction extends Action { } } + @Override public void run() { ensureContentSaved(); SynchronizeVersionsWizard wizard = new SynchronizeVersionsWizard(activeEditor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizard.java index b4b6631a21..e89d010d34 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -25,11 +25,13 @@ public class SynchronizeVersionsWizard extends Wizard { this.featureEditor = featureEditor; } + @Override public void addPages() { mainPage = new SynchronizeVersionsWizardPage(featureEditor); addPage(mainPage); } + @Override public boolean performFinish() { return mainPage.finish(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizardPage.java index 930cb84a0c..98c59802fb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/SynchronizeVersionsWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -59,6 +59,7 @@ public class SynchronizeVersionsWizardPage extends WizardPage { this.fFeatureEditor = featureEditor; } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -106,6 +107,7 @@ public class SynchronizeVersionsWizardPage extends WizardPage { final int mode = saveSettings(); IRunnableWithProgress operation = new WorkspaceModifyOperation() { + @Override public void execute(IProgressMonitor monitor) { try { runOperation(mode, monitor); @@ -142,6 +144,7 @@ public class SynchronizeVersionsWizardPage extends WizardPage { return; PDEModelUtility.modifyModel(new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) { modifyVersion(((IBundlePluginModelBase) model).getBundleModel(), targetVersion); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLDetailsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLDetailsSection.java index 2cea3d7deb..292b99069b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLDetailsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLDetailsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,6 +43,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe createClient(getSection(), page.getManagedForm().getToolkit()); } + @Override public void commit(boolean onSave) { fUrlText.commit(); fNameText.commit(); @@ -78,6 +79,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe } } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = toolkit.createComposite(section); GridLayout layout = new GridLayout(); @@ -91,6 +93,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe fUrlText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_URLDetailsSection_updateUrl, null, false); fUrlText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { String url = text.getValue() != null ? text.getValue() : ""; //$NON-NLS-1$ if (url.length() > 0 && !verifySiteUrl(feature, url)) { @@ -104,6 +107,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe fNameText = new FormEntry(container, toolkit, PDEUIMessages.FeatureEditor_URLDetailsSection_updateUrlLabel, null, false); fNameText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { String name = text.getValue() != null ? text.getValue() : ""; //$NON-NLS-1$ commitSiteName(name); @@ -131,6 +135,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe MessageDialog.openError(PDEPlugin.getActiveWorkbenchShell(), PDEUIMessages.FeatureEditor_URLDetailsSection_badUrlTitle, PDEUIMessages.FeatureEditor_URLDetailsSection_badUrlMessage); } + @Override public void dispose() { IFeatureModel model = (IFeatureModel) getPage().getModel(); if (model != null) @@ -148,6 +153,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe model.addModelChangedListener(this); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); @@ -165,11 +171,13 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe } } + @Override public void setFocus() { if (fUrlText != null) fUrlText.getText().setFocus(); } + @Override public void refresh() { update(); super.refresh(); @@ -200,6 +208,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe fNameText.setValue(updateSiteLabel != null ? updateSiteLabel : "", true); //$NON-NLS-1$ } + @Override public void cancelEdit() { fNameText.cancelEdit(); fUrlText.cancelEdit(); @@ -209,6 +218,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe /** * @see org.eclipse.update.ui.forms.internal.FormSection#canPaste(Clipboard) */ + @Override public boolean canPaste(Clipboard clipboard) { TransferData[] types = clipboard.getAvailableTypes(); Transfer[] transfers = new Transfer[] {TextTransfer.getInstance(), RTFTransfer.getInstance()}; @@ -221,6 +231,7 @@ public class URLDetailsSection extends PDESection implements IPartSelectionListe return false; } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLSection.java index 216eb5edd3..017d844a36 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/feature/URLSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,6 +44,7 @@ public class URLSection extends TableSection { private Image fUrlImage; class URLContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object input) { IFeature feature = (IFeature) input; IFeatureURL featureUrl = feature.getURL(); @@ -56,6 +57,7 @@ public class URLSection extends TableSection { class URLLabelProvider extends LabelProvider { + @Override public Image getImage(Object obj) { if (obj instanceof IFeatureURLElement) { return fUrlImage; @@ -74,10 +76,12 @@ public class URLSection extends TableSection { getSection().setDescription(PDEUIMessages.FeatureEditor_URLSection_desc); } + @Override public void commit(boolean onSave) { super.commit(onSave); } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = createClientContainer(section, 2, toolkit); GridLayout layout = (GridLayout) container.getLayout(); @@ -94,11 +98,13 @@ public class URLSection extends TableSection { initialize(); } + @Override protected void buttonSelected(int index) { if (index == 0) handleNew(); } + @Override public void dispose() { IFeatureModel model = (IFeatureModel) getPage().getModel(); if (model != null) @@ -106,6 +112,7 @@ public class URLSection extends TableSection { super.dispose(); } + @Override protected void fillContextMenu(IMenuManager manager) { IModel model = (IModel) getPage().getModel(); ISelection selection = fUrlViewer.getSelection(); @@ -183,9 +190,11 @@ public class URLSection extends TableSection { } } + @Override public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.DELETE.getId())) { BusyIndicator.showWhile(fUrlViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -204,6 +213,7 @@ public class URLSection extends TableSection { } if (actionId.equals(ActionFactory.SELECT_ALL.getId())) { BusyIndicator.showWhile(fUrlViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleSelectAll(); } @@ -213,6 +223,7 @@ public class URLSection extends TableSection { return false; } + @Override protected void selectionChanged(IStructuredSelection selection) { getPage().getPDEEditor().setSelection(selection); } @@ -224,6 +235,7 @@ public class URLSection extends TableSection { model.addModelChangedListener(this); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); @@ -256,6 +268,7 @@ public class URLSection extends TableSection { private void makeActions() { IModel model = (IModel) getPage().getModel(); fNewAction = new Action() { + @Override public void run() { handleNew(); } @@ -264,8 +277,10 @@ public class URLSection extends TableSection { fNewAction.setEnabled(model.isEditable()); fDeleteAction = new Action() { + @Override public void run() { BusyIndicator.showWhile(fUrlViewer.getTable().getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -276,11 +291,13 @@ public class URLSection extends TableSection { fDeleteAction.setEnabled(model.isEditable()); } + @Override public void setFocus() { if (fUrlViewer != null) fUrlViewer.getTable().setFocus(); } + @Override public void refresh() { IFeatureModel model = (IFeatureModel) getPage().getModel(); IFeature feature = model.getFeature(); @@ -288,6 +305,7 @@ public class URLSection extends TableSection { super.refresh(); } + @Override public boolean canPaste(Clipboard clipboard) { ModelDataTransfer modelTransfer = ModelDataTransfer.getInstance(); Object[] objects = (Object[]) clipboard.getContents(modelTransfer); @@ -301,6 +319,7 @@ public class URLSection extends TableSection { * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canPaste(Object, * Object[]) */ + @Override protected boolean canPaste(Object target, Object[] objects) { for (int i = 0; i < objects.length; i++) { if (!(objects[i] instanceof FeatureURLElement)) @@ -309,6 +328,7 @@ public class URLSection extends TableSection { return true; } + @Override protected void doPaste() { Clipboard clipboard = getPage().getPDEEditor().getClipboard(); ModelDataTransfer modelTransfer = ModelDataTransfer.getInstance(); @@ -322,6 +342,7 @@ public class URLSection extends TableSection { * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doPaste(Object, * Object[]) */ + @Override protected void doPaste(Object target, Object[] objects) { IFeatureModel model = (IFeatureModel) getPage().getModel(); if (!model.isEditable()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineMouseMoveListener.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineMouseMoveListener.java index a4a5b101fa..47f2b7a594 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineMouseMoveListener.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineMouseMoveListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -38,6 +38,7 @@ public class QuickOutlineMouseMoveListener implements MouseMoveListener { /* (non-Javadoc) * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent) */ + @Override public void mouseMove(MouseEvent e) { Tree tree = fTreeViewer.getTree(); if (tree.equals(e.getSource())) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineNamePatternFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineNamePatternFilter.java index f974a32c63..77b9d361dc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineNamePatternFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlineNamePatternFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -25,6 +25,7 @@ public class QuickOutlineNamePatternFilter extends ViewerFilter { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { // Element passes the filter if the string matcher is undefined or the // viewer is not a tree viewer diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlinePopupDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlinePopupDialog.java index 1b6f3d9608..509030b442 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlinePopupDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/outline/QuickOutlinePopupDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2014 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -80,6 +80,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createDialogArea(Composite parent) { // Applies only to dialog body - not title. See createTitleControl // Create an empty dialog area, if the source page is not defined @@ -106,6 +107,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.dialogs.PopupDialog#fillDialogMenu(org.eclipse.jface.action.IMenuManager) */ + @Override protected void fillDialogMenu(IMenuManager dialogMenu) { // Add the sort action dialogMenu.add(fSortAction); @@ -161,6 +163,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation final Tree tree = fTreeViewer.getTree(); // Handle key events tree.addKeyListener(new KeyListener() { + @Override public void keyPressed(KeyEvent e) { if (e.character == 0x1B) { // Dispose on ESC key press @@ -168,12 +171,14 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation } } + @Override public void keyReleased(KeyEvent e) { // NO-OP } }); // Handle mouse clicks tree.addMouseListener(new MouseAdapter() { + @Override public void mouseUp(MouseEvent e) { handleTreeViewerMouseUp(tree, e); } @@ -182,10 +187,12 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation tree.addMouseMoveListener(new QuickOutlineMouseMoveListener(fTreeViewer)); // Handle widget selection events tree.addSelectionListener(new SelectionListener() { + @Override public void widgetSelected(SelectionEvent e) { // NO-OP } + @Override public void widgetDefaultSelected(SelectionEvent e) { gotoSelectedElement(); } @@ -216,6 +223,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#addDisposeListener(org.eclipse.swt.events.DisposeListener) */ + @Override public void addDisposeListener(DisposeListener listener) { getShell().addDisposeListener(listener); } @@ -223,6 +231,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#addFocusListener(org.eclipse.swt.events.FocusListener) */ + @Override public void addFocusListener(FocusListener listener) { getShell().addFocusListener(listener); } @@ -230,6 +239,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#computeSizeHint() */ + @Override public Point computeSizeHint() { // Return the shell's size // Note that it already has the persisted size if persisting is enabled. @@ -239,6 +249,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#dispose() */ + @Override public void dispose() { close(); } @@ -246,6 +257,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#isFocusControl() */ + @Override public boolean isFocusControl() { if (fTreeViewer.getControl().isFocusControl() || fFilterText.isFocusControl()) { return true; @@ -256,6 +268,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#removeDisposeListener(org.eclipse.swt.events.DisposeListener) */ + @Override public void removeDisposeListener(DisposeListener listener) { getShell().removeDisposeListener(listener); } @@ -263,6 +276,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#removeFocusListener(org.eclipse.swt.events.FocusListener) */ + @Override public void removeFocusListener(FocusListener listener) { getShell().removeFocusListener(listener); } @@ -270,6 +284,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setBackgroundColor(org.eclipse.swt.graphics.Color) */ + @Override public void setBackgroundColor(Color background) { applyBackgroundColor(background, getContents()); } @@ -277,6 +292,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setFocus() */ + @Override public void setFocus() { getShell().forceFocus(); fFilterText.setFocus(); @@ -285,6 +301,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setForegroundColor(org.eclipse.swt.graphics.Color) */ + @Override public void setForegroundColor(Color foreground) { applyForegroundColor(foreground, getContents()); } @@ -292,6 +309,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setInformation(java.lang.String) */ + @Override public void setInformation(String information) { // Ignore // See IInformationControlExtension2 @@ -300,6 +318,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setLocation(org.eclipse.swt.graphics.Point) */ + @Override public void setLocation(Point location) { /* * If the location is persisted, it gets managed by PopupDialog - fine. Otherwise, the location is @@ -320,6 +339,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setSize(int, int) */ + @Override public void setSize(int width, int height) { getShell().setSize(width, height); } @@ -327,6 +347,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setSizeConstraints(int, int) */ + @Override public void setSizeConstraints(int maxWidth, int maxHeight) { // Ignore } @@ -334,6 +355,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControl#setVisible(boolean) */ + @Override public void setVisible(boolean visible) { if (visible) { open(); @@ -346,6 +368,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControlExtension#hasContents() */ + @Override public boolean hasContents() { if ((fTreeViewer == null) || (fTreeViewer.getInput() == null)) { return false; @@ -356,6 +379,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.IInformationControlExtension2#setInput(java.lang.Object) */ + @Override public void setInput(Object input) { // Input comes from PDESourceInfoProvider.getInformation2() // The input should be a model object of some sort @@ -368,6 +392,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) */ + @Override public void widgetDisposed(DisposeEvent e) { // Note: We do not reuse the dialog fTreeViewer = null; @@ -377,6 +402,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation /* (non-Javadoc) * @see org.eclipse.jface.dialogs.PopupDialog#createTitleControl(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createTitleControl(Composite parent) { // Applies only to dialog title - not body. See createDialogArea // Create the text widget @@ -422,6 +448,7 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation private void createUIListenersFilterText() { // Handle key events fFilterText.addKeyListener(new KeyListener() { + @Override public void keyPressed(KeyEvent e) { if (e.keyCode == 0x0D) { // Return key was pressed @@ -438,12 +465,14 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation } } + @Override public void keyReleased(KeyEvent e) { // NO-OP } }); // Handle text modify events fFilterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String text = ((Text) e.widget).getText(); int length = text.length(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java index f7b5599819..8d217ead88 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/AbstractPluginElementDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -29,6 +29,7 @@ public abstract class AbstractPluginElementDetails extends PDEDetails { return fMasterSection; } + @Override public boolean doGlobalAction(String actionId) { // TODO reveal the keybinding Ctrl+F to the user, ideally by showing the action in the context menu if (actionId.equals(ActionFactory.FIND.getId())) { @@ -39,6 +40,7 @@ public abstract class AbstractPluginElementDetails extends PDEDetails { // add value of the currently focused attribute text to the filter ((ExtensionsSection) fMasterSection).addAttributeToFilter(filterText, true); Display.getCurrent().asyncExec(new Runnable() { + @Override public void run() { // bugfix: after tree refresh bring focus back to the element details form getPage().updateFormSelection(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BlankQuery.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BlankQuery.java index 67b1a7f21a..ed25a61a09 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BlankQuery.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BlankQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -25,23 +25,28 @@ public class BlankQuery implements ISearchQuery { fObject = object; } + @Override public IStatus run(IProgressMonitor monitor) throws OperationCanceledException { monitor.done(); return new Status(IStatus.OK, IPDEUIConstants.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$ } + @Override public String getLabel() { return '\'' + fObject.getName() + '\''; } + @Override public boolean canRerun() { return true; } + @Override public boolean canRunInBackground() { return true; } + @Override public ISearchResult getSearchResult() { return new SearchResult(this); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleFoldingStructureProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleFoldingStructureProvider.java index 51dc7f9f1c..a15998a347 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleFoldingStructureProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleFoldingStructureProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -30,6 +30,7 @@ public class BundleFoldingStructureProvider extends AbstractFoldingStructureProv super(editor, model); } + @Override public void addFoldingRegions(Set<Position> currentRegions, IEditingModel model) throws BadLocationException { IBundle bundle = ((BundleModel) model).getBundle(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleHyperlinkDetector.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleHyperlinkDetector.java index 4a0c15ae72..2afca9b060 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleHyperlinkDetector.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleHyperlinkDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -34,6 +34,7 @@ public class BundleHyperlinkDetector implements IHyperlinkDetector { /* * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion, boolean) */ + @Override public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { if (region == null) return null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleInputContext.java index 73876d9438..a792ea854a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -51,6 +51,7 @@ public class BundleInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.InputContext#createModel(org.eclipse.ui.IEditorInput) */ + @Override protected IBaseModel createModel(IEditorInput input) throws CoreException { BundleModel model = null; boolean isReconciling = input instanceof IFileEditorInput; @@ -78,6 +79,7 @@ public class BundleInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -85,6 +87,7 @@ public class BundleInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#addTextEditOperation(java.util.ArrayList, org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { Object[] objects = event.getChangedObjects(); if (objects != null) { @@ -145,6 +148,7 @@ public class BundleInputContext extends UTF8InputContext { } } + @Override public void doRevert() { fEditOperations.clear(); fOperationTable.clear(); @@ -152,10 +156,12 @@ public class BundleInputContext extends UTF8InputContext { model.reconciled(model.getDocument()); } + @Override protected String getPartitionName() { return "___bundle_partition"; //$NON-NLS-1$ } + @Override protected IDocumentSetupParticipant getDocumentSetupParticipant() { return new ManifestDocumentSetupParticipant(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleSourcePage.java index b2855490a8..eb18793a36 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/BundleSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -70,6 +70,7 @@ public class BundleSourcePage extends KeyValueSourcePage { */ private class BundleOutlineContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parent) { // Need an identifying class for label provider if (parent instanceof ImportPackageHeader) { @@ -94,14 +95,17 @@ public class BundleSourcePage extends KeyValueSourcePage { return libraries; } + @Override public boolean hasChildren(Object parent) { return getChildren(parent).length > 0; } + @Override public Object getParent(Object child) { return null; } + @Override public Object[] getElements(Object parent) { if (parent instanceof BundleModel) { BundleModel model = (BundleModel) parent; @@ -570,10 +574,12 @@ public class BundleSourcePage extends KeyValueSourcePage { range[1] = header.getName().length(); } return new IDocumentRange() { + @Override public int getOffset() { return range[0]; } + @Override public int getLength() { return range[1]; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/CreateManifestOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/CreateManifestOperation.java index 3ce254c960..b7ebb55f11 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/CreateManifestOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/CreateManifestOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -33,6 +33,7 @@ public class CreateManifestOperation implements IRunnableWithProgress { fModel = model; } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { handleConvert(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependenciesPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependenciesPage.java index a5ea3976f0..e08842e72e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependenciesPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependenciesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -33,10 +33,12 @@ public class DependenciesPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_PLUGIN_DEPENDENCIES; } + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); boolean isBundle = isBundle(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyAnalysisSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyAnalysisSection.java index 15d8227907..c08d66f03c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyAnalysisSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyAnalysisSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -50,6 +50,7 @@ public class DependencyAnalysisSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.DependencyAnalysisSection_title); @@ -61,6 +62,7 @@ public class DependencyAnalysisSection extends PDESection { formText.setImage("hierarchy", lp.get(PDEPluginImages.DESC_CALLEES)); //$NON-NLS-1$ formText.setImage("dependencies", lp.get(PDEPluginImages.DESC_CALLERS)); //$NON-NLS-1$ formText.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { if (e.getHref().equals("unused")) //$NON-NLS-1$ doFindUnusedDependencies(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyManagementSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyManagementSection.java index 45ee43ca2a..201645f7d8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyManagementSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyManagementSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,6 +91,7 @@ public class DependencyManagementSection extends TableSection implements IPlugin /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { if (fAdditionalBundles == null) return createAdditionalBundles(); @@ -631,11 +632,13 @@ public class DependencyManagementSection extends TableSection implements IPlugin super.dispose(); } + @Override public void modelsChanged(PluginModelDelta delta) { fAdditionalBundles = null; final Control control = fAdditionalTable.getControl(); if (!control.isDisposed()) { control.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (!control.isDisposed()) fAdditionalTable.refresh(); @@ -681,6 +684,7 @@ public class DependencyManagementSection extends TableSection implements IPlugin updateButtons(); } + @Override public void propertyChange(PropertyChangeEvent event) { if (fSortAction.equals(event.getSource()) && IAction.RESULT.equals(event.getProperty())) { updateUpDownButtons(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyPropertiesDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyPropertiesDialog.java index 710b0fe3d2..fec5f2a854 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyPropertiesDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/DependencyPropertiesDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -65,6 +65,7 @@ public class DependencyPropertiesDialog extends StatusDialog { fVersionPart = new PluginVersionPart(true); else fVersionPart = new PluginVersionPart(false) { + @Override protected String getGroupText() { return PDEUIMessages.DependencyPropertiesDialog_exportGroupText; } @@ -72,10 +73,12 @@ public class DependencyPropertiesDialog extends StatusDialog { fVersionPart.setVersion(version); } + @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); } + @Override protected Control createDialogArea(Composite parent) { Composite comp = (Composite) super.createDialogArea(parent); @@ -108,6 +111,7 @@ public class DependencyPropertiesDialog extends StatusDialog { fVersionPart.createVersionFields(comp, true, fEditable); ModifyListener ml = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { updateStatus(fVersionPart.validateFullVersionRangeText(true)); } @@ -133,6 +137,7 @@ public class DependencyPropertiesDialog extends StatusDialog { return fVersion; } + @Override protected void okPressed() { fOptional = (fOptionalButton == null) ? false : fOptionalButton.getSelection(); fExported = (fReexportButton == null) ? false : fReexportButton.getSelection(); 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 b2c42b40ad..7d0f900571 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, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -60,16 +60,19 @@ public class ExecutionEnvironmentSection extends TableSection { fImage = PDEPluginImages.DESC_JAVA_LIB_OBJ.createImage(); } + @Override public Image getImage(Object element) { return fImage; } + @Override public String getText(Object element) { if (element instanceof IExecutionEnvironment) return ((IExecutionEnvironment) element).getId(); return super.getText(element); } + @Override public void dispose() { if (fImage != null) fImage.dispose(); @@ -78,6 +81,7 @@ public class ExecutionEnvironmentSection extends TableSection { } class ContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IBundleModel) { IBundleModel model = (IBundleModel) inputElement; @@ -96,6 +100,7 @@ public class ExecutionEnvironmentSection extends TableSection { createClient(getSection(), page.getEditor().getToolkit()); } + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.RequiredExecutionEnvironmentSection_title); if (isFragment()) @@ -120,12 +125,15 @@ public class ExecutionEnvironmentSection extends TableSection { Hyperlink link = toolkit.createHyperlink(container, PDEUIMessages.BuildExecutionEnvironmentSection_configure, SWT.NONE); link.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); link.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkEntered(HyperlinkEvent e) { } + @Override public void linkExited(HyperlinkEvent e) { } + @Override public void linkActivated(HyperlinkEvent e) { SWTFactory.showPreferencePage(PDEPlugin.getActiveWorkbenchShell(), "org.eclipse.jdt.debug.ui.jreProfiles", null); //$NON-NLS-1$ } @@ -140,12 +148,15 @@ public class ExecutionEnvironmentSection extends TableSection { link = toolkit.createHyperlink(container, PDEUIMessages.ExecutionEnvironmentSection_updateClasspath, SWT.NONE); link.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); link.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkEntered(HyperlinkEvent e) { } + @Override public void linkExited(HyperlinkEvent e) { } + @Override public void linkActivated(HyperlinkEvent e) { try { getPage().getEditor().doSave(null); @@ -178,17 +189,20 @@ public class ExecutionEnvironmentSection extends TableSection { section.setClient(container); } + @Override public void dispose() { IBundleModel model = getBundleModel(); if (model != null) model.removeModelChangedListener(this); } + @Override public void refresh() { fEETable.refresh(); updateButtons(); } + @Override protected void buttonSelected(int index) { switch (index) { case 0 : @@ -206,6 +220,7 @@ public class ExecutionEnvironmentSection extends TableSection { } } + @Override protected void fillContextMenu(IMenuManager manager) { manager.add(fAddAction); if (!fEETable.getSelection().isEmpty()) { @@ -217,6 +232,7 @@ public class ExecutionEnvironmentSection extends TableSection { private void makeActions() { fAddAction = new Action(PDEUIMessages.RequiredExecutionEnvironmentSection_add) { + @Override public void run() { handleAdd(); } @@ -224,6 +240,7 @@ public class ExecutionEnvironmentSection extends TableSection { fAddAction.setEnabled(isEditable()); fRemoveAction = new Action(PDEUIMessages.NewManifestEditor_LibrarySection_remove) { + @Override public void run() { handleRemove(); } @@ -333,6 +350,7 @@ public class ExecutionEnvironmentSection extends TableSection { return list.toArray(); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); @@ -400,6 +418,7 @@ public class ExecutionEnvironmentSection extends TableSection { return model.isFragmentModel(); } + @Override public boolean doGlobalAction(String actionId) { if (!isEditable()) { return false; @@ -425,6 +444,7 @@ public class ExecutionEnvironmentSection extends TableSection { return false; } + @Override protected boolean canPaste(Object target, Object[] objects) { RequiredExecutionEnvironmentHeader header = getHeader(); for (int i = 0; i < objects.length; i++) { @@ -437,22 +457,26 @@ public class ExecutionEnvironmentSection extends TableSection { return false; } + @Override protected void selectionChanged(IStructuredSelection selection) { getPage().getPDEEditor().setSelection(selection); if (getPage().getModel().isEditable()) updateButtons(); } + @Override protected void doPaste(Object target, Object[] objects) { addExecutionEnvironments(objects); } private void doFullBuild(final IProject project) { Job buildJob = new Job(PDEUIMessages.CompilersConfigurationBlock_building) { + @Override public boolean belongsTo(Object family) { return ResourcesPlugin.FAMILY_MANUAL_BUILD == family; } + @Override protected IStatus run(IProgressMonitor monitor) { try { project.build(IncrementalProjectBuilder.FULL_BUILD, JavaCore.BUILDER_ID, null, monitor); @@ -468,6 +492,7 @@ public class ExecutionEnvironmentSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#isDragAndDropEnabled() */ + @Override protected boolean isDragAndDropEnabled() { return true; } @@ -475,6 +500,7 @@ public class ExecutionEnvironmentSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canDragMove(java.lang.Object[]) */ + @Override public boolean canDragMove(Object[] sourceObjects) { if (validateDragMoveSanity(sourceObjects) == false) { return false; @@ -485,6 +511,7 @@ public class ExecutionEnvironmentSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canDropMove(java.lang.Object, java.lang.Object[], int) */ + @Override public boolean canDropMove(Object targetObject, Object[] sourceObjects, int targetLocation) { // Sanity check if (validateDropMoveSanity(targetObject, sourceObjects) == false) { @@ -558,6 +585,7 @@ public class ExecutionEnvironmentSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doDropMove(java.lang.Object, java.lang.Object[], int) */ + @Override public void doDropMove(Object targetObject, Object[] sourceObjects, int targetLocation) { // Sanity check if (validateDropMoveSanity(targetObject, sourceObjects) == false) { @@ -608,6 +636,7 @@ public class ExecutionEnvironmentSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doDragRemove(java.lang.Object[]) */ + @Override public void doDragRemove(Object[] sourceObjects) { // Validate source if (validateDragMoveSanity(sourceObjects) == false) { 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 ac0499a68c..de5586dd4b 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, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -60,6 +60,7 @@ public class ExportPackageSection extends TableSection { private static final int CALCULATE_USE_INDEX = 3; class ExportPackageContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object parent) { if (fHeader == null) { Bundle bundle = (Bundle) getBundle(); @@ -449,6 +450,7 @@ public class ExportPackageSection extends TableSection { final Collection<?> pckgs = fHeader == null ? new Vector<Object>() : fHeader.getPackageNames(); final boolean allowJava = "true".equals(getBundle().getHeader(ICoreConstants.ECLIPSE_JREBUNDLE)); //$NON-NLS-1$ Runnable runnable = new Runnable() { + @Override public void run() { ArrayList<IPackageFragment> elements = new ArrayList<IPackageFragment>(); ArrayList<IPackageFragment> conditional = new ArrayList<IPackageFragment>(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java index 55a54df64e..bad63969e7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -58,6 +58,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar private Button fVisibleButton; class TableContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { ExportPackageObject object = (ExportPackageObject) parent; if (object == null || !object.isInternal()) @@ -68,10 +69,12 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar class TableLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { return obj.toString(); } + @Override public Image getColumnImage(Object obj, int index) { return fImage; } @@ -82,6 +85,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar fHandleDefaultButton = false; } + @Override public void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.ExportPackageVisibilitySection_title); section.setDescription(PDEUIMessages.ExportPackageVisibilitySection_default); @@ -92,6 +96,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar fInternalButton = toolkit.createButton(comp, PDEUIMessages.ExportPackageVisibilitySection_hideAll, SWT.RADIO); fInternalButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { if (!fBlockChanges) { for (int i = 0; i < fSelectedObjects.length; i++) { @@ -132,6 +137,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar private void makeActions() { fAddAction = new Action(PDEUIMessages.ManifestEditor_ExportSection_add) { + @Override public void run() { handleAdd(); } @@ -139,6 +145,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar fAddAction.setEnabled(isEditable()); fRemoveAction = new Action(PDEUIMessages.ManifestEditor_ExportSection_remove) { + @Override public void run() { handleRemove(); } @@ -146,6 +153,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar fRemoveAction.setEnabled(isEditable()); } + @Override protected void selectionChanged(IStructuredSelection selection) { // Update global selection getPage().getPDEEditor().setSelection(selection); @@ -154,6 +162,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar getTablePart().setButtonEnabled(1, item != null); } + @Override protected void buttonSelected(int index) { if (index == ADD_INDEX) handleAdd(); @@ -164,6 +173,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#doGlobalAction(java.lang.String) */ + @Override public boolean doGlobalAction(String actionId) { if (!isEditable()) { @@ -190,6 +200,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canPaste(java.lang.Object, java.lang.Object[]) */ + @Override protected boolean canPaste(Object targetObject, Object[] sourceObjects) { // One export package object must be selected if (isOneObjectSelected() == false) { @@ -221,6 +232,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doPaste(java.lang.Object, java.lang.Object[]) */ + @Override protected void doPaste(Object targetObject, Object[] sourceObjects) { // Paste all source objects for (int i = 0; i < sourceObjects.length; i++) { @@ -237,6 +249,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar } } + @Override public void dispose() { IBundleModel model = getBundleModel(); if (model != null) @@ -246,6 +259,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar super.dispose(); } + @Override protected void fillContextMenu(IMenuManager manager) { getPage().getPDEEditor().getContributor().contextMenuAboutToShow(manager); } @@ -284,6 +298,7 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar } } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); @@ -307,11 +322,13 @@ public class ExportPackageVisibilitySection extends TableSection implements IPar fFriendViewer.getTable().setSelection(Math.min(index, fFriendViewer.getTable().getItemCount() - 1)); } + @Override public void refresh() { update(null); super.refresh(); } + @Override public void selectionChanged(IFormPart source, ISelection selection) { List<?> list = ((IStructuredSelection) selection).toList(); if (list.size() > 0) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionAttributePointDectector.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionAttributePointDectector.java index 5d6a4b1248..ef6098dd8a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionAttributePointDectector.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionAttributePointDectector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -152,6 +152,7 @@ public class ExtensionAttributePointDectector implements MouseListener, KeyListe /* (non-Javadoc) * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent) */ + @Override public void mouseDoubleClick(MouseEvent e) { // Ignore } @@ -159,14 +160,17 @@ public class ExtensionAttributePointDectector implements MouseListener, KeyListe /* (non-Javadoc) * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent) */ + @Override public void mouseDown(MouseEvent e) { // Ignore } + @Override public void mouseUp(MouseEvent e) { checkIfOnTarget(); } + @Override public void keyPressed(KeyEvent e) { checkIfOnTarget(); } @@ -174,6 +178,7 @@ public class ExtensionAttributePointDectector implements MouseListener, KeyListe /* (non-Javadoc) * @see org.eclipse.swt.events.KeyListener#keyReleased(org.eclipse.swt.events.KeyEvent) */ + @Override public void keyReleased(KeyEvent e) { // Ignore } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionDetails.java index 3206394fcb..f67644de25 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -55,6 +55,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite) */ + @Override public void createContents(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1)); @@ -89,6 +90,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { rtext.setImage("open", PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_SCHEMA_OBJ)); //$NON-NLS-1$ rtext.setImage("search", PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_PSEARCH_OBJ)); //$NON-NLS-1$ rtext.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { if (e.getHref().equals("search")) { //$NON-NLS-1$ FindDeclarationsAction findDeclarationsAction = new FindDeclarationsAction(input); @@ -129,6 +131,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { private void createNameEntryField(FormToolkit toolkit, Composite client) { name = new FormEntry(client, toolkit, PDEUIMessages.ExtensionDetails_name, null, false); name.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (input != null) try { @@ -147,6 +150,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { private void createIDEntryField(FormToolkit toolkit, Composite client) { id = new FormEntry(client, toolkit, PDEUIMessages.ExtensionDetails_id, null, false); id.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (input != null) try { @@ -161,6 +165,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.IDetailsPage#inputChanged(org.eclipse.jface.viewers.IStructuredSelection) */ + @Override public void selectionChanged(IFormPart part, ISelection selection) { IStructuredSelection ssel = (IStructuredSelection) selection; if (ssel.size() == 1) { @@ -239,6 +244,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { labelControl.getParent().layout(); } + @Override public void cancelEdit() { id.cancelEdit(); name.cancelEdit(); @@ -248,6 +254,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.IDetailsPage#commit() */ + @Override public void commit(boolean onSave) { id.commit(); name.commit(); @@ -257,10 +264,12 @@ public class ExtensionDetails extends AbstractPluginElementDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.IDetailsPage#setFocus() */ + @Override public void setFocus() { id.getText().setFocus(); } + @Override public void dispose() { IPluginModelBase model = (IPluginModelBase) getPage().getModel(); if (model != null) @@ -268,6 +277,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { super.dispose(); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.CHANGE) { Object obj = e.getChangedObjects()[0]; @@ -279,6 +289,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.IDetailsPage#refresh() */ + @Override public void refresh() { update(); super.refresh(); @@ -287,6 +298,7 @@ public class ExtensionDetails extends AbstractPluginElementDetails { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.IContextPart#fireSaveNeeded() */ + @Override public void fireSaveNeeded() { markDirty(); PDEFormPage page = (PDEFormPage) getManagedForm().getContainer(); @@ -296,14 +308,17 @@ public class ExtensionDetails extends AbstractPluginElementDetails { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.IContextPart#getContextId() */ + @Override public String getContextId() { return PluginInputContext.CONTEXT_ID; } + @Override public PDEFormPage getPage() { return (PDEFormPage) getManagedForm().getContainer(); } + @Override public boolean isEditable() { return getPage().getPDEEditor().getAggregateModel().isEditable(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementBodyTextDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementBodyTextDetails.java index ec3241cc1b..bb778fa054 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementBodyTextDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementBodyTextDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -61,6 +61,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite) */ + @Override public void createContents(Composite parent) { // Get the toolkit createUIToolkit(); @@ -84,6 +85,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail private void createListenersHyperlinkBody() { // Listen to hyperlink clicks fHyperlinkBody.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { handleHyperlinkBodyLinkActivated(); } @@ -125,6 +127,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail private void createListenersTextBody() { // Listen for text input fTextBody.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { handleTextBodyValueChanged(); } @@ -231,6 +234,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.ui.forms.IPartSelectionListener#selectionChanged(org.eclipse.ui.forms.IFormPart, org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(IFormPart part, ISelection selection) { // Get the structured selection IStructuredSelection structured_selection = (IStructuredSelection) selection; @@ -284,6 +288,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IContextPart#fireSaveNeeded() */ + @Override public void fireSaveNeeded() { markDirty(); getPage().getPDEEditor().fireSaveNeeded(getContextId(), false); @@ -292,6 +297,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IContextPart#getContextId() */ + @Override public String getContextId() { return PluginInputContext.CONTEXT_ID; } @@ -299,6 +305,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IContextPart#getPage() */ + @Override public PDEFormPage getPage() { return (PDEFormPage) getManagedForm().getContainer(); } @@ -306,6 +313,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IContextPart#isEditable() */ + @Override public boolean isEditable() { return getPage().getPDEEditor().getAggregateModel().isEditable(); } @@ -313,6 +321,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.pde.core.IModelChangedListener#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent event) { // Refresh the UI if the plugin element data changed if (event.getChangeType() == IModelChangedEvent.CHANGE) { @@ -326,6 +335,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { updateUI(); super.refresh(); @@ -334,6 +344,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEDetails#cancelEdit() */ + @Override public void cancelEdit() { fTextBody.cancelEdit(); super.cancelEdit(); @@ -342,6 +353,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean) */ + @Override public void commit(boolean onSave) { fTextBody.commit(); super.commit(onSave); @@ -350,6 +362,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IPluginModelBase model = (IPluginModelBase) getPage().getModel(); // Remove the model listener @@ -362,6 +375,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#setFocus() */ + @Override public void setFocus() { fTextBody.getText().setFocus(); } @@ -369,6 +383,7 @@ public class ExtensionElementBodyTextDetails extends AbstractPluginElementDetail /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.text.TextHoverDescriptionProvider#getDescription(org.eclipse.swt.widgets.Control) */ + @Override public String getHoverContent(Control control) { // Retrieve either the hyperlink, label or text description as the // hover content diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementDetails.java index 6e3a581a09..5c56d5225c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionElementDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2014 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -44,19 +44,23 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { rows = new ArrayList<ExtensionAttributeRow>(); } + @Override public String getContextId() { return PluginInputContext.CONTEXT_ID; } + @Override public void fireSaveNeeded() { markDirty(); getPage().getPDEEditor().fireSaveNeeded(getContextId(), false); } + @Override public PDEFormPage getPage() { return (PDEFormPage) getManagedForm().getContainer(); } + @Override public boolean isEditable() { return getPage().getPDEEditor().getAggregateModel().isEditable(); } @@ -66,6 +70,7 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { * * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite) */ + @Override public void createContents(Composite parent) { parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1)); FormToolkit toolkit = getManagedForm().getToolkit(); @@ -161,6 +166,7 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { * * @see org.eclipse.ui.forms.IDetailsPage#inputChanged(org.eclipse.jface.viewers.IStructuredSelection) */ + @Override public void selectionChanged(IFormPart masterPart, ISelection selection) { IStructuredSelection ssel = (IStructuredSelection) selection; if (ssel.size() == 1) { @@ -170,6 +176,7 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { update(); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.CHANGE) { Object obj = e.getChangedObjects()[0]; @@ -275,6 +282,7 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { * * @see org.eclipse.ui.forms.IDetailsPage#commit() */ + @Override public void commit(boolean onSave) { for (int i = 0; i < rows.size(); i++) { ExtensionAttributeRow row = rows.get(i); @@ -288,6 +296,7 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { * * @see org.eclipse.ui.forms.IDetailsPage#setFocus() */ + @Override public void setFocus() { if (rows.size() > 0) rows.get(0).setFocus(); @@ -298,6 +307,7 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { * * @see org.eclipse.ui.forms.IDetailsPage#dispose() */ + @Override public void dispose() { for (int i = 0; i < rows.size(); i++) { ExtensionAttributeRow row = rows.get(i); @@ -314,6 +324,7 @@ public class ExtensionElementDetails extends AbstractPluginElementDetails { * * @see org.eclipse.ui.forms.IDetailsPage#refresh() */ + @Override public void refresh() { update(); super.refresh(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionHyperLink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionHyperLink.java index 35e427d7a9..d91e386fb5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionHyperLink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionHyperLink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -20,6 +20,7 @@ public class ExtensionHyperLink extends AbstractHyperlink { super(region, pointID); } + @Override public void open() { new ShowDescriptionAction(fElement).run(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointDetails.java index afebe60088..221851fe2b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -62,19 +62,23 @@ public class ExtensionPointDetails extends PDEDetails { public ExtensionPointDetails() { } + @Override public String getContextId() { return PluginInputContext.CONTEXT_ID; } + @Override public void fireSaveNeeded() { markDirty(); getPage().getPDEEditor().fireSaveNeeded(getContextId(), false); } + @Override public PDEFormPage getPage() { return (PDEFormPage) getManagedForm().getContainer(); } + @Override public boolean isEditable() { return getPage().getPDEEditor().getAggregateModel().isEditable(); } @@ -84,6 +88,7 @@ public class ExtensionPointDetails extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#createContents(org.eclipse.swt.widgets.Composite) */ + @Override public void createContents(Composite parent) { parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1)); FormToolkit toolkit = getManagedForm().getToolkit(); @@ -100,6 +105,7 @@ public class ExtensionPointDetails extends PDEDetails { fIdEntry = new FormEntry(client, toolkit, PDEUIMessages.ExtensionPointDetails_id, null, false); fIdEntry.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (fInput != null) { try { @@ -112,6 +118,7 @@ public class ExtensionPointDetails extends PDEDetails { }); fNameEntry = new FormEntry(client, toolkit, PDEUIMessages.ExtensionPointDetails_name, null, false); fNameEntry.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (fInput != null) try { @@ -124,6 +131,7 @@ public class ExtensionPointDetails extends PDEDetails { boolean editable = getPage().getModel().isEditable(); fSchemaEntry = new FormEntry(client, toolkit, PDEUIMessages.ExtensionPointDetails_schema, PDEUIMessages.ExtensionPointDetails_browse, editable); // fSchemaEntry.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (fInput != null) { try { @@ -135,6 +143,7 @@ public class ExtensionPointDetails extends PDEDetails { } } + @Override public void linkActivated(HyperlinkEvent e) { IProject project = getPage().getPDEEditor().getCommonProject(); if (fSchemaEntry.getValue() == null || fSchemaEntry.getValue().length() == 0) { @@ -148,6 +157,7 @@ public class ExtensionPointDetails extends PDEDetails { generateSchema(); } + @Override public void browseButtonSelected(FormEntry entry) { final IProject project = getPage().getPDEEditor().getCommonProject(); ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(PDEPlugin.getActiveWorkbenchShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider()); @@ -156,6 +166,7 @@ public class ExtensionPointDetails extends PDEDetails { dialog.setDoubleClickSelects(false); dialog.setAllowMultiple(false); dialog.addFilter(new ViewerFilter() { + @Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IFile) { String ext = ((IFile) element).getFullPath().getFileExtension(); @@ -175,6 +186,7 @@ public class ExtensionPointDetails extends PDEDetails { } }); dialog.setValidator(new ISelectionStatusValidator() { + @Override public IStatus validate(Object[] selection) { IPluginModelBase model = (IPluginModelBase) getPage().getPDEEditor().getAggregateModel(); String pluginName = model.getPluginBase().getId(); @@ -222,6 +234,7 @@ public class ExtensionPointDetails extends PDEDetails { fRichText.setImage("search", PDEPlugin.getDefault().getLabelProvider().get( //$NON-NLS-1$ PDEPluginImages.DESC_PSEARCH_OBJ)); fRichText.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { IBaseModel model = getPage().getPDEEditor().getAggregateModel(); String pointID = null; @@ -284,6 +297,7 @@ public class ExtensionPointDetails extends PDEDetails { markDetailsPart(section); } + @Override public void dispose() { IPluginModelBase model = (IPluginModelBase) getPage().getModel(); if (model != null) @@ -291,6 +305,7 @@ public class ExtensionPointDetails extends PDEDetails { super.dispose(); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.CHANGE) { Object obj = e.getChangedObjects()[0]; @@ -307,6 +322,7 @@ public class ExtensionPointDetails extends PDEDetails { updateRichText(); } + @Override public void cancelEdit() { fIdEntry.cancelEdit(); fNameEntry.cancelEdit(); @@ -331,6 +347,7 @@ public class ExtensionPointDetails extends PDEDetails { Display d = ww.getShell().getDisplay(); d.asyncExec(new Runnable() { + @Override public void run() { try { String editorId = IPDEUIConstants.SCHEMA_EDITOR_ID; @@ -345,6 +362,7 @@ public class ExtensionPointDetails extends PDEDetails { private void generateSchema() { final IProject project = getPage().getPDEEditor().getCommonProject(); BusyIndicator.showWhile(getPage().getPartControl().getDisplay(), new Runnable() { + @Override public void run() { NewSchemaFileWizard wizard = new NewSchemaFileWizard(project, fInput, true); WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); @@ -361,6 +379,7 @@ public class ExtensionPointDetails extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#inputChanged(org.eclipse.jface.viewers.IStructuredSelection) */ + @Override public void selectionChanged(IFormPart masterPart, ISelection selection) { IStructuredSelection ssel = (IStructuredSelection) selection; if (ssel.size() == 1) { @@ -375,6 +394,7 @@ public class ExtensionPointDetails extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#commit() */ + @Override public void commit(boolean onSave) { fIdEntry.commit(); fNameEntry.commit(); @@ -387,6 +407,7 @@ public class ExtensionPointDetails extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#setFocus() */ + @Override public void setFocus() { fIdEntry.getText().setFocus(); } @@ -396,6 +417,7 @@ public class ExtensionPointDetails extends PDEDetails { * * @see org.eclipse.ui.forms.IDetailsPage#refresh() */ + @Override public void refresh() { update(); super.refresh(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsPage.java index 1891261ab2..e576305cbd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -38,19 +38,23 @@ public class ExtensionPointsPage extends PDEFormPage { super(ExtensionPointsPage.this); } + @Override protected PDESection createMasterSection(IManagedForm managedForm, Composite parent) { fExtensionPointsSection = new ExtensionPointsSection(getPage(), parent); return fExtensionPointsSection; } + @Override protected void registerPages(DetailsPart detailsPart) { detailsPart.setPageProvider(new IDetailsPageProvider() { + @Override public Object getPageKey(Object object) { if (object instanceof IPluginExtensionPoint) return IPluginExtensionPoint.class; return object.getClass(); } + @Override public IDetailsPage getPage(Object key) { if (key.equals(IPluginExtensionPoint.class)) return new ExtensionPointDetails(); @@ -68,10 +72,12 @@ public class ExtensionPointsPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_PLUGIN_EXT_POINTS; } + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -82,6 +88,7 @@ public class ExtensionPointsPage extends PDEFormPage { PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.MANIFEST_PLUGIN_EXT_POINTS); } + @Override public void updateFormSelection() { super.updateFormSelection(); IFormPage page = getPDEEditor().findPage(PluginInputContext.CONTEXT_ID); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsSection.java index 104cb60d18..522181c8a2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionPointsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2010 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -49,6 +49,7 @@ public class ExtensionPointsSection extends TableSection { private TableViewer pointTable; class TableContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { IPluginModelBase model = (IPluginModelBase) getPage().getModel(); IPluginBase pluginBase = model.getPluginBase(); @@ -66,6 +67,7 @@ public class ExtensionPointsSection extends TableSection { getTablePart().setEditable(false); } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = createClientContainer(section, 2, toolkit); TablePart tablePart = getTablePart(); @@ -97,6 +99,7 @@ public class ExtensionPointsSection extends TableSection { pointTable.setSelection(pointTable.getSelection()); } + @Override public void dispose() { IBaseModel model = getPage().getModel(); if (model instanceof IModelChangeProvider) @@ -104,6 +107,7 @@ public class ExtensionPointsSection extends TableSection { super.dispose(); } + @Override public boolean doGlobalAction(String actionId) { if (!isEditable()) { @@ -127,12 +131,14 @@ public class ExtensionPointsSection extends TableSection { return false; } + @Override public void refresh() { pointTable.refresh(); getManagedForm().fireSelectionChanged(this, pointTable.getSelection()); super.refresh(); } + @Override public boolean setFormInput(Object object) { if (object instanceof IPluginExtensionPoint) { pointTable.setSelection(new StructuredSelection(object), true); @@ -141,11 +147,13 @@ public class ExtensionPointsSection extends TableSection { return false; } + @Override protected void selectionChanged(IStructuredSelection selection) { getPage().getPDEEditor().setSelection(selection); super.selectionChanged(selection); } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); @@ -165,10 +173,12 @@ public class ExtensionPointsSection extends TableSection { } } + @Override protected void fillContextMenu(IMenuManager manager) { ISelection selection = pointTable.getSelection(); Action newAction = new Action(PDEUIMessages.ManifestEditor_DetailExtensionPointSection_newExtensionPoint) { + @Override public void run() { handleNew(); } @@ -195,6 +205,7 @@ public class ExtensionPointsSection extends TableSection { } Action deleteAction = new Action(PDEUIMessages.Actions_delete_label) { + @Override public void run() { handleDelete(); } @@ -204,6 +215,7 @@ public class ExtensionPointsSection extends TableSection { getPage().getPDEEditor().getContributor().contextMenuAboutToShow(manager); } + @Override protected void buttonSelected(int index) { if (index == 0) handleNew(); @@ -211,6 +223,7 @@ public class ExtensionPointsSection extends TableSection { handleDelete(); } + @Override protected void handleDoubleClick(IStructuredSelection selection) { if (!selection.isEmpty()) { PluginExtensionPointNode extensionPoint = (PluginExtensionPointNode) selection.getFirstElement(); @@ -262,6 +275,7 @@ public class ExtensionPointsSection extends TableSection { IFile file = ((IFileEditorInput) getPage().getPDEEditor().getEditorInput()).getFile(); final IProject project = file.getProject(); BusyIndicator.showWhile(pointTable.getTable().getDisplay(), new Runnable() { + @Override public void run() { NewExtensionPointWizard wizard = new NewExtensionPointWizard(project, (IPluginModelBase) getPage().getModel(), (ManifestEditor) getPage().getPDEEditor()); WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); @@ -293,6 +307,7 @@ public class ExtensionPointsSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doPaste(java.lang.Object, java.lang.Object[]) */ + @Override protected void doPaste(Object targetObject, Object[] sourceObjects) { // By default, fragment.xml does not exist until the first extension // or extension point is created. @@ -331,6 +346,7 @@ public class ExtensionPointsSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canPaste(java.lang.Object, java.lang.Object[]) */ + @Override protected boolean canPaste(Object targetObject, Object[] sourceObjects) { // All source objects must be extension points // No restriction on duplicates diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsPage.java index 7b3d5ba75e..22f80f5e39 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -40,11 +40,13 @@ public class ExtensionsPage extends PDEFormPage { super(ExtensionsPage.this); } + @Override protected PDESection createMasterSection(IManagedForm managedForm, Composite parent) { fSection = new ExtensionsSection(getPage(), parent); return fSection; } + @Override protected void registerPages(DetailsPart detailsPart) { detailsPart.setPageLimit(10); // register static page for the extensions @@ -58,6 +60,7 @@ public class ExtensionsPage extends PDEFormPage { detailsPart.setPageProvider(this); } + @Override public Object getPageKey(Object object) { if (object instanceof IPluginExtension) return IPluginExtension.class; @@ -93,6 +96,7 @@ public class ExtensionsPage extends PDEFormPage { return object.getClass(); } + @Override public IDetailsPage getPage(Object object) { if (object instanceof ISchemaElement) return new ExtensionElementDetails(fSection, (ISchemaElement) object); @@ -115,10 +119,12 @@ public class ExtensionsPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_PLUGIN_EXTENSIONS; } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); form.setText(PDEUIMessages.ExtensionsPage_title); @@ -130,6 +136,7 @@ public class ExtensionsPage extends PDEFormPage { super.createFormContent(managedForm); } + @Override public void updateFormSelection() { super.updateFormSelection(); IFormPage page = getPDEEditor().findPage(PluginInputContext.CONTEXT_ID); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsSection.java index 1611cd0b6c..57121a74a6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExtensionsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -103,6 +103,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis private static final String MENU_NEW_ID = "NewMenu"; //$NON-NLS-1$ class ExtensionContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parent) { Object[] children = null; if (parent instanceof IPluginBase) @@ -117,10 +118,12 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis return children; } + @Override public boolean hasChildren(Object parent) { return getChildren(parent).length > 0; } + @Override public Object getParent(Object child) { if (child instanceof IPluginExtension) { return ((IPluginModelBase) getPage().getModel()).getPluginBase(); @@ -130,6 +133,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis return null; } + @Override public Object[] getElements(Object parent) { return getChildren(parent); } @@ -146,6 +150,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis return resolveObjectImage(obj); } + @Override public Font getFont(Object element) { if (fFilteredTree.isFiltered() && fPatternFilter.getMatchingLeafs().contains(element)) { return JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT); @@ -272,6 +277,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis final Text filterText = fFilteredTree.getFilterControl(); if (filterText != null) { filterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { StructuredViewer viewer = getStructuredViewerPart().getViewer(); IStructuredSelection ssel = (IStructuredSelection) viewer.getSelection(); @@ -646,6 +652,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis private void handleNew() { final IProject project = getPage().getPDEEditor().getCommonProject(); BusyIndicator.showWhile(fExtensionTree.getTree().getDisplay(), new Runnable() { + @Override public void run() { ((ManifestEditor) getPage().getEditor()).ensurePluginContextPresence(); NewExtensionWizard wizard = new NewExtensionWizard(project, (IPluginModelBase) getPage().getModel(), (ManifestEditor) getPage().getPDEEditor()) { @@ -669,6 +676,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis final IExtensionEditorWizard wizard = (IExtensionEditorWizard) element.createExecutableExtension("class"); //$NON-NLS-1$ wizard.init(project, model, selection); BusyIndicator.showWhile(fExtensionTree.getTree().getDisplay(), new Runnable() { + @Override public void run() { WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); dialog.create(); @@ -694,6 +702,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis IPluginModelBase model = (IPluginModelBase) getPage().getModel(); final ExtensionEditorWizard wizard = new ExtensionEditorWizard(project, model, selection); BusyIndicator.showWhile(fExtensionTree.getTree().getDisplay(), new Runnable() { + @Override public void run() { WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); dialog.create(); @@ -1504,6 +1513,7 @@ public class ExtensionsSection extends TreeSection implements IPropertyChangeLis return fFilteredTree.getViewer(); } + @Override public void propertyChange(PropertyChangeEvent event) { if (fSortAction.equals(event.getSource()) && IAction.RESULT.equals(event.getProperty())) { StructuredViewer viewer = getStructuredViewerPart().getViewer(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FormFilteredTree.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FormFilteredTree.java index 3301165f80..7c0331737e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FormFilteredTree.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FormFilteredTree.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -33,6 +33,7 @@ public class FormFilteredTree extends FilteredTree { super(parent, treeStyle, filter, true); } + @Override protected void createControl(Composite parent, int treeStyle) { toolkit = new FormToolkit(parent.getDisplay()); GridLayout layout = FormLayoutFactory.createClearGridLayout(false, 1); @@ -45,6 +46,7 @@ public class FormFilteredTree extends FilteredTree { /* (non-Javadoc) * @see org.eclipse.swt.widgets.Widget#dispose() */ + @Override public void dispose() { if (toolkit != null) { toolkit.dispose(); @@ -53,6 +55,7 @@ public class FormFilteredTree extends FilteredTree { super.dispose(); } + @Override protected Text doCreateFilterText(Composite parent) { int borderStyle = toolkit.getBorderStyle(); @@ -69,6 +72,7 @@ public class FormFilteredTree extends FilteredTree { return fEntryFilter.getText(); } + @Override protected TreeViewer doCreateTreeViewer(Composite parent, int style) { TreeViewer viewer = super.doCreateTreeViewer(parent, toolkit.getBorderStyle() | style); toolkit.paintBordersFor(viewer.getTree().getParent()); @@ -84,30 +88,37 @@ public class FormFilteredTree extends FilteredTree { fEntryFilter.setFormEntryListener(new FormEntryAdapter(part) { // Override all callback methods except focusGained // See Bug # 184085 + @Override public void browseButtonSelected(FormEntry entry) { // NO-OP } + @Override public void linkActivated(HyperlinkEvent e) { // NO-OP } + @Override public void linkEntered(HyperlinkEvent e) { // NO-OP } + @Override public void linkExited(HyperlinkEvent e) { // NO-OP } + @Override public void selectionChanged(FormEntry entry) { // NO-OP } + @Override public void textDirty(FormEntry entry) { // NO-OP } + @Override public void textValueChanged(FormEntry entry) { // NO-OP } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java index 2b69444d03..6813ce5c10 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -62,10 +62,12 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { super(page, parent); } + @Override protected String getSectionDescription() { return PDEUIMessages.ManifestEditor_PluginSpecSection_fdesc; } + @Override protected void createSpecificControls(Composite parent, FormToolkit toolkit, IActionBars actionBars) { createPluginIdEntry(parent, toolkit, actionBars); createPluginVersionEntry(parent, toolkit, actionBars); @@ -78,6 +80,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { fPluginIdEntry = new FormEntry(parent, toolkit, PDEUIMessages.GeneralInfoSection_pluginId, PDEUIMessages.GeneralInfoSection_browse, // isEditable()); fPluginIdEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { ((IFragment) getPluginBase()).setPluginId(fPluginIdEntry.getValue()); @@ -86,6 +89,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { } } + @Override public void linkActivated(HyperlinkEvent e) { String plugin = fPluginIdEntry.getValue(); if (!(PluginRegistry.findModel(plugin) instanceof IPluginModel)) { @@ -94,6 +98,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { ManifestEditor.openPluginEditor(fPluginIdEntry.getValue()); } + @Override public void browseButtonSelected(FormEntry entry) { handleOpenDialog(); } @@ -118,6 +123,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { fPluginIdEntry.setEditable(isEditable()); // Create validator fPluginIdValidator = new TextValidator(getManagedForm(), fPluginIdEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validatePluginId(); } @@ -157,6 +163,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { private void createBundlePluginVersionEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { FormEntryAdapter textListener = new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { ((IFragment) getPluginBase()).setPluginVersion(getVersion()); @@ -165,6 +172,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { } } + @Override public void textDirty(FormEntry entry) { setFieldsEnabled(); super.textDirty(entry); @@ -176,12 +184,14 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { fPluginMinVersionEntry.setEditable(isEditable()); // Create validator fPluginMinVersionValidator = new TextValidator(getManagedForm(), fPluginMinVersionEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validatePluginMinVersion(); } }; SelectionAdapter comboListener = new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { try { ((IFragment) getPluginBase()).setPluginVersion(getVersion()); @@ -202,6 +212,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { fPluginMaxVersionEntry.setEditable(isEditable()); // Create validator fPluginMaxVersionValidator = new TextValidator(getManagedForm(), fPluginMaxVersionEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validatePluginMaxVersion(); } @@ -235,6 +246,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { private void createNonBundlePluginVersionEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fPluginMinVersionEntry = new FormEntry(client, toolkit, PDEUIMessages.GeneralInfoSection_pluginVersion, null, false); fPluginMinVersionEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { ((IFragment) getPluginBase()).setPluginVersion(entry.getValue()); @@ -264,6 +276,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { PDEUIMessages.ManifestEditor_MatchSection_equivalent, PDEUIMessages.ManifestEditor_MatchSection_compatible, PDEUIMessages.ManifestEditor_MatchSection_perfect, PDEUIMessages.ManifestEditor_MatchSection_greater}; fMatchCombo.setItems(items); fMatchCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { int match = fMatchCombo.getSelectionIndex(); try { @@ -276,6 +289,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { fMatchCombo.getControl().setEnabled(isEditable()); } + @Override public void commit(boolean onSave) { fPluginIdEntry.commit(); fPluginMinVersionEntry.commit(); @@ -283,6 +297,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { super.commit(onSave); } + @Override public void cancelEdit() { fPluginIdEntry.cancelEdit(); fPluginMinVersionEntry.cancelEdit(); @@ -290,6 +305,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { super.cancelEdit(); } + @Override public void refresh() { IPluginModelBase model = (IPluginModelBase) getPage().getModel(); IFragment fragment = (IFragment) model.getPluginBase(); @@ -378,6 +394,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { } // added for bug 172675 + @Override protected void addListeners() { if (isBundle()) { IBundleModel model = getBundle().getModel(); @@ -387,6 +404,7 @@ public class FragmentGeneralInfoSection extends GeneralInfoSection { super.addListeners(); } + @Override protected void removeListeners() { if (isBundle()) { IBundleModel model = getBundle().getModel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java index f77db83388..bef502343e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -71,6 +71,7 @@ public abstract class GeneralInfoSection extends PDESection { * @see org.eclipse.pde.internal.ui.neweditor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, * org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.ManifestEditor_PluginSpecSection_title); section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); @@ -139,6 +140,7 @@ public abstract class GeneralInfoSection extends PDESection { private void createIDEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fIdEntry = new FormEntry(client, toolkit, PDEUIMessages.GeneralInfoSection_id, null, false); fIdEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { getPluginBase().setId(entry.getValue()); @@ -150,6 +152,7 @@ public abstract class GeneralInfoSection extends PDESection { fIdEntry.setEditable(isEditable()); // Create validator fIdEntryValidator = new TextValidator(getManagedForm(), fIdEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validateIdEntry(); } @@ -164,6 +167,7 @@ public abstract class GeneralInfoSection extends PDESection { private void createVersionEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fVersionEntry = new FormEntry(client, toolkit, PDEUIMessages.GeneralInfoSection_version, null, false); fVersionEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { getPluginBase().setVersion(entry.getValue()); @@ -175,6 +179,7 @@ public abstract class GeneralInfoSection extends PDESection { fVersionEntry.setEditable(isEditable()); // Create validator fVersionEntryValidator = new TextValidator(getManagedForm(), fVersionEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validateVersionEntry(); } @@ -193,6 +198,7 @@ public abstract class GeneralInfoSection extends PDESection { private void createNameEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fNameEntry = new FormEntry(client, toolkit, PDEUIMessages.GeneralInfoSection_name, null, false); fNameEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { getPluginBase().setName(entry.getValue()); @@ -204,6 +210,7 @@ public abstract class GeneralInfoSection extends PDESection { fNameEntry.setEditable(isEditable()); // Create validator fNameEntryValidator = new TextValidator(getManagedForm(), fNameEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validateNameEntry(); } @@ -218,6 +225,7 @@ public abstract class GeneralInfoSection extends PDESection { private void createProviderEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fProviderEntry = new FormEntry(client, toolkit, PDEUIMessages.GeneralInfoSection_provider, null, false); fProviderEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { getPluginBase().setProviderName(entry.getValue()); @@ -229,6 +237,7 @@ public abstract class GeneralInfoSection extends PDESection { fProviderEntry.setEditable(isEditable()); // Create validator fProviderEntryValidator = new TextValidator(getManagedForm(), fProviderEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validateProviderEntry(); } @@ -247,6 +256,7 @@ public abstract class GeneralInfoSection extends PDESection { private void createPlatformFilterEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fPlatformFilterEntry = new FormEntry(client, toolkit, PDEUIMessages.GeneralInfoSection_platformFilter, null, false); fPlatformFilterEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getBundle().setHeader(PLATFORM_FILTER, fPlatformFilterEntry.getValue()); } @@ -254,6 +264,7 @@ public abstract class GeneralInfoSection extends PDESection { fPlatformFilterEntry.setEditable(isEditable()); // Create validator fPlatformEntryValidator = new TextValidator(getManagedForm(), fPlatformFilterEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validatePlatformEntry(); } @@ -269,6 +280,7 @@ public abstract class GeneralInfoSection extends PDESection { return ControlValidationUtility.validatePlatformFilterField(fPlatformFilterEntry.getText().getText(), fPlatformEntryValidator); } + @Override public void commit(boolean onSave) { fIdEntry.commit(); fVersionEntry.commit(); @@ -284,6 +296,7 @@ public abstract class GeneralInfoSection extends PDESection { * * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); @@ -300,6 +313,7 @@ public abstract class GeneralInfoSection extends PDESection { } } + @Override public void refresh() { IPluginModelBase model = (IPluginModelBase) getPage().getPDEEditor().getContextManager().getAggregateModel(); IPluginBase pluginBase = model.getPluginBase(); @@ -320,6 +334,7 @@ public abstract class GeneralInfoSection extends PDESection { super.refresh(); } + @Override public void cancelEdit() { fIdEntry.cancelEdit(); fNameEntry.cancelEdit(); @@ -330,6 +345,7 @@ public abstract class GeneralInfoSection extends PDESection { super.cancelEdit(); } + @Override public void dispose() { removeListeners(); super.dispose(); @@ -347,6 +363,7 @@ public abstract class GeneralInfoSection extends PDESection { ((IModelChangeProvider) model).addModelChangedListener(this); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); return (d.getFocusControl() instanceof Text); @@ -368,6 +385,7 @@ public abstract class GeneralInfoSection extends PDESection { fSingleton.setLayoutData(td); fSingleton.setEnabled(isEditable()); fSingleton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { IManifestHeader header = getSingletonHeader(); if (header instanceof BundleSymbolicNameHeader) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java index 0e48c34e16..1c370bed8d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ImportPackageSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -121,6 +121,7 @@ public class ImportPackageSection extends TableSection { } class ImportPackageContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object parent) { if (fHeader == null) { Bundle bundle = (Bundle) getBundle(); @@ -428,6 +429,7 @@ public class ImportPackageSection extends TableSection { private void handleAdd() { final ConditionalListSelectionDialog dialog = new ConditionalListSelectionDialog(PDEPlugin.getActiveWorkbenchShell(), new ImportPackageDialogLabelProvider(), PDEUIMessages.ImportPackageSection_dialogButtonLabel); Runnable runnable = new Runnable() { + @Override public void run() { setElements(dialog); dialog.setMultipleSelection(true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JarSelectionValidator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JarSelectionValidator.java index 0d1841c53e..c112917a24 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JarSelectionValidator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JarSelectionValidator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -38,6 +38,7 @@ public class JarSelectionValidator implements ISelectionStatusValidator { /* * @see org.eclipse.ui.dialogs.ISelectionValidator#isValid(java.lang.Object) */ + @Override public IStatus validate(Object[] elements) { if (isValidSelection(elements)) { return new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, "", //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JavaAttributeWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JavaAttributeWizard.java index d5a39d69df..3ae0c027d1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JavaAttributeWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/JavaAttributeWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -62,14 +62,17 @@ public class JavaAttributeWizard extends Wizard { return setting; } + @Override public void addPages() { fMainPage = new JavaAttributeWizardPage(fProject, fModel, fAttInfo, fClassName); addPage(fMainPage); ((JavaAttributeWizardPage) fMainPage).init(); } + @Override public boolean performFinish() { IRunnableWithProgress op = new WorkspaceModifyOperation() { + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException { fMainPage.createType(monitor); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibrarySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibrarySection.java index 0747550a56..5b1fef0eab 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibrarySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibrarySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,6 +91,7 @@ public class LibrarySection extends TableSection implements IBuildPropertiesCons } class TableContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { return getModel().getPluginBase().getLibraries(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibraryVisibilitySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibraryVisibilitySection.java index de2dd22a46..f26a8e2ef7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibraryVisibilitySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LibraryVisibilitySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -55,6 +55,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec private Action fRemoveAction; class TableContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (parent instanceof IPluginLibrary) { String[] filters = ((IPluginLibrary) parent).getContentFilters(); @@ -66,10 +67,12 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec class TableLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { return obj.toString(); } + @Override public Image getColumnImage(Object obj, int index) { return JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_PACKAGE); } @@ -82,6 +85,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec fHandleDefaultButton = false; } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = toolkit.createComposite(section); container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 1)); @@ -90,6 +94,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec fFullExportButton = toolkit.createButton(container, label, SWT.RADIO); fFullExportButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fFullExportButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { try { if (fCurrentLibrary != null) @@ -119,6 +124,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec private void makeActions() { fAddAction = new Action(PDEUIMessages.ManifestEditor_ExportSection_add) { + @Override public void run() { handleAdd(); } @@ -126,6 +132,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec fAddAction.setEnabled(isEditable()); fRemoveAction = new Action(PDEUIMessages.ManifestEditor_ExportSection_remove) { + @Override public void run() { handleRemove(); } @@ -153,11 +160,13 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec toolkit.paintBordersFor(parent); } + @Override protected void selectionChanged(IStructuredSelection selection) { Object item = selection.getFirstElement(); getTablePart().setButtonEnabled(1, item != null); } + @Override protected void buttonSelected(int index) { if (index == ADD_INDEX) handleAdd(); @@ -168,6 +177,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#doGlobalAction(java.lang.String) */ + @Override public boolean doGlobalAction(String actionId) { if (!isEditable()) { @@ -181,6 +191,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec return false; } + @Override public void dispose() { IPluginModelBase model = (IPluginModelBase) getPage().getModel(); if (model != null) @@ -188,6 +199,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec super.dispose(); } + @Override protected void fillContextMenu(IMenuManager manager) { if (fSelectedExportButton.isEnabled() && fSelectedExportButton.getSelection()) { manager.add(fAddAction); @@ -240,6 +252,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec } } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { if (fCurrentLibrary != null) @@ -250,11 +263,13 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec refresh(); } + @Override public void refresh() { update(fCurrentLibrary); super.refresh(); } + @Override public void selectionChanged(IFormPart source, ISelection selection) { if (selection == null || selection.isEmpty()) update(null); @@ -299,6 +314,7 @@ public class LibraryVisibilitySection extends TableSection implements IPartSelec /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canPaste(org.eclipse.swt.dnd.Clipboard) */ + @Override public boolean canPaste(Clipboard clipboard) { // Paste not supported for plug-ins that do not have a MANIFEST.MF return false; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LoopDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LoopDialog.java index 54339b8af2..8482c7a421 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LoopDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/LoopDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,6 +33,7 @@ public class LoopDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof DependencyLoop) return ((DependencyLoop) parentElement).getMembers(); @@ -42,6 +43,7 @@ public class LoopDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) */ + @Override public Object getParent(Object element) { return null; } @@ -49,6 +51,7 @@ public class LoopDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ + @Override public boolean hasChildren(Object element) { return element instanceof DependencyLoop; } @@ -56,6 +59,7 @@ public class LoopDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { return fLoops; } @@ -66,6 +70,7 @@ public class LoopDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { if (element instanceof DependencyLoop) return fLoopImage; @@ -75,6 +80,7 @@ public class LoopDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { return PDEPlugin.getDefault().getLabelProvider().getText(element); } @@ -87,6 +93,7 @@ public class LoopDialog extends TrayDialog { fLoopImage = provider.get(PDEPluginImages.DESC_LOOP_OBJ); } + @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); } @@ -94,11 +101,13 @@ public class LoopDialog extends TrayDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.LOOP_DIALOG); } + @Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridLayout layout = new GridLayout(); @@ -125,6 +134,7 @@ public class LoopDialog extends TrayDialog { /** * @since 3.5 */ + @Override protected boolean isResizable() { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditor.java index f1dc733b51..72a9355d59 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditor.java @@ -217,6 +217,7 @@ public class ManifestEditor extends PDELauncherFormEditor implements IShowEditor return manager; } + @Override public void monitoredFileAdded(IFile file) { if (fInputContextManager == null) return; @@ -288,6 +289,7 @@ public class ManifestEditor extends PDELauncherFormEditor implements IShowEditor } } + @Override public boolean monitoredFileRemoved(IFile file) { //TODO may need to check with the user if there //are unsaved changes in the model for the @@ -309,6 +311,7 @@ public class ManifestEditor extends PDELauncherFormEditor implements IShowEditor } } + @Override public void contextRemoved(InputContext context) { close(true); } @@ -653,6 +656,7 @@ public class ManifestEditor extends PDELauncherFormEditor implements IShowEditor /* (non-Javadoc) * @see org.eclipse.ui.IShowEditorInput#showEditorInput(org.eclipse.ui.IEditorInput) */ + @Override public void showEditorInput(IEditorInput editorInput) { String name = editorInput.getName(); String id = getActivePageInstance().getId(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorContributor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorContributor.java index dfe673c9f4..5623b6b1b4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorContributor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorContributor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2011 IBM Corporation and others. + * Copyright (c) 2003, 2015 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,9 +28,11 @@ public class ManifestEditorContributor extends PDEFormTextEditorContributor { public ExternalizeAction() { } + @Override public void run() { if (getEditor() != null) { BusyIndicator.showWhile(SWTUtil.getStandardDisplay(), new Runnable() { + @Override public void run() { GetNonExternalizedStringsAction externalizeAction = new GetNonExternalizedStringsAction(); IStructuredSelection selection = new StructuredSelection(getEditor().getCommonProject()); @@ -45,6 +47,7 @@ public class ManifestEditorContributor extends PDEFormTextEditorContributor { super("&Plugin"); //$NON-NLS-1$ } + @Override public void contextMenuAboutToShow(IMenuManager mm, boolean addClipboard) { super.contextMenuAboutToShow(mm, addClipboard); IBaseModel model = getEditor().getAggregateModel(); @@ -54,24 +57,29 @@ public class ManifestEditorContributor extends PDEFormTextEditorContributor { } } + @Override protected void makeActions() { super.makeActions(); fExternalizeAction = new ExternalizeAction(); fExternalizeAction.setText(PDEUIMessages.ManifestEditorContributor_externStringsActionName); } + @Override public boolean supportsContentAssist() { return true; } + @Override public boolean supportsFormatAction() { return true; } + @Override public boolean supportsCorrectionAssist() { return true; } + @Override public boolean supportsHyperlinking() { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorMatchingStrategy.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorMatchingStrategy.java index 82de1b64fd..aa0c2fe191 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorMatchingStrategy.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestEditorMatchingStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -18,6 +18,7 @@ import org.eclipse.ui.ide.ResourceUtil; public class ManifestEditorMatchingStrategy implements IEditorMatchingStrategy { + @Override public boolean matches(IEditorReference editorRef, IEditorInput input) { IFile inputFile = ResourceUtil.getFile(input); if (input instanceof IFileEditorInput && inputFile != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestHyperlinkDetector.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestHyperlinkDetector.java index aeda5648ed..9707940aad 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestHyperlinkDetector.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestHyperlinkDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class ManifestHyperlinkDetector extends PDEHyperlinkDetector { super(page); } + @Override protected IHyperlink[] detectAttributeHyperlink(IDocumentAttributeNode attr) { String attrValue = attr.getAttributeValue(); if (attrValue.length() == 0) @@ -76,6 +77,7 @@ public class ManifestHyperlinkDetector extends PDEHyperlinkDetector { return null; } + @Override protected IHyperlink[] detectNodeHyperlink(IDocumentElementNode node) { // TODO what can we do here? // suggestions: @@ -99,6 +101,7 @@ public class ManifestHyperlinkDetector extends PDEHyperlinkDetector { return null; } + @Override protected IHyperlink[] detectTextNodeHyperlink(IDocumentTextNode node) { IDocumentElementNode enclosing = node.getEnclosingElement(); if (!(enclosing instanceof IPluginObject)) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestOutlinePage.java index 2164357817..81aa55e7ae 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -24,6 +24,7 @@ public class ManifestOutlinePage extends FormOutlinePage { super(editor); } + @Override protected Object[] getChildren(Object parent) { if (parent instanceof PDEFormPage) { PDEFormPage page = (PDEFormPage) parent; @@ -43,6 +44,7 @@ public class ManifestOutlinePage extends FormOutlinePage { return new Object[0]; } + @Override protected String getParentPageId(Object item) { String pageId = null; if (item instanceof IPluginImport || item instanceof ImportPackageObject) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestSourcePage.java index 2455f14378..5dc88ae024 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ManifestSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -92,6 +92,7 @@ public class ManifestSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ + @Override public Object[] getChildren(Object parent) { PluginModelBase model = (PluginModelBase) getInputContext().getModel(); @@ -126,6 +127,7 @@ public class ManifestSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) */ + @Override public Object getParent(Object element) { if (element instanceof IDocumentElementNode) return ((IDocumentElementNode) element).getParentNode(); @@ -135,6 +137,7 @@ public class ManifestSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ + @Override public boolean hasChildren(Object element) { if (element instanceof IPluginBase) { return ((IDocumentElementNode) element).getChildNodes().length > 0; @@ -145,6 +148,7 @@ public class ManifestSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IPluginModelBase) { return new Object[] {((IPluginModelBase) inputElement).getPluginBase()}; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MatchSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MatchSection.java index 1f91aadf51..c41228fe44 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MatchSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MatchSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -49,6 +49,7 @@ public class MatchSection extends PDESection implements IPartSelectionListener { createClient(getSection(), formPage.getEditor().getToolkit()); } + @Override public void commit(boolean onSave) { if (isDirty() == false) return; @@ -65,11 +66,13 @@ public class MatchSection extends PDESection implements IPartSelectionListener { super.commit(onSave); } + @Override public void cancelEdit() { fVersionText.cancelEdit(); super.cancelEdit(); } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = toolkit.createComposite(section); container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 2)); @@ -80,10 +83,12 @@ public class MatchSection extends PDESection implements IPartSelectionListener { fVersionText = new FormEntry(container, toolkit, PDEUIMessages.ManifestEditor_MatchSection_version, null, false); fVersionText.setFormEntryListener(new FormEntryAdapter(this, getPage().getEditor().getEditorSite().getActionBars()) { + @Override public void textValueChanged(FormEntry text) { applyVersion(text.getValue()); } + @Override public void textDirty(FormEntry text) { if (fBlockChanges) return; @@ -106,6 +111,7 @@ public class MatchSection extends PDESection implements IPartSelectionListener { fMatchCombo.add(PDEUIMessages.ManifestEditor_MatchSection_greater); fMatchCombo.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fMatchCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (!fBlockChanges) { applyMatch(fMatchCombo.getSelectionIndex()); @@ -126,6 +132,7 @@ public class MatchSection extends PDESection implements IPartSelectionListener { private void createReexportButton(FormToolkit toolkit, Composite container) { fReexportButton = toolkit.createButton(container, PDEUIMessages.ManifestEditor_MatchSection_reexport, SWT.CHECK); fReexportButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (!fBlockChanges && fCurrentImport instanceof IPluginImport) { try { @@ -145,6 +152,7 @@ public class MatchSection extends PDESection implements IPartSelectionListener { private void createOptionalButton(FormToolkit toolkit, Composite container) { fOptionalButton = toolkit.createButton(container, PDEUIMessages.ManifestEditor_MatchSection_optional, SWT.CHECK); fOptionalButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (fBlockChanges) return; @@ -187,6 +195,7 @@ public class MatchSection extends PDESection implements IPartSelectionListener { return fMatchCombo.getSelectionIndex(); } + @Override public void dispose() { IModel model = (IModel) getPage().getModel(); if (model instanceof IModelChangeProvider) @@ -200,6 +209,7 @@ public class MatchSection extends PDESection implements IPartSelectionListener { ((IModelChangeProvider) model).addModelChangedListener(this); } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.REMOVE) { Object obj = e.getChangedObjects()[0]; @@ -214,6 +224,7 @@ public class MatchSection extends PDESection implements IPartSelectionListener { } } + @Override public void selectionChanged(IFormPart part, ISelection selection) { IStructuredSelection ssel = (IStructuredSelection) selection; if (ssel.size() == 1) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MissingResourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MissingResourcePage.java index d9bf719828..0c9c77efd8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MissingResourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/MissingResourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -29,6 +29,7 @@ public class MissingResourcePage extends PDEFormPage { super(editor, "missing", PDEUIMessages.MissingResourcePage_missingResource); //$NON-NLS-1$ } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); Composite comp = managedForm.getToolkit().createComposite(form); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewElementAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewElementAction.java index 5ba641bfda..75648f07f2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewElementAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewElementAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -46,6 +46,7 @@ public class NewElementAction extends Action { return elementInfo != null ? elementInfo.getName() : UNKNOWN_ELEMENT_TAG; } + @Override public void run() { IPluginElement newElement = parent.getModel().getFactory().createElement(parent); try { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewRuntimeLibraryDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewRuntimeLibraryDialog.java index 1f82bc1d62..dd32d9f82a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewRuntimeLibraryDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/NewRuntimeLibraryDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -65,12 +65,14 @@ public class NewRuntimeLibraryDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() */ + @Override protected void computeResult() { } /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.NEW_LIBRARY); @@ -79,6 +81,7 @@ public class NewRuntimeLibraryDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createDialogArea(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -99,6 +102,7 @@ public class NewRuntimeLibraryDialog extends SelectionStatusDialog { libraryText.setLayoutData(gd); libraryText.setText(PDEUIMessages.ManifestEditor_RuntimeLibraryDialog_default); libraryText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { updateStatus(validator.validate(libraryText.getText())); } @@ -110,6 +114,7 @@ public class NewRuntimeLibraryDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.jface.window.Window#open() */ + @Override public int open() { libraryText.setText("library.jar"); //$NON-NLS-1$ libraryText.setSelection(0, libraryText.getText().length() - 4); @@ -123,6 +128,7 @@ public class NewRuntimeLibraryDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed() */ + @Override protected void okPressed() { libraryName = libraryText.getText(); super.okPressed(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/OverviewPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/OverviewPage.java index d16aeb86cf..5c89739be3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/OverviewPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/OverviewPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -61,10 +61,12 @@ public class OverviewPage extends LaunchShortcutOverviewPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_PLUGIN_OVERVIEW; } + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -226,6 +228,7 @@ public class OverviewPage extends LaunchShortcutOverviewPage { * * @see org.eclipse.ui.forms.events.HyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkActivated(HyperlinkEvent e) { String href = (String) e.getHref(); // try page references @@ -355,11 +358,13 @@ public class OverviewPage extends LaunchShortcutOverviewPage { } } + @Override public void dispose() { fDisposed = true; super.dispose(); } + @Override protected short getIndent() { return 5; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PackageSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PackageSelectionDialog.java index fccc5fbe52..77cd133279 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PackageSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PackageSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -35,6 +35,7 @@ public class PackageSelectionDialog extends ElementListSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.ElementListSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createDialogArea(Composite parent) { Control control = super.createDialogArea(parent); getShell().setText(PDEUIMessages.PackageSelectionDialog_title); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginExportAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginExportAction.java index ce863ec219..3d5ede1257 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginExportAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginExportAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -48,6 +48,7 @@ public class PluginExportAction extends Action { if (fEditor.isDirty()) { try { IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { fEditor.doSave(monitor); } @@ -60,6 +61,7 @@ public class PluginExportAction extends Action { } } + @Override public void run() { if (fEditor != null) ensureContentSaved(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginFoldingStructureProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginFoldingStructureProvider.java index 1cff8db25b..9e4e843f52 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginFoldingStructureProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginFoldingStructureProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -26,6 +26,7 @@ public class PluginFoldingStructureProvider extends AbstractFoldingStructureProv super(editor, model); } + @Override public void addFoldingRegions(Set<Position> currentRegions, IEditingModel model) throws BadLocationException { IExtensions extensions = ((IPluginModelBase) model).getExtensions(); IPluginExtension[] pluginExtensions = extensions.getExtensions(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java index 907b41498b..fb5cdf57b9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -58,10 +58,12 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { super(page, parent); } + @Override protected String getSectionDescription() { return PDEUIMessages.ManifestEditor_PluginSpecSection_desc; } + @Override protected void createSpecificControls(Composite parent, FormToolkit toolkit, IActionBars actionBars) { createClassEntry(parent, toolkit, actionBars); FormEditor formEditor = getPage().getEditor(); @@ -71,6 +73,7 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { } } + @Override protected void addListeners() { if (isBundle()) { IBundleModel model = getBundle().getModel(); @@ -80,6 +83,7 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { super.addListeners(); } + @Override protected void removeListeners() { if (isBundle()) { IBundleModel model = getBundle().getModel(); @@ -96,6 +100,7 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { fLazyStart.setLayoutData(td); fLazyStart.setEnabled(isEditable()); fLazyStart.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { LazyStartHeader[] headers = getLazyStartHeaders(); // must block the refresh otherwise we have problems with multiple activation headers. @@ -114,6 +119,7 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { fClassEntry = new FormEntry(client, toolkit, PDEUIMessages.GeneralInfoSection_class, PDEUIMessages.GeneralInfoSection_browse, // isEditable()); fClassEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { try { ((IPlugin) getPluginBase()).setClassName(entry.getValue()); @@ -122,6 +128,7 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { } } + @Override public void linkActivated(HyperlinkEvent e) { String value = fClassEntry.getValue(); IProject project = getPage().getPDEEditor().getCommonProject(); @@ -130,6 +137,7 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { fClassEntry.setValue(value); } + @Override public void browseButtonSelected(FormEntry entry) { doOpenSelectionDialog(entry.getValue()); } @@ -154,16 +162,19 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { return new JavaAttributeValue(project, model, null, fClassEntry.getValue()); } + @Override public void cancelEdit() { fClassEntry.cancelEdit(); super.cancelEdit(); } + @Override public void commit(boolean onSave) { fClassEntry.commit(); super.commit(onSave); } + @Override public void refresh() { if (fBlockListener) return; @@ -234,6 +245,7 @@ public class PluginGeneralInfoSection extends GeneralInfoSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.plugin.GeneralInfoSection#dispose() */ + @Override public void dispose() { super.dispose(); if (fTypeFieldAssistDisposer != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContext.java index 29044652b8..9e491dfd28 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -41,6 +41,7 @@ public class PluginInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.InputContext#createModel(org.eclipse.ui.IEditorInput) */ + @Override protected IBaseModel createModel(IEditorInput input) throws CoreException { PluginModelBase model = null; boolean isReconciling = input instanceof IFileEditorInput; @@ -72,6 +73,7 @@ public class PluginInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -80,6 +82,7 @@ public class PluginInputContext extends XMLInputContext { return fIsFragment; } + @Override protected void reorderInsertEdits(ArrayList<TextEdit> ops) { HashMap<Object, TextEdit> map = getOperationTable(); Iterator<Object> iter = map.keySet().iterator(); @@ -130,6 +133,7 @@ public class PluginInputContext extends XMLInputContext { } } + @Override public void doRevert() { fEditOperations.clear(); fOperationTable.clear(); @@ -138,6 +142,7 @@ public class PluginInputContext extends XMLInputContext { model.reconciled(model.getDocument()); } + @Override protected String getPartitionName() { return "___plugin_partition"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContextManager.java index 80949d310f..34b3555507 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginInputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public class PluginInputContextManager extends InputContextManager { super(editor); } + @Override public IBaseModel getAggregateModel() { if (bmodel != null) return bmodel; @@ -46,6 +47,7 @@ public class PluginInputContextManager extends InputContextManager { return findPluginModel(); } + @Override protected void structureChanged(IFile file, boolean added) { // If a plugin.xml file has been added to the project the editor should update if (added && ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR.equalsIgnoreCase(file.getName())) { @@ -57,6 +59,7 @@ public class PluginInputContextManager extends InputContextManager { super.structureChanged(file, added); } + @Override protected void fireContextChange(InputContext context, boolean added) { super.fireContextChange(context, added); if (context.getId().equals(BundleInputContext.CONTEXT_ID)) { @@ -121,6 +124,7 @@ public class PluginInputContextManager extends InputContextManager { smodel.fireModelChanged(new ModelChangedEvent(smodel, IModelChangedEvent.WORLD_CHANGED, null, null)); // now pass the listener to the target model smodel.transferListenersTo(tmodel, new IModelChangedListenerFilter() { + @Override public boolean accept(IModelChangedListener listener) { if (listener instanceof IFormPart || listener instanceof FormOutlinePage) return true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginLauncherFormPageHelper.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginLauncherFormPageHelper.java index 8fadff611b..2679fe248b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginLauncherFormPageHelper.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginLauncherFormPageHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -20,14 +20,17 @@ public class PluginLauncherFormPageHelper implements ILauncherFormPageHelper { fEditor = editor; } + @Override public Object getLaunchObject() { return fEditor.getCommonProject(); } + @Override public boolean isOSGi() { return !((ManifestEditor) fEditor).showExtensionTabs(); } + @Override public void preLaunch() { } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java index 85b31747c7..82d1dc1598 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginUndoManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -36,6 +36,7 @@ public class PluginUndoManager extends ModelUndoManager { setUndoLevelLimit(30); } + @Override protected String getPageId(Object obj) { if (obj instanceof IPluginBase) return OverviewPage.PAGE_ID; @@ -50,6 +51,7 @@ public class PluginUndoManager extends ModelUndoManager { return null; } + @Override protected void execute(IModelChangedEvent event, boolean undo) { Object[] elements = event.getChangedObjects(); int type = event.getChangeType(); @@ -277,6 +279,7 @@ public class PluginUndoManager extends ModelUndoManager { } } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.CHANGE) { Object changedObject = event.getChangedObjects()[0]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RequiresSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RequiresSection.java index 2ca0ee36e6..7c9b840ab9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RequiresSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RequiresSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -69,6 +69,7 @@ public class RequiresSection extends TableSection implements IPluginModelListene private int fImportInsertIndex; class ImportContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object parent) { if (fImports == null) createImportObjects(); @@ -628,11 +629,13 @@ public class RequiresSection extends TableSection implements IPluginModelListene job.schedule(); } + @Override public void modelsChanged(PluginModelDelta delta) { fImports = null; final Control control = fImportViewer.getControl(); if (!control.isDisposed()) { control.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (!control.isDisposed()) fImportViewer.refresh(); @@ -677,6 +680,7 @@ public class RequiresSection extends TableSection implements IPluginModelListene return true; } + @Override public void propertyChange(PropertyChangeEvent event) { if (fSortAction.equals(event.getSource()) && IAction.RESULT.equals(event.getProperty())) { updateUpDownButtons(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ResourceAttributeValue.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ResourceAttributeValue.java index b038b2ab9b..d1f4b8c4c0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ResourceAttributeValue.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ResourceAttributeValue.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -29,6 +29,7 @@ public class ResourceAttributeValue { return stringValue; } + @Override public String toString() { return getStringValue(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RuntimePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RuntimePage.java index 3d239e1917..3c3839540a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RuntimePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/RuntimePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -29,12 +29,14 @@ public class RuntimePage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { if (((IPluginModelBase) getPDEEditor().getAggregateModel()).isFragmentModel()) return IHelpContextIds.MANIFEST_FRAGMENT_RUNTIME; return IHelpContextIds.MANIFEST_PLUGIN_RUNTIME; } + @Override protected void createFormContent(IManagedForm mform) { super.createFormContent(mform); ScrolledForm form = mform.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/BooleanAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/BooleanAttributeRow.java index ac03cfae09..6fd731b4d9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/BooleanAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/BooleanAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -29,6 +29,7 @@ public class BooleanAttributeRow extends ChoiceAttributeRow { * @see org.eclipse.pde.internal.ui.neweditor.plugin.ExtensionElementEditor#createContents(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.forms.widgets.FormToolkit, int) */ + @Override public void createContents(Composite parent, FormToolkit toolkit, int span) { super.createContents(parent, toolkit, span); if (getUse() != ISchemaAttribute.REQUIRED) @@ -40,6 +41,7 @@ public class BooleanAttributeRow extends ChoiceAttributeRow { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.plugin.rows.ChoiceAttributeRow#isValid(java.lang.String) */ + @Override protected boolean isValid(String value) { if (getUse() == ISchemaAttribute.REQUIRED) return (value.equals("true") || value.equals("false")); //$NON-NLS-1$ //$NON-NLS-2$ @@ -49,6 +51,7 @@ public class BooleanAttributeRow extends ChoiceAttributeRow { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.plugin.rows.ChoiceAttributeRow#getValidValue() */ + @Override protected String getValidValue() { return "true"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ButtonAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ButtonAttributeRow.java index 9d7034cf86..af0bd75461 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ButtonAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ButtonAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -37,11 +37,13 @@ public abstract class ButtonAttributeRow extends ReferenceAttributeRow { super(part, att); } + @Override public void createContents(Composite parent, FormToolkit toolkit, int span) { super.createContents(parent, toolkit, span); if (part.isEditable()) { Button button = toolkit.createButton(parent, PDEUIMessages.ReferenceAttributeRow_browse, SWT.PUSH); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (!isReferenceModel()) browse(); @@ -51,6 +53,7 @@ public abstract class ButtonAttributeRow extends ReferenceAttributeRow { } } + @Override protected GridData createGridData(int span) { GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.widthHint = 20; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ChoiceAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ChoiceAttributeRow.java index e42e88abb9..045e8970be 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ChoiceAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ChoiceAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -39,6 +39,7 @@ public class ChoiceAttributeRow extends ExtensionAttributeRow { super(part, att); } + @Override public void createContents(Composite parent, FormToolkit toolkit, int span) { super.createContents(parent, toolkit, span); createLabel(parent, toolkit); @@ -62,6 +63,7 @@ public class ChoiceAttributeRow extends ExtensionAttributeRow { gd.horizontalIndent = FormLayoutFactory.CONTROL_HORIZONTAL_INDENT; combo.getControl().setLayoutData(gd); combo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (!blockNotification) markDirty(); @@ -73,6 +75,7 @@ public class ChoiceAttributeRow extends ExtensionAttributeRow { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.plugin.ExtensionElementEditor#update(org.eclipse.pde.internal.ui.neweditor.plugin.DummyExtensionElement) */ + @Override protected void update() { blockNotification = true; String value = getValue(); @@ -109,6 +112,7 @@ public class ChoiceAttributeRow extends ExtensionAttributeRow { return false; } + @Override public void commit() { if (dirty && input != null) { try { @@ -123,6 +127,7 @@ public class ChoiceAttributeRow extends ExtensionAttributeRow { } } + @Override public void setFocus() { combo.getControl().setFocus(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ClassAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ClassAttributeRow.java index 1e8181507e..5623baed73 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ClassAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ClassAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -36,6 +36,7 @@ public class ClassAttributeRow extends ButtonAttributeRow { super(part, att); } + @Override protected boolean isReferenceModel() { return !part.getPage().getModel().isEditable(); } @@ -45,6 +46,7 @@ public class ClassAttributeRow extends ButtonAttributeRow { * * @see org.eclipse.pde.internal.ui.neweditor.plugin.ReferenceAttributeRow#openReference() */ + @Override protected void openReference() { String name = TextUtil.trimNonAlphaChars(text.getText()).replace('$', '.'); name = PDEJavaHelperUI.createClass(name, getProject(), createJavaAttributeValue(name), true); @@ -57,6 +59,7 @@ public class ClassAttributeRow extends ButtonAttributeRow { * * @see org.eclipse.pde.internal.ui.editor.plugin.rows.ReferenceAttributeRow#createContents(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit, int) */ + @Override public void createContents(Composite parent, FormToolkit toolkit, int span) { super.createContents(parent, toolkit, span); @@ -70,8 +73,10 @@ public class ClassAttributeRow extends ButtonAttributeRow { * * @see org.eclipse.pde.internal.ui.neweditor.plugin.ReferenceAttributeRow#browse() */ + @Override protected void browse() { BusyIndicator.showWhile(text.getDisplay(), new Runnable() { + @Override public void run() { doOpenSelectionDialog(); } @@ -112,6 +117,7 @@ public class ClassAttributeRow extends ButtonAttributeRow { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.plugin.rows.ExtensionAttributeRow#dispose() */ + @Override public void dispose() { super.dispose(); if (fTypeFieldAssistDisposer != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ExtensionAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ExtensionAttributeRow.java index e432cae326..f00f5a6412 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ExtensionAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ExtensionAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2014 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -116,6 +116,7 @@ public abstract class ExtensionAttributeRow implements IControlHoverContentProvi fIC.setSizeConstraints(300, 600); } + @Override public String getHoverContent(Control c) { if (c instanceof Label || c instanceof Hyperlink) { StringBuffer result = new StringBuffer(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ReferenceAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ReferenceAttributeRow.java index e2748039d7..c8c587a873 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ReferenceAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ReferenceAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -40,6 +40,7 @@ public abstract class ReferenceAttributeRow extends TextAttributeRow { * @see org.eclipse.pde.internal.ui.neweditor.plugin.ExtensionElementEditor#createContents(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.forms.widgets.FormToolkit, int) */ + @Override protected void createLabel(Composite parent, FormToolkit toolkit) { if (!part.isEditable()) { super.createLabel(parent, toolkit); @@ -48,6 +49,7 @@ public abstract class ReferenceAttributeRow extends TextAttributeRow { Hyperlink link = toolkit.createHyperlink(parent, getPropertyLabel(), SWT.NULL); link.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { if (!isReferenceModel()) { openReference(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ResourceAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ResourceAttributeRow.java index 9c352375f3..a255eb498c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ResourceAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/ResourceAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -44,10 +44,12 @@ public class ResourceAttributeRow extends ButtonAttributeRow { * * @see org.eclipse.pde.internal.ui.neweditor.plugin.ReferenceAttributeRow#openReference() */ + @Override protected boolean isReferenceModel() { return !part.getPage().getModel().isEditable(); } + @Override protected void openReference() { IResource file = getFile(); boolean successful = false; @@ -114,6 +116,7 @@ public class ResourceAttributeRow extends ButtonAttributeRow { * * @see org.eclipse.pde.internal.ui.neweditor.plugin.ReferenceAttributeRow#browse() */ + @Override protected void browse() { final IProject project = part.getPage().getPDEEditor().getCommonProject(); ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(PDEPlugin.getActiveWorkbenchShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider()); @@ -122,6 +125,7 @@ public class ResourceAttributeRow extends ButtonAttributeRow { if (resource != null) dialog.setInitialSelection(resource); dialog.addFilter(new ViewerFilter() { + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IProject) return ((IProject) element).equals(project); @@ -132,6 +136,7 @@ public class ResourceAttributeRow extends ButtonAttributeRow { dialog.setTitle(PDEUIMessages.ResourceAttributeCellEditor_title); dialog.setMessage(PDEUIMessages.ResourceAttributeCellEditor_message); dialog.setValidator(new ISelectionStatusValidator() { + @Override public IStatus validate(Object[] selection) { if (selection != null && selection.length > 0 && (selection[0] instanceof IFile || selection[0] instanceof IContainer)) return new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TextAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TextAttributeRow.java index 16eee6fae9..40e74685f8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TextAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TextAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -40,12 +40,14 @@ public class TextAttributeRow extends ExtensionAttributeRow { super(part, att); } + @Override public void createContents(Composite parent, FormToolkit toolkit, int span) { super.createContents(parent, toolkit, span); createLabel(parent, toolkit); text = toolkit.createText(parent, "", SWT.SINGLE); //$NON-NLS-1$ text.setLayoutData(createGridData(span)); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (!blockNotification) markDirty(); @@ -64,6 +66,7 @@ public class TextAttributeRow extends ExtensionAttributeRow { private void createUITextFocusListener() { // Required to enable Ctrl-V paste operations text.addFocusListener(new FocusAdapter() { + @Override public void focusGained(FocusEvent e) { ITextSelection selection = new TextSelection(1, 1); part.getPage().getPDEEditor().getContributor().updateSelectableActions(selection); @@ -84,12 +87,14 @@ public class TextAttributeRow extends ExtensionAttributeRow { * * @see org.eclipse.pde.internal.ui.neweditor.plugin.ExtensionElementEditor#update(org.eclipse.pde.internal.ui.neweditor.plugin.DummyExtensionElement) */ + @Override protected void update() { blockNotification = true; text.setText(getValue()); blockNotification = false; } + @Override public void commit() { if (dirty && input != null) { String value = text.getText(); @@ -102,6 +107,7 @@ public class TextAttributeRow extends ExtensionAttributeRow { } } + @Override public void setFocus() { text.setFocus(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TranslatableAttributeRow.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TranslatableAttributeRow.java index 525aebd0ed..b6c949f693 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TranslatableAttributeRow.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/rows/TranslatableAttributeRow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -31,10 +31,12 @@ public class TranslatableAttributeRow extends ReferenceAttributeRow { super(part, att); } + @Override protected boolean isReferenceModel() { return !part.getPage().getModel().isEditable(); } + @Override protected void openReference() { TranslationHyperlink link = new TranslationHyperlink(null, text.getText(), (IPluginModelBase) part.getPage().getModel()); link.open(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/AboutSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/AboutSection.java index cc8b7a5fa6..840c105eb5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/AboutSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/AboutSection.java @@ -51,6 +51,7 @@ public class AboutSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); GridData data = new GridData(GridData.FILL_BOTH); @@ -71,19 +72,23 @@ public class AboutSection extends PDESection { fImageEntry.setEditable(isEditable()); // Create validator fImageEntryValidator = new TextValidator(getManagedForm(), fImageEntry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validateImageEntry(); } }; fImageEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getAboutInfo().setImagePath(entry.getValue()); } + @Override public void browseButtonSelected(FormEntry entry) { handleBrowse(); } + @Override public void linkActivated(HyperlinkEvent e) { EditorUtilities.openImage(fImageEntry.getValue(), getProduct().getDefiningPluginId()); } @@ -107,6 +112,7 @@ public class AboutSection extends PDESection { fTextEntry.setEditable(isEditable()); // Create Text field listener fTextEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getAboutInfo().setText(entry.getValue()); } @@ -141,18 +147,21 @@ public class AboutSection extends PDESection { } } + @Override public void refresh() { fImageEntry.setValue(getAboutInfo().getImagePath(), true); fTextEntry.setValue(getAboutInfo().getText(), true); super.refresh(); } + @Override public void commit(boolean onSave) { fImageEntry.commit(); fTextEntry.commit(); super.commit(onSave); } + @Override public void cancelEdit() { fImageEntry.cancelEdit(); fTextEntry.cancelEdit(); @@ -176,6 +185,7 @@ public class AboutSection extends PDESection { return (IProductModel) getPage().getPDEEditor().getAggregateModel(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -187,6 +197,7 @@ public class AboutSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -204,6 +215,7 @@ public class AboutSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java index bb37eb5802..698578c667 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ArgumentsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -118,6 +118,7 @@ public class ArgumentsSection extends PDESection { else ((CCombo) archComboControl).select(fLastArch[fLastTab]); fArchCombo.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (fProgramArgs.isDirty()) fProgramArgs.commit(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/BrandingPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/BrandingPage.java index 2aa8d209a7..48af514851 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/BrandingPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/BrandingPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -31,6 +31,7 @@ public class BrandingPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.BRANDING_PAGE; } @@ -38,6 +39,7 @@ public class BrandingPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CSSSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CSSSection.java index 6901d2812b..cb5d51a28b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CSSSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CSSSection.java @@ -58,6 +58,7 @@ public class CSSSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); @@ -81,10 +82,12 @@ public class CSSSection extends PDESection { fFileEntry.setEditable(isEditable()); fFileEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getCSSInfo().setFilePath(entry.getValue()); } + @Override public void browseButtonSelected(FormEntry entry) { handleBrowse(); } @@ -96,16 +99,19 @@ public class CSSSection extends PDESection { text.setLayoutData(data); text.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkEntered(HyperlinkEvent e) { IStatusLineManager mng = getPage().getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(e.getLabel()); } + @Override public void linkExited(HyperlinkEvent e) { IStatusLineManager mng = getPage().getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(null); } + @Override public void linkActivated(HyperlinkEvent e) { String href = (String) e.getHref(); if (href.equals("command.synchronize")) { //$NON-NLS-1$ @@ -178,16 +184,19 @@ public class CSSSection extends PDESection { } } + @Override public void refresh() { fFileEntry.setValue(getCSSInfo().getFilePath(), true); super.refresh(); } + @Override public void commit(boolean onSave) { fFileEntry.commit(); super.commit(onSave); } + @Override public void cancelEdit() { fFileEntry.cancelEdit(); super.cancelEdit(); @@ -210,6 +219,7 @@ public class CSSSection extends PDESection { return (IProductModel) getPage().getPDEEditor().getAggregateModel(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -221,6 +231,7 @@ public class CSSSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -238,6 +249,7 @@ public class CSSSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationPage.java index 697b18dd21..cccb896e7a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others + * Copyright (c) 2005, 2015 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 @@ -44,6 +44,7 @@ public class ConfigurationPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationSection.java index b35df4c8b8..15fb9c0799 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ConfigurationSection.java @@ -66,6 +66,7 @@ public class ConfigurationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); @@ -91,6 +92,7 @@ public class ConfigurationSection extends PDESection { fTabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, new int[] {100}, true); fTabFolder.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (fCustomEntry.isDirty()) fCustomEntry.commit(); @@ -105,6 +107,7 @@ public class ConfigurationSection extends PDESection { fDefault.setLayoutData(gd); fDefault.setEnabled(isEditable()); fDefault.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (!fBlockChanges) { boolean selected = fDefault.getSelection(); @@ -128,6 +131,7 @@ public class ConfigurationSection extends PDESection { fCustomEntry = new FormEntry(client, toolkit, PDEUIMessages.ConfigurationSection_file, PDEUIMessages.ConfigurationSection_browse, isEditable(), 35); // BidiUtils.applyBidiProcessing(fCustomEntry.getText(), StructuredTextTypeHandlerFactory.FILE); fCustomEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { if (!fBlockChanges) { IConfigurationFileInfo info = getConfigurationFileInfo(); @@ -137,10 +141,12 @@ public class ConfigurationSection extends PDESection { } } + @Override public void browseButtonSelected(FormEntry entry) { handleBrowse(); } + @Override public void linkActivated(HyperlinkEvent e) { handleOpen(); } @@ -157,6 +163,7 @@ public class ConfigurationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { @@ -181,6 +188,7 @@ public class ConfigurationSection extends PDESection { } } + @Override public void refresh() { fBlockChanges = true; fLastTab = fTabFolder.getSelectionIndex(); @@ -218,16 +226,19 @@ public class ConfigurationSection extends PDESection { return (IProductModel) getPage().getPDEEditor().getAggregateModel(); } + @Override public void commit(boolean onSave) { fCustomEntry.commit(); super.commit(onSave); } + @Override public void cancelEdit() { fCustomEntry.cancelEdit(); super.cancelEdit(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -256,6 +267,7 @@ public class ConfigurationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CustomizationPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CustomizationPage.java index 5ea0bbb20d..2e82b0de23 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CustomizationPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/CustomizationPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Rapicorp Corporation and others. + * Copyright (c) 2014, 2015 Rapicorp 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 @@ -32,6 +32,7 @@ public class CustomizationPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.CUSTOMIZATION_PAGE; } @@ -39,6 +40,7 @@ public class CustomizationPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/DependenciesPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/DependenciesPage.java index 76f93ea68a..1b0c5c001a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/DependenciesPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/DependenciesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 Code 9 Corporation and others. + * Copyright (c) 2008, 2015 Code 9 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 @@ -37,6 +37,7 @@ public class DependenciesPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.CONFIGURATION_PAGE; } @@ -44,6 +45,7 @@ public class DependenciesPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/FeatureSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/FeatureSection.java index 25ab26f673..233124e467 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/FeatureSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/FeatureSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -50,6 +50,7 @@ public class FeatureSection extends TableSection implements IPropertyChangeListe private Action fNewFeatureAction; class ContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object parent) { return getProduct().getFeatures(); } @@ -551,6 +552,7 @@ public class FeatureSection extends TableSection implements IPropertyChangeListe product.swap(feature1, feature2); } + @Override public void propertyChange(PropertyChangeEvent event) { if (fSortAction.equals(event.getSource()) && IAction.RESULT.equals(event.getProperty())) { updateButtons(true, true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/GeneralInfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/GeneralInfoSection.java index d724ed6318..7030ec8b8b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/GeneralInfoSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/GeneralInfoSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 EclipseSource Corporation and others. + * Copyright (c) 2009, 2015 EclipseSource 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 @@ -45,6 +45,7 @@ public class GeneralInfoSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.GeneralInfoSection_title); section.setDescription(PDEUIMessages.GeneralInfoSection_desc); @@ -70,6 +71,7 @@ public class GeneralInfoSection extends PDESection { getModel().addModelChangedListener(this); } + @Override public void dispose() { IProductModel model = getModel(); if (model != null) @@ -80,6 +82,7 @@ public class GeneralInfoSection extends PDESection { private void createNameEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fNameEntry = new FormEntry(client, toolkit, PDEUIMessages.ProductInfoSection_productname, null, false); fNameEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getProduct().setName(entry.getValue().trim()); } @@ -94,6 +97,7 @@ public class GeneralInfoSection extends PDESection { private void createIdEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fIdEntry = new FormEntry(client, toolkit, PDEUIMessages.ProductInfoSection_id, null, false); fIdEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getProduct().setId(entry.getValue().trim()); validateProductId(); @@ -120,6 +124,7 @@ public class GeneralInfoSection extends PDESection { private void createVersionEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { fVersionEntry = new FormEntry(client, toolkit, PDEUIMessages.ProductInfoSection_version, null, false); fVersionEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getProduct().setVersion(entry.getValue().trim()); } @@ -138,6 +143,7 @@ public class GeneralInfoSection extends PDESection { fLaunchersButton.setLayoutData(data); fLaunchersButton.setEnabled(isEditable()); fLaunchersButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { getProduct().setIncludeLaunchers(fLaunchersButton.getSelection()); } @@ -147,6 +153,7 @@ public class GeneralInfoSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean) */ + @Override public void commit(boolean onSave) { fIdEntry.commit(); fNameEntry.commit(); @@ -157,6 +164,7 @@ public class GeneralInfoSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#cancelEdit() */ + @Override public void cancelEdit() { fIdEntry.cancelEdit(); fNameEntry.cancelEdit(); @@ -175,6 +183,7 @@ public class GeneralInfoSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { IProduct product = getProduct(); if (product.getId() != null) { @@ -190,6 +199,7 @@ public class GeneralInfoSection extends PDESection { super.refresh(); } + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -228,6 +238,7 @@ public class GeneralInfoSection extends PDESection { getPage().setLastFocusControl(fIdEntry.getText()); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/IntroSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/IntroSection.java index 8e11512a17..9f0c48c1fa 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/IntroSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/IntroSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -60,6 +60,7 @@ public class IntroSection extends PDESection { createClient(getSection(), page.getEditor().getToolkit()); } + @Override public void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); @@ -92,6 +93,7 @@ public class IntroSection extends PDESection { fIntroCombo.setItems(fAvailableIntroIds); fIntroCombo.add(""); //$NON-NLS-1$ fIntroCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleSelection(); } @@ -102,6 +104,7 @@ public class IntroSection extends PDESection { button.setEnabled(isEditable()); button.setLayoutData(new GridData(GridData.FILL)); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleNewIntro(); } @@ -173,6 +176,7 @@ public class IntroSection extends PDESection { } } + @Override public void refresh() { String introId = getIntroInfo().getId(); if (introId == null) { @@ -226,6 +230,7 @@ public class IntroSection extends PDESection { private void addRequiredBundle() { ModelModification mod = new ModelModification(fManifest) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IBundlePluginModelBase)) return; @@ -248,6 +253,7 @@ public class IntroSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -265,6 +271,7 @@ public class IntroSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/JRESection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/JRESection.java index e51b309fdd..2ef16d3e0e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/JRESection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/JRESection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -42,6 +42,7 @@ import org.eclipse.ui.forms.widgets.*; public class JRESection extends PDESection { private final class EELabelProvider extends LabelProvider { + @Override public String getText(Object element) { if (!(element instanceof IExecutionEnvironment)) return ""; //$NON-NLS-1$ @@ -74,6 +75,7 @@ public class JRESection extends PDESection { createClient(getSection(), page.getEditor().getToolkit()); } + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); @@ -100,6 +102,7 @@ public class JRESection extends PDESection { fTabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, new int[] {100}, true); fTabFolder.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { refresh(); } @@ -118,6 +121,7 @@ public class JRESection extends PDESection { fEEsCombo.setItems(VMUtil.getExecutionEnvironments()); fEEsCombo.addItem("", 0); //$NON-NLS-1$ fEEsCombo.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (!fBlockChanges) { Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement(); @@ -131,6 +135,7 @@ public class JRESection extends PDESection { fExecutionEnvironmentsButton = toolkit.createButton(client, PDEUIMessages.ProductJRESection_browseEEs, SWT.PUSH); GridDataFactory.fillDefaults().applyTo(fExecutionEnvironmentsButton); fExecutionEnvironmentsButton.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event event) { PreferencesUtil.createPreferenceDialogOn(getSection().getShell(), "org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$ new String[] {"org.eclipse.jdt.debug.ui.jreProfiles"}, null).open(); //$NON-NLS-1$ @@ -143,6 +148,7 @@ public class JRESection extends PDESection { buttonLayout.horizontalSpan = 2; fEEButton.setLayoutData(buttonLayout); fEEButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { getJVMLocations().setIncludeJREWithProduct(getOS(fLastTab), fEEButton.getSelection()); } @@ -171,6 +177,7 @@ public class JRESection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getProductModel(); if (model != null) { @@ -199,6 +206,7 @@ public class JRESection extends PDESection { } } + @Override public void refresh() { fBlockChanges = true; fLastTab = fTabFolder.getSelectionIndex(); @@ -249,6 +257,7 @@ public class JRESection extends PDESection { return (IProductModel) getPage().getPDEEditor().getAggregateModel(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); return d.getFocusControl() instanceof Text; @@ -261,6 +270,7 @@ public class JRESection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java index 243e785535..038d8bfcf6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LauncherSection.java @@ -80,14 +80,17 @@ public class LauncherSection extends PDESection { private void addEntryFormListener() { IActionBars actionBars = getPage().getPDEEditor().getEditorSite().getActionBars(); setFormEntryListener(new FormEntryAdapter(LauncherSection.this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getLauncherInfo().setIconPath(fIconId, entry.getValue()); } + @Override public void browseButtonSelected(FormEntry entry) { handleBrowse((IconEntry) entry); } + @Override public void linkActivated(HyperlinkEvent e) { openImage(IconEntry.this.getValue()); } @@ -107,6 +110,7 @@ public class LauncherSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override public void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); @@ -125,6 +129,7 @@ public class LauncherSection extends PDESection { IActionBars actionBars = getPage().getPDEEditor().getEditorSite().getActionBars(); fNameEntry = new FormEntry(container, toolkit, PDEUIMessages.LauncherSection_launcherName, null, false); fNameEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getLauncherInfo().setLauncherName(entry.getValue()); } @@ -145,6 +150,7 @@ public class LauncherSection extends PDESection { fTabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, new int[] {100}, true); fTabFolder.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateTabSelection(); } @@ -174,6 +180,7 @@ public class LauncherSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { @@ -226,6 +233,7 @@ public class LauncherSection extends PDESection { final int index = i; // Create validator fMultipleWinIconValidator[index] = new TextValidator(getManagedForm(), ientry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validateMultipleWinIcon(ientry, index); } @@ -234,6 +242,7 @@ public class LauncherSection extends PDESection { fMultipleWinIconValidator[index].setEnabled(false); // Validate on modify ientry.getText().addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fMultipleWinIconValidator[index].validate(); } @@ -247,6 +256,7 @@ public class LauncherSection extends PDESection { td.colspan = 3; fIcoButton.setLayoutData(td); fIcoButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean selected = fIcoButton.getSelection(); getLauncherInfo().setUseWinIcoFile(selected); @@ -258,6 +268,7 @@ public class LauncherSection extends PDESection { final IconEntry ientry = new IconEntry(comp, toolkit, PDEUIMessages.LauncherSection_file, ILauncherInfo.P_ICO_PATH); // Create validator fSingleWinIconValidator = new TextValidator(getManagedForm(), ientry.getText(), getProject(), true) { + @Override protected boolean validateControl() { return validateSingleWinIcon(ientry); } @@ -331,6 +342,7 @@ public class LauncherSection extends PDESection { return comp; } + @Override public void refresh() { ILauncherInfo info = getLauncherInfo(); fNameEntry.setValue(info.getLauncherName(), true); @@ -400,6 +412,7 @@ public class LauncherSection extends PDESection { return (IProductModel) getPage().getPDEEditor().getAggregateModel(); } + @Override public void commit(boolean onSave) { fNameEntry.commit(); for (int i = 0; i < fIcons.size(); i++) @@ -407,6 +420,7 @@ public class LauncherSection extends PDESection { super.commit(onSave); } + @Override public void cancelEdit() { fNameEntry.cancelEdit(); for (int i = 0; i < fIcons.size(); i++) @@ -466,6 +480,7 @@ public class LauncherSection extends PDESection { return "bmp"; //$NON-NLS-1$ } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); return (d.getFocusControl() instanceof Text); @@ -495,6 +510,7 @@ public class LauncherSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LaunchingPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LaunchingPage.java index a871953e7c..98d785dca6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LaunchingPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LaunchingPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -31,6 +31,7 @@ public class LaunchingPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.LAUNCHING_PAGE; } @@ -38,6 +39,7 @@ public class LaunchingPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicenseSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicenseSection.java index 898ae6eda6..7bb6341098 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicenseSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicenseSection.java @@ -39,6 +39,7 @@ public class LicenseSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { // Configure section @@ -56,6 +57,7 @@ public class LicenseSection extends PDESection { fURLEntry = new FormEntry(client, toolkit, PDEUIMessages.LicenseSection_url, SWT.NONE); BidiUtils.applyBidiProcessing(fURLEntry.getText(), StructuredTextTypeHandlerFactory.URL); fURLEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getLicenseInfo().setURL(entry.getValue()); } @@ -65,6 +67,7 @@ public class LicenseSection extends PDESection { fLicenseEntry = new FormEntry(client, toolkit, PDEUIMessages.LicenseSection_text, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL); fLicenseEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getLicenseInfo().setLicense(entry.getValue()); } @@ -83,6 +86,7 @@ public class LicenseSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { ILicenseInfo info = getLicenseInfo(); fURLEntry.setValue(info.getURL(), true); @@ -90,12 +94,14 @@ public class LicenseSection extends PDESection { super.refresh(); } + @Override public void commit(boolean onSave) { fURLEntry.commit(); fLicenseEntry.commit(); super.commit(onSave); } + @Override public void cancelEdit() { fURLEntry.cancelEdit(); fLicenseEntry.cancelEdit(); @@ -119,6 +125,7 @@ public class LicenseSection extends PDESection { return (IProductModel) getPage().getPDEEditor().getAggregateModel(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -130,6 +137,7 @@ public class LicenseSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -147,6 +155,7 @@ public class LicenseSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicensingPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicensingPage.java index 691570d635..584631add7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicensingPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/LicensingPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 Code 9 Corporation and others. + * Copyright (c) 2008, 2015 Code 9 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 @@ -34,6 +34,7 @@ public class LicensingPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/OverviewPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/OverviewPage.java index 4054b222c5..31555ff820 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/OverviewPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/OverviewPage.java @@ -36,6 +36,7 @@ public class OverviewPage extends LaunchShortcutOverviewPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.OVERVIEW_PAGE; } @@ -43,6 +44,7 @@ public class OverviewPage extends LaunchShortcutOverviewPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -83,6 +85,7 @@ public class OverviewPage extends LaunchShortcutOverviewPage { section.setClient(createClient(section, PDEUIMessages.Product_overview_exporting, toolkit)); } + @Override public void linkActivated(HyperlinkEvent e) { String href = (String) e.getHref(); if (href.equals("action.synchronize")) { //$NON-NLS-1$ @@ -126,6 +129,7 @@ public class OverviewPage extends LaunchShortcutOverviewPage { return fLauncherHelper; } + @Override protected short getIndent() { return 35; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginConfigurationSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginConfigurationSection.java index a350734159..70f7ba452b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginConfigurationSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginConfigurationSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 Code 9 Corporation and others. + * Copyright (c) 2008, 2015 Code 9 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 @@ -53,6 +53,7 @@ public class PluginConfigurationSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { return fProduct.getPluginConfigurations(); } @@ -60,6 +61,7 @@ public class PluginConfigurationSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ + @Override public void dispose() { } @@ -67,6 +69,7 @@ public class PluginConfigurationSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { if (oldInput == newInput) return; @@ -78,12 +81,14 @@ public class PluginConfigurationSection extends TableSection { private class LabelProvider extends PDELabelProvider { + @Override public Image getColumnImage(Object obj, int index) { if (index == 0) return super.getColumnImage(PluginRegistry.findModel(((IPluginConfiguration) obj).getId()), index); return null; } + @Override public String getColumnText(Object obj, int index) { IPluginConfiguration configuration = (IPluginConfiguration) obj; switch (index) { @@ -160,6 +165,7 @@ public class PluginConfigurationSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.ConfigurationPageMock_sectionTitle); section.setDescription(PDEUIMessages.ConfigurationPageMock_sectionDesc); @@ -183,9 +189,11 @@ public class PluginConfigurationSection extends TableSection { table.addControlListener(new ControlListener() { + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { int size = table.getSize().x; column1.setWidth(size / 7 * 4); @@ -208,6 +216,7 @@ public class PluginConfigurationSection extends TableSection { updateRemoveButtons(true, true); } + @Override protected void buttonSelected(int index) { switch (index) { case 0 : @@ -396,6 +405,7 @@ public class PluginConfigurationSection extends TableSection { } } + @Override protected void selectionChanged(IStructuredSelection selection) { updateRemoveButtons(true, false); } @@ -440,6 +450,7 @@ public class PluginConfigurationSection extends TableSection { fAutoColumnEditor.minimumWidth = 50; table.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { showControls(); } @@ -469,6 +480,7 @@ public class PluginConfigurationSection extends TableSection { int defaultLevel = level.length() == 0 || "default".equals(level) ? 0 : Integer.parseInt(level); //$NON-NLS-1$ spinner.setSelection(defaultLevel); spinner.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { int selection = spinner.getSelection(); item.setText(1, selection == 0 ? "default" //$NON-NLS-1$ @@ -484,6 +496,7 @@ public class PluginConfigurationSection extends TableSection { combo.setText(item.getText(2)); combo.pack(); combo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { item.setText(2, combo.getText()); ppc.setAutoStart(Boolean.valueOf(combo.getText()).booleanValue()); @@ -504,6 +517,7 @@ public class PluginConfigurationSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.core.IPluginModelListener#modelsChanged(org.eclipse.pde.internal.core.PluginModelDelta) */ + @Override public void modelChanged(IModelChangedEvent e) { //TODO update modelChanged method // No need to call super, handling world changed event here diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginSection.java index 57ccc3bcef..ffe7e73852 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PluginSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -56,6 +56,7 @@ import org.eclipse.ui.forms.widgets.Section; public class PluginSection extends TableSection implements IPluginModelListener { class ContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object parent) { return getProduct().getPlugins(); } @@ -557,10 +558,12 @@ public class PluginSection extends TableSection implements IPluginModelListener /* (non-Javadoc) * @see org.eclipse.pde.internal.core.IPluginModelListener#modelsChanged(org.eclipse.pde.internal.core.PluginModelDelta) */ + @Override public void modelsChanged(PluginModelDelta delta) { final Control control = fPluginTable.getControl(); if (!control.isDisposed()) { control.getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (!control.isDisposed()) { fPluginTable.refresh(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PreferencesSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PreferencesSection.java index 06b2617c3e..ff2ff84ff7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PreferencesSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PreferencesSection.java @@ -55,6 +55,7 @@ public class PreferencesSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); @@ -74,16 +75,19 @@ public class PreferencesSection extends PDESection { configText.setLayoutData(data); configText.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkEntered(HyperlinkEvent e) { IStatusLineManager mng = getPage().getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(e.getLabel()); } + @Override public void linkExited(HyperlinkEvent e) { IStatusLineManager mng = getPage().getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(null); } + @Override public void linkActivated(HyperlinkEvent e) { String href = (String) e.getHref(); if (href.equals("command.generate")) { //$NON-NLS-1$ @@ -302,6 +306,7 @@ public class PreferencesSection extends PDESection { } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -313,6 +318,7 @@ public class PreferencesSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -330,6 +336,7 @@ public class PreferencesSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductEditor.java index c01dc57cbb..e97cca7325 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -41,6 +41,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#getEditorID() */ + @Override protected String getEditorID() { return IPDEUIConstants.PRODUCT_EDITOR_ID; } @@ -48,6 +49,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#isSaveAsAllowed() */ + @Override public boolean isSaveAsAllowed() { return true; } @@ -55,6 +57,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#getContextIDForSaveAs() */ + @Override public String getContextIDForSaveAs() { return ProductInputContext.CONTEXT_ID; } @@ -62,6 +65,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#createInputContextManager() */ + @Override protected InputContextManager createInputContextManager() { return new ProductInputContextManager(this); } @@ -69,6 +73,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#createResourceContexts(org.eclipse.pde.internal.ui.editor.context.InputContextManager, org.eclipse.ui.IFileEditorInput) */ + @Override protected void createResourceContexts(InputContextManager manager, IFileEditorInput input) { manager.putContext(input, new ProductInputContext(this, input, true)); manager.monitorFile(input.getFile()); @@ -77,6 +82,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#createSystemFileContexts(org.eclipse.pde.internal.ui.editor.context.InputContextManager, org.eclipse.pde.internal.ui.editor.SystemFileEditorInput) */ + @Override protected void createSystemFileContexts(InputContextManager manager, FileStoreEditorInput input) { File file = new File(input.getURI()); String name = file.getName(); @@ -95,6 +101,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#createStorageContexts(org.eclipse.pde.internal.ui.editor.context.InputContextManager, org.eclipse.ui.IStorageEditorInput) */ + @Override protected void createStorageContexts(InputContextManager manager, IStorageEditorInput input) { if (input.getName().endsWith(".product")) { //$NON-NLS-1$ manager.putContext(input, new ProductInputContext(this, input, true)); @@ -104,6 +111,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#createContentOutline() */ + @Override protected ISortableContentOutlinePage createContentOutline() { return new ProductOutlinePage(this); } @@ -111,6 +119,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#getInputContext(java.lang.Object) */ + @Override protected InputContext getInputContext(Object object) { return fInputContextManager.findContext(ProductInputContext.CONTEXT_ID); } @@ -118,6 +127,7 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormEditor#addPages() */ + @Override protected void addEditorPages() { try { addPage(new OverviewPage(this)); @@ -150,12 +160,14 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.IInputContextListener#contextAdded(org.eclipse.pde.internal.ui.editor.context.InputContext) */ + @Override public void editorContextAdded(InputContext context) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.IInputContextListener#contextRemoved(org.eclipse.pde.internal.ui.editor.context.InputContext) */ + @Override public void contextRemoved(InputContext context) { close(false); } @@ -163,16 +175,19 @@ public class ProductEditor extends PDELauncherFormEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.IInputContextListener#monitoredFileAdded(org.eclipse.core.resources.IFile) */ + @Override public void monitoredFileAdded(IFile monitoredFile) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.IInputContextListener#monitoredFileRemoved(org.eclipse.core.resources.IFile) */ + @Override public boolean monitoredFileRemoved(IFile monitoredFile) { return true; } + @Override public void contributeToToolbar(IToolBarManager manager) { contributeLaunchersToToolbar(manager); manager.add(getExportAction()); @@ -189,6 +204,7 @@ public class ProductEditor extends PDELauncherFormEditor { return fExportAction; } + @Override protected ILauncherFormPageHelper getLauncherHelper() { if (fLauncherHelper == null) fLauncherHelper = new ProductLauncherFormPageHelper(this); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductExportAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductExportAction.java index 4dbc8085c0..3a62d7fd22 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductExportAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductExportAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -43,6 +43,7 @@ public class ProductExportAction extends Action { fProject = null; } + @Override public void run() { ProductExportWizard wizard = new ProductExportWizard(fProject); wizard.init(PlatformUI.getWorkbench(), fSelection); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInfoSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInfoSection.java index 8f3a88d47a..d79b48b518 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInfoSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInfoSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -55,16 +55,19 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis class ExtensionIdComboPart extends ComboPart implements SelectionListener { private String fRemovedId; + @Override public void createControl(Composite parent, FormToolkit toolkit, int style) { super.createControl(parent, toolkit, style); addSelectionListener(this); } + @Override public void widgetSelected(SelectionEvent e) { if (getSelectionIndex() != getItemCount() - 1) fRemovedId = null; } + @Override public void widgetDefaultSelected(SelectionEvent e) { } @@ -151,6 +154,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.ProductInfoSection_title); section.setDescription(PDEUIMessages.ProductInfoSection_desc); @@ -177,6 +181,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis PDECore.getDefault().getModelManager().addStateDeltaListener(this); } + @Override public void dispose() { IProductModel model = getModel(); if (model != null) @@ -197,6 +202,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis fProductCombo.setItems(TargetPlatform.getProducts()); fProductCombo.add(""); //$NON-NLS-1$ fProductCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { getProduct().setProductId(fProductCombo.getSelection()); } @@ -205,6 +211,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis Button button = toolkit.createButton(client, PDEUIMessages.ProductInfoSection_new, SWT.PUSH); button.setEnabled(isEditable()); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleNewDefinition(); } @@ -237,6 +244,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis fAppCombo.setItems(TargetPlatform.getApplications()); fAppCombo.add(""); //$NON-NLS-1$ fAppCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { getProduct().setApplication(fAppCombo.getSelection()); } @@ -257,14 +265,17 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis FormText text = toolkit.createFormText(comp, true); text.setText(PDEUIMessages.Product_overview_configuration, true, true); text.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkEntered(HyperlinkEvent e) { getStatusLineManager().setMessage(e.getLabel()); } + @Override public void linkExited(HyperlinkEvent e) { getStatusLineManager().setMessage(null); } + @Override public void linkActivated(HyperlinkEvent e) { String pageId = fPluginButton.getSelection() ? DependenciesPage.PLUGIN_ID : DependenciesPage.FEATURE_ID; getPage().getEditor().setActivePage(pageId); @@ -277,6 +288,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis fPluginButton.setLayoutData(gd); fPluginButton.setEnabled(isEditable()); fPluginButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean selected = fPluginButton.getSelection(); IProduct product = getProduct(); @@ -305,6 +317,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { IProduct product = getProduct(); if (product.getProductId() != null) { @@ -318,6 +331,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis super.refresh(); } + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -385,6 +399,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis return site.getActionBars().getStatusLineManager(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -393,6 +408,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis return false; } + @Override public void registryChanged(IRegistryChangeEvent event) { final IExtensionDelta[] applicationDeltas = event.getExtensionDeltas(IPDEBuildConstants.BUNDLE_CORE_RUNTIME, "applications"); //$NON-NLS-1$ final IExtensionDelta[] productDeltas = event.getExtensionDeltas(IPDEBuildConstants.BUNDLE_CORE_RUNTIME, "products"); //$NON-NLS-1$ @@ -400,6 +416,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis return; Display.getDefault().syncExec(new Runnable() { + @Override public void run() { fAppCombo.handleExtensionDelta(applicationDeltas); fProductCombo.handleExtensionDelta(productDeltas); @@ -407,6 +424,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis }); } + @Override public void stateChanged(State newState) { String[] products = TargetPlatform.getProducts(); final String[] finalProducts = new String[products.length + 1]; @@ -419,6 +437,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis finalApps[apps.length] = ""; //$NON-NLS-1$ Display.getDefault().syncExec(new Runnable() { + @Override public void run() { fAppCombo.reload(finalApps); fProductCombo.reload(finalProducts); @@ -426,6 +445,7 @@ public class ProductInfoSection extends PDESection implements IRegistryChangeLis }); } + @Override public void stateResolved(StateDelta delta) { // do nothing } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContext.java index eb3ef5b853..f6a0d4a8e4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -42,6 +42,7 @@ public class ProductInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -49,6 +50,7 @@ public class ProductInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.InputContext#createModel(org.eclipse.ui.IEditorInput) */ + @Override protected IBaseModel createModel(IEditorInput input) throws CoreException { IProductModel model = null; if (input instanceof IStorageEditorInput) { @@ -78,12 +80,14 @@ public class ProductInputContext extends UTF8InputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.InputContext#addTextEditOperation(java.util.ArrayList, org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.InputContext#flushModel(org.eclipse.jface.text.IDocument) */ + @Override protected void flushModel(IDocument doc) { if (!(getModel() instanceof IEditable)) return; @@ -104,6 +108,7 @@ public class ProductInputContext extends UTF8InputContext { } } + @Override public void doRevert() { fEditOperations.clear(); IProductModel model = (IProductModel) getModel(); @@ -115,6 +120,7 @@ public class ProductInputContext extends UTF8InputContext { } } + @Override protected String getPartitionName() { return "___prod_partition"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContextManager.java index ec0fb92ac9..63f6f942b5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductInputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -27,6 +27,7 @@ public class ProductInputContextManager extends InputContextManager { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.InputContextManager#getAggregateModel() */ + @Override public IBaseModel getAggregateModel() { InputContext context = findContext(ProductInputContext.CONTEXT_ID); return (context != null) ? context.getModel() : null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductLauncherFormPageHelper.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductLauncherFormPageHelper.java index 64ca4cb181..c14e49098c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductLauncherFormPageHelper.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductLauncherFormPageHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -31,6 +31,7 @@ public class ProductLauncherFormPageHelper implements ILauncherFormPageHelper { fEditor = editor; } + @Override public Object getLaunchObject() { Object file = fEditor.getEditorInput().getAdapter(IFile.class); if (file != null) @@ -38,10 +39,12 @@ public class ProductLauncherFormPageHelper implements ILauncherFormPageHelper { return ((IProductModel) fEditor.getAggregateModel()).getUnderlyingResource(); } + @Override public boolean isOSGi() { return false; } + @Override public void preLaunch() { handleSynchronize(false); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductOutlinePage.java index 758b2f3620..ffae099282 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -20,9 +20,11 @@ public class ProductOutlinePage extends FormOutlinePage { super(editor); } + @Override public void sort(boolean sorting) { } + @Override protected Object[] getChildren(Object parent) { if (parent instanceof DependenciesPage) { DependenciesPage page = (DependenciesPage) parent; @@ -34,6 +36,7 @@ public class ProductOutlinePage extends FormOutlinePage { return new Object[0]; } + @Override protected String getParentPageId(Object item) { if (item instanceof IProductPlugin) return DependenciesPage.PLUGIN_ID; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductValidateAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductValidateAction.java index 20ab180c9a..fb9b722a8d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductValidateAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/ProductValidateAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 EclipseSource Corporation and others. + * Copyright (c) 2009, 2015 EclipseSource 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 @@ -37,6 +37,7 @@ public class ProductValidateAction extends Action { fProduct = product; } + @Override public void run() { Set<IPluginModelBase> launchPlugins = new HashSet<IPluginModelBase>(); if (fProduct.useFeatures()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java index bcedc5ebcd..364e31487d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/PropertiesSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 IBM Corporation and others. + * Copyright (c) 2010, 2015 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 @@ -52,6 +52,7 @@ public class PropertiesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IProduct) { return ((IProduct) inputElement).getConfigurationProperties(); @@ -62,24 +63,28 @@ public class PropertiesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } private class LabelProvider extends PDELabelProvider { + @Override public Image getColumnImage(Object obj, int index) { if (index == 0) return get(PDEPluginImages.DESC_PROPERTIES); return null; } + @Override public String getColumnText(Object obj, int index) { IConfigurationProperty configuration = (IConfigurationProperty) obj; switch (index) { @@ -116,12 +121,14 @@ public class PropertiesSection extends TableSection { setTitle(PDEUIMessages.PropertiesSection_PropertyDialogTitle); } + @Override protected Control createDialogArea(Composite parent) { Composite comp = (Composite) super.createDialogArea(parent); ((GridLayout) comp.getLayout()).numColumns = 2; SWTFactory.createLabel(comp, PDEUIMessages.PropertiesSection_Name, 1); fName = SWTFactory.createSingleText(comp, 1); fName.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validate(); } @@ -129,6 +136,7 @@ public class PropertiesSection extends TableSection { SWTFactory.createLabel(comp, PDEUIMessages.PropertiesSection_Value, 1); fValue = SWTFactory.createSingleText(comp, 1); fValue.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validate(); } @@ -136,10 +144,12 @@ public class PropertiesSection extends TableSection { SWTFactory.createLabel(comp, PDEUIMessages.PropertiesSection_OS, 1); fOS = SWTFactory.createCombo(comp, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, COMBO_OSLABELS); fOS.addSelectionListener(new SelectionListener() { + @Override public void widgetSelected(SelectionEvent e) { updateStatus(Status.OK_STATUS); } + @Override public void widgetDefaultSelected(SelectionEvent e) { updateStatus(Status.OK_STATUS); } @@ -149,10 +159,12 @@ public class PropertiesSection extends TableSection { SWTFactory.createLabel(comp, PDEUIMessages.PropertiesSection_Arch, 1); fArch = SWTFactory.createCombo(comp, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, COMBO_ARCHLABELS); fArch.addSelectionListener(new SelectionListener() { + @Override public void widgetSelected(SelectionEvent e) { updateStatus(Status.OK_STATUS); } + @Override public void widgetDefaultSelected(SelectionEvent e) { updateStatus(Status.OK_STATUS); } @@ -197,6 +209,7 @@ public class PropertiesSection extends TableSection { } } + @Override protected void okPressed() { if (fEdit != null) { // Product properties are stored in a map that isn't updated on edit, remove the property and add a new one @@ -215,6 +228,7 @@ public class PropertiesSection extends TableSection { super.okPressed(); } + @Override protected Control createHelpControl(Composite parent) { return parent; } @@ -229,14 +243,17 @@ public class PropertiesSection extends TableSection { } class ValueCellModifier implements ICellModifier { + @Override public boolean canModify(Object element, String property) { return element instanceof IConfigurationProperty; } + @Override public Object getValue(Object element, String property) { return ((IConfigurationProperty) element).getValue(); } + @Override public void modify(Object item, String property, Object value) { Object data = ((TableItem) item).getData(); if (data instanceof IConfigurationProperty) { @@ -261,6 +278,7 @@ public class PropertiesSection extends TableSection { return labels; } + @Override protected void buttonSelected(int index) { switch (index) { case 0 : @@ -278,6 +296,7 @@ public class PropertiesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { section.setText(PDEUIMessages.PropertiesSection_PropertiesSectionTitle); section.setDescription(PDEUIMessages.PropertiesSection_PropertiesSectionDescription); @@ -289,11 +308,13 @@ public class PropertiesSection extends TableSection { fPropertiesTable = getTablePart().getTableViewer(); fPropertiesTable.setSorter(new ViewerSorter()); fPropertiesTable.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleEdit(); } }); fPropertiesTable.getTable().addKeyListener(new KeyAdapter() { + @Override public void keyReleased(KeyEvent e) { if (e.keyCode == SWT.DEL) { handleRemove(); @@ -321,9 +342,11 @@ public class PropertiesSection extends TableSection { table.addControlListener(new ControlListener() { + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { int size = table.getSize().x; nameColumn.setWidth(size / 9 * 3); @@ -408,6 +431,7 @@ public class PropertiesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.TableSection#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection) */ + @Override protected void selectionChanged(IStructuredSelection selection) { updateButtons(); } @@ -429,6 +453,7 @@ public class PropertiesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.core.IPluginModelListener#modelsChanged(org.eclipse.pde.internal.core.PluginModelDelta) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here fPropertiesTable.setInput(getProduct()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashConfigurationSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashConfigurationSection.java index 2a4653c298..915b58858b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashConfigurationSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashConfigurationSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -73,6 +73,7 @@ public class SplashConfigurationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { // Set globals fSection = section; @@ -92,12 +93,14 @@ public class SplashConfigurationSection extends PDESection { private void createUIListenersFieldTemplateCombo() { // Selection listener fFieldTemplateCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleTemplateComboWidgetSelected(); } }); // Focus listener fFieldTemplateCombo.getControl().addFocusListener(new FocusAdapter() { + @Override public void focusGained(FocusEvent e) { double currentTarget = TargetPlatformHelper.getTargetVersion(); if (currentTarget <= 3.2) { @@ -105,6 +108,7 @@ public class SplashConfigurationSection extends PDESection { } } + @Override public void focusLost(FocusEvent e) { fControlDecoration.hide(); } @@ -248,6 +252,7 @@ public class SplashConfigurationSection extends PDESection { private void createProgressBarConfig(Composite parent) { fAddBarButton = createButton(parent, fToolkit, PDEUIMessages.SplashSection_progressBar); fAddBarButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean enable = fAddBarButton.getSelection(); getSplashInfo().addProgressBar(enable, false); @@ -276,6 +281,7 @@ public class SplashConfigurationSection extends PDESection { for (int i = 0; i < fBarSpinners.length; i++) { fBarSpinners[i].setEnabled(isEditable()); fBarSpinners[i].addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { applySpinners(true); } @@ -292,6 +298,7 @@ public class SplashConfigurationSection extends PDESection { private void createProgressMessageConfig(Composite parent) { fAddMessageButton = createButton(parent, fToolkit, PDEUIMessages.SplashSection_progressMessage); fAddMessageButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean enable = fAddMessageButton.getSelection(); getSplashInfo().addProgressMessage(enable, false); @@ -315,6 +322,7 @@ public class SplashConfigurationSection extends PDESection { fMessageControls[8] = createLabel(parent, fToolkit, foreground, PDEUIMessages.SplashSection_messageColor); fColorSelector = new ColorSelector(parent); fColorSelector.addListener(new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { if (!event.getNewValue().equals(event.getOldValue())) applyColor(); @@ -328,6 +336,7 @@ public class SplashConfigurationSection extends PDESection { for (int i = 0; i < fMessageSpinners.length; i++) { fMessageSpinners[i].setEnabled(isEditable()); fMessageSpinners[i].addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { applySpinners(false); } @@ -409,6 +418,7 @@ public class SplashConfigurationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { ISplashInfo info = getSplashInfo(); fBlockNotification = true; @@ -491,6 +501,7 @@ public class SplashConfigurationSection extends PDESection { return (IProductModel) getPage().getPDEEditor().getAggregateModel(); } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -523,6 +534,7 @@ public class SplashConfigurationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -556,6 +568,7 @@ public class SplashConfigurationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashLocationSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashLocationSection.java index c232cceea4..7257268bf2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashLocationSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashLocationSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -40,6 +40,7 @@ public class SplashLocationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override protected void createClient(Section section, FormToolkit toolkit) { // Configure section @@ -56,10 +57,12 @@ public class SplashLocationSection extends PDESection { IActionBars actionBars = getPage().getPDEEditor().getEditorSite().getActionBars(); fPluginEntry = new FormEntry(client, toolkit, PDEUIMessages.SplashSection_plugin, PDEUIMessages.SplashSection_browse, false); fPluginEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { getSplashInfo().setLocation(entry.getValue(), false); } + @Override public void browseButtonSelected(FormEntry entry) { handleBrowse(); } @@ -75,17 +78,20 @@ public class SplashLocationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { ISplashInfo info = getSplashInfo(); fPluginEntry.setValue(info.getLocation(), true); super.refresh(); } + @Override public void commit(boolean onSave) { fPluginEntry.commit(); super.commit(onSave); } + @Override public void cancelEdit() { fPluginEntry.cancelEdit(); super.cancelEdit(); @@ -120,6 +126,7 @@ public class SplashLocationSection extends PDESection { } } + @Override public boolean canPaste(Clipboard clipboard) { Display d = getSection().getDisplay(); Control c = d.getFocusControl(); @@ -131,6 +138,7 @@ public class SplashLocationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#modelChanged(org.eclipse.pde.core.IModelChangedEvent) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { @@ -148,6 +156,7 @@ public class SplashLocationSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { IProductModel model = getModel(); if (model != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashPage.java index 8c46418889..eeda78c1cd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/SplashPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -36,6 +36,7 @@ public class SplashPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.SPLASH_PAGE; } @@ -43,6 +44,7 @@ public class SplashPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesPage.java index d6d6f4b972..29f842cdc5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Rapicorp Corporation and others. + * Copyright (c) 2014, 2015 Rapicorp 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 @@ -31,6 +31,7 @@ public class UpdatesPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.UPDATES_PAGE; } @@ -38,6 +39,7 @@ public class UpdatesPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesSection.java index f986f27d60..753e555b29 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/UpdatesSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Rapicorp Corporation and others. + * Copyright (c) 2014, 2015 Rapicorp 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 @@ -49,6 +49,7 @@ public class UpdatesSection extends TableSection { setTitle(PDEUIMessages.UpdatesSection_RepositoryDialogTitle); } + @Override protected Control createDialogArea(Composite parent) { Composite comp = (Composite) super.createDialogArea(parent); ((GridLayout) comp.getLayout()).numColumns = 2; @@ -61,6 +62,7 @@ public class UpdatesSection extends TableSection { target.setTransfer(new Transfer[] {URLTransfer.getInstance(), FileTransfer.getInstance()}); target.addDropListener(new TextURLDropAdapter(fLocation, true)); fLocation.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validate(); } @@ -96,6 +98,7 @@ public class UpdatesSection extends TableSection { updateStatus(Status.OK_STATUS); } + @Override protected void okPressed() { if (fEdit != null) { // Remove the repository and add a new one @@ -113,6 +116,7 @@ public class UpdatesSection extends TableSection { super.okPressed(); } + @Override protected Control createHelpControl(Composite parent) { return parent; } @@ -135,6 +139,7 @@ public class UpdatesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IProduct) { return ((IProduct) inputElement).getRepositories(); @@ -145,24 +150,28 @@ public class UpdatesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } private class LabelProvider extends PDELabelProvider { + @Override public Image getColumnImage(Object obj, int index) { if (index == 0) return get(PDEPluginImages.DESC_REPOSITORY_OBJ); return null; } + @Override public String getColumnText(Object obj, int index) { IRepositoryInfo repo = (IRepositoryInfo) obj; switch (index) { @@ -231,9 +240,11 @@ public class UpdatesSection extends TableSection { table.addControlListener(new ControlListener() { + @Override public void controlMoved(ControlEvent e) { } + @Override public void controlResized(ControlEvent e) { int size = table.getSize().x; locationColumn.setWidth(size / 6 * 5); @@ -397,6 +408,7 @@ public class UpdatesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.pde.internal.core.IPluginModelListener#modelsChanged(org.eclipse.pde.internal.core.PluginModelDelta) */ + @Override public void modelChanged(IModelChangedEvent e) { // No need to call super, handling world changed event here fRepositoryTable.setInput(getProduct()); @@ -430,6 +442,7 @@ public class UpdatesSection extends TableSection { fEnabledColumnEditor.minimumWidth = 50; table.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { showControls(); } @@ -456,6 +469,7 @@ public class UpdatesSection extends TableSection { combo.setText(item.getText(1)); combo.pack(); combo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { item.setText(1, combo.getText()); repo.setEnabled(Boolean.valueOf(combo.getText()).booleanValue()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/VersionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/VersionDialog.java index d20c97c5c2..60bc343569 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/VersionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/product/VersionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 Code 9 Corporation and others. + * Copyright (c) 2008, 2015 Code 9 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 @@ -27,6 +27,7 @@ public class VersionDialog extends StatusDialog { super(parent); fEditable = editable; fVersionPart = new PluginVersionPart(false) { + @Override protected String getGroupText() { return PDEUIMessages.VersionDialog_text; } @@ -35,11 +36,13 @@ public class VersionDialog extends StatusDialog { setTitle(PDEUIMessages.VersionDialog_title); } + @Override protected Control createDialogArea(Composite parent) { Composite comp = (Composite) super.createDialogArea(parent); fVersionPart.createVersionFields(comp, true, fEditable); ModifyListener ml = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { updateStatus(fVersionPart.validateFullVersionRangeText(true)); } @@ -53,6 +56,7 @@ public class VersionDialog extends StatusDialog { return fVersion; } + @Override protected void okPressed() { fVersion = fVersionPart.getVersion(); super.okPressed(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java index 9dfee3ac78..4175e2124a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/AbstractSchemaDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -58,6 +58,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { fShowDescription = showDescription; } + @Override public void modelChanged(IModelChangedEvent event) { if ((event.getChangeType() == IModelChangedEvent.REMOVE) || (fShowDTD == false) || (fDtdSection == null)) { return; @@ -69,6 +70,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { } } + @Override public final void createContents(Composite parent) { // This is a hacked fix to ensure that the label columns on every details // page have the same width. SchemaDetails_translatable plus 11 pixels @@ -146,6 +148,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { //gd.horizontalIndent = FormLayoutFactory.CONTROL_HORIZONTAL_INDENT; fDescriptionViewer.createUI(container, gd); fDescriptionViewer.getDocument().addDocumentListener(new IDocumentListener() { + @Override public void documentChanged(DocumentEvent event) { if (blockListeners()) return; @@ -161,6 +164,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { } } + @Override public void documentAboutToBeChanged(DocumentEvent event) { } }); @@ -184,35 +188,42 @@ public abstract class AbstractSchemaDetails extends PDEDetails { fSection.setText(title); } + @Override public String getContextId() { return SchemaInputContext.CONTEXT_ID; } + @Override public PDEFormPage getPage() { return (PDEFormPage) getManagedForm().getContainer(); } + @Override public boolean isEditable() { return getPage().getPDEEditor().getAggregateModel().isEditable(); } + @Override public void fireSaveNeeded() { markDirty(); getPage().getPDEEditor().fireSaveNeeded(getContextId(), false); } + @Override public boolean canPaste(Clipboard clipboard) { if (fShowDescription && fDescriptionViewer != null && fDescriptionViewer.getViewer().getTextWidget().isFocusControl()) return fDescriptionViewer.canPaste(); return super.canPaste(clipboard); } + @Override public boolean doGlobalAction(String actionId) { if (fShowDescription && fDescriptionViewer != null && fDescriptionViewer.getViewer().getTextWidget().isFocusControl()) return fDescriptionViewer.doGlobalAction(actionId); return super.doGlobalAction(actionId); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (!(part instanceof ElementSection)) return; @@ -322,6 +333,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { gd.horizontalIndent = 10; fUnboundSelect.setLayoutData(gd); fUnboundSelect.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -365,6 +377,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { protected void hookMinOccur(SelectionAdapter adapter) { fMinOccurSpinner.addSelectionListener(adapter); fMinOccurSpinner.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (blockListeners()) return; @@ -379,6 +392,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { fUnboundSelect.addSelectionListener(adapter); fMaxOccurSpinner.addSelectionListener(adapter); fMaxOccurSpinner.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (blockListeners()) return; @@ -405,6 +419,7 @@ public abstract class AbstractSchemaDetails extends PDEDetails { fBlockListeners = blockListeners; } + @Override public void dispose() { // Set the context menu to null to prevent the editor context menu // from being disposed along with the source viewer diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/DocSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/DocSection.java index 2cccc5675f..8365b5a91e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/DocSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/DocSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -58,11 +58,13 @@ public class DocSection extends PDESection { createClient(getSection(), page.getManagedForm().getToolkit()); } + @Override public void commit(boolean onSave) { handleApply(); super.commit(onSave); } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = toolkit.createComposite(section); container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 1)); @@ -81,6 +83,7 @@ public class DocSection extends PDESection { fTabFolder.setSelectionBackground(new Color[] {selectedColor, toolkit.getColors().getBackground()}, new int[] {100}, true); fTabFolder.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateTabSelection(); } @@ -91,6 +94,7 @@ public class DocSection extends PDESection { fSourceViewer.configure(fSourceConfiguration); fSourceViewer.setDocument(fDocument); fSourceViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateSelection(event.getSelection()); } @@ -100,6 +104,7 @@ public class DocSection extends PDESection { styledText.setMenu(getPage().getPDEEditor().getContextMenu()); styledText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); styledText.addFocusListener(new FocusAdapter() { + @Override public void focusGained(FocusEvent e) { getPage().getPDEEditor().getContributor().updateSelectableActions(null); } @@ -123,6 +128,7 @@ public class DocSection extends PDESection { } } + @Override public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.CUT.getId())) { fSourceViewer.doOperation(ITextOperationTarget.CUT); @@ -153,6 +159,7 @@ public class DocSection extends PDESection { getPage().getPDEEditor().getContributor().contextMenuAboutToShow(manager); } + @Override public boolean setFormInput(Object input) { int index = -1; if (input instanceof ISchema) { @@ -206,12 +213,14 @@ public class DocSection extends PDESection { public void initialize() { fSourceViewer.setEditable(fSchema.isEditable()); fDocument.addDocumentListener(new IDocumentListener() { + @Override public void documentChanged(DocumentEvent e) { if (!fIgnoreChange && fSchema.isEditable()) { markDirty(); } } + @Override public void documentAboutToBeChanged(DocumentEvent e) { } }); @@ -222,6 +231,7 @@ public class DocSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#dispose() */ + @Override public void dispose() { // Dispose of the source configuration if (fSourceConfiguration != null) { @@ -269,6 +279,7 @@ public class DocSection extends PDESection { } } + @Override public void setFocus() { fSourceViewer.getTextWidget().setFocus(); updateSelection(fSourceViewer.getSelection()); @@ -288,12 +299,14 @@ public class DocSection extends PDESection { fIgnoreChange = false; } + @Override public void modelChanged(IModelChangedEvent e) { if (e.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { markStale(); } } + @Override public void refresh() { IDocumentSection[] sections = fSchema.getDocumentSections(); int index = fTabFolder.getSelectionIndex(); @@ -305,6 +318,7 @@ public class DocSection extends PDESection { super.refresh(); } + @Override public boolean canPaste(Clipboard clipboard) { return fSourceViewer.canDoOperation(ITextOperationTarget.PASTE); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java index 060a4039b0..75eec83ad5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -46,6 +46,7 @@ public class ElementSection extends TreeSection { private CollapseAction fCollapseAction; class ContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object object) { if (object instanceof Schema) { Schema schema = (Schema) object; @@ -54,6 +55,7 @@ public class ElementSection extends TreeSection { return new Object[0]; } + @Override public Object[] getChildren(Object parent) { Object[] children = new Object[0]; if (parent instanceof ISchemaElement) { @@ -74,12 +76,14 @@ public class ElementSection extends TreeSection { return children; } + @Override public Object getParent(Object child) { if (child instanceof ISchemaObject) return ((ISchemaObject) child).getParent(); return null; } + @Override public boolean hasChildren(Object parent) { if (parent instanceof ISchemaAttribute || parent instanceof ISchemaObjectReference) return false; @@ -544,6 +548,7 @@ public class ElementSection extends TreeSection { } else if (e.getChangeType() == IModelChangedEvent.INSERT) { fTreeViewer.add(parent, sobj); fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() { + @Override public void run() { fTreeViewer.setSelection(new StructuredSelection(sobj), true); } @@ -565,6 +570,7 @@ public class ElementSection extends TreeSection { final ISchemaCompositor compositor = type.getCompositor(); if (compositor != null) { fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() { + @Override public void run() { fTreeViewer.setSelection(new StructuredSelection(compositor), true); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDragAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDragAdapter.java index 627929e74e..372995b16e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDragAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDragAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public class ElementSectionDragAdapter extends DragSourceAdapter { * Returns the data to be transferred in a drag and drop * operation. */ + @Override public void dragSetData(DragSourceEvent event) { if (event.doit == false) return; @@ -63,6 +64,7 @@ public class ElementSectionDragAdapter extends DragSourceAdapter { /** * All selection must be named model objects. */ + @Override public void dragStart(DragSourceEvent event) { // Workaround for 1GEUS9V @@ -76,6 +78,7 @@ public class ElementSectionDragAdapter extends DragSourceAdapter { event.doit = canDrag(); } + @Override public void dragFinished(DragSourceEvent event) { if (event.doit == false || fDragData == null) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDropAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDropAdapter.java index 6797c1523c..a1974cc269 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDropAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/ElementSectionDropAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -29,6 +29,7 @@ public class ElementSectionDropAdapter extends ViewerDropAdapter { /** * @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object) */ + @Override public boolean performDrop(Object data) { fSsection.handleOp(getCurrentTarget(), fDragAdapter.getDragData(), getCurrentOperation()); return true; @@ -37,6 +38,7 @@ public class ElementSectionDropAdapter extends ViewerDropAdapter { /** * @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData) */ + @Override public boolean validateDrop(Object target, int operation, TransferData transferType) { fCurrentTransfer = transferType; if (!ModelDataTransfer.getInstance().isSupportedType(fCurrentTransfer)) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/FilteredSchemaAttributeSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/FilteredSchemaAttributeSelectionDialog.java index 59f1901563..fc4a2f6a58 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/FilteredSchemaAttributeSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/FilteredSchemaAttributeSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -43,6 +43,7 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti setChecked(true); } + @Override public void run() { optionalAttributesFilter.setEnabled(isChecked()); scheduleRefresh(); @@ -54,6 +55,7 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti private boolean enabled = true; + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (enabled) // select everything return true; @@ -85,16 +87,19 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.FILTERED_SCHEMA_ATTRIBUTE_SELECTION_DIALOG); } private class SchemaListLabelProvider extends LabelProvider implements ILabelDecorator { + @Override public Image getImage(Object element) { return PDEPlugin.getDefault().getLabelProvider().getImage(element); } + @Override public String getText(Object element) { if (element instanceof ISchemaAttribute) { ISchemaAttribute attribute = (ISchemaAttribute) element; @@ -107,10 +112,12 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti return PDEPlugin.getDefault().getLabelProvider().getText(element); } + @Override public Image decorateImage(Image image, Object element) { return image; // nothing to decorate } + @Override public String decorateText(String text, Object element) { if (element instanceof ISchemaAttribute) { ISchemaAttribute attribute = (ISchemaAttribute) element; @@ -125,10 +132,12 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti private class SchemaDetailsLabelProvider extends LabelProvider { + @Override public Image getImage(Object element) { return PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_EXT_POINT_OBJ); } + @Override public String getText(Object element) { if (element instanceof ISchemaAttribute) { ISchemaAttribute attribute = (ISchemaAttribute) element; @@ -141,10 +150,12 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti private class SchemaItemsFilter extends ItemsFilter { + @Override public boolean isConsistentItem(Object item) { return true; } + @Override public boolean matchItem(Object item) { if (item instanceof ISchemaAttribute) { ISchemaAttribute attribute = (ISchemaAttribute) item; @@ -160,16 +171,19 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti private class SchemaComparator implements Comparator<Object> { + @Override public int compare(Object arg0, Object arg1) { return 0; } } + @Override protected ItemsFilter createFilter() { return new SchemaItemsFilter(); } + @Override protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException { IPluginModelBase[] models = PluginRegistry.getActiveModels(); @@ -207,6 +221,7 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti } + @Override protected IDialogSettings getDialogSettings() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS); if (settings == null) { @@ -215,6 +230,7 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti return settings; } + @Override public String getElementName(Object item) { if (item instanceof ISchemaAttribute) { ISchemaAttribute attribute = (ISchemaAttribute) item; @@ -223,20 +239,24 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti return null; } + @Override protected void fillViewMenu(IMenuManager menuManager) { super.fillViewMenu(menuManager); menuManager.add(new Separator()); menuManager.add(optionalAttributesAction); } + @Override protected Comparator<?> getItemsComparator() { return new SchemaComparator(); } + @Override protected IStatus validateItem(Object item) { return new Status(IStatus.OK, "org.eclipse.pde.ui", 0, "", null); //$NON-NLS-1$ //$NON-NLS-2$ } + @Override protected void restoreDialog(IDialogSettings settings) { super.restoreDialog(settings); @@ -249,16 +269,19 @@ public class FilteredSchemaAttributeSelectionDialog extends FilteredItemsSelecti applyFilter(); } + @Override protected void storeDialog(IDialogSettings settings) { super.storeDialog(settings); settings.put(S_OPTIONAL_ATTRIBUTES, optionalAttributesAction.isChecked()); } + @Override public boolean close() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); return super.close(); } + @Override protected Control createExtendedContentArea(Composite parent) { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewAttributeAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewAttributeAction.java index c2ed1db809..bc79d5aeec 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewAttributeAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewAttributeAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public class NewAttributeAction extends Action { return PDELabelUtility.generateName(element.getAttributeNames(), PDEUIMessages.SchemaEditor_NewAttribute_initialName, false); } + @Override public void run() { String name = getInitialName(); SchemaAttribute att = new SchemaAttribute(element, name); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewClassCreationWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewClassCreationWizard.java index 5c30bb4d15..24547066bf 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewClassCreationWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewClassCreationWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -37,6 +37,7 @@ public class NewClassCreationWizard extends JavaAttributeWizard { fIsInterface = isInterface; } + @Override public void addPages() { if (fIsInterface) fMainPage = new NewInterfaceWizardPage(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewCompositorAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewCompositorAction.java index e0a10ead38..af9fdd1a5e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewCompositorAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewCompositorAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -58,6 +58,7 @@ public class NewCompositorAction extends Action { return firstLetter + rest; } + @Override public void run() { SchemaCompositor compositor = new SchemaCompositor(source, kind); if (object instanceof SchemaElement) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewElementAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewElementAction.java index 8b5d418693..e08327bc62 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewElementAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewElementAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public class NewElementAction extends Action { return schema; } + @Override public void run() { String name = getInitialName(); SchemaElement element; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewReferenceAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewReferenceAction.java index 71d7bd11df..6317e65bee 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewReferenceAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewReferenceAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ public class NewReferenceAction extends Action { setEnabled(source.getSchema().isEditable()); } + @Override public void run() { if (object != null && object instanceof SchemaCompositor) { SchemaCompositor parent = (SchemaCompositor) object; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewRestrictionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewRestrictionDialog.java index 89b43fa8f5..c250e4d354 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewRestrictionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/NewRestrictionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,11 +32,13 @@ public class NewRestrictionDialog extends MessageDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.NEW_RESTRICTION_DIALOG); } + @Override protected Control createCustomArea(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); comp.setLayout(new GridLayout()); @@ -50,6 +52,7 @@ public class NewRestrictionDialog extends MessageDialog { return fRestriction; } + @Override public boolean close() { fRestriction = fText.getText(); return super.close(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java index b136efb4b4..315c6e8d60 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaAttributeDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -52,6 +52,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } class SchemaAttributeContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object inputElement) { ISchemaSimpleType type = fAttribute.getType(); ISchemaRestriction restriction = type.getRestriction(); @@ -61,6 +62,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } } + @Override public void createDetails(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); Color foreground = toolkit.getColors().getColor(IFormColors.TITLE); @@ -108,6 +110,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { protected abstract void createTypeDetails(Composite parent, FormToolkit toolkit); + @Override public void updateFields(ISchemaObject object) { if (!(object instanceof SchemaAttribute)) return; @@ -142,8 +145,10 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { fValue.setEditable(editable); } + @Override public void hookListeners() { fValue.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (blockListeners()) return; @@ -151,6 +156,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } }); fName.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (blockListeners()) return; @@ -179,6 +185,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } }); fDepTrue.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -186,6 +193,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } }); fType.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -206,6 +214,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } }); fUseDefault.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -217,6 +226,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } }); fUseOther.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -245,6 +255,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { } } + @Override public void modelChanged(IModelChangedEvent event) { Object[] changedObjs = event.getChangedObjects(); if (event.getChangeType() == IModelChangedEvent.INSERT && changedObjs.length > 0) { @@ -258,6 +269,7 @@ public abstract class SchemaAttributeDetails extends AbstractSchemaDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean) */ + @Override public void commit(boolean onSave) { super.commit(onSave); // Only required for form entries diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java index a7dd31221f..1929046b48 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaCompositorDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public class SchemaCompositorDetails extends AbstractSchemaDetails { super(section, true, false); } + @Override public void createDetails(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); @@ -54,6 +55,7 @@ public class SchemaCompositorDetails extends AbstractSchemaDetails { setText(PDEUIMessages.SchemaCompositorDetails_title); } + @Override public void updateFields(ISchemaObject object) { if (!(object instanceof SchemaCompositor)) return; @@ -69,8 +71,10 @@ public class SchemaCompositorDetails extends AbstractSchemaDetails { enableMinMax(editable); } + @Override public void hookListeners() { hookMinOccur(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -78,6 +82,7 @@ public class SchemaCompositorDetails extends AbstractSchemaDetails { } }); hookMaxOccur(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -85,6 +90,7 @@ public class SchemaCompositorDetails extends AbstractSchemaDetails { } }); fKind.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -97,6 +103,7 @@ public class SchemaCompositorDetails extends AbstractSchemaDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean) */ + @Override public void commit(boolean onSave) { super.commit(onSave); // Only required for form entries diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditor.java index 16d51da1eb..f9b1e3effe 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -76,6 +76,7 @@ public class SchemaEditor extends MultiSourceEditor { return contextManager; } + @Override public void monitoredFileAdded(IFile file) { /* String name = file.getName(); @@ -86,6 +87,7 @@ public class SchemaEditor extends MultiSourceEditor { */ } + @Override public boolean monitoredFileRemoved(IFile file) { /* //TODO may need to check with the user if there @@ -100,6 +102,7 @@ public class SchemaEditor extends MultiSourceEditor { addSourcePage(context.getId()); } + @Override public void contextRemoved(InputContext context) { close(false); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditorContributor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditorContributor.java index b2a8f2fb85..d4cab0698c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditorContributor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaEditorContributor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,10 +24,12 @@ public class SchemaEditorContributor extends PDEFormTextEditorContributor { public PreviewAction() { } + @Override public void run() { if (getEditor() != null) { final SchemaEditor schemaEditor = (SchemaEditor) getEditor(); BusyIndicator.showWhile(SWTUtil.getStandardDisplay(), new Runnable() { + @Override public void run() { schemaEditor.previewReferenceDocument(); } @@ -44,6 +46,7 @@ public class SchemaEditorContributor extends PDEFormTextEditorContributor { return true; } + @Override public void contextMenuAboutToShow(IMenuManager mm, boolean addClipboard) { super.contextMenuAboutToShow(mm, addClipboard); mm.add(new Separator()); @@ -54,6 +57,7 @@ public class SchemaEditorContributor extends PDEFormTextEditorContributor { return fPreviewAction; } + @Override protected void makeActions() { super.makeActions(); fPreviewAction = new PreviewAction(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java index 3644f712cd..74010db99b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -39,6 +39,7 @@ public class SchemaElementDetails extends AbstractSchemaDetails { super(section, true, true); } + @Override public void createDetails(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); Color foreground = toolkit.getColors().getColor(IFormColors.TITLE); @@ -62,6 +63,7 @@ public class SchemaElementDetails extends AbstractSchemaDetails { setText(PDEUIMessages.SchemaElementDetails_title); } + @Override public void updateFields(ISchemaObject object) { if (object instanceof SchemaElementReference) object = ((SchemaElementReference) object).getReferencedObject(); @@ -90,8 +92,10 @@ public class SchemaElementDetails extends AbstractSchemaDetails { fTransFalse.setEnabled(editable && isTranslatable); } + @Override public void hookListeners() { fName.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (blockListeners()) return; @@ -117,6 +121,7 @@ public class SchemaElementDetails extends AbstractSchemaDetails { } }); fDepTrue.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -124,6 +129,7 @@ public class SchemaElementDetails extends AbstractSchemaDetails { } }); fTransTrue.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -132,6 +138,7 @@ public class SchemaElementDetails extends AbstractSchemaDetails { }); } + @Override public void modelChanged(IModelChangedEvent event) { Object[] changedObjs = event.getChangedObjects(); if (event.getChangeType() == IModelChangedEvent.INSERT && changedObjs.length > 0) { @@ -145,6 +152,7 @@ public class SchemaElementDetails extends AbstractSchemaDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean) */ + @Override public void commit(boolean onSave) { super.commit(onSave); // Only required for form entries diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java index 205d9b7cc5..145abe9f29 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaElementReferenceDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -37,6 +37,7 @@ public class SchemaElementReferenceDetails extends AbstractSchemaDetails { super(section, true, false); } + @Override public void createDetails(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); @@ -53,6 +54,7 @@ public class SchemaElementReferenceDetails extends AbstractSchemaDetails { setText(PDEUIMessages.SchemaElementReferenceDetails_title); } + @Override public void updateFields(ISchemaObject object) { if (!(object instanceof SchemaElementReference)) return; @@ -68,8 +70,10 @@ public class SchemaElementReferenceDetails extends AbstractSchemaDetails { enableMinMax(editable); } + @Override public void hookListeners() { hookMinOccur(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -77,6 +81,7 @@ public class SchemaElementReferenceDetails extends AbstractSchemaDetails { } }); hookMaxOccur(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -84,6 +89,7 @@ public class SchemaElementReferenceDetails extends AbstractSchemaDetails { } }); fReferenceLink.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { if (blockListeners()) return; @@ -95,6 +101,7 @@ public class SchemaElementReferenceDetails extends AbstractSchemaDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean) */ + @Override public void commit(boolean onSave) { super.commit(onSave); // Only required for form entries diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormOutlinePage.java index 864d2052ab..d1b305c122 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -21,6 +21,7 @@ import org.eclipse.pde.internal.ui.editor.PDEFormEditor; public class SchemaFormOutlinePage extends FormOutlinePage { private Object[] fTopics; + @Override public Object[] getChildren(Object parent) { ISchema schema = (ISchema) fEditor.getAggregateModel(); if (schema != null && schema.isValid()) { @@ -42,6 +43,7 @@ public class SchemaFormOutlinePage extends FormOutlinePage { super(ilp); } + @Override public String getText(Object obj) { String label = getObjectLabel(obj); return (label == null) ? super.getText(obj) : label; @@ -52,6 +54,7 @@ public class SchemaFormOutlinePage extends FormOutlinePage { super(editor); } + @Override public ILabelProvider createLabelProvider() { return new SchemaLabelProvider(PDEPlugin.getDefault().getLabelProvider()); } @@ -108,6 +111,7 @@ public class SchemaFormOutlinePage extends FormOutlinePage { return fTopics; } + @Override protected String getParentPageId(Object item) { if (item instanceof ISchemaElement || item instanceof ISchemaAttribute) return SchemaFormPage.PAGE_ID; @@ -116,6 +120,7 @@ public class SchemaFormOutlinePage extends FormOutlinePage { return super.getParentPageId(item); } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.WORLD_CHANGED) { fTopics = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormPage.java index f37b2f8169..3cfd3ae2b0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaFormPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -42,11 +42,13 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener super(SchemaFormPage.this); } + @Override protected PDESection createMasterSection(IManagedForm managedForm, Composite parent) { fSection = new ElementSection(getPage(), parent); return fSection; } + @Override protected void registerPages(DetailsPart detailsPart) { fDetailsPart = detailsPart; detailsPart.setPageLimit(5); @@ -61,6 +63,7 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener detailsPart.setPageProvider(this); } + @Override public Object getPageKey(Object object) { if (object instanceof ISchemaObjectReference) return ISchemaObjectReference.class; @@ -87,6 +90,7 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener return null; } + @Override public IDetailsPage getPage(Object object) { return null; } @@ -100,10 +104,12 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.SCHEMA_EDITOR_MAIN; } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); ISchema schema = (ISchema) ((SchemaEditor) getEditor()).getAggregateModel(); @@ -121,6 +127,7 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener private ControlContribution createUIControlConPreviewRefDoc() { return new ControlContribution("Preview") { //$NON-NLS-1$ + @Override protected Control createControl(Composite parent) { // Create UI createUIImageHyperlinkPreviewRefDoc(parent); @@ -140,14 +147,17 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener private void createUIListenerImageHyperlinkPreviewRefDoc() { fImageHyperlinkPreviewRefDoc.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkActivated(HyperlinkEvent e) { handleLinkActivatedPreviewRefDoc(); } + @Override public void linkEntered(HyperlinkEvent e) { handleLinkEnteredPreviewRefDoc(e.getLabel()); } + @Override public void linkExited(HyperlinkEvent e) { handleLinkExitedPreviewRefDoc(); } @@ -185,6 +195,7 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener schema.addModelChangedListener(this); } + @Override public void dispose() { ISchema schema = (ISchema) getModel(); if (schema != null) @@ -192,6 +203,7 @@ public class SchemaFormPage extends PDEFormPage implements IModelChangedListener super.dispose(); } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.CHANGE) { String changeProperty = event.getChangedProperty(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIdentifierAttributeDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIdentifierAttributeDetails.java index 9f5c409bba..70b268bcea 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIdentifierAttributeDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIdentifierAttributeDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -44,6 +44,7 @@ public class SchemaIdentifierAttributeDetails extends SchemaAttributeDetails { } // TODO we should reuse our attribute tables when possible + @Override protected void createTypeDetails(Composite parent, FormToolkit toolkit) { GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.heightHint = 40; @@ -85,6 +86,7 @@ public class SchemaIdentifierAttributeDetails extends SchemaAttributeDetails { fRemoveRestriction.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } + @Override public void updateFields(ISchemaObject object) { if (!(object instanceof SchemaAttribute)) return; @@ -106,16 +108,19 @@ public class SchemaIdentifierAttributeDetails extends SchemaAttributeDetails { fRemoveRestriction.setEnabled(!fRestrictionsTable.getSelection().isEmpty() && editable); } + @Override public void hookListeners() { super.hookListeners(); IActionBars actionBars = getPage().getPDEEditor().getEditorSite().getActionBars(); fReferenceEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { if (blockListeners()) return; getAttribute().setBasedOn(fReferenceEntry.getValue()); } + @Override public void browseButtonSelected(FormEntry entry) { if (blockListeners()) return; @@ -123,6 +128,7 @@ public class SchemaIdentifierAttributeDetails extends SchemaAttributeDetails { } }); fAddRestriction.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -151,6 +157,7 @@ public class SchemaIdentifierAttributeDetails extends SchemaAttributeDetails { } }); fRemoveRestriction.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -187,6 +194,7 @@ public class SchemaIdentifierAttributeDetails extends SchemaAttributeDetails { } }); fRestrictionsTable.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (blockListeners()) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIncludesSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIncludesSection.java index 7712154514..cc37eb2b40 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIncludesSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaIncludesSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -49,6 +49,7 @@ public class SchemaIncludesSection extends TableSection { private TableViewer fViewer; class PDEProjectFilter extends ViewerFilter { + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IProject) { try { @@ -68,6 +69,7 @@ public class SchemaIncludesSection extends TableSection { getSection().setDescription(PDEUIMessages.SchemaIncludesSection_description); } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = createClientContainer(section, 2, toolkit); createViewerPartControl(container, SWT.MULTI, 2, toolkit); @@ -85,6 +87,7 @@ public class SchemaIncludesSection extends TableSection { initialize(); } + @Override protected void buttonSelected(int index) { if (index == 0) handleNewInclude(); @@ -92,6 +95,7 @@ public class SchemaIncludesSection extends TableSection { handleRemoveInclude(); } + @Override protected void selectionChanged(IStructuredSelection selection) { getPage().getManagedForm().fireSelectionChanged(this, selection); getPage().getPDEEditor().setSelection(selection); @@ -101,6 +105,7 @@ public class SchemaIncludesSection extends TableSection { getTablePart().setButtonEnabled(1, object instanceof ISchemaInclude); } + @Override public void dispose() { ISchema schema = getSchema(); if (schema != null) @@ -109,6 +114,7 @@ public class SchemaIncludesSection extends TableSection { super.dispose(); } + @Override public void modelChanged(IModelChangedEvent e) { int changeType = e.getChangeType(); if (changeType == IModelChangedEvent.WORLD_CHANGED) { @@ -127,6 +133,7 @@ public class SchemaIncludesSection extends TableSection { } } + @Override public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.DELETE.getId())) { handleRemoveInclude(); @@ -223,6 +230,7 @@ public class SchemaIncludesSection extends TableSection { return unlisted; } + @Override protected void handleDoubleClick(IStructuredSelection selection) { Object object = selection.getFirstElement(); if (object instanceof ISchemaInclude) { @@ -249,6 +257,7 @@ public class SchemaIncludesSection extends TableSection { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { getTablePart().setButtonEnabled(0, getSchema().isEditable()); getTablePart().setButtonEnabled(1, false); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java index d6c73ccdce..c61a8a88a0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -48,6 +48,7 @@ public class SchemaInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -55,6 +56,7 @@ public class SchemaInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#createModel(org.eclipse.ui.IEditorInput) */ + @Override protected IBaseModel createModel(IEditorInput input) throws CoreException { if (input instanceof FileStoreEditorInput) return createExternalModel((FileStoreEditorInput) input); @@ -108,9 +110,11 @@ public class SchemaInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#addTextEditOperation(java.util.ArrayList, org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { } + @Override protected void flushModel(IDocument doc) { // if model is dirty, flush its content into // the document so that the source editor will @@ -143,6 +147,7 @@ public class SchemaInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.context.InputContext#flushEditorInput() */ + @Override public void flushEditorInput() { // Override parent, since this editor does not utilize edit operations IDocumentProvider provider = getDocumentProvider(); @@ -154,6 +159,7 @@ public class SchemaInputContext extends XMLInputContext { setValidated(false); } + @Override protected boolean synchronizeModel(IDocument doc) { Schema schema = (Schema) getModel(); if (schema == null) { @@ -181,9 +187,11 @@ public class SchemaInputContext extends XMLInputContext { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.XMLInputContext#reorderInsertEdits(java.util.ArrayList) */ + @Override protected void reorderInsertEdits(ArrayList<TextEdit> ops) { } + @Override protected String getPartitionName() { return "___schema_partition"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContextManager.java index 9fa7e7ed8a..8f4eb5fc89 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaInputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -23,6 +23,7 @@ public class SchemaInputContextManager extends InputContextManager { super(editor); } + @Override public IBaseModel getAggregateModel() { return findSchema(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaJavaAttributeDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaJavaAttributeDetails.java index 0005b6fa13..9217dcf483 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaJavaAttributeDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaJavaAttributeDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -44,6 +44,7 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { super(section); } + @Override protected void createTypeDetails(Composite parent, FormToolkit toolkit) { fClassEntry = new FormEntry(parent, toolkit, PDEUIMessages.SchemaAttributeDetails_extends, PDEUIMessages.SchemaAttributeDetails_browseButton, isEditable(), 13); fInterfaceEntry = new FormEntry(parent, toolkit, PDEUIMessages.SchemaAttributeDetails_implements, PDEUIMessages.SchemaAttributeDetails_browseButton, isEditable(), 13); @@ -51,6 +52,7 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { fInterfaceEntryFieldAssistDisposer = PDEJavaHelperUI.addTypeFieldAssistToText(fInterfaceEntry.getText(), getPage().getPDEEditor().getCommonProject(), IJavaSearchConstants.INTERFACE); } + @Override public void updateFields(ISchemaObject object) { if (!(object instanceof SchemaAttribute)) return; @@ -82,16 +84,19 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { fInterfaceEntry.setEditable(editable); } + @Override public void hookListeners() { super.hookListeners(); IActionBars actionBars = getPage().getPDEEditor().getEditorSite().getActionBars(); fClassEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { if (blockListeners()) return; setBasedOn(); } + @Override public void linkActivated(HyperlinkEvent e) { if (blockListeners()) return; @@ -101,6 +106,7 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { fClassEntry.setValue(value); } + @Override public void browseButtonSelected(FormEntry entry) { if (blockListeners()) return; @@ -108,12 +114,14 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { } }); fInterfaceEntry.setFormEntryListener(new FormEntryAdapter(this, actionBars) { + @Override public void textValueChanged(FormEntry entry) { if (blockListeners()) return; setBasedOn(); } + @Override public void linkActivated(HyperlinkEvent e) { if (blockListeners()) return; @@ -123,6 +131,7 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { fInterfaceEntry.setValue(value); } + @Override public void browseButtonSelected(FormEntry entry) { if (blockListeners()) return; @@ -183,6 +192,7 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { } } + @Override public void commit(boolean onSave) { super.commit(onSave); // Only required for form entries @@ -190,6 +200,7 @@ public class SchemaJavaAttributeDetails extends SchemaAttributeDetails { fInterfaceEntry.commit(); } + @Override public void dispose() { super.dispose(); if (fClassEntryFieldAssistDisposer != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOtherAttributeDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOtherAttributeDetails.java index 671603d97a..fb0926469f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOtherAttributeDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOtherAttributeDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -19,6 +19,7 @@ public class SchemaOtherAttributeDetails extends SchemaAttributeDetails { super(section); } + @Override protected void createTypeDetails(Composite parent, FormToolkit toolkit) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOverviewPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOverviewPage.java index 9c50a8d561..ec336908b5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOverviewPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaOverviewPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -51,16 +51,19 @@ public class SchemaOverviewPage extends PDEFormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#getHelpResource() */ + @Override protected String getHelpResource() { return IHelpContextIds.SCHEMA_EDITOR_DOC; } + @Override public void setActive(boolean active) { if (!active) getManagedForm().commit(false); super.setActive(active); } + @Override protected void createFormContent(IManagedForm managedForm) { ScrolledForm form = managedForm.getForm(); ISchema schema = (ISchema) ((SchemaEditor) getEditor()).getAggregateModel(); @@ -91,6 +94,7 @@ public class SchemaOverviewPage extends PDEFormPage { private ControlContribution createUIControlConPreviewRefDoc() { return new ControlContribution("Preview") { //$NON-NLS-1$ + @Override protected Control createControl(Composite parent) { // Create UI createUIImageHyperlinkPreviewRefDoc(parent); @@ -116,14 +120,17 @@ public class SchemaOverviewPage extends PDEFormPage { */ private void createUIListenerImageHyperlinkPreviewRefDoc() { fImageHyperlinkPreviewRefDoc.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkActivated(HyperlinkEvent e) { handleLinkActivatedPreviewRefDoc(); } + @Override public void linkEntered(HyperlinkEvent e) { handleLinkEnteredPreviewRefDoc(e.getLabel()); } + @Override public void linkExited(HyperlinkEvent e) { handleLinkExitedPreviewRefDoc(); } @@ -164,6 +171,7 @@ public class SchemaOverviewPage extends PDEFormPage { fPreviewAction.run(); } + @Override public void dispose() { fColorManager.dispose(); super.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaPreviewLauncher.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaPreviewLauncher.java index bcc39cf1dc..67cbca43fe 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaPreviewLauncher.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaPreviewLauncher.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -33,6 +33,7 @@ public class SchemaPreviewLauncher implements IEditorLauncher { /* (non-Javadoc) * @see org.eclipse.ui.IEditorLauncher#open(org.eclipse.core.runtime.IPath) */ + @Override public void open(IPath filePath) { // Create the preview action PreviewReferenceAction action = new PreviewReferenceAction(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java index d2cd96d74a..04d24e9ccb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaRootElementDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,6 +43,7 @@ public class SchemaRootElementDetails extends AbstractSchemaDetails { super(section, true, true); } + @Override public void createDetails(Composite parent) { FormToolkit toolkit = getManagedForm().getToolkit(); Color foreground = toolkit.getColors().getColor(IFormColors.TITLE); @@ -68,6 +69,7 @@ public class SchemaRootElementDetails extends AbstractSchemaDetails { setText(PDEUIMessages.SchemaElementDetails_rootTitle); } + @Override public void updateFields(ISchemaObject element) { if (!(element instanceof ISchemaElement)) return; @@ -100,8 +102,10 @@ public class SchemaRootElementDetails extends AbstractSchemaDetails { } } + @Override public void hookListeners() { fDepTrue.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -113,6 +117,7 @@ public class SchemaRootElementDetails extends AbstractSchemaDetails { }); fInternalTrue.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -122,6 +127,7 @@ public class SchemaRootElementDetails extends AbstractSchemaDetails { }); fSuggestion.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry entry) { if (blockListeners()) return; @@ -133,6 +139,7 @@ public class SchemaRootElementDetails extends AbstractSchemaDetails { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean) */ + @Override public void commit(boolean onSave) { super.commit(onSave); // Only required for form entries diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSourcePage.java index 06eab91955..fece9d3a74 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -30,6 +30,7 @@ public class SchemaSourcePage extends XMLSourcePage { */ } + @Override protected void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); menu.add(new Separator()); @@ -37,10 +38,12 @@ public class SchemaSourcePage extends XMLSourcePage { menu.add(contributor.getPreviewAction()); } + @Override public ILabelProvider createOutlineLabelProvider() { return null; } + @Override public ITreeContentProvider createOutlineContentProvider() { return null; } @@ -48,6 +51,7 @@ public class SchemaSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#createOutlineSorter() */ + @Override public ViewerComparator createOutlineComparator() { return null; } @@ -55,10 +59,12 @@ public class SchemaSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#updateSelection(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void updateSelection(SelectionChangedEvent e) { // NO-OP } + @Override protected ISortableContentOutlinePage createOutlinePage() { //TODO remove this method when the above three stubs // are implemented @@ -68,6 +74,7 @@ public class SchemaSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEProjectionSourcePage#isQuickOutlineEnabled() */ + @Override public boolean isQuickOutlineEnabled() { return false; } @@ -75,10 +82,12 @@ public class SchemaSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#updateSelection(java.lang.Object) */ + @Override public void updateSelection(Object object) { // NO-OP } + @Override protected void setPartName(String partName) { super.setPartName(PDEUIMessages.EditorSourcePage_name); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSpecSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSpecSection.java index 6938b937c5..3660caabe3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSpecSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaSpecSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public class SchemaSpecSection extends PDESection { createClient(getSection(), page.getManagedForm().getToolkit()); } + @Override public void commit(boolean onSave) { fPluginText.commit(); fPointText.commit(); @@ -41,6 +42,7 @@ public class SchemaSpecSection extends PDESection { super.commit(onSave); } + @Override public void cancelEdit() { fPluginText.cancelEdit(); fPointText.cancelEdit(); @@ -48,6 +50,7 @@ public class SchemaSpecSection extends PDESection { super.cancelEdit(); } + @Override public void createClient(Section section, FormToolkit toolkit) { Composite container = toolkit.createComposite(section); container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 2)); @@ -57,18 +60,21 @@ public class SchemaSpecSection extends PDESection { final Schema schema = (Schema) getPage().getModel(); fPluginText = new FormEntry(container, toolkit, PDEUIMessages.SchemaEditor_SpecSection_plugin, null, false); fPluginText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { schema.setPluginId(text.getValue()); } }); fPointText = new FormEntry(container, toolkit, PDEUIMessages.SchemaEditor_SpecSection_point, null, false); fPointText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { schema.setPointId(text.getValue()); } }); fNameText = new FormEntry(container, toolkit, PDEUIMessages.SchemaEditor_SpecSection_name, null, false); fNameText.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { schema.setName(text.getValue()); getPage().getManagedForm().getForm().setText(schema.getName()); @@ -80,6 +86,7 @@ public class SchemaSpecSection extends PDESection { initialize(); } + @Override public void dispose() { ISchema schema = (ISchema) getPage().getModel(); if (schema != null) @@ -99,12 +106,14 @@ public class SchemaSpecSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.ui.forms.SectionPart#setFocus() */ + @Override public void setFocus() { if (fPluginText != null) { fPluginText.getText().setFocus(); } } + @Override public void refresh() { ISchema schema = (ISchema) getPage().getModel(); fPluginText.setValue(schema.getPluginId(), true); @@ -114,6 +123,7 @@ public class SchemaSpecSection extends PDESection { super.refresh(); } + @Override public boolean canPaste(Clipboard clipboard) { return isEditable(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaStringAttributeDetails.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaStringAttributeDetails.java index 00395d713d..7cfea70424 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaStringAttributeDetails.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/schema/SchemaStringAttributeDetails.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -38,6 +38,7 @@ public class SchemaStringAttributeDetails extends SchemaAttributeDetails { super(section); } + @Override protected void createTypeDetails(Composite parent, FormToolkit toolkit) { Color foreground = toolkit.getColors().getColor(IFormColors.TITLE); @@ -84,6 +85,7 @@ public class SchemaStringAttributeDetails extends SchemaAttributeDetails { fRemoveRestriction.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); } + @Override public void updateFields(ISchemaObject object) { if (!(object instanceof SchemaAttribute)) return; @@ -101,9 +103,11 @@ public class SchemaStringAttributeDetails extends SchemaAttributeDetails { fRemoveRestriction.setEnabled(!fRestrictionsTable.getSelection().isEmpty() && editable); } + @Override public void hookListeners() { super.hookListeners(); fTransTrue.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -111,6 +115,7 @@ public class SchemaStringAttributeDetails extends SchemaAttributeDetails { } }); fAddRestriction.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -139,6 +144,7 @@ public class SchemaStringAttributeDetails extends SchemaAttributeDetails { } }); fRemoveRestriction.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (blockListeners()) return; @@ -175,6 +181,7 @@ public class SchemaStringAttributeDetails extends SchemaAttributeDetails { } }); fRestrictionsTable.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (blockListeners()) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchivePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchivePage.java index 1f11a2aece..187a568ef9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchivePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchivePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -30,6 +30,7 @@ public class ArchivePage extends PDEFormPage { super(editor, PAGE_ID, PDEUIMessages.ArchivePage_name); } + @Override protected void createFormContent(IManagedForm mform) { super.createFormContent(mform); ScrolledForm form = mform.getForm(); @@ -48,6 +49,7 @@ public class ArchivePage extends PDEFormPage { form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_JAVA_LIB_OBJ)); } + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_SITE_ARCHIVES; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchiveSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchiveSection.java index 24f534cf2d..9f81369ee3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchiveSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/ArchiveSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -61,6 +61,7 @@ public class ArchiveSection extends PDESection { } class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { ISiteModel model = (ISiteModel) parent; return model.getSite().getArchives(); @@ -68,6 +69,7 @@ public class ArchiveSection extends PDESection { } class ArchiveLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { ISiteArchive archive = (ISiteArchive) obj; switch (index) { @@ -79,6 +81,7 @@ public class ArchiveSection extends PDESection { return ""; //$NON-NLS-1$ } + @Override public Image getColumnImage(Object obj, int index) { return null; } @@ -191,6 +194,7 @@ public class ArchiveSection extends PDESection { fViewer.setLabelProvider(new ArchiveLabelProvider()); fViewer.setInput(getPage().getModel()); fViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { handleSelectionChanged(); } @@ -217,6 +221,7 @@ public class ArchiveSection extends PDESection { private void showDialog(final ISiteArchive archive) { final ISiteModel model = (ISiteModel) getPage().getModel(); BusyIndicator.showWhile(fTable.getDisplay(), new Runnable() { + @Override public void run() { NewArchiveDialog dialog = new NewArchiveDialog(fTable.getShell(), model, archive); dialog.create(); @@ -250,6 +255,7 @@ public class ArchiveSection extends PDESection { public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.DELETE.getId())) { BusyIndicator.showWhile(fTable.getDisplay(), new Runnable() { + @Override public void run() { handleDelete(); } @@ -277,6 +283,7 @@ public class ArchiveSection extends PDESection { private void createContextMenu(Control control) { MenuManager popupMenuManager = new MenuManager(); IMenuListener listener = new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager mng) { Action removeAction = new Action(PDEUIMessages.SiteEditor_remove) { @Override diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategoryDetailsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategoryDetailsSection.java index 3e66a71ec1..13c7657ebd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategoryDetailsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategoryDetailsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -256,6 +256,7 @@ public class CategoryDetailsSection extends PDESection implements IPartSelection super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategorySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategorySection.java index 7ff6576df3..e8ed8b453e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategorySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/CategorySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -69,6 +69,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene private IStructuredSelection cachedSelection; class CategoryContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object inputElement) { // model = (ISite) inputElement; ArrayList<IWritable> result = new ArrayList<IWritable>(); @@ -84,6 +85,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return result.toArray(); } + @Override public Object[] getChildren(Object parent) { if (parent instanceof ISiteCategoryDefinition) { ISiteCategoryDefinition catDef = (ISiteCategoryDefinition) parent; @@ -102,10 +104,12 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return new Object[0]; } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof ISiteCategoryDefinition) { ISiteCategoryDefinition catDef = (ISiteCategoryDefinition) element; @@ -135,6 +139,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @see org.eclipse.update.ui.forms.internal.FormSection#createClient(org.eclipse.swt.widgets.Composite, * org.eclipse.update.ui.forms.internal.FormWidgetFactory) */ + @Override public void createClient(Section section, FormToolkit toolkit) { fModel = (ISiteModel) getPage().getModel(); fModel.addModelChangedListener(this); @@ -152,6 +157,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene Transfer[] transfers = new Transfer[] {ModelDataTransfer.getInstance()}; if (isEditable()) { fCategoryViewer.addDropSupport(ops, transfers, new ViewerDropAdapter(fCategoryViewer) { + @Override public void dragEnter(DropTargetEvent event) { Object target = determineTarget(event); if (target == null && event.detail == DND.DROP_COPY) { @@ -165,6 +171,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * * @see org.eclipse.jface.viewers.ViewerDropAdapter#dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent) */ + @Override public void dragOperationChanged(DropTargetEvent event) { Object target = determineTarget(event); if (target == null && event.detail == DND.DROP_COPY) { @@ -178,6 +185,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * * @see org.eclipse.jface.viewers.ViewerDropAdapter#dragOver(org.eclipse.swt.dnd.DropTargetEvent) */ + @Override public void dragOver(DropTargetEvent event) { Object target = determineTarget(event); if (target == null && event.detail == DND.DROP_COPY) { @@ -197,6 +205,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @return one of the <code>LOCATION_* </code> * constants defined in this class */ + @Override protected int determineLocation(DropTargetEvent event) { if (!(event.item instanceof Item)) { return LOCATION_NONE; @@ -213,6 +222,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return LOCATION_ON; } + @Override public boolean performDrop(Object data) { if (!(data instanceof Object[])) return false; @@ -231,6 +241,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return false; } + @Override public boolean validateDrop(Object target, int operation, TransferData transferType) { return (target instanceof ISiteCategoryDefinition || target == null); } @@ -239,6 +250,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } fCategoryViewer.addDragSupport(DND.DROP_MOVE | DND.DROP_COPY, transfers, new DragSourceListener() { + @Override public void dragStart(DragSourceEvent event) { IStructuredSelection ssel = (IStructuredSelection) fCategoryViewer.getSelection(); if (ssel == null || ssel.isEmpty() || !(ssel.getFirstElement() instanceof SiteFeatureAdapter)) { @@ -246,11 +258,13 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override public void dragSetData(DragSourceEvent event) { IStructuredSelection ssel = (IStructuredSelection) fCategoryViewer.getSelection(); event.data = ssel.toArray(); } + @Override public void dragFinished(DragSourceEvent event) { } }); @@ -324,6 +338,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override protected void buttonSelected(int index) { switch (index) { case BUTTON_ADD_CATEGORY : @@ -343,6 +358,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override protected void handleDoubleClick(IStructuredSelection ssel) { super.handleDoubleClick(ssel); Object selected = ssel.getFirstElement(); @@ -352,6 +368,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override protected void selectionChanged(IStructuredSelection selection) { getPage().getPDEEditor().setSelection(selection); updateButtons(); @@ -462,6 +479,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return null; } + @Override public void dispose() { super.dispose(); FeatureModelManager mng = PDECore.getDefault().getFeatureModelManager(); @@ -471,8 +489,10 @@ public class CategorySection extends TreeSection implements IFeatureModelListene fSiteLabelProvider.dispose(); } + @Override protected void fillContextMenu(IMenuManager manager) { Action removeAction = new Action(PDEUIMessages.CategorySection_remove) { + @Override public void run() { doGlobalAction(ActionFactory.DELETE.getId()); } @@ -489,6 +509,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene Action synchronizeAction = new SynchronizePropertiesAction(features, fModel); manager.add(synchronizeAction); Action buildAction = new Action(PDEUIMessages.CategorySection_build) { + @Override public void run() { ((SiteEditor) getPage().getPDEEditor()).handleBuild(features); } @@ -499,6 +520,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } } + @Override public boolean doGlobalAction(String actionId) { if (actionId.equals(ActionFactory.CUT.getId())) { handleRemove(); @@ -518,6 +540,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene return false; } + @Override public void refresh() { fCategoryViewer.refresh(); updateButtons(); @@ -535,6 +558,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene fCategoryTreePart.setButtonEnabled(BUTTON_IMPORT_ENVIRONMENT, featureCount > 0); } + @Override public void modelChanged(IModelChangedEvent e) { markStale(); } @@ -551,6 +575,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#doPaste(java.lang.Object, * java.lang.Object[]) */ + @Override protected void doPaste(Object target, Object[] objects) { try { for (int i = 0; i < objects.length; i++) { @@ -570,6 +595,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene * @see org.eclipse.pde.internal.ui.editor.StructuredViewerSection#canPaste(java.lang.Object, * java.lang.Object[]) */ + @Override protected boolean canPaste(Object target, Object[] objects) { if (target == null || target instanceof ISiteCategoryDefinition) { for (int i = 0; i < objects.length; i++) { @@ -635,6 +661,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene IStructuredSelection sel = (IStructuredSelection) fCategoryViewer.getSelection(); final ISiteFeature[] selectedFeatures = getFeaturesFromSelection(sel); BusyIndicator.showWhile(fCategoryTreePart.getControl().getDisplay(), new Runnable() { + @Override public void run() { new SynchronizePropertiesAction(selectedFeatures, getModel()).run(); } @@ -644,6 +671,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene private void handleNewFeature() { final Control control = fCategoryViewer.getControl(); BusyIndicator.showWhile(control.getDisplay(), new Runnable() { + @Override public void run() { IFeatureModel[] allModels = PDECore.getDefault().getFeatureModelManager().getModels(); ArrayList<IFeatureModel> newModels = new ArrayList<IFeatureModel>(); @@ -764,6 +792,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#setFormInput(java.lang.Object) */ + @Override public boolean setFormInput(Object input) { if (input instanceof ISiteCategoryDefinition) { fCategoryViewer.setSelection(new StructuredSelection(input), true); @@ -794,6 +823,7 @@ public class CategorySection extends TreeSection implements IFeatureModelListene } + @Override public void modelsChanged(IFeatureModelDelta delta) { markStale(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/DescriptionSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/DescriptionSection.java index aacaaf989e..05560bdc4a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/DescriptionSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/DescriptionSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -40,6 +40,7 @@ public class DescriptionSection extends PDESection { createClient(getSection(), page.getManagedForm().getToolkit()); } + @Override public void commit(boolean onSave) { fNameEntry.commit(); fURLEntry.commit(); @@ -47,6 +48,7 @@ public class DescriptionSection extends PDESection { super.commit(onSave); } + @Override public void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); Composite container = toolkit.createComposite(section); @@ -58,6 +60,7 @@ public class DescriptionSection extends PDESection { fNameEntry = new FormEntry(container, toolkit, PDEUIMessages.DescriptionSection_nameLabel, null, false); fNameEntry.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { setName(text.getValue()); } @@ -66,6 +69,7 @@ public class DescriptionSection extends PDESection { fURLEntry = new FormEntry(container, toolkit, PDEUIMessages.SiteEditor_DescriptionSection_urlLabel, null, false); fURLEntry.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { setDescriptionURL(text.getValue()); } @@ -79,6 +83,7 @@ public class DescriptionSection extends PDESection { fDescEntry.getText().setLayoutData(gd); fDescEntry.getLabel().setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); fDescEntry.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { setDescriptionText(text.getValue()); } @@ -147,6 +152,7 @@ public class DescriptionSection extends PDESection { } } + @Override public void dispose() { ISiteModel model = (ISiteModel) getPage().getModel(); if (model != null) @@ -160,10 +166,12 @@ public class DescriptionSection extends PDESection { model.addModelChangedListener(this); } + @Override public void modelChanged(IModelChangedEvent e) { markStale(); } + @Override public void setFocus() { if (fNameEntry != null) fNameEntry.getText().setFocus(); @@ -175,6 +183,7 @@ public class DescriptionSection extends PDESection { } } + @Override public void refresh() { ISiteModel model = (ISiteModel) getPage().getModel(); ISite site = model.getSite(); @@ -184,6 +193,7 @@ public class DescriptionSection extends PDESection { super.refresh(); } + @Override public void cancelEdit() { fNameEntry.cancelEdit(); fURLEntry.cancelEdit(); @@ -194,6 +204,7 @@ public class DescriptionSection extends PDESection { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESection#canPaste(org.eclipse.swt.dnd.Clipboard) */ + @Override public boolean canPaste(Clipboard clipboard) { TransferData[] types = clipboard.getAvailableTypes(); Transfer[] transfers = new Transfer[] {TextTransfer.getInstance(), RTFTransfer.getInstance()}; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeatureDetailsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeatureDetailsSection.java index 81e6876234..330923c0e0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeatureDetailsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeatureDetailsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -200,6 +200,7 @@ public class FeatureDetailsSection extends PDESection implements IPartSelectionL super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeaturesPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeaturesPage.java index 1731bef430..7455a5a55c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeaturesPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/FeaturesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -32,13 +32,16 @@ public class FeaturesPage extends PDEFormPage { super(FeaturesPage.this); } + @Override protected PDESection createMasterSection(IManagedForm managedForm, Composite parent) { fCategorySection = new CategorySection(getPage(), parent); return fCategorySection; } + @Override protected void registerPages(DetailsPart detailsPart) { detailsPart.setPageProvider(new IDetailsPageProvider() { + @Override public Object getPageKey(Object object) { if (object instanceof SiteFeatureAdapter) return SiteFeatureAdapter.class; @@ -47,6 +50,7 @@ public class FeaturesPage extends PDEFormPage { return object.getClass(); } + @Override public IDetailsPage getPage(Object key) { if (key.equals(SiteFeatureAdapter.class)) return createFeatureDetails(); @@ -63,6 +67,7 @@ public class FeaturesPage extends PDEFormPage { fBlock = new SiteFeaturesBlock(); } + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -75,10 +80,12 @@ public class FeaturesPage extends PDEFormPage { private IDetailsPage createFeatureDetails() { return new PDEDetailsSections() { + @Override protected PDESection[] createSections(PDEFormPage page, Composite parent) { return new PDESection[] {new FeatureDetailsSection(getPage(), parent), new PortabilitySection(getPage(), parent)}; } + @Override public String getContextId() { return SiteInputContext.CONTEXT_ID; } @@ -87,16 +94,19 @@ public class FeaturesPage extends PDEFormPage { private IDetailsPage createCategoryDetails() { return new PDEDetailsSections() { + @Override protected PDESection[] createSections(PDEFormPage page, Composite parent) { return new PDESection[] {new CategoryDetailsSection(getPage(), parent)}; } + @Override public String getContextId() { return SiteInputContext.CONTEXT_ID; } }; } + @Override protected String getHelpResource() { return IHelpContextIds.MANIFEST_SITE_FEATURES; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/MirrorsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/MirrorsSection.java index bc14cd0e01..8f152eae20 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/MirrorsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/MirrorsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -36,11 +36,13 @@ public class MirrorsSection extends PDESection { createClient(getSection(), page.getManagedForm().getToolkit()); } + @Override public void commit(boolean onSave) { fMirrorsURLEntry.commit(); super.commit(onSave); } + @Override public void createClient(Section section, FormToolkit toolkit) { section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); @@ -55,6 +57,7 @@ public class MirrorsSection extends PDESection { fMirrorsURLEntry = new FormEntry(container, toolkit, PDEUIMessages.SiteEditor_MirrorsSection_urlLabel, null, false); fMirrorsURLEntry.setFormEntryListener(new FormEntryAdapter(this) { + @Override public void textValueChanged(FormEntry text) { setMirrorsURL(text.getValue()); } @@ -76,6 +79,7 @@ public class MirrorsSection extends PDESection { } } + @Override public void dispose() { ISiteModel model = (ISiteModel) getPage().getModel(); if (model != null) @@ -89,10 +93,12 @@ public class MirrorsSection extends PDESection { model.addModelChangedListener(this); } + @Override public void modelChanged(IModelChangedEvent e) { markStale(); } + @Override public void setFocus() { if (fMirrorsURLEntry != null) fMirrorsURLEntry.getText().setFocus(); @@ -104,6 +110,7 @@ public class MirrorsSection extends PDESection { } } + @Override public void refresh() { ISiteModel model = (ISiteModel) getPage().getModel(); ISite site = model.getSite(); @@ -111,6 +118,7 @@ public class MirrorsSection extends PDESection { super.refresh(); } + @Override public void cancelEdit() { fMirrorsURLEntry.cancelEdit(); super.cancelEdit(); @@ -119,6 +127,7 @@ public class MirrorsSection extends PDESection { /** * @see org.eclipse.update.ui.forms.internal.FormSection#canPaste(Clipboard) */ + @Override public boolean canPaste(Clipboard clipboard) { TransferData[] types = clipboard.getAvailableTypes(); Transfer[] transfers = new Transfer[] {TextTransfer.getInstance(), RTFTransfer.getInstance()}; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/NewArchiveDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/NewArchiveDialog.java index fd604debe6..afdb7d0447 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/NewArchiveDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/NewArchiveDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,11 +44,13 @@ public class NewArchiveDialog extends StatusDialog { this.fSiteArchive = archive; } + @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); dialogChanged(); } + @Override protected Control createDialogArea(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -61,6 +63,7 @@ public class NewArchiveDialog extends StatusDialog { createEntries(container); ModifyListener listener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { dialogChanged(); } @@ -154,6 +157,7 @@ public class NewArchiveDialog extends StatusDialog { return false; } + @Override protected void okPressed() { execute(); super.okPressed(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/PortabilitySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/PortabilitySection.java index a862ba9e3c..86d409f1c2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/PortabilitySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/PortabilitySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -168,6 +168,7 @@ public class PortabilitySection extends PDESection implements IPartSelectionList @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fOsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getOSChoices(); openPortabilityChoiceDialog(IEnvironment.P_OS, fOsText, choices); @@ -193,6 +194,7 @@ public class PortabilitySection extends PDESection implements IPartSelectionList @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fWsText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getWSChoices(); openPortabilityChoiceDialog(IEnvironment.P_WS, fWsText, choices); @@ -219,6 +221,7 @@ public class PortabilitySection extends PDESection implements IPartSelectionList @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fNlText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getNLChoices(); openPortabilityChoiceDialog(IEnvironment.P_NL, fNlText, choices); @@ -244,6 +247,7 @@ public class PortabilitySection extends PDESection implements IPartSelectionList @Override public void browseButtonSelected(FormEntry entry) { BusyIndicator.showWhile(fArchText.getText().getDisplay(), new Runnable() { + @Override public void run() { Choice[] choices = getArchChoices(); openPortabilityChoiceDialog(IEnvironment.P_ARCH, fArchText, choices); @@ -332,6 +336,7 @@ public class PortabilitySection extends PDESection implements IPartSelectionList super.refresh(); } + @Override public void selectionChanged(IFormPart part, ISelection selection) { if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object o = ((IStructuredSelection) selection).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteEditor.java index c280a9cb44..c6cf5ce62d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -45,10 +45,12 @@ public class SiteEditor extends MultiSourceEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#getEditorID() */ + @Override protected String getEditorID() { return IPDEUIConstants.SITE_EDITOR_ID; } + @Override protected void createResourceContexts(InputContextManager manager, IFileEditorInput input) { IFile file = input.getFile(); IFile siteFile = null; @@ -63,15 +65,18 @@ public class SiteEditor extends MultiSourceEditor { } } + @Override protected InputContextManager createInputContextManager() { SiteInputContextManager contextManager = new SiteInputContextManager(this); contextManager.setUndoManager(new SiteUndoManager(this)); return contextManager; } + @Override public void monitoredFileAdded(IFile file) { } + @Override public boolean monitoredFileRemoved(IFile file) { //TODO may need to check with the user if there //are unsaved changes in the model for the @@ -79,14 +84,17 @@ public class SiteEditor extends MultiSourceEditor { return true; } + @Override public void editorContextAdded(InputContext context) { addSourcePage(context.getId()); } + @Override public void contextRemoved(InputContext context) { close(false); } + @Override protected void createSystemFileContexts(InputContextManager manager, FileStoreEditorInput input) { File file = new File(input.getURI()); File siteFile = null; @@ -107,6 +115,7 @@ public class SiteEditor extends MultiSourceEditor { } } + @Override protected void createStorageContexts(InputContextManager manager, IStorageEditorInput input) { String name = input.getName().toLowerCase(Locale.ENGLISH); if (name.startsWith("site.xml")) { //$NON-NLS-1$ @@ -114,10 +123,12 @@ public class SiteEditor extends MultiSourceEditor { } } + @Override protected void contextMenuAboutToShow(IMenuManager manager) { super.contextMenuAboutToShow(manager); } + @Override protected void addEditorPages() { try { addPage(new FeaturesPage(this)); @@ -128,6 +139,7 @@ public class SiteEditor extends MultiSourceEditor { addSourcePage(SiteInputContext.CONTEXT_ID); } + @Override protected String computeInitialPageId() { return FeaturesPage.PAGE_ID; } @@ -135,10 +147,12 @@ public class SiteEditor extends MultiSourceEditor { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.MultiSourceEditor#createXMLSourcePage(org.eclipse.pde.internal.ui.neweditor.PDEFormEditor, java.lang.String, java.lang.String) */ + @Override protected PDESourcePage createSourcePage(PDEFormEditor editor, String title, String name, String contextId) { return new SiteSourcePage(editor, title, name); } + @Override protected ISortableContentOutlinePage createContentOutline() { return new SiteOutlinePage(this); } @@ -147,6 +161,7 @@ public class SiteEditor extends MultiSourceEditor { * (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormEditor#getInputContext(java.lang.Object) */ + @Override protected InputContext getInputContext(Object object) { InputContext context = null; if (object instanceof ISiteObject) { @@ -155,6 +170,7 @@ public class SiteEditor extends MultiSourceEditor { return context; } + @Override public void contributeToToolbar(IToolBarManager manager) { manager.add(getBuildAllAction()); } @@ -162,6 +178,7 @@ public class SiteEditor extends MultiSourceEditor { protected Action getBuildAllAction() { if (fBuildAllAction == null) { fBuildAllAction = new Action() { + @Override public void run() { handleBuild(((ISiteModel) getAggregateModel()).getSite().getFeatures()); } @@ -171,6 +188,7 @@ public class SiteEditor extends MultiSourceEditor { updateActionEnablement(); ((ISiteModel) getAggregateModel()).addModelChangedListener(new IModelChangedListener() { + @Override public void modelChanged(IModelChangedEvent event) { updateActionEnablement(); } @@ -220,6 +238,7 @@ public class SiteEditor extends MultiSourceEditor { if (isDirty()) { try { IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { doSave(monitor); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteFeatureAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteFeatureAdapter.java index 38bf04176f..876d2f0b43 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteFeatureAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteFeatureAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2009 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -30,6 +30,7 @@ public class SiteFeatureAdapter implements Serializable, IWritable { /* (non-Javadoc) * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter) */ + @Override public void write(String indent, PrintWriter writer) { feature.write(indent, writer); } @@ -40,6 +41,7 @@ public class SiteFeatureAdapter implements Serializable, IWritable { * * @see java.lang.Object#equals(java.lang.Object) */ + @Override public boolean equals(Object obj) { if (obj instanceof SiteFeatureAdapter) { SiteFeatureAdapter adapter = (SiteFeatureAdapter) obj; @@ -60,6 +62,7 @@ public class SiteFeatureAdapter implements Serializable, IWritable { /* (non-Javadoc) * @see java.lang.Object#hashCode() */ + @Override public int hashCode() { if (feature.getId() == null) { return super.hashCode(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContext.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContext.java index c509191a77..35be32684b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContext.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,6 +43,7 @@ public class SiteInputContext extends XMLInputContext { create(); } + @Override protected IBaseModel createModel(IEditorInput input) { IBaseModel model = null; InputStream is = null; @@ -95,6 +96,7 @@ public class SiteInputContext extends XMLInputContext { return model; } + @Override public void dispose() { ISiteModel model = (ISiteModel) getModel(); if (storageModel) { @@ -103,6 +105,7 @@ public class SiteInputContext extends XMLInputContext { super.dispose(); } + @Override protected void flushModel(IDocument doc) { // if model is dirty, flush its content into // the document so that the source editor will @@ -128,6 +131,7 @@ public class SiteInputContext extends XMLInputContext { } } + @Override protected boolean synchronizeModel(IDocument doc) { ISiteModel model = (ISiteModel) getModel(); boolean cleanModel = true; @@ -154,6 +158,7 @@ public class SiteInputContext extends XMLInputContext { * * @see org.eclipse.pde.internal.ui.neweditor.InputContext#getId() */ + @Override public String getId() { return CONTEXT_ID; } @@ -164,15 +169,18 @@ public class SiteInputContext extends XMLInputContext { * @see org.eclipse.pde.internal.ui.neweditor.context.InputContext#addTextEditOperation(java.util.ArrayList, * org.eclipse.pde.core.IModelChangedEvent) */ + @Override protected void addTextEditOperation(ArrayList<TextEdit> ops, IModelChangedEvent event) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.neweditor.context.XMLInputContext#reorderInsertEdits(java.util.ArrayList) */ + @Override protected void reorderInsertEdits(ArrayList<TextEdit> ops) { } + @Override protected String getPartitionName() { return "___site_partition"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContextManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContextManager.java index b830365a09..b56f3c8b16 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContextManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteInputContextManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -23,6 +23,7 @@ public class SiteInputContextManager extends InputContextManager { super(editor); } + @Override public IBaseModel getAggregateModel() { return findSiteModel(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteLabelProvider.java index 1252aeee97..a0b33b1406 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -42,6 +42,7 @@ class SiteLabelProvider extends LabelProvider { fSharedProvider.connect(this); } + @Override public Image getImage(Object element) { if (element instanceof ISiteCategoryDefinition) return fCatDefImage; @@ -55,6 +56,7 @@ class SiteLabelProvider extends LabelProvider { return fSharedProvider.getImage(element); } + @Override public String getText(Object element) { if (element instanceof ISiteCategoryDefinition) return ((ISiteCategoryDefinition) element).getName(); @@ -70,6 +72,7 @@ class SiteLabelProvider extends LabelProvider { /* (non-Javadoc) * @see org.eclipse.jface.viewers.BaseLabelProvider#dispose() */ + @Override public void dispose() { fSharedProvider.disconnect(this); // Dispose of images diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteOutlinePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteOutlinePage.java index e7ceb75bd5..c8516d28ae 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteOutlinePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -29,6 +29,7 @@ public class SiteOutlinePage extends FormOutlinePage { super(editor); } + @Override protected Object[] getChildren(Object parent) { if (parent instanceof PDEFormPage) { PDEFormPage page = (PDEFormPage) parent; @@ -73,6 +74,7 @@ public class SiteOutlinePage extends FormOutlinePage { return new Object[0]; } + @Override protected String getParentPageId(Object item) { String pageId = null; if (item instanceof ISiteCategoryDefinition || item instanceof SiteFeatureAdapter) @@ -89,6 +91,7 @@ public class SiteOutlinePage extends FormOutlinePage { * * @see org.eclipse.pde.internal.ui.editor.FormOutlinePage#createLabelProvider() */ + @Override public ILabelProvider createLabelProvider() { fLabelProvider = new SiteLabelProvider(); return fLabelProvider; @@ -99,6 +102,7 @@ public class SiteOutlinePage extends FormOutlinePage { * * @see org.eclipse.pde.internal.ui.editor.FormOutlinePage#dispose() */ + @Override public void dispose() { super.dispose(); if (fLabelProvider != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteSourcePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteSourcePage.java index 39a583c686..0eb27d3f3e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteSourcePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteSourcePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,10 +24,12 @@ public class SiteSourcePage extends XMLSourcePage { return null; } + @Override public ILabelProvider createOutlineLabelProvider() { return null; } + @Override public ITreeContentProvider createOutlineContentProvider() { return null; } @@ -35,6 +37,7 @@ public class SiteSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#createOutlineSorter() */ + @Override public ViewerComparator createOutlineComparator() { return null; } @@ -42,10 +45,12 @@ public class SiteSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#updateSelection(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void updateSelection(SelectionChangedEvent e) { // NO-OP } + @Override protected ISortableContentOutlinePage createOutlinePage() { // TODO remove this method when the above three stubs // are implemented @@ -55,6 +60,7 @@ public class SiteSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEProjectionSourcePage#isQuickOutlineEnabled() */ + @Override public boolean isQuickOutlineEnabled() { return false; } @@ -62,6 +68,7 @@ public class SiteSourcePage extends XMLSourcePage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDESourcePage#updateSelection(java.lang.Object) */ + @Override public void updateSelection(Object object) { // NO-OP } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteUndoManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteUndoManager.java index 667a495505..4eb609910b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteUndoManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SiteUndoManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,6 +24,7 @@ public class SiteUndoManager extends ModelUndoManager { setUndoLevelLimit(30); } + @Override protected String getPageId(Object obj) { if (obj instanceof ISiteDescription) { return ArchivePage.PAGE_ID; @@ -39,6 +40,7 @@ public class SiteUndoManager extends ModelUndoManager { /* * @see IModelUndoManager#execute(ModelUndoOperation) */ + @Override protected void execute(IModelChangedEvent event, boolean undo) { IModelChangeProvider model = event.getChangeProvider(); Object[] elements = event.getChangedObjects(); @@ -128,6 +130,7 @@ public class SiteUndoManager extends ModelUndoManager { } } + @Override public void modelChanged(IModelChangedEvent event) { if (event.getChangeType() == IModelChangedEvent.CHANGE) { Object object = event.getChangedObjects()[0]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesAction.java index d4f4b685ce..02af8e7c95 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -29,6 +29,7 @@ public class SynchronizePropertiesAction extends Action { fModel = model; } + @Override public void run() { SynchronizePropertiesWizard wizard = new SynchronizePropertiesWizard(fSiteFeatures, fModel); WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizard.java index 148a233302..4d553b5c23 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,11 +33,13 @@ public class SynchronizePropertiesWizard extends Wizard { fModel = model; } + @Override public void addPages() { fMainPage = new SynchronizePropertiesWizardPage(fSiteFeatures, fModel); addPage(fMainPage); } + @Override public boolean performFinish() { return fMainPage.finish(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizardPage.java index d689fe9332..383ecb3028 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/site/SynchronizePropertiesWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -61,6 +61,7 @@ public class SynchronizePropertiesWizardPage extends WizardPage { fModel = model; } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -94,6 +95,7 @@ public class SynchronizePropertiesWizardPage extends WizardPage { final int mode = saveSettings(); IRunnableWithProgress operation = new WorkspaceModifyOperation() { + @Override public void execute(IProgressMonitor monitor) { try { runOperation(mode, monitor); @@ -144,6 +146,7 @@ public class SynchronizePropertiesWizardPage extends WizardPage { } final boolean isPatch = patch; getShell().getDisplay().syncExec(new Runnable() { + @Override public void run() { try { siteFeature.setNL(feature.getNL()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ArgumentsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ArgumentsSection.java index e01792e23b..c06d8b3706 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ArgumentsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ArgumentsSection.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.targetdefinition;
import org.eclipse.pde.core.target.ITargetDefinition;
@@ -96,6 +96,7 @@ public class ArgumentsSection extends SectionPart { fProgramArguments = new FormEntry(programComp, toolkit, PDEUIMessages.ArgumentsSection_0, SWT.MULTI | SWT.WRAP);
fProgramArguments.getText().setLayoutData(new GridData(GridData.FILL_BOTH));
fProgramArguments.setFormEntryListener(new SimpleFormEntryAdapter(this) {
+ @Override
public void textValueChanged(FormEntry entry) {
String value = entry.getValue().trim();
getTarget().setProgramArguments(value.length() > 0 ? value : null);
@@ -104,6 +105,7 @@ public class ArgumentsSection extends SectionPart { Button variables = toolkit.createButton(programComp, PDEUIMessages.ArgumentsSection_variableButtonTitle, SWT.NONE);
variables.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
variables.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getSection().getShell());
dialog.open();
@@ -125,6 +127,7 @@ public class ArgumentsSection extends SectionPart { fVMArguments = new FormEntry(vmComp, toolkit, PDEUIMessages.ArgumentsSection_1, SWT.MULTI | SWT.WRAP);
fVMArguments.getText().setLayoutData(new GridData(GridData.FILL_BOTH));
fVMArguments.setFormEntryListener(new SimpleFormEntryAdapter(this) {
+ @Override
public void textValueChanged(FormEntry entry) {
String value = entry.getValue().trim();
getTarget().setVMArguments(value.length() > 0 ? value : null);
@@ -142,6 +145,7 @@ public class ArgumentsSection extends SectionPart { Button vmArgs = toolkit.createButton(buttons, PDEUIMessages.ArgumentsSection_argumentsButtonTitle, SWT.NONE);
vmArgs.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
vmArgs.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
ArgumentsFromContainerSelectionDialog dialog = new ArgumentsFromContainerSelectionDialog(getSection().getShell(), getTarget());
if (dialog.open() == Window.OK) {
@@ -160,6 +164,7 @@ public class ArgumentsSection extends SectionPart { variables = toolkit.createButton(buttons, PDEUIMessages.ArgumentsSection_variableButtonTitle, SWT.NONE);
variables.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
variables.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getSection().getShell());
dialog.open();
@@ -184,6 +189,7 @@ public class ArgumentsSection extends SectionPart { /* (non-Javadoc)
* @see org.eclipse.ui.forms.AbstractFormPart#refresh()
*/
+ @Override
public void refresh() {
fProgramArguments.setValue(getTarget().getProgramArguments(), true);
fVMArguments.setValue(getTarget().getVMArguments(), true);
@@ -193,6 +199,7 @@ public class ArgumentsSection extends SectionPart { /* (non-Javadoc)
* @see org.eclipse.ui.forms.AbstractFormPart#commit(boolean)
*/
+ @Override
public void commit(boolean onSave) {
fProgramArguments.commit();
fVMArguments.commit();
@@ -202,6 +209,7 @@ public class ArgumentsSection extends SectionPart { /* (non-Javadoc)
* @see org.eclipse.ui.forms.AbstractFormPart#dispose()
*/
+ @Override
public void dispose() {
if (fImage != null)
fImage.dispose();
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentPage.java index af76c7d89f..20f3fc65dd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -45,6 +45,7 @@ public class ContentPage extends FormPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -64,6 +65,7 @@ public class ContentPage extends FormPage { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormPage#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); @@ -78,6 +80,7 @@ public class ContentPage extends FormPage { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormPage#canLeaveThePage() */ + @Override public boolean canLeaveThePage() { ((TargetEditor) getEditor()).setDirty(isDirty()); return true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentSection.java index bb998011d4..743850837f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ContentSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -67,6 +67,7 @@ public class ContentSection extends SectionPart { fEditor.getTargetChangedListener().setContentTree(fContentGroup); fContentGroup.addTargetChangedListener(fEditor.getTargetChangedListener()); fContentGroup.addTargetChangedListener(new ITargetChangedListener() { + @Override public void contentsChanged(ITargetDefinition definition, Object source, boolean resolve, boolean forceResolve) { markDirty(); } @@ -80,6 +81,7 @@ public class ContentSection extends SectionPart { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { // Use the change listener as it can check if we are resolved, resolving, or cancelled bug 264908 fEditor.getTargetChangedListener().contentsChanged(getTarget(), this, false, false); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/DefinitionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/DefinitionPage.java index a6cdc03b21..dfc3b1f350 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/DefinitionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/DefinitionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -51,6 +51,7 @@ public class DefinitionPage extends FormPage implements IHyperlinkListener { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.PDEFormPage#createFormContent(org.eclipse.ui.forms.IManagedForm) */ + @Override protected void createFormContent(IManagedForm managedForm) { super.createFormContent(managedForm); ScrolledForm form = managedForm.getForm(); @@ -70,6 +71,7 @@ public class DefinitionPage extends FormPage implements IHyperlinkListener { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormPage#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); @@ -123,6 +125,7 @@ public class DefinitionPage extends FormPage implements IHyperlinkListener { return text; } + @Override public void linkActivated(HyperlinkEvent e) { String href = (String) e.getHref(); if (href.equals("content")) //$NON-NLS-1$ @@ -131,11 +134,13 @@ public class DefinitionPage extends FormPage implements IHyperlinkListener { getEditor().setActivePage(EnvironmentPage.PAGE_ID); } + @Override public void linkEntered(HyperlinkEvent e) { IStatusLineManager mng = getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(e.getLabel()); } + @Override public void linkExited(HyperlinkEvent e) { IStatusLineManager mng = getEditor().getEditorSite().getActionBars().getStatusLineManager(); mng.setMessage(null); @@ -144,6 +149,7 @@ public class DefinitionPage extends FormPage implements IHyperlinkListener { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormPage#canLeaveThePage() */ + @Override public boolean canLeaveThePage() { ((TargetEditor) getEditor()).setDirty(isDirty()); return true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentPage.java index e796b2faf0..8ee96f7439 100755 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentPage.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.targetdefinition;
import org.eclipse.pde.internal.ui.*;
@@ -40,6 +40,7 @@ public class EnvironmentPage extends FormPage { /* (non-Javadoc)
* @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
*/
+ @Override
protected void createFormContent(IManagedForm managedForm) {
super.createFormContent(managedForm);
ScrolledForm form = managedForm.getForm();
@@ -59,6 +60,7 @@ public class EnvironmentPage extends FormPage { /* (non-Javadoc)
* @see org.eclipse.ui.forms.editor.FormPage#dispose()
*/
+ @Override
public void dispose() {
PDEPlugin.getDefault().getLabelProvider().disconnect(this);
super.dispose();
@@ -77,6 +79,7 @@ public class EnvironmentPage extends FormPage { /* (non-Javadoc)
* @see org.eclipse.ui.forms.editor.FormPage#canLeaveThePage()
*/
+ @Override
public boolean canLeaveThePage() {
((TargetEditor) getEditor()).setDirty(isDirty());
return true;
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentSection.java index ccbfabf8d3..527bc30bb3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/EnvironmentSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -140,29 +140,34 @@ public class EnvironmentSection extends SectionPart { refresh(); fOSCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { markDirty(); getTarget().setOS(getText(fOSCombo)); } }); fWSCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { markDirty(); getTarget().setWS(getText(fWSCombo)); } }); fArchCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { markDirty(); getTarget().setArch(getText(fArchCombo)); } }); fNLCombo.getControl().addFocusListener(new FocusAdapter() { + @Override public void focusGained(FocusEvent event) { // if we haven't gotten all the values for the NL's, display a busy cursor to the user while we find them. if (!LOCALES_INITIALIZED) { try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { initializeAllLocales(); LOCALES_INITIALIZED = true; @@ -186,6 +191,7 @@ public class EnvironmentSection extends SectionPart { } fNLCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String value = getText(fNLCombo); if (value == null) { @@ -271,6 +277,7 @@ public class EnvironmentSection extends SectionPart { return text; } + @Override public void refresh() { ITargetDefinition target = getTarget(); String presetValue = (target.getOS() == null) ? "" : target.getOS(); //$NON-NLS-1$ @@ -289,6 +296,7 @@ public class EnvironmentSection extends SectionPart { return; // kick off thread in background to find the NL values new Thread(new Runnable() { + @Override public void run() { initializeAllLocales(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ImplicitDependenciesSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ImplicitDependenciesSection.java index ed492578ae..add2ff1044 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ImplicitDependenciesSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/ImplicitDependenciesSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -108,6 +108,7 @@ public class ImplicitDependenciesSection extends SectionPart { table.setLayoutData(new GridData(GridData.FILL_BOTH)); fViewer = new TableViewer(table); fViewer.setContentProvider(new DefaultTableProvider() { + @Override public Object[] getElements(Object inputElement) { NameVersionDescriptor[] bundles = getTarget().getImplicitDependencies(); if (bundles == null) { @@ -118,6 +119,7 @@ public class ImplicitDependenciesSection extends SectionPart { }); fViewer.setLabelProvider(new StyledBundleLabelProvider(true, false)); fViewer.setComparator(new ViewerComparator() { + @Override public int compare(Viewer viewer, Object e1, Object e2) { NameVersionDescriptor bundle1 = (NameVersionDescriptor) e1; NameVersionDescriptor bundle2 = (NameVersionDescriptor) e2; @@ -126,11 +128,13 @@ public class ImplicitDependenciesSection extends SectionPart { }); fViewer.setInput(getTarget()); fViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateButtons(); } }); fViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { Object object = ((IStructuredSelection) event.getSelection()).getFirstElement(); ManifestEditor.openPluginEditor(((NameVersionDescriptor) object).getId()); @@ -147,6 +151,7 @@ public class ImplicitDependenciesSection extends SectionPart { fAdd = toolkit.createButton(parent, PDEUIMessages.ImplicitDependenicesSection_Add, SWT.PUSH); fAdd.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING)); fAdd.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleAdd(); } @@ -155,6 +160,7 @@ public class ImplicitDependenciesSection extends SectionPart { fRemove = toolkit.createButton(parent, PDEUIMessages.ImplicitDependenicesSection_Remove, SWT.PUSH); fRemove.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING)); fRemove.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleRemove(); } @@ -163,6 +169,7 @@ public class ImplicitDependenciesSection extends SectionPart { fRemoveAll = toolkit.createButton(parent, PDEUIMessages.ImplicitDependenicesSection_RemoveAll, SWT.PUSH); fRemoveAll.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING)); fRemoveAll.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleRemoveAll(); } @@ -274,6 +281,7 @@ public class ImplicitDependenciesSection extends SectionPart { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { // TODO Try to retain selection during refresh, add and remove operations fViewer.setInput(getTarget()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/InformationSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/InformationSection.java index 0c952501b9..307399724c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/InformationSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/InformationSection.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
+ * Copyright (c) 2009, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.targetdefinition;
import org.eclipse.pde.core.target.ITargetDefinition;
@@ -77,6 +77,7 @@ public class InformationSection extends SectionPart { fNameText = toolkit.createText(client, getTarget().getName());
fNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fNameText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
String value = fNameText.getText().trim();
getTarget().setName(value.length() > 0 ? value : null);
@@ -86,6 +87,7 @@ public class InformationSection extends SectionPart { fNameTextValidator = new TextValidator(fPage.getManagedForm(), fNameText, null, true) {
+ @Override
protected boolean autoEnable() {
if (getText().getEditable() == false) {
return false;
@@ -93,6 +95,7 @@ public class InformationSection extends SectionPart { return true;
}
+ @Override
protected boolean validateControl() {
return ControlValidationUtility.validateRequiredField(fNameText.getText(), fNameTextValidator, IMessageProvider.ERROR);
}
@@ -104,6 +107,7 @@ public class InformationSection extends SectionPart { /* (non-Javadoc)
* @see org.eclipse.ui.forms.AbstractFormPart#refresh()
*/
+ @Override
public void refresh() {
fNameText.setText(getTarget().getName() != null ? getTarget().getName() : ""); //$NON-NLS-1$
super.refresh();
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/JRESection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/JRESection.java index 62de189cd0..17cf134f39 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/JRESection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/JRESection.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.editor.targetdefinition;
import org.eclipse.pde.core.target.ITargetDefinition;
@@ -90,6 +90,7 @@ public class JRESection extends SectionPart { gd.horizontalSpan = 3;
fDefaultJREButton.setLayoutData(gd);
fDefaultJREButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateWidgets();
if (!fBlockChanges) {
@@ -101,6 +102,7 @@ public class JRESection extends SectionPart { fNamedJREButton = toolkit.createButton(client, PDEUIMessages.JRESection_JREName, SWT.RADIO);
fNamedJREButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateWidgets();
if (!fBlockChanges) {
@@ -117,6 +119,7 @@ public class JRESection extends SectionPart { fNamedJREsCombo.setItems(installs);
fNamedJREsCombo.setVisibleItemCount(30);
fNamedJREsCombo.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (!fBlockChanges) {
getTarget().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getVMInstall(fNamedJREsCombo.getSelection())));
@@ -127,6 +130,7 @@ public class JRESection extends SectionPart { fConfigureJREButton = toolkit.createButton(client, PDEUIMessages.JRESection_jrePreference, SWT.PUSH);
fConfigureJREButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
openPreferencePage(JRE_PREF_PAGE_ID);
}
@@ -136,6 +140,7 @@ public class JRESection extends SectionPart { fExecEnvButton = toolkit.createButton(client, PDEUIMessages.JRESection_ExecutionEnv, SWT.RADIO);
fExecEnvButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateWidgets();
if (!fBlockChanges) {
@@ -151,6 +156,7 @@ public class JRESection extends SectionPart { fExecEnvsCombo.setItems(fExecEnvChoices.toArray(new String[fExecEnvChoices.size()]));
fExecEnvsCombo.setVisibleItemCount(30);
fExecEnvsCombo.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (!fBlockChanges) {
getTarget().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getSelection())));
@@ -161,6 +167,7 @@ public class JRESection extends SectionPart { Button configureEEButton = toolkit.createButton(client, PDEUIMessages.JRESection_eePreference, SWT.PUSH);
configureEEButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
openPreferencePage(EE_PREF_PAGE_ID);
}
@@ -191,6 +198,7 @@ public class JRESection extends SectionPart { /* (non-Javadoc)
* @see org.eclipse.ui.forms.AbstractFormPart#refresh()
*/
+ @Override
public void refresh() {
fBlockChanges = true;
IPath jrePath = getTarget().getJREContainer();
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/LocationsSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/LocationsSection.java index 2844539f7d..546f9eced1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/LocationsSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/LocationsSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -67,6 +67,7 @@ public class LocationsSection extends SectionPart { fEditor.getTargetChangedListener().setLocationTree(fContainerGroup); fContainerGroup.addTargetChangedListener(fEditor.getTargetChangedListener()); fContainerGroup.addTargetChangedListener(new ITargetChangedListener() { + @Override public void contentsChanged(ITargetDefinition definition, Object source, boolean resolve, boolean forceResolve) { markDirty(); } @@ -79,6 +80,7 @@ public class LocationsSection extends SectionPart { /* (non-Javadoc) * @see org.eclipse.ui.forms.AbstractFormPart#refresh() */ + @Override public void refresh() { fContainerGroup.setInput(getTarget()); super.refresh(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/SimpleFormEntryAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/SimpleFormEntryAdapter.java index 802fb1298e..d15e3c9bbe 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/SimpleFormEntryAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/SimpleFormEntryAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -31,24 +31,28 @@ public class SimpleFormEntryAdapter implements IFormEntryListener { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.parts.IFormEntryListener#browseButtonSelected(org.eclipse.pde.internal.ui.parts.FormEntry) */ + @Override public void browseButtonSelected(FormEntry entry) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.parts.IFormEntryListener#focusGained(org.eclipse.pde.internal.ui.parts.FormEntry) */ + @Override public void focusGained(FormEntry entry) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.parts.IFormEntryListener#selectionChanged(org.eclipse.pde.internal.ui.parts.FormEntry) */ + @Override public void selectionChanged(FormEntry entry) { } /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.parts.IFormEntryListener#textDirty(org.eclipse.pde.internal.ui.parts.FormEntry) */ + @Override public void textDirty(FormEntry entry) { fFormPart.markDirty(); } @@ -56,24 +60,28 @@ public class SimpleFormEntryAdapter implements IFormEntryListener { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.parts.IFormEntryListener#textValueChanged(org.eclipse.pde.internal.ui.parts.FormEntry) */ + @Override public void textValueChanged(FormEntry entry) { } /* (non-Javadoc) * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkActivated(HyperlinkEvent e) { } /* (non-Javadoc) * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkEntered(HyperlinkEvent e) { } /* (non-Javadoc) * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse.ui.forms.events.HyperlinkEvent) */ + @Override public void linkExited(HyperlinkEvent e) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditor.java index b324c9ecb9..ad2785259b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -60,6 +60,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormEditor#createToolkit(org.eclipse.swt.widgets.Display) */ + @Override protected FormToolkit createToolkit(Display display) { return new FormToolkit(PDEPlugin.getDefault().getFormColors(display)); } @@ -67,6 +68,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormEditor#addPages() */ + @Override protected void addPages() { try { setActiveEditor(this); @@ -81,6 +83,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void doSave(IProgressMonitor monitor) { commitPages(true); try { @@ -94,6 +97,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.part.EditorPart#doSaveAs() */ + @Override public void doSaveAs() { commitPages(true); ITargetDefinition target = getTarget(); @@ -134,6 +138,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed() */ + @Override public boolean isSaveAsAllowed() { return true; } @@ -146,6 +151,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormEditor#isDirty() */ + @Override public boolean isDirty() { return fDirty || super.isDirty(); } @@ -154,6 +160,7 @@ public class TargetEditor extends FormEditor { * @see org.eclipse.ui.forms.editor.FormEditor#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput) * @since 3.7 */ + @Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { if (!(input instanceof IFileEditorInput) && !(input instanceof IURIEditorInput)) throw new PartInitException(NLS.bind(PDEUIMessages.TargetEditor_6, input.getClass().getName())); @@ -163,6 +170,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput) */ + @Override protected void setInput(IEditorInput input) { super.setInput(input); setPartName(getEditorInput().getName()); @@ -172,6 +180,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.ui.forms.editor.FormEditor#dispose() */ + @Override public void dispose() { // Cancel any resolution jobs that are runnning Job.getJobManager().cancel(getTargetChangedListener().getJobFamily()); @@ -219,20 +228,24 @@ public class TargetEditor extends FormEditor { public void contributeToToolbar(final ScrolledForm form, String contextID) { ControlContribution setAsTarget = new ControlContribution("Set") { //$NON-NLS-1$ + @Override protected Control createControl(Composite parent) { final ImageHyperlink hyperlink = new ImageHyperlink(parent, SWT.NONE); hyperlink.setText(PDEUIMessages.AbstractTargetPage_setTarget); hyperlink.setUnderlined(true); hyperlink.setForeground(getToolkit().getHyperlinkGroup().getForeground()); hyperlink.addHyperlinkListener(new IHyperlinkListener() { + @Override public void linkActivated(HyperlinkEvent e) { LoadTargetDefinitionJob.load(getTarget()); } + @Override public void linkEntered(HyperlinkEvent e) { hyperlink.setForeground(getToolkit().getHyperlinkGroup().getActiveForeground()); } + @Override public void linkExited(HyperlinkEvent e) { hyperlink.setForeground(getToolkit().getHyperlinkGroup().getForeground()); } @@ -243,8 +256,10 @@ public class TargetEditor extends FormEditor { final String helpContextID = contextID; Action help = new Action("help") { //$NON-NLS-1$ + @Override public void run() { BusyIndicator.showWhile(form.getForm().getDisplay(), new Runnable() { + @Override public void run() { PlatformUI.getWorkbench().getHelpSystem().displayHelp(helpContextID); } @@ -255,6 +270,7 @@ public class TargetEditor extends FormEditor { help.setImageDescriptor(PDEPluginImages.DESC_HELP); Action export = new Action("export") { //$NON-NLS-1$ + @Override public void run() { TargetDefinitionExportWizard wizard = new TargetDefinitionExportWizard(getTarget()); wizard.setWindowTitle(PDEUIMessages.ExportActiveTargetDefinition); @@ -289,6 +305,7 @@ public class TargetEditor extends FormEditor { public void showError(final String message, final CoreException exception) { Display display = getSite().getShell().getDisplay(); display.asyncExec(new Runnable() { + @Override public void run() { ErrorDialog.openError(getSite().getShell(), PDEUIMessages.TargetEditor_4, message, exception.getStatus()); } @@ -392,6 +409,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) */ + @Override public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.POST_CHANGE) { IResourceDelta delta = event.getDelta().findMember(fTargetFileInWorkspace.getFullPath()); @@ -402,6 +420,7 @@ public class TargetEditor extends FormEditor { if (!fSaving) { Display display = getSite().getShell().getDisplay(); display.asyncExec(new Runnable() { + @Override public void run() { TargetEditor.this.doRevert(); } @@ -437,6 +456,7 @@ public class TargetEditor extends FormEditor { return fJobFamily; } + @Override public void contentsChanged(ITargetDefinition definition, Object source, boolean resolve, boolean forceResolve) { if (!forceResolve && (!resolve || definition.isResolved())) { if (fContentTree != null && source != fContentTree) { @@ -466,6 +486,7 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected IStatus run(IProgressMonitor monitor) { getTarget().resolve(monitor); if (monitor.isCanceled()) { @@ -478,14 +499,17 @@ public class TargetEditor extends FormEditor { /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object) */ + @Override public boolean belongsTo(Object family) { return family.equals(getJobFamily()); } }; resolveJob.addJobChangeListener(new JobChangeAdapter() { + @Override public void done(org.eclipse.core.runtime.jobs.IJobChangeEvent event) { final IStatus status = event.getResult(); UIJob job = new UIJob(PDEUIMessages.TargetEditor_2) { + @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (fContentTree != null) { if (status.getSeverity() == IStatus.CANCEL) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditorContributor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditorContributor.java index de5cca80cb..456f2db391 100755 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditorContributor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/targetdefinition/TargetEditorContributor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -30,16 +30,19 @@ public class TargetEditorContributor extends EditorActionBarContributor { private IAction fRevertAction; class RevertAction extends Action implements IUpdate { + @Override public void run() { if (fEditor != null) fEditor.doRevert(); } + @Override public void update() { setEnabled(fEditor != null ? fEditor.isDirty() : false); } } + @Override public void setActiveEditor(IEditorPart targetEditor) { if (targetEditor instanceof TargetEditor) { fEditor = (TargetEditor) targetEditor; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AbstractHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AbstractHyperlink.java index 39d9d60db8..7d708bb474 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AbstractHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AbstractHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -23,14 +23,17 @@ public abstract class AbstractHyperlink implements IHyperlink { fElement = element; } + @Override public IRegion getHyperlinkRegion() { return fRegion; } + @Override public String getHyperlinkText() { return null; } + @Override public String getTypeLabel() { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationHover.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationHover.java index b5c683129c..bedbe64fb8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationHover.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -19,6 +19,7 @@ import org.eclipse.ui.texteditor.MarkerAnnotation; public class AnnotationHover implements IAnnotationHover { + @Override public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { String[] messages = getMessagesForLine(sourceViewer, lineNumber); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationModelFactory.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationModelFactory.java index 39164951ad..9b09b71169 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationModelFactory.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/AnnotationModelFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -19,6 +19,7 @@ import org.eclipse.pde.internal.ui.editor.SystemFileMarkerAnnotationModel; public class AnnotationModelFactory implements IAnnotationModelFactory { + @Override public IAnnotationModel createAnnotationModel(IPath location) { IFile file = FileBuffers.getWorkspaceFileAtLocation(location); if (file == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ArgumentRule.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ArgumentRule.java index 7abac7dfdf..9338aa634c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ArgumentRule.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ArgumentRule.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -19,6 +19,7 @@ public class ArgumentRule extends WordPatternRule { /* * @see IWordDetector#isWordStart */ + @Override public boolean isWordStart(char c) { return '{' == c; } @@ -26,6 +27,7 @@ public class ArgumentRule extends WordPatternRule { /* * @see IWordDetector#isWordPart */ + @Override public boolean isWordPart(char c) { return c == '}' || Character.isDigit(c); } @@ -45,6 +47,7 @@ public class ArgumentRule extends WordPatternRule { /* * @see org.eclipse.jface.text.rules.WordPatternRule#endSequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner) */ + @Override protected boolean endSequenceDetected(ICharacterScanner scanner) { fCount++; @@ -58,6 +61,7 @@ public class ArgumentRule extends WordPatternRule { /* * @see org.eclipse.jface.text.rules.PatternRule#sequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner, char[], boolean) */ + @Override protected boolean sequenceDetected(ICharacterScanner scanner, char[] sequence, boolean eofAllowed) { fCount = 0; return super.sequenceDetected(scanner, sequence, eofAllowed); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/BundleHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/BundleHyperlink.java index a3236b6fa9..31b13b79ad 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/BundleHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/BundleHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -19,6 +19,7 @@ public class BundleHyperlink extends ManifestElementHyperlink { super(region, pluginID); } + @Override protected void open2() { ManifestEditor.openPluginEditor(fElement); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ChangeAwareSourceViewerConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ChangeAwareSourceViewerConfiguration.java index b19e3200c3..21ab74c823 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ChangeAwareSourceViewerConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ChangeAwareSourceViewerConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -56,6 +56,7 @@ public abstract class ChangeAwareSourceViewerConfiguration extends TextSourceVie })); } + @Override public IReconciler getReconciler(ISourceViewer sourceViewer) { if (fSourcePage != null && fReconciler == null) { IBaseModel model = fSourcePage.getInputContext().getModel(); @@ -72,6 +73,7 @@ public abstract class ChangeAwareSourceViewerConfiguration extends TextSourceVie return fReconciler; } + @Override public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) { if (fSourcePage == null) return null; @@ -127,6 +129,7 @@ public abstract class ChangeAwareSourceViewerConfiguration extends TextSourceVie */ private IInformationControlCreator getOutlinePresenterControlCreator(ISourceViewer sourceViewer, final String commandId) { return new IInformationControlCreator() { + @Override public IInformationControl createInformationControl(Shell parent) { int shellStyle = SWT.RESIZE; QuickOutlinePopupDialog dialog = new QuickOutlinePopupDialog(parent, shellStyle, fSourcePage, fSourcePage); @@ -141,12 +144,14 @@ public abstract class ChangeAwareSourceViewerConfiguration extends TextSourceVie protected IInformationControlCreator getInformationControlCreator(final boolean cutDown) { return new IInformationControlCreator() { + @Override public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, !cutDown); } }; } + @Override public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { IHyperlinkDetector[] registeredDetectors = super.getHyperlinkDetectors(sourceViewer); if (registeredDetectors == null) @@ -165,6 +170,7 @@ public abstract class ChangeAwareSourceViewerConfiguration extends TextSourceVie return allDetectors; } + @Override public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) { if (sourceViewer.isEditable()) { if (fQuickAssistant == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java index ca3b6aa552..b039aeda65 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,6 +91,7 @@ public class ColorManager implements IColorManager, IPDEColorConstants { } + @Override public void dispose() { counter--; if (counter == 0) @@ -111,6 +112,7 @@ public class ColorManager implements IColorManager, IPDEColorConstants { fColorTable.put(property, new Color(Display.getCurrent(), setting)); } + @Override public Color getColor(String key) { Color color = fColorTable.get(key); if (color == null) @@ -118,6 +120,7 @@ public class ColorManager implements IColorManager, IPDEColorConstants { return color; } + @Override public void handlePropertyChangeEvent(PropertyChangeEvent event) { Object color = event.getNewValue(); if (color instanceof RGB) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ExternalizedStringRule.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ExternalizedStringRule.java index 4015fec0e2..3feb3f773d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ExternalizedStringRule.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ExternalizedStringRule.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -35,6 +35,7 @@ public class ExternalizedStringRule extends WordPatternRule { /* (non-Javadoc) * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char) */ + @Override public boolean isWordStart(char character) { if (character == '%') { return true; @@ -45,6 +46,7 @@ public class ExternalizedStringRule extends WordPatternRule { /* (non-Javadoc) * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char) */ + @Override public boolean isWordPart(char character) { if (Character.isLetterOrDigit(character)) { return true; @@ -69,6 +71,7 @@ public class ExternalizedStringRule extends WordPatternRule { /* (non-Javadoc) * @see org.eclipse.jface.text.rules.WordPatternRule#endSequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner) */ + @Override protected boolean endSequenceDetected(ICharacterScanner scanner) { // Read the next character char character = (char) scanner.read(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/JavaHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/JavaHyperlink.java index 926a34d293..7e0a55793f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/JavaHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/JavaHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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,6 +28,7 @@ public class JavaHyperlink extends AbstractHyperlink { fResource = res; } + @Override public void open() { try { if (fResource == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestConfiguration.java index 7af69ba8fa..25e452a9f8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -43,16 +43,19 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration super(fColorManager); } + @Override public boolean affectsTextPresentation(String property) { return property.startsWith(IPDEColorConstants.P_HEADER_KEY) || property.startsWith(IPDEColorConstants.P_HEADER_OSGI); } + @Override protected Token getTokenAffected(PropertyChangeEvent event) { if (event.getProperty().startsWith(IPDEColorConstants.P_HEADER_OSGI)) return fToken; return (Token) fDefaultReturnToken; } + @Override protected void initialize() { fToken = new Token(createTextAttribute(IPDEColorConstants.P_HEADER_OSGI)); WordRule rule = new WordRule(new KeywordDetector(), Token.UNDEFINED, true); @@ -95,10 +98,12 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration super(fColorManager); } + @Override public boolean affectsTextPresentation(String property) { return property.startsWith(IPDEColorConstants.P_HEADER_ASSIGNMENT) || property.startsWith(IPDEColorConstants.P_HEADER_VALUE) || property.startsWith(IPDEColorConstants.P_HEADER_ATTRIBUTES); } + @Override protected Token getTokenAffected(PropertyChangeEvent event) { String property = event.getProperty(); if (property.startsWith(IPDEColorConstants.P_HEADER_ASSIGNMENT)) @@ -108,6 +113,7 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration return (Token) fDefaultReturnToken; } + @Override protected void initialize() { IRule[] rules = new IRule[2]; fAssignmentToken = new Token(createTextAttribute(IPDEColorConstants.P_HEADER_ASSIGNMENT)); @@ -144,20 +150,24 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration } class AssignmentDetector implements IWordDetector { + @Override public boolean isWordStart(char c) { return c == ':' || c == '='; } + @Override public boolean isWordPart(char c) { return false; } } class KeywordDetector implements IWordDetector { + @Override public boolean isWordStart(char c) { return Character.isJavaIdentifierStart(c); } + @Override public boolean isWordPart(char c) { return c != ':' && c != '=' && !Character.isSpaceChar(c); } @@ -178,6 +188,7 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration this.fDocumentPartitioning = documentPartitioning; } + @Override public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { String[] partitions = ManifestPartitionScanner.PARTITIONS; String[] all = new String[partitions.length + 1]; @@ -186,12 +197,14 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration return all; } + @Override public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { if (fAnnotationHover == null) fAnnotationHover = new AnnotationHover(); return fAnnotationHover; } + @Override public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { PresentationReconciler reconciler = new PresentationReconciler(); reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); @@ -207,16 +220,19 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration return reconciler; } + @Override public boolean affectsTextPresentation(PropertyChangeEvent event) { String property = event.getProperty(); return property.startsWith(IPDEColorConstants.P_HEADER_KEY) || property.startsWith(IPDEColorConstants.P_HEADER_OSGI) || property.startsWith(IPDEColorConstants.P_HEADER_VALUE) || property.startsWith(IPDEColorConstants.P_HEADER_ATTRIBUTES) || property.startsWith(IPDEColorConstants.P_HEADER_ASSIGNMENT); } + @Override public boolean affectsColorPresentation(PropertyChangeEvent event) { String property = event.getProperty(); return property.equals(IPDEColorConstants.P_HEADER_KEY) || property.equals(IPDEColorConstants.P_HEADER_OSGI) || property.equals(IPDEColorConstants.P_HEADER_VALUE) || property.equals(IPDEColorConstants.P_HEADER_ATTRIBUTES) || property.equals(IPDEColorConstants.P_HEADER_ASSIGNMENT); } + @Override public void adaptToPreferenceChange(PropertyChangeEvent event) { if (affectsColorPresentation(event)) fColorManager.handlePropertyChangeEvent(event); @@ -224,12 +240,14 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration fPropertyValueScanner.adaptToPreferenceChange(event); } + @Override public void dispose() { super.dispose(); if (fContentAssistant != null) fContentAssistantProcessor.dispose(); } + @Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (fSourcePage != null && fSourcePage.isEditable()) { if (fContentAssistant == null) { @@ -241,6 +259,7 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration fContentAssistant.addCompletionListener(fContentAssistantProcessor); fContentAssistant.enableAutoInsert(true); fContentAssistant.setInformationControlCreator(new IInformationControlCreator() { + @Override public IInformationControl createInformationControl(Shell parent) { return new DefaultInformationControl(parent, false); } @@ -252,16 +271,19 @@ public class ManifestConfiguration extends ChangeAwareSourceViewerConfiguration return null; } + @Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { if (fTextHover == null && fSourcePage != null) fTextHover = new ManifestTextHover(fSourcePage); return fTextHover; } + @Override protected int getInfoImplementationType() { return SourceInformationProvider.F_MANIFEST_IMP; } + @Override public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) { if (fDocumentPartitioning != null) return fDocumentPartitioning; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestElementHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestElementHyperlink.java index 2b2c33f55e..3685771e94 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestElementHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestElementHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -20,6 +20,7 @@ public abstract class ManifestElementHyperlink extends AbstractHyperlink { protected abstract void open2(); + @Override public void open() { // remove whitespace inbetween chars int len = fElement.length(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestTextHover.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestTextHover.java index f2d970e1d5..16cc0714ed 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestTextHover.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ManifestTextHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -35,6 +35,7 @@ public class ManifestTextHover extends PDETextHover { fJP = JavaCore.create(project); } + @Override public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { int offset = hoverRegion.getOffset(); IDocumentRange range = fSourcePage.getRangeElement(offset, false); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/MultilineDamagerRepairer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/MultilineDamagerRepairer.java index a687b4bd42..94cae40932 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/MultilineDamagerRepairer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/MultilineDamagerRepairer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -27,6 +27,7 @@ public class MultilineDamagerRepairer extends DefaultDamagerRepairer { /* (non-Javadoc) * @see org.eclipse.jface.text.presentation.IPresentationDamager#getDamageRegion(org.eclipse.jface.text.ITypedRegion, org.eclipse.jface.text.DocumentEvent, boolean) */ + @Override public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent e, boolean documentPartitioningChanged) { return partition; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEDefaultInformationControl.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEDefaultInformationControl.java index ed1cb5437e..ab30472516 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEDefaultInformationControl.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEDefaultInformationControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,6 +24,7 @@ public class PDEDefaultInformationControl extends DefaultInformationControl { /* * @see IInformationControl#dispose() */ + @Override public void dispose() { fDisposed = true; super.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEQuickAssistAssistant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEQuickAssistAssistant.java index 28e7f8cb44..128b3020d1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEQuickAssistAssistant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDEQuickAssistAssistant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -49,24 +49,29 @@ public class PDEQuickAssistAssistant extends QuickAssistAssistant { fMarker = marker; } + @Override public void apply(IDocument document) { fResolution.run(fMarker); } + @Override public Point getSelection(IDocument document) { return new Point(fPosition.offset, 0); } + @Override public String getAdditionalProposalInfo() { if (fResolution instanceof IMarkerResolution2) return ((IMarkerResolution2) fResolution).getDescription(); return null; } + @Override public String getDisplayString() { return fResolution.getLabel(); } + @Override public Image getImage() { if (fResolution instanceof AbstractPDEMarkerResolution) { switch (((AbstractPDEMarkerResolution) fResolution).getType()) { @@ -85,18 +90,22 @@ public class PDEQuickAssistAssistant extends QuickAssistAssistant { return null; } + @Override public IContextInformation getContextInformation() { return null; } + @Override public IInformationControlCreator getInformationControlCreator() { return null; } + @Override public int getPrefixCompletionStart(IDocument document, int completionOffset) { return 0; } + @Override public CharSequence getPrefixCompletionText(IDocument document, int completionOffset) { return null; } @@ -104,6 +113,7 @@ public class PDEQuickAssistAssistant extends QuickAssistAssistant { /* (non-Javadoc) * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension4#isAutoInsertable() */ + @Override public boolean isAutoInsertable() { return true; } @@ -128,6 +138,7 @@ public class PDEQuickAssistAssistant extends QuickAssistAssistant { /* (non-Javadoc) * @see java.lang.Comparable#compareTo(java.lang.Object) */ + @Override public int compareTo(Object arg0) { if (!(arg0 instanceof PDECompletionProposal)) return -1; @@ -148,10 +159,12 @@ public class PDEQuickAssistAssistant extends QuickAssistAssistant { ResolutionGenerator fGenerator = new ResolutionGenerator(); HashMap<IMarker, IMarkerResolution[]> fResMap = new HashMap<IMarker, IMarkerResolution[]>(); + @Override public String getErrorMessage() { return null; } + @Override public boolean canFix(Annotation annotation) { boolean bRetVal = false; if (annotation instanceof SimpleMarkerAnnotation) { @@ -195,10 +208,12 @@ public class PDEQuickAssistAssistant extends QuickAssistAssistant { } } + @Override public boolean canAssist(IQuickAssistInvocationContext invocationContext) { return false; } + @Override public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) { IAnnotationModel amodel = invocationContext.getSourceViewer().getAnnotationModel(); IDocument doc = invocationContext.getSourceViewer().getDocument(); @@ -207,6 +222,7 @@ public class PDEQuickAssistAssistant extends QuickAssistAssistant { Iterator<?> it = amodel.getAnnotationIterator(); TreeSet<ICompletionProposal> proposalSet = new TreeSet<ICompletionProposal>(new Comparator<Object>() { + @Override public int compare(Object o1, Object o2) { if (o1 instanceof ICompletionProposal && o2 instanceof ICompletionProposal) { ICompletionProposal proposal1 = (ICompletionProposal) o1; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESelectAnnotationRulerAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESelectAnnotationRulerAction.java index fec7c94ea0..4dffa8bab1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESelectAnnotationRulerAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESelectAnnotationRulerAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -32,6 +32,7 @@ public class PDESelectAnnotationRulerAction extends SelectMarkerRulerAction { fPrefix = prefix; } + @Override public void run() { runWithEvent(null); } @@ -40,6 +41,7 @@ public class PDESelectAnnotationRulerAction extends SelectMarkerRulerAction { * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event) * @since 3.2 */ + @Override public void runWithEvent(Event event) { if (fIsEditable) { ITextOperationTarget operation = (ITextOperationTarget) fTextEditor.getAdapter(ITextOperationTarget.class); @@ -54,6 +56,7 @@ public class PDESelectAnnotationRulerAction extends SelectMarkerRulerAction { super.run(); } + @Override public void update() { checkReadOnly(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESourceInfoProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESourceInfoProvider.java index 18f6df5110..e4e54428d5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESourceInfoProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDESourceInfoProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -34,6 +34,8 @@ public class PDESourceInfoProvider implements IInformationProvider, IInformation /** * @deprecated */ + @Deprecated + @Override public String getInformation(ITextViewer textViewer, IRegion subject) { // This method is deprecated. Call the non-deprecated method return getInformation2(textViewer, subject).toString(); @@ -42,6 +44,7 @@ public class PDESourceInfoProvider implements IInformationProvider, IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int) */ + @Override public IRegion getSubject(ITextViewer textViewer, int offset) { // Subject used in getInformation2 if ((textViewer == null) || (fSourcePage == null)) { @@ -59,6 +62,7 @@ public class PDESourceInfoProvider implements IInformationProvider, IInformation /* (non-Javadoc) * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion) */ + @Override public Object getInformation2(ITextViewer textViewer, IRegion subject) { // Calls setInput on the quick outline popup dialog if ((textViewer == null) || (fSourcePage == null)) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDETextHover.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDETextHover.java index 76d9785f5a..3acdd7ef45 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDETextHover.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PDETextHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -20,16 +20,19 @@ import org.eclipse.ui.editors.text.EditorsUI; public abstract class PDETextHover implements ITextHoverExtension, ITextHover { + @Override public IRegion getHoverRegion(ITextViewer textViewer, int offset) { return new Region(offset, 0); } + @Override public IInformationControlCreator getHoverControlCreator() { return getInformationControlCreator(); } public static IInformationControlCreator getInformationControlCreator() { return new IInformationControlCreator() { + @Override public IInformationControl createInformationControl(Shell parent) { return new PDEDefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString()); } @@ -44,15 +47,18 @@ public abstract class PDETextHover implements ITextHoverExtension, ITextHover { public static void addHoverListenerToControl(final IInformationControl infoControl, final Control control, final IControlHoverContentProvider provider) { control.addMouseTrackListener(new MouseTrackListener() { + @Override public void mouseEnter(MouseEvent e) { } + @Override public void mouseExit(MouseEvent e) { if (infoControl instanceof PDEDefaultInformationControl && ((PDEDefaultInformationControl) infoControl).isDisposed()) return; infoControl.setVisible(false); } + @Override public void mouseHover(MouseEvent e) { if (infoControl instanceof PDEDefaultInformationControl && ((PDEDefaultInformationControl) infoControl).isDisposed()) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PackageHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PackageHyperlink.java index b44780999c..8515dce7c2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PackageHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PackageHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -30,6 +30,7 @@ public class PackageHyperlink extends ManifestElementHyperlink { fHeader = header; } + @Override protected void open2() { IResource res = fHeader.getBundle().getModel().getUnderlyingResource(); if (res == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLConfiguration.java index 344e1b2304..b3b2310f92 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2015 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,6 +28,7 @@ public class PluginXMLConfiguration extends XMLConfiguration { super(colorManager, page); } + @Override public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { if (sourceViewer.isEditable() && fContentAssistant == null) { fContentAssistProcessor = new XMLContentAssistProcessor(fSourcePage); @@ -43,12 +44,14 @@ public class PluginXMLConfiguration extends XMLConfiguration { return fContentAssistant; } + @Override public void dispose() { if (fContentAssistProcessor != null) fContentAssistProcessor.dispose(); super.dispose(); } + @Override public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { if (fTextHover == null && fSourcePage != null) fTextHover = new PluginXMLTextHover(fSourcePage); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLTextHover.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLTextHover.java index b03fb19936..51a4df77d6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLTextHover.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/PluginXMLTextHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -29,6 +29,7 @@ public class PluginXMLTextHover extends PDETextHover { fSourcePage = sourcePage; } + @Override public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { int offset = hoverRegion.getOffset(); IDocumentRange range = fSourcePage.getRangeElement(offset, true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ReconcilingStrategy.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ReconcilingStrategy.java index f3e51c7c39..75154e9c00 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ReconcilingStrategy.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ReconcilingStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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,6 +28,7 @@ public class ReconcilingStrategy implements IReconcilingStrategy { /* (non-Javadoc) * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument) */ + @Override public void setDocument(IDocument document) { fDocument = document; } @@ -35,6 +36,7 @@ public class ReconcilingStrategy implements IReconcilingStrategy { /* (non-Javadoc) * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion, org.eclipse.jface.text.IRegion) */ + @Override public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) { if (fDocument != null) notifyParticipants(); @@ -43,6 +45,7 @@ public class ReconcilingStrategy implements IReconcilingStrategy { /* (non-Javadoc) * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion) */ + @Override public void reconcile(IRegion partition) { if (fDocument != null) notifyParticipants(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ResourceHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ResourceHyperlink.java index e00f3e617c..13bb48e815 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ResourceHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ResourceHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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,6 +28,7 @@ public class ResourceHyperlink extends AbstractHyperlink { fResource = res; } + @Override public void open() { if (fResource == null) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SchemaHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SchemaHyperlink.java index b1f83af539..299aa0498d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SchemaHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SchemaHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -23,6 +23,7 @@ public class SchemaHyperlink extends AbstractHyperlink { fResource = res; } + @Override public void open() { if (fResource != null) SchemaEditor.openSchema(fResource.getProject().getFile(fElement)); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SourceInformationProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SourceInformationProvider.java index fcf2ecac98..e03ceae974 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SourceInformationProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/SourceInformationProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -27,21 +27,26 @@ public class SourceInformationProvider implements IInformationProvider, IInforma protected ITextHover fImplementation; protected int fImpType; + @Override public void partOpened(IWorkbenchPart part) { } + @Override public void partDeactivated(IWorkbenchPart part) { } + @Override public void partClosed(IWorkbenchPart part) { if (fSourcePage != null && part == fSourcePage.getEditor() && fImpType != F_NO_IMP) fSourcePage.getSite().getWorkbenchWindow().getPartService().removePartListener(this); } + @Override public void partActivated(IWorkbenchPart part) { update(); } + @Override public void partBroughtToTop(IWorkbenchPart part) { update(); } @@ -79,12 +84,14 @@ public class SourceInformationProvider implements IInformationProvider, IInforma } } + @Override public IRegion getSubject(ITextViewer textViewer, int offset) { if (textViewer != null) return PDEWordFinder.findWord(textViewer.getDocument(), offset); return null; } + @Override public String getInformation(ITextViewer textViewer, IRegion subject) { if (fImplementation != null) { String s = fImplementation.getHoverInfo(textViewer, subject); @@ -94,6 +101,7 @@ public class SourceInformationProvider implements IInformationProvider, IInforma return null; } + @Override public IInformationControlCreator getInformationPresenterControlCreator() { return fPresenterControlCreator; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TranslationHyperlink.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TranslationHyperlink.java index c7728a6875..b97b7c3250 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TranslationHyperlink.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/TranslationHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -51,6 +51,7 @@ public class TranslationHyperlink extends AbstractHyperlink { return fOpened; } + @Override public void open() { fOpened = openHyperLink(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLConfiguration.java index 544ffe0d5c..2259007d6f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2010 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -48,10 +48,12 @@ public class XMLConfiguration extends ChangeAwareSourceViewerConfiguration { super(page, colorManager); } + @Override public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) { return new String[] {IDocument.DEFAULT_CONTENT_TYPE, XMLPartitionScanner.XML_COMMENT, XMLPartitionScanner.XML_TAG, XMLStringPartitionScanner.XML_STRING}; } + @Override public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) { if (fDoubleClickStrategy == null) fDoubleClickStrategy = new XMLDoubleClickStrategy(); @@ -70,6 +72,7 @@ public class XMLConfiguration extends ChangeAwareSourceViewerConfiguration { return fTagScanner; } + @Override public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { PresentationReconciler reconciler = new PresentationReconciler(); reconciler.setDocumentPartitioning(XMLDocumentSetupParticpant.XML_PARTITIONING); @@ -90,6 +93,7 @@ public class XMLConfiguration extends ChangeAwareSourceViewerConfiguration { return reconciler; } + @Override public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { if (fAnnotationHover == null) fAnnotationHover = new AnnotationHover(); @@ -100,6 +104,7 @@ public class XMLConfiguration extends ChangeAwareSourceViewerConfiguration { * Preference colors or fonts have changed. * Update the default tokens of the scanners. */ + @Override public void adaptToPreferenceChange(PropertyChangeEvent event) { if (fTagScanner == null) return; //property change before the editor is fully created @@ -141,16 +146,19 @@ public class XMLConfiguration extends ChangeAwareSourceViewerConfiguration { return textAttribute; } + @Override public boolean affectsTextPresentation(PropertyChangeEvent event) { String property = event.getProperty(); return property.startsWith(IPDEColorConstants.P_DEFAULT) || property.startsWith(IPDEColorConstants.P_PROC_INSTR) || property.startsWith(IPDEColorConstants.P_STRING) || property.startsWith(IPDEColorConstants.P_EXTERNALIZED_STRING) || property.startsWith(IPDEColorConstants.P_TAG) || property.startsWith(IPDEColorConstants.P_XML_COMMENT); } + @Override public boolean affectsColorPresentation(PropertyChangeEvent event) { String property = event.getProperty(); return property.equals(IPDEColorConstants.P_DEFAULT) || property.equals(IPDEColorConstants.P_PROC_INSTR) || property.equals(IPDEColorConstants.P_STRING) || property.equals(IPDEColorConstants.P_EXTERNALIZED_STRING) || property.equals(IPDEColorConstants.P_TAG) || property.equals(IPDEColorConstants.P_XML_COMMENT); } + @Override protected int getInfoImplementationType() { return SourceInformationProvider.F_XML_IMP; } @@ -158,6 +166,7 @@ public class XMLConfiguration extends ChangeAwareSourceViewerConfiguration { /* (non-Javadoc) * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer) */ + @Override public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) { return XMLDocumentSetupParticpant.XML_PARTITIONING; } @@ -165,6 +174,7 @@ public class XMLConfiguration extends ChangeAwareSourceViewerConfiguration { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.text.ChangeAwareSourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer) */ + @Override public IReconciler getReconciler(ISourceViewer sourceViewer) { if (fSourcePage != null && fReconciler == null) { IBaseModel model = fSourcePage.getInputContext().getModel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLDoubleClickStrategy.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLDoubleClickStrategy.java index cee0ceeef9..0c58cd93f7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLDoubleClickStrategy.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLDoubleClickStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -15,6 +15,7 @@ import org.eclipse.jface.text.*; public class XMLDoubleClickStrategy implements ITextDoubleClickStrategy { protected ITextViewer fText; + @Override public void doubleClicked(ITextViewer part) { int pos = part.getSelectedRange().x; if (pos > 0) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLReconcilingStrategy.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLReconcilingStrategy.java index 9b9cfed102..bb13f96656 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLReconcilingStrategy.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLReconcilingStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -58,6 +58,7 @@ public class XMLReconcilingStrategy extends SpellingReconcileStrategy { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector#accept(org.eclipse.ui.texteditor.spelling.SpellingProblem) */ + @Override public void accept(SpellingProblem problem) { fAddAnnotations.put(new SpellingAnnotation(problem), new Position(problem.getOffset(), problem.getLength())); } @@ -65,6 +66,7 @@ public class XMLReconcilingStrategy extends SpellingReconcileStrategy { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector#beginCollecting() */ + @Override public void beginCollecting() { fAddAnnotations = new HashMap<SpellingAnnotation, Position>(); } @@ -72,6 +74,7 @@ public class XMLReconcilingStrategy extends SpellingReconcileStrategy { /* * @see org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector#endCollecting() */ + @Override public void endCollecting() { synchronized (fLockObject) { for (Iterator<SpellingAnnotation> iter = fAddAnnotations.keySet().iterator(); iter.hasNext();) { @@ -89,6 +92,7 @@ public class XMLReconcilingStrategy extends SpellingReconcileStrategy { super(viewer, EditorsUI.getSpellingService()); } + @Override public void reconcile(IRegion region) { deleteAllAnnotations(region); @@ -147,6 +151,7 @@ public class XMLReconcilingStrategy extends SpellingReconcileStrategy { /* (non-Javadoc) * @see org.eclipse.ui.texteditor.spelling.SpellingReconcileStrategy#createSpellingProblemCollector() */ + @Override protected ISpellingProblemCollector createSpellingProblemCollector() { IAnnotationModel model = getAnnotationModel(); if (model == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLScanner.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLScanner.java index ca84ddfca0..2f92dce3f8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLScanner.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLScanner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -22,6 +22,7 @@ public class XMLScanner extends BasePDEScanner { super(manager); } + @Override protected void initialize() { fProcInstr = new Token(createTextAttribute(IPDEColorConstants.P_PROC_INSTR)); fExternalizedString = new Token(createTextAttribute(IPDEColorConstants.P_EXTERNALIZED_STRING)); @@ -36,6 +37,7 @@ public class XMLScanner extends BasePDEScanner { setDefaultReturnToken(new Token(createTextAttribute(IPDEColorConstants.P_DEFAULT))); } + @Override protected Token getTokenAffected(PropertyChangeEvent event) { if (event.getProperty().startsWith(IPDEColorConstants.P_PROC_INSTR)) { return fProcInstr; @@ -45,6 +47,7 @@ public class XMLScanner extends BasePDEScanner { return (Token) fDefaultReturnToken; } + @Override public boolean affectsTextPresentation(String property) { return property.startsWith(IPDEColorConstants.P_DEFAULT) || property.startsWith(IPDEColorConstants.P_PROC_INSTR) || property.startsWith(IPDEColorConstants.P_EXTERNALIZED_STRING); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagRule.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagRule.java index 47fb35dadf..f1a3e8ebb1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagRule.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagRule.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -18,6 +18,7 @@ public class XMLTagRule extends MultiLineRule { super("<", ">", token); //$NON-NLS-1$ //$NON-NLS-2$ } + @Override protected boolean sequenceDetected(ICharacterScanner scanner, char[] sequence, boolean eofAllowed) { int c = scanner.read(); if (sequence[0] == '<') { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagScanner.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagScanner.java index 925079b441..ab27ee288f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagScanner.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLTagScanner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -23,6 +23,7 @@ public class XMLTagScanner extends BasePDEScanner { super(manager); } + @Override protected void initialize() { fStringToken = new Token(createTextAttribute(IPDEColorConstants.P_STRING)); fExternalizedStringToken = new Token(createTextAttribute(IPDEColorConstants.P_EXTERNALIZED_STRING)); @@ -38,6 +39,7 @@ public class XMLTagScanner extends BasePDEScanner { setDefaultReturnToken(new Token(createTextAttribute(IPDEColorConstants.P_TAG))); } + @Override protected Token getTokenAffected(PropertyChangeEvent event) { String property = event.getProperty(); if (property.startsWith(IPDEColorConstants.P_STRING)) { @@ -48,6 +50,7 @@ public class XMLTagScanner extends BasePDEScanner { return (Token) fDefaultReturnToken; } + @Override public boolean affectsTextPresentation(String property) { return property.startsWith(IPDEColorConstants.P_TAG) || property.startsWith(IPDEColorConstants.P_STRING) || property.startsWith(IPDEColorConstants.P_EXTERNALIZED_STRING); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLWhitespaceDetector.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLWhitespaceDetector.java index b8f482f8a5..7097873fb5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLWhitespaceDetector.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/XMLWhitespaceDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -14,6 +14,7 @@ import org.eclipse.jface.text.rules.IWhitespaceDetector; public class XMLWhitespaceDetector implements IWhitespaceDetector { + @Override public boolean isWhitespace(char c) { return (c == ' ' || c == '\t' || c == '\n' || c == '\r'); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/AbstractControlValidator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/AbstractControlValidator.java index fd55baa7e1..981400f024 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/AbstractControlValidator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/AbstractControlValidator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -63,6 +63,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IControlValdiator#getEnabled() */ + @Override public boolean getEnabled() { return fEnabled; } @@ -70,6 +71,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IControlValdiator#setEnabled(boolean) */ + @Override public void setEnabled(boolean enabled) { // Nothing to do here if enablement is not being changed if (enabled == fEnabled) { @@ -90,6 +92,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.IControlValdiator#validate() */ + @Override public boolean validate() { // Skip validation if the validator is disabled if (fEnabled == false) { @@ -111,6 +114,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IValidatorMessageHandler#addMessage(java.lang.Object, java.lang.String, int) */ + @Override public void addMessage(Object key, String messageText, int messageType) { // Add a prefix, if one was specified if (fMessagePrefix != null) { @@ -123,6 +127,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IValidatorMessageHandler#addMessage(java.lang.String, int) */ + @Override public void addMessage(String messageText, int messageType) { // Add a prefix, if one was specified if (fMessagePrefix != null) { @@ -164,6 +169,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IValidatorMessageHandler#removeMessage(java.lang.Object) */ + @Override public void removeMessage(Object key) { fManagedForm.getMessageManager().removeMessage(key, fControl); } @@ -171,6 +177,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IValidatorMessageHandler#setMessagePrefix(java.lang.String) */ + @Override public void setMessagePrefix(String prefix) { fMessagePrefix = prefix; } @@ -178,6 +185,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IValidatorMessageHandler#getMessagePrefix() */ + @Override public String getMessagePrefix() { return fMessagePrefix; } @@ -185,6 +193,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IValidatorMessageHandler#getManagedForm() */ + @Override public IManagedForm getManagedForm() { return fManagedForm; } @@ -192,6 +201,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IValidatorMessageHandler#getMessageManager() */ + @Override public IMessageManager getMessageManager() { return fManagedForm.getMessageManager(); } @@ -199,6 +209,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IControlValidator#setRefresh(boolean) */ + @Override public void setRefresh(boolean refresh) { getMessageManager().setAutoUpdate(refresh); } @@ -206,6 +217,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IControlValdiator#getControl() */ + @Override public Control getControl() { return fControl; } @@ -213,6 +225,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IControlValidator#isValid() */ + @Override public boolean isValid() { return fIsValid; } @@ -220,6 +233,7 @@ public abstract class AbstractControlValidator implements IControlValidator, IVa /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.IControlValidator#reset() */ + @Override public void reset() { fIsValid = true; fManagedForm.getMessageManager().removeMessages(fControl); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/TextValidator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/TextValidator.java index 276a5fa67e..0939df879e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/TextValidator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/validation/TextValidator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -53,6 +53,7 @@ public abstract class TextValidator extends AbstractControlValidator { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.AbstractControlValidator#setEnabled(boolean) */ + @Override public void setEnabled(boolean enabled) { // Nothing to do here if enablement is not being changed if (getEnabled() == enabled) { @@ -74,6 +75,7 @@ public abstract class TextValidator extends AbstractControlValidator { protected void createListeners() { fModifyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { handleModifyTextEvent(e); } @@ -108,6 +110,7 @@ public abstract class TextValidator extends AbstractControlValidator { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.validation.AbstractControlValidator#autoEnable() */ + @Override protected boolean autoEnable() { // Enable validator if the text field is editable if (getText().getEditable() == false) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultContentProvider.java index c582b42a55..47501d3285 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -19,9 +19,11 @@ public class DefaultContentProvider implements IContentProvider { super(); } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultElement.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultElement.java index a1be09a983..e2bf552ac7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultElement.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/DefaultElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -14,18 +14,22 @@ import org.eclipse.swt.graphics.Image; public abstract class DefaultElement implements IPDEElement { + @Override public Object[] getChildren() { return null; } + @Override public Image getImage() { return null; } + @Override public String getLabel() { return ""; //$NON-NLS-1$ } + @Override public Object getParent() { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementLabelProvider.java index 2fcfb73646..b69ca4af34 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -20,6 +20,7 @@ public class ElementLabelProvider extends LabelProvider { super(); } + @Override public Image getImage(Object element) { if (element instanceof IPDEElement) { return ((IPDEElement) element).getImage(); @@ -27,6 +28,7 @@ public class ElementLabelProvider extends LabelProvider { return super.getImage(element); } + @Override public String getText(Object element) { if (element instanceof IPDEElement) { return ((IPDEElement) element).getLabel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementList.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementList.java index 2f0a27e051..174d5a737b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementList.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ElementList.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -32,6 +32,7 @@ public class ElementList extends NamedElement { children.addElement(child); } + @Override public Object[] getChildren() { if (children.size() == 0) return new Object[0]; @@ -48,6 +49,7 @@ public class ElementList extends NamedElement { return children.size(); } + @Override public String toString() { return children.toString(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ListContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ListContentProvider.java index 2c82324fd4..1465dac9c0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ListContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/ListContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -18,6 +18,7 @@ public class ListContentProvider extends DefaultContentProvider implements IStru super(); } + @Override public Object[] getElements(Object element) { if (element instanceof IPDEElement) { return ((IPDEElement) element).getChildren(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/NamedElement.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/NamedElement.java index 2df134019d..f553836090 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/NamedElement.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/NamedElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,18 +33,22 @@ public class NamedElement extends DefaultElement { this.parent = parent; } + @Override public Image getImage() { return image; } + @Override public String getLabel() { return name; } + @Override public Object getParent() { return parent; } + @Override public String toString() { return getLabel(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/TreeContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/TreeContentProvider.java index 0adf748ed0..365f11920d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/TreeContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/elements/TreeContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -19,9 +19,11 @@ public class TreeContentProvider extends ListContentProvider implements ITreeCon super(); } + @Override public void dispose() { } + @Override public Object[] getChildren(Object element) { if (element instanceof IPDEElement) { return ((IPDEElement) element).getChildren(); @@ -29,6 +31,7 @@ public class TreeContentProvider extends ListContentProvider implements ITreeCon return null; } + @Override public Object[] getElements(Object element) { if (element instanceof IPDEElement) { return ((IPDEElement) element).getChildren(); @@ -36,6 +39,7 @@ public class TreeContentProvider extends ListContentProvider implements ITreeCon return null; } + @Override public Object getParent(Object element) { if (element instanceof IPDEElement) { return ((IPDEElement) element).getParent(); @@ -43,6 +47,7 @@ public class TreeContentProvider extends ListContentProvider implements ITreeCon return null; } + @Override public boolean hasChildren(java.lang.Object element) { if (element instanceof IPDEElement) { Object[] children = ((IPDEElement) element).getChildren(); @@ -51,6 +56,7 @@ public class TreeContentProvider extends ListContentProvider implements ITreeCon return false; } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java index 03d101672a..6a0d364a84 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -219,10 +219,12 @@ public abstract class AbstractPluginBlock { } class PluginContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public boolean hasChildren(Object parent) { return !(parent instanceof IPluginModelBase); } + @Override public Object[] getChildren(Object parent) { if (parent == fExternalPlugins) return getExternalModels(); @@ -231,6 +233,7 @@ public abstract class AbstractPluginBlock { return new Object[0]; } + @Override public Object getParent(Object child) { if (child instanceof IPluginModelBase) { IResource resource = ((IPluginModelBase) child).getUnderlyingResource(); @@ -239,6 +242,7 @@ public abstract class AbstractPluginBlock { return null; } + @Override public Object[] getElements(Object input) { ArrayList<NamedElement> list = new ArrayList<NamedElement>(); if (getWorkspaceModels().length > 0) @@ -339,6 +343,7 @@ public abstract class AbstractPluginBlock { boolean previousFilter = false; + @Override public void preRefresh(FilterableCheckboxTreeViewer viewer, boolean filtered) { refreshTreeView(fPluginTreeViewer); if (previousFilter != filtered) { @@ -360,6 +365,7 @@ public abstract class AbstractPluginBlock { fPluginTreeViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { // Since a check on the root of a CheckBoxTreeViewer selects all its children // (hidden or not), we need to ensure that all items are shown @@ -386,6 +392,7 @@ public abstract class AbstractPluginBlock { fPluginTreeViewer.setLabelProvider(getLabelProvider()); fPluginTreeViewer.setAutoExpandLevel(2); fPluginTreeViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(final CheckStateChangedEvent event) { Object element = event.getElement(); if (element instanceof IPluginModelBase) { @@ -477,6 +484,7 @@ public abstract class AbstractPluginBlock { int defaultLevel = level.length() == 0 || "default".equals(level) ? 0 : Integer.parseInt(level); //$NON-NLS-1$ spinner.setSelection(defaultLevel); spinner.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (item.getChecked()) { int selection = spinner.getSelection(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ApplicationSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ApplicationSelectionDialog.java index 959e2ae182..65c111d6ff 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ApplicationSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ApplicationSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -38,6 +38,7 @@ public class ApplicationSelectionDialog extends TrayDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.LAUNCHER_APPLICATION_SELECTION); @@ -46,11 +47,13 @@ public class ApplicationSelectionDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) */ + @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); } + @Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridLayout layout = new GridLayout(); @@ -85,6 +88,7 @@ public class ApplicationSelectionDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ + @Override protected void okPressed() { fSelectedApplication = applicationCombo.getText(); super.okPressed(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/BaseBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/BaseBlock.java index 6ca4e14029..241d08f665 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/BaseBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/BaseBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -47,6 +47,7 @@ public abstract class BaseBlock { protected Link fLocationLink; class Listener extends SelectionAdapter implements ModifyListener { + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); if (source == fFileSystemButton) { @@ -60,6 +61,7 @@ public abstract class BaseBlock { } } + @Override public void modifyText(ModifyEvent e) { if (fTab != null) fTab.scheduleUpdateJob(); @@ -86,6 +88,7 @@ public abstract class BaseBlock { fLocationText.addModifyListener(fListener); fLocationLink.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { try { String path = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(getLocation(), false); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java index 0a7f93f72e..f573b39954 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -47,6 +47,7 @@ public class ConfigurationAreaBlock extends BaseBlock { fUseDefaultLocationButton.setLayoutData(gd); fUseDefaultLocationButton.setText(PDEUIMessages.ConfigurationTab_useDefaultLoc); fUseDefaultLocationButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean useDefaultArea = fUseDefaultLocationButton.getSelection(); if (useDefaultArea) @@ -62,6 +63,7 @@ public class ConfigurationAreaBlock extends BaseBlock { createText(group, PDEUIMessages.ConfigurationTab_configLog, 20); fLocationText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (!fUseDefaultLocationButton.getSelection()) { // As the user types, save the text and restore it if default button is toggled @@ -132,14 +134,17 @@ public class ConfigurationAreaBlock extends BaseBlock { configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, location); } + @Override protected String getName() { return PDEUIMessages.ConfigurationAreaBlock_name; } + @Override protected boolean isFile() { return false; } + @Override public String validate() { if (fUseDefaultLocationButton.getSelection()) return null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationTemplateBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationTemplateBlock.java index 4dc80a56ac..c4d43aa0c1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationTemplateBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationTemplateBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -57,6 +57,7 @@ public class ConfigurationTemplateBlock extends BaseBlock { gd.horizontalSpan = 2; fGenerateFileButton.setLayoutData(gd); fGenerateFileButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { enableBrowseSection(!fGenerateFileButton.getSelection()); boolean generateConfig = fGenerateFileButton.getSelection(); @@ -110,14 +111,17 @@ public class ConfigurationTemplateBlock extends BaseBlock { configuration.setAttribute(IPDELauncherConstants.CONFIG_TEMPLATE_LOCATION, "${target_home}" + File.separatorChar + "configuration" + File.separatorChar + "config.ini"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } + @Override protected String getName() { return PDEUIMessages.ConfigurationTemplateBlock_name; } + @Override protected boolean isFile() { return true; } + @Override protected void handleBrowseWorkspace() { ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(fTab.getControl().getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider()); @@ -130,6 +134,7 @@ public class ConfigurationTemplateBlock extends BaseBlock { dialog.setTitle(PDEUIMessages.ConfigurationTab_fileSelection); dialog.setMessage(PDEUIMessages.ConfigurationTab_fileDialogMessage); dialog.setValidator(new ISelectionStatusValidator() { + @Override public IStatus validate(Object[] selection) { if (selection.length > 0 && selection[0] instanceof IFile) return new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$ @@ -168,6 +173,7 @@ public class ConfigurationTemplateBlock extends BaseBlock { return null; } + @Override protected void handleBrowseFileSystem() { FileDialog dialog = new FileDialog(fTab.getControl().getShell()); dialog.setFilterExtensions(new String[] {"*.ini"}); //$NON-NLS-1$ @@ -178,6 +184,7 @@ public class ConfigurationTemplateBlock extends BaseBlock { fLocationText.setText(res); } + @Override protected String getLocation() { String path = fLocationText.getText().trim(); IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); @@ -188,6 +195,7 @@ public class ConfigurationTemplateBlock extends BaseBlock { } } + @Override public String validate() { if (fGenerateFileButton.getSelection()) return null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java index b2b0629d56..da031a1fe9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FeatureBlock.java @@ -167,6 +167,7 @@ public class FeatureBlock { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { // Only the name column gets an image, see getColumnImage() return null; @@ -175,6 +176,7 @@ public class FeatureBlock { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { // If the label provider implement ILabelProvider the ViewerComparator calls getText() with whatever was passed to it, in our case we are already passing the label text based on sort order if (element instanceof String) { @@ -487,6 +489,7 @@ public class FeatureBlock { } class LocationCellModifier implements ICellModifier { + @Override public boolean canModify(Object element, String property) { if (element instanceof FeatureLaunchModel || element instanceof PluginLaunchModel) { return fTree.getChecked(element); @@ -494,6 +497,7 @@ public class FeatureBlock { return false; } + @Override public Object getValue(Object element, String property) { if (property == PROPERTY_RESOLUTION) { if (element instanceof FeatureLaunchModel) { @@ -518,6 +522,7 @@ public class FeatureBlock { return null; } + @Override public void modify(Object item, String property, Object value) { if (property == PROPERTY_RESOLUTION && value != null) { Object data = ((TreeItem) item).getData(); @@ -560,6 +565,7 @@ public class FeatureBlock { class PluginContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object input) { if (input instanceof Collection) { return ((Collection<?>) input).toArray(); @@ -570,12 +576,15 @@ public class FeatureBlock { return new Object[0]; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public Object[] getChildren(Object parentElement) { if (parentElement == fAdditionalPluginsParentElement) { return fAdditionalPlugins.toArray(); @@ -583,12 +592,14 @@ public class FeatureBlock { return new Object[0]; } + @Override public Object getParent(Object element) { if (element instanceof PluginLaunchModel) return fAdditionalPluginsParentElement; return null; } + @Override public boolean hasChildren(Object element) { if (element instanceof NamedElement) return true; @@ -857,6 +868,7 @@ public class FeatureBlock { public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { getDisplay().asyncExec(new Runnable() { + @Override public void run() { fTree.getControl().setRedraw(false); fTree.removeFilter(fSelectedOnlyFilter); @@ -901,6 +913,7 @@ public class FeatureBlock { fTree.setLabelProvider(new FeatureTreeLabelProvider()); fTree.setContentProvider(new PluginContentProvider()); fTree.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { updateCounter(); fTab.updateLaunchConfigurationDialog(); @@ -913,6 +926,7 @@ public class FeatureBlock { fTree.setColumnProperties(new String[] {null, PROPERTY_RESOLUTION}); fTree.setCellModifier(new LocationCellModifier()); fTree.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { ISelection selection = event.getSelection(); if (selection == null || !(selection instanceof IStructuredSelection)) { @@ -925,6 +939,7 @@ public class FeatureBlock { }); fTree.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) fTree.getSelection(); boolean allPlugins = true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FilteredCheckboxTree.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FilteredCheckboxTree.java index a0a6ce88fd..508255735e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FilteredCheckboxTree.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/FilteredCheckboxTree.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -159,6 +159,7 @@ class FilteredCheckboxTree extends FilteredTree { super(parent, style); addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { FilteredCheckboxTreeItem item = itemCache.get(event.getElement()); if (item != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/GenericExceptionStatusHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/GenericExceptionStatusHandler.java index 704dba6b42..cba77c1697 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/GenericExceptionStatusHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/GenericExceptionStatusHandler.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2009 eXXcellent solutions gmbh and others.
+ * Copyright (c) 2009, 2015 eXXcellent solutions gmbh 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,7 +7,7 @@ *
* Contributors:
* Achim Demelt, eXXcellent solutions gmbh - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.launcher;
import org.eclipse.core.runtime.CoreException;
@@ -17,6 +17,7 @@ import org.eclipse.pde.internal.ui.PDEPlugin; public class GenericExceptionStatusHandler implements IStatusHandler {
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
PDEPlugin.logException(status.getException());
return null;
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JREBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JREBlock.java index 77021d434c..784d39b886 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JREBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JREBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -61,6 +61,7 @@ public class JREBlock { updateJREEnablement(); } + @Override public void modifyText(ModifyEvent e) { fTab.scheduleUpdateJob(); } @@ -315,6 +316,7 @@ public class JREBlock { private Comparator<Object> getComparator() { return new Comparator<Object>() { + @Override public int compare(Object arg0, Object arg1) { return arg0.toString().compareTo(arg1.toString()); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JUnitProgramBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JUnitProgramBlock.java index 33740eb129..01975895ed 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JUnitProgramBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/JUnitProgramBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -27,10 +27,12 @@ public class JUnitProgramBlock extends ProgramBlock { super(tab); } + @Override protected String getApplicationAttribute() { return IPDELauncherConstants.APP_TO_TEST; } + @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { if (!LauncherUtils.requiresUI(config)) config.setAttribute(IPDELauncherConstants.APPLICATION, IPDEConstants.CORE_TEST_APPLICATION); @@ -38,6 +40,7 @@ public class JUnitProgramBlock extends ProgramBlock { super.setDefaults(config); } + @Override protected String[] getApplicationNames() { TreeSet<String> result = new TreeSet<String>(); result.add(PDEUIMessages.JUnitProgramBlock_headless); @@ -51,6 +54,7 @@ public class JUnitProgramBlock extends ProgramBlock { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.launcher.BasicLauncherTab#initializeApplicationSection(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override protected void initializeApplicationSection(ILaunchConfiguration config) throws CoreException { String application = config.getAttribute(IPDELauncherConstants.APPLICATION, (String) null); if (IPDEConstants.CORE_TEST_APPLICATION.equals(application)) @@ -62,6 +66,7 @@ public class JUnitProgramBlock extends ProgramBlock { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.launcher.BasicLauncherTab#saveApplicationSection(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override protected void saveApplicationSection(ILaunchConfigurationWorkingCopy config) { if (fApplicationCombo.getText().equals(PDEUIMessages.JUnitProgramBlock_headless)) { String appName = fApplicationCombo.isEnabled() ? IPDEConstants.CORE_TEST_APPLICATION : null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchTerminationStatusHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchTerminationStatusHandler.java index 256ef7e5d4..755f1bfb2a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchTerminationStatusHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LaunchTerminationStatusHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 eXXcellent solutions gmbh, EclipseSource Corporation + * Copyright (c) 2009, 2015 eXXcellent solutions gmbh, EclipseSource 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 @@ -34,6 +34,7 @@ public class LaunchTerminationStatusHandler implements IStatusHandler { public static final int OPEN_IN_ERROR_LOG_VIEW = 0; public static final int OPEN_IN_SYSTEM_EDITOR = 1; + @Override public Object handleStatus(IStatus status, Object source) throws CoreException { if (status.getCode() == 13) handleOtherReasonsFoundInLog((ILaunch) source); @@ -44,6 +45,7 @@ public class LaunchTerminationStatusHandler implements IStatusHandler { private void handleWorkspaceInUse() { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { MessageDialog.openError(PDEPlugin.getActiveWorkbenchShell(), PDEUIMessages.Launcher_error_title, PDEMessages.Launcher_error_code15); } @@ -52,6 +54,7 @@ public class LaunchTerminationStatusHandler implements IStatusHandler { private void handleOtherReasonsFoundInLog(final ILaunch launch) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { try { File log = LaunchListener.getMostRecentLogFile(launch.getLaunchConfiguration()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LauncherUtilsStatusHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LauncherUtilsStatusHandler.java index 0b57690f29..dc50290c5c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LauncherUtilsStatusHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/LauncherUtilsStatusHandler.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2009, 2012 eXXcellent solutions gmbh, EclipseSource Corporation,
+ * Copyright (c) 2009, 2015 eXXcellent solutions gmbh, EclipseSource Corporation,
* 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
@@ -10,7 +10,7 @@ * Achim Demelt, eXXcellent solutions gmbh - initial API and implementation
* EclipseSource - initial API and implementation, ongoing enhancements
* IBM Corporation - ongoing enhancements
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.launcher;
import java.util.*;
@@ -39,6 +39,7 @@ import org.eclipse.ui.IWorkbenchWindow; public class LauncherUtilsStatusHandler implements IStatusHandler {
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
int code = status.getCode();
switch (code) {
@@ -101,6 +102,7 @@ public class LauncherUtilsStatusHandler implements IStatusHandler { private void organizeManifests(final ArrayList<?> projects, final IProgressMonitor monitor, final Properties lastRun) {
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
OrganizeManifestsProcessor processor = new OrganizeManifestsProcessor(projects);
initializeProcessor(processor);
@@ -162,6 +164,7 @@ public class LauncherUtilsStatusHandler implements IStatusHandler { private static Integer generateDialog(final String message) {
final int[] result = new int[1];
getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
String title = PDEUIMessages.LauncherUtils_title;
MessageDialog dialog = new MessageDialog(getActiveShell(), title, null, message, MessageDialog.QUESTION, new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL}, 0);
@@ -173,6 +176,7 @@ public class LauncherUtilsStatusHandler implements IStatusHandler { private static void generateErrorDialog(final String title, final String message, final ILaunchConfiguration launchConfig, final String mode) {
getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
Shell parentShell = getActiveShell();
MessageDialog dialog = new MessageDialog(parentShell, title, null, message, MessageDialog.ERROR, new String[] {PDEUIMessages.LauncherUtils_edit, IDialogConstants.OK_LABEL}, 1);
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiBundleBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiBundleBlock.java index 439fd76348..713ce6b3ee 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiBundleBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiBundleBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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,6 +28,7 @@ public class OSGiBundleBlock extends AbstractPluginBlock { super(tab); } + @Override protected void savePluginState(ILaunchConfigurationWorkingCopy config) { Object[] selected = fPluginTreeViewer.getCheckedElements(); @@ -104,6 +105,7 @@ public class OSGiBundleBlock extends AbstractPluginBlock { fPluginTreeViewer.setGrayed(fWorkspacePlugins, fNumWorkspaceChecked > 0 && fNumWorkspaceChecked < getWorkspaceModels().length); } + @Override protected LaunchValidationOperation createValidationOperation() { return new OSGiValidationOperation(fLaunchConfiguration); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiFrameworkBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiFrameworkBlock.java index 813c6e457a..2333a13217 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiFrameworkBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/OSGiFrameworkBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -39,6 +39,7 @@ public class OSGiFrameworkBlock { class Listener extends SelectionAdapter implements ModifyListener { + @Override public void widgetSelected(SelectionEvent e) { if (e.widget == fLaunchWithCombo) { setActiveIndex(); @@ -46,6 +47,7 @@ public class OSGiFrameworkBlock { fTab.updateLaunchConfigurationDialog(); } + @Override public void modifyText(ModifyEvent e) { fTab.updateLaunchConfigurationDialog(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PDELogFileProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PDELogFileProvider.java index 7e0e9c4f6b..c68599f765 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PDELogFileProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PDELogFileProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -31,6 +31,7 @@ public class PDELogFileProvider implements ILogFileProvider { * @see ILogFileProvider#getLogSources() * @since 3.4 */ + @Override public Map<String, String> getLogSources() { ILaunchConfiguration[] configurations = null; try { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginBlock.java index 69896633a3..36e364d15a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -47,6 +47,7 @@ public class PluginBlock extends AbstractPluginBlock { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.launcher.AbstractPluginBlock#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration, boolean) */ + @Override public void initializeFrom(ILaunchConfiguration config, boolean enableTable) throws CoreException { if (fLaunchConfig != null && fLaunchConfig.equals(config) && fIsEnabled == enableTable) { @@ -136,10 +137,12 @@ public class PluginBlock extends AbstractPluginBlock { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.launcher.AbstractPluginBlock#isEnabled() */ + @Override protected boolean isEnabled() { return fIsEnabled; } + @Override protected void savePluginState(ILaunchConfigurationWorkingCopy config) { // If the table is populated, store what is checked. If we are lazy loading and need to init, store the default checkstate if (isEnabled() || fInitDefaultCheckState) { @@ -201,6 +204,7 @@ public class PluginBlock extends AbstractPluginBlock { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.launcher.AbstractPluginBlock#addRequiredPlugins() */ + @Override protected void addRequiredPlugins() { // Check that the application or product we are launching has its requirements included try { @@ -221,6 +225,7 @@ public class PluginBlock extends AbstractPluginBlock { super.addRequiredPlugins(); } + @Override protected LaunchValidationOperation createValidationOperation() { return new EclipsePluginValidationOperation(fLaunchConfig); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginStatusDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginStatusDialog.java index f5d5bcf387..af5da0988b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginStatusDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginStatusDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class PluginStatusDialog extends TrayDialog { class ContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parentElement) { if (fInput.containsKey(parentElement)) { return (Object[]) fInput.get(parentElement); @@ -42,10 +43,12 @@ public class PluginStatusDialog extends TrayDialog { return new Object[0]; } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { if (fInput.containsKey(element) && element instanceof BundleDescription) { return true; @@ -56,6 +59,7 @@ public class PluginStatusDialog extends TrayDialog { return false; } + @Override public Object[] getElements(Object inputElement) { return ((Map<?, ?>) inputElement).keySet().toArray(); } @@ -89,6 +93,7 @@ public class PluginStatusDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) */ + @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); if (fShowCancelButton) { @@ -99,11 +104,13 @@ public class PluginStatusDialog extends TrayDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.PLUGIN_STATUS_DIALOG); } + @Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridData gd = new GridData(GridData.FILL_BOTH); @@ -126,6 +133,7 @@ public class PluginStatusDialog extends TrayDialog { return container; } + @Override public boolean close() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); return super.close(); @@ -143,6 +151,7 @@ public class PluginStatusDialog extends TrayDialog { return PDEPlugin.getPluginId() + ".PLUGIN_STATUS_DIALOG"; //$NON-NLS-1$ } + @Override protected IDialogSettings getDialogBoundsSettings() { return getDialogSettings(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginValidationStatusHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginValidationStatusHandler.java index 25eba45c1a..f5044f658f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginValidationStatusHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/PluginValidationStatusHandler.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2009 eXXcellent solutions gmbh, EclipseSource Corporation
+ * Copyright (c) 2009, 2015 eXXcellent solutions gmbh, EclipseSource 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
@@ -9,7 +9,7 @@ * Contributors:
* Achim Demelt, eXXcellent solutions gmbh - initial API and implementation
* EclipseSource - initial API and implementation, ongoing enhancements
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.launcher;
import org.eclipse.core.runtime.*;
@@ -24,6 +24,7 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display;
public class PluginValidationStatusHandler implements IStatusHandler {
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
if (status.getCode() == EclipsePluginValidationOperation.CREATE_EXTENSION_ERROR_CODE)
return createExtensionError((String) source);
@@ -43,6 +44,7 @@ public class PluginValidationStatusHandler implements IStatusHandler { final int[] result = new int[1];
final Display display = LauncherUtilsStatusHandler.getDisplay();
display.syncExec(new Runnable() {
+ @Override
public void run() {
PluginStatusDialog dialog = new PluginStatusDialog(display.getActiveShell());
dialog.showCancelButton(true);
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ProgramBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ProgramBlock.java index afc7b6618f..e7def734d4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ProgramBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ProgramBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -39,6 +39,7 @@ public class ProgramBlock { private ControlDecoration fProductComboDecoration; class Listener extends SelectionAdapter implements ModifyListener { + @Override public void widgetSelected(SelectionEvent e) { Object source = e.getSource(); if (source == fProductButton) { @@ -51,6 +52,7 @@ public class ProgramBlock { fTab.scheduleUpdateJob(); } + @Override public void modifyText(ModifyEvent e) { if (e.getSource() == fProductCombo) { updateProductDecorator(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/RunWorkbenchAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/RunWorkbenchAction.java index fc66283297..488f30bf2c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/RunWorkbenchAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/RunWorkbenchAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -23,9 +23,11 @@ import org.eclipse.ui.PlatformUI; * welcome and cheat sheet files. */ public class RunWorkbenchAction extends Action { + @Override public void run() { final EclipseLaunchShortcut shortcut = new EclipseLaunchShortcut(); BusyIndicator.showWhile(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay(), new Runnable() { + @Override public void run() { shortcut.launch(new StructuredSelection(), ILaunchManager.RUN_MODE); notifyResult(true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/SoftwareInstallBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/SoftwareInstallBlock.java index 8510db6010..fbed0e5260 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/SoftwareInstallBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/SoftwareInstallBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -51,6 +51,7 @@ public class SoftwareInstallBlock { Group group = SWTFactory.createGroup(parent, PDEUIMessages.ProfileBlock_0, 1, 1, GridData.FILL_HORIZONTAL); fGenerateProfileButton = SWTFactory.createCheckButton(group, PDEUIMessages.ProfileBlock_1, null, false, 1); fGenerateProfileButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fTab.updateLaunchConfigurationDialog(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java index fa54a42843..e0013f1be5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -106,6 +106,7 @@ public class TracingBlock { fPluginViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); fPluginViewer.setComparator(new ListUtil.PluginComparator()); fPluginViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent e) { CheckboxTableViewer tableViewer = (CheckboxTableViewer) e.getSource(); boolean selected = tableViewer.getChecked(getSelectedModel()); @@ -114,6 +115,7 @@ public class TracingBlock { } }); fPluginViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { CheckboxTableViewer tableViewer = (CheckboxTableViewer) event.getSource(); tableViewer.setSelection(new StructuredSelection(event.getElement())); @@ -122,6 +124,7 @@ public class TracingBlock { } }); fPluginViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { CheckboxTableViewer tableViewer = (CheckboxTableViewer) event.getSource(); Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingPropertySource.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingPropertySource.java index c61b839fec..1454bd8731 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingPropertySource.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/TracingPropertySource.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -65,6 +65,7 @@ public class TracingPropertySource { super(key, label); } + @Override public void create(Composite parent, boolean enabled) { checkbox = fBlock.getToolkit().createButton(parent, getLabel(), SWT.CHECK); TableWrapData td = new TableWrapData(); @@ -78,9 +79,11 @@ public class TracingPropertySource { checkbox.setSelection(value.intValue() == 1); } + @Override public void initialize() { update(); checkbox.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { int value = checkbox.getSelection() ? 1 : 0; valueModified(new Integer(value)); @@ -96,6 +99,7 @@ public class TracingPropertySource { super(key, label); } + @Override public void create(Composite parent, boolean enabled) { Label label = fBlock.getToolkit().createLabel(parent, getLabel()); label.setEnabled(enabled); @@ -114,9 +118,11 @@ public class TracingPropertySource { text.setText(value); } + @Override public void initialize() { update(); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { valueModified(text.getText()); } @@ -144,6 +150,7 @@ public class TracingPropertySource { keyArray[i++] = key; } Arrays.sort(keyArray, new Comparator<Object>() { + @Override public int compare(Object o1, Object o2) { return compareKeys(o1, o2); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/AvailableFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/AvailableFilter.java index e6047bf2fb..071e832844 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/AvailableFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/AvailableFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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,6 +28,7 @@ public class AvailableFilter extends ViewerFilter { this.labelProvider = labelProvider; } + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { // filter out any items that are currently selected // on a full refresh, these will have been added back to the list diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsLabelProvider.java index 9ba88d69a3..2a8c2ea9aa 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class ExternalizeStringsLabelProvider extends LabelProvider implements IT fFontRegistry = JFaceResources.getFontRegistry(); } + @Override public String getColumnText(Object element, int columnIndex) { if (element instanceof ModelChangeElement) { ModelChangeElement changeElement = (ModelChangeElement) element; @@ -36,10 +37,12 @@ public class ExternalizeStringsLabelProvider extends LabelProvider implements IT return ""; //$NON-NLS-1$ } + @Override public Image getColumnImage(Object element, int columnIndex) { return null; } + @Override public Font getFont(Object element) { if (element instanceof ModelChangeElement) { ModelChangeElement changeElement = (ModelChangeElement) element; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsOperation.java index cfd8363827..d484d270f9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -53,6 +53,7 @@ public class ExternalizeStringsOperation extends WorkspaceModifyOperation { fFileChanges = new HashMap<IFile, TextFileChange>(); } + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { for (int i = 0; i < fChangeFiles.length; i++) { if (fChangeFiles[i] instanceof ModelChangeFile) { @@ -97,6 +98,7 @@ public class ExternalizeStringsOperation extends WorkspaceModifyOperation { private void getChangeForBuild(IFile buildPropsFile, IProgressMonitor monitor, CompositeChange parent, final String localization) { // Create change TextFileChange[] changes = PDEModelUtility.changesForModelModication(new ModelModification(buildPropsFile) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { // Get model & set includes entry... @@ -183,6 +185,7 @@ public class ExternalizeStringsOperation extends WorkspaceModifyOperation { return; final String localiz = change.getBundleLocalization(); TextFileChange[] result = PDEModelUtility.changesForModelModication(new ModelModification(manifest) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) { IBundlePluginModelBase bundleModel = (IBundlePluginModelBase) model; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsProcessor.java index 29c8ac47fe..6f7040f156 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -20,6 +20,7 @@ public class ExternalizeStringsProcessor extends RefactoringProcessor { Object[] fChangeFiles = null; + @Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException { RefactoringStatus status = new RefactoringStatus(); if (fChangeFiles == null) @@ -27,10 +28,12 @@ public class ExternalizeStringsProcessor extends RefactoringProcessor { return status; } + @Override public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException { return null; } + @Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { CompositeChange change = new CompositeChange(""); //$NON-NLS-1$ change.markAsSynthetic(); @@ -43,22 +46,27 @@ public class ExternalizeStringsProcessor extends RefactoringProcessor { return change; } + @Override public Object[] getElements() { return fChangeFiles; } + @Override public String getIdentifier() { return getClass().getName(); } + @Override public String getProcessorName() { return PDEUIMessages.ExternalizeStringsWizard_title; } + @Override public boolean isApplicable() throws CoreException { return true; } + @Override public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException { return new RefactoringParticipant[0]; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizard.java index 979a907a65..669de64a5c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -27,6 +27,7 @@ public class ExternalizeStringsWizard extends RefactoringWizard { fModelChangeTable = changeTable; } + @Override protected void addUserInputPages() { setDefaultPageTitle(getRefactoring().getName()); page1 = new ExternalizeStringsWizardPage(fModelChangeTable); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizardPage.java index 024a48a1e5..d4dc1261bc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ExternalizeStringsWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -61,16 +61,19 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { private class ModelChangeContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object parent) { return fModelChangeTable.getAllModelChanges().toArray(); } + @Override public Object[] getChildren(Object parentElement) { if (!(parentElement instanceof ModelChange)) return new Object[0]; return ((ModelChange) parentElement).getModelChangeFiles(); } + @Override public Object getParent(Object element) { if (element instanceof ModelChangeFile) { return ((ModelChangeFile) element).getModel(); @@ -78,24 +81,29 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { return null; } + @Override public boolean hasChildren(Object element) { return element instanceof ModelChange; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } private class ExternalizeStringsCellModifier implements ICellModifier { + @Override public boolean canModify(Object element, String property) { return (property != null && (element instanceof ModelChangeElement) && !TABLE_PROPERTIES[VALUE].equals(property) && (isPageComplete() || element.equals(fErrorElement)) && (TABLE_PROPERTIES[KEY].equals(property) && ((ModelChangeElement) element).isExternalized())); } + @Override public Object getValue(Object element, String property) { if (element instanceof ModelChangeElement) { ModelChangeElement changeElement = (ModelChangeElement) element; @@ -106,6 +114,7 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { return ""; //$NON-NLS-1$ } + @Override public void modify(Object element, String property, Object value) { if (element instanceof TableItem) { Object data = ((TableItem) element).getData(); @@ -163,6 +172,7 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { } }; fModifyListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String localization = fLocalizationText.getText(); if (StringHelper.isValidLocalization(localization)) { @@ -195,6 +205,7 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { super.dispose(); } + @Override public void createControl(Composite parent) { SashForm superSash = new SashForm(parent, SWT.HORIZONTAL); @@ -234,11 +245,13 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { gd.heightHint = 250; fInputViewer.getTree().setLayoutData(gd); fInputViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { handleSelectionChanged(event); } }); fInputViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { setPageComplete(hasCheckedElements()); } @@ -328,6 +341,7 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { fPropertiesViewer.setColumnProperties(TABLE_PROPERTIES); fPropertiesViewer.setCellModifier(new ExternalizeStringsCellModifier()); fPropertiesViewer.setContentProvider(new IStructuredContentProvider() { + @Override public Object[] getElements(Object inputElement) { if (fInputViewer.getSelection() instanceof IStructuredSelection) { Object selection = ((IStructuredSelection) fInputViewer.getSelection()).getFirstElement(); @@ -339,19 +353,23 @@ public class ExternalizeStringsWizardPage extends UserInputWizardPage { return new Object[0]; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } }); fPropertiesViewer.setLabelProvider(new ExternalizeStringsLabelProvider()); fPropertiesViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { handlePropertySelection(); } }); fPropertiesViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { Object element = event.getElement(); if (element instanceof ModelChangeElement) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsAction.java index 99c7612b1d..53a31c0963 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -39,6 +39,7 @@ public class GetNonExternalizedStringsAction extends AbstractHandler { /* (non-Javadoc) * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) */ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { /* * Pass <code>fExternalizeSelectedPluginsOnly</code> to the operation to indicate diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java index 40c66210b3..291632eb97 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/GetNonExternalizedStringsOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -50,6 +50,7 @@ public class GetNonExternalizedStringsOperation implements IRunnableWithProgress fExternalizeSelectedPluginsOnly = externalizeSelectedPluginsOnly; } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (fSelection instanceof IStructuredSelection) { @@ -94,6 +95,7 @@ public class GetNonExternalizedStringsOperation implements IRunnableWithProgress private void getUnExternalizedStrings(IProject project, IProgressMonitor monitor) { PDEModelUtility.modifyModel(new ModelModification(project) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) inspectManifest((IBundlePluginModelBase) model, monitor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeAction.java index 24fc720249..f0f45f8cf4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -31,6 +31,7 @@ public class InternationalizeAction extends AbstractHandler { /* (non-Javadoc) * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) */ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { //Create an InternationalizeOperation on the workbench selection. ISelection selection = HandlerUtil.getCurrentSelection(event); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeOperation.java index bcdf85f6e3..1371b222cb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -48,6 +48,7 @@ public class InternationalizeOperation implements IRunnableWithProgress { fSelection = selection; } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (fSelection instanceof IStructuredSelection) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizard.java index 14c9ae3036..8976fc379e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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,12 +72,14 @@ public class InternationalizeWizard extends Wizard implements IImportWizard { /** * Initialises selections */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { } /** * Adds the plug-in and locale pages to the wizard */ + @Override public void addPages() { setNeedsProgressMonitor(true); page1 = new InternationalizeWizardPluginPage(fInternationalizePluginModelTable, "Plug-ins"); //$NON-NLS-1$ @@ -116,6 +118,7 @@ public class InternationalizeWizard extends Wizard implements IImportWizard { return page2.getLocalesForInternationalization(); } + @Override public boolean performFinish() { page1.storeSettings(); page2.storeSettings(); @@ -131,6 +134,7 @@ public class InternationalizeWizard extends Wizard implements IImportWizard { * @param currentPage * @return the next wizard page */ + @Override public IWizardPage getNextPage(IWizardPage currentPage) { if (currentPage.equals(page1)) { ensurePluginsAreExternalized(); @@ -144,6 +148,7 @@ public class InternationalizeWizard extends Wizard implements IImportWizard { * @param currentPage * @return the previous wizard page */ + @Override public IWizardPage getPreviousPage(IWizardPage currentPage) { if (currentPage.equals(page2)) { return page1; @@ -151,6 +156,7 @@ public class InternationalizeWizard extends Wizard implements IImportWizard { return null; } + @Override public boolean canFinish() { return getPluginModelsForInternationalization().size() > 0 && getLocalesForInternationalization().size() > 0; } @@ -182,10 +188,12 @@ public class InternationalizeWizard extends Wizard implements IImportWizard { externalize.runGetNonExternalizedStringsAction(externalizeSelection); } + @Override public boolean performCancel() { return super.performCancel(); } + @Override public void setContainer(IWizardContainer wizardContainer) { super.setContainer(wizardContainer); if (getContainer() instanceof TrayDialog) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardLocalePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardLocalePage.java index 9335c3aae2..d0867a85e3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardLocalePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardLocalePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -69,6 +69,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard private ILabelProvider fLabelProvider = PDEPlugin.getDefault().getLabelProvider(); private class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { return ((InternationalizeModelTable) inputElement).getModels(); } @@ -94,6 +95,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard fFilter = new AvailableFilter(fSelected, fLabelProvider); fAvailableListViewer.addFilter(fFilter); fFilterJob = new WorkbenchJob("FilterJob") { //$NON-NLS-1$ + @Override public IStatus runInUIThread(IProgressMonitor monitor) { handleFilter(); return Status.OK_STATUS; @@ -119,6 +121,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -198,6 +201,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard /* (non-Javadoc) * @see org.eclipse.pde.core.IModelProviderListener#modelsChanged(org.eclipse.pde.core.IModelProviderEvent) */ + @Override public void modelsChanged(IModelProviderEvent event) { fRefreshNeeded = true; } @@ -209,18 +213,21 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard private void addViewerListeners() { fAvailableListViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleAdd(); } }); fSelectedListViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleRemove(); } }); fAvailableListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (!fBlockSelectionListeners) updateSelectionBasedEnablement(event.getSelection(), true); @@ -228,6 +235,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard }); fSelectedListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (!fBlockSelectionListeners) updateSelectionBasedEnablement(event.getSelection(), false); @@ -235,6 +243,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard }); fFilterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fFilterJob.cancel(); fFilterJob.schedule(200); @@ -287,6 +296,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard fAddButton.setText(PDEUIMessages.ImportWizard_DetailedPage_add); fAddButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fAddButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleAdd(); } @@ -297,6 +307,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard fAddAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_addAll); fAddAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fAddAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleAddAll(); } @@ -307,6 +318,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard fRemoveButton.setText(PDEUIMessages.ImportWizard_DetailedPage_remove); fRemoveButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fRemoveButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleRemove(); } @@ -317,6 +329,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard fRemoveAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_removeAll); fRemoveAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fRemoveAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleRemoveAll(); } @@ -482,6 +495,7 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard } } + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); PDECore.getDefault().getModelManager().getExternalModelManager().removeModelProviderListener(this); @@ -491,10 +505,12 @@ public class InternationalizeWizardLocalePage extends InternationalizationWizard fBlockSelectionListeners = blockSelectionListeners; } + @Override public boolean isCurrentPage() { return super.isCurrentPage(); } + @Override public boolean canFlipToNextPage() { return false; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardOpenOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardOpenOperation.java index 713fd696b8..7d17213ced 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardOpenOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardOpenOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -44,6 +44,7 @@ public class InternationalizeWizardOpenOperation { final InterruptedException[] canceled = new InterruptedException[1]; Runnable r = new Runnable() { + @Override public void run() { try { manager.beginRule(ResourcesPlugin.getWorkspace().getRoot(), null); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardPluginPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardPluginPage.java index a283bfc19c..03c9221325 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardPluginPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/InternationalizeWizardPluginPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -87,6 +87,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard /** * @return the list of available non-selected plug-ins */ + @Override public Object[] getElements(Object parent) { return fInternationalizeModelTable.getModels(); } @@ -96,6 +97,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard /** * @return the list of selected plug-ins */ + @Override public Object[] getElements(Object parent) { return fInternationalizeModelTable.getPreSelected(); } @@ -124,6 +126,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard fFilter = new AvailableFilter(fSelected, PDEPlugin.getDefault().getLabelProvider()); fAvailableViewer.addFilter(fFilter); fFilterJob = new WorkbenchJob("FilterJob") { //$NON-NLS-1$ + @Override public IStatus runInUIThread(IProgressMonitor monitor) { handleFilter(); return Status.OK_STATUS; @@ -152,6 +155,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -183,6 +187,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard fTemplateText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fTemplateText.setText(template != null ? template : NLSFragmentGenerator.PLUGIN_NAME_MACRO + ".nl1"); //$NON-NLS-1$ fTemplateText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { pageChanged(); } @@ -354,6 +359,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard /* (non-Javadoc) * @see org.eclipse.pde.core.IModelProviderListener#modelsChanged(org.eclipse.pde.core.IModelProviderEvent) */ + @Override public void modelsChanged(IModelProviderEvent event) { fRefreshNeeded = true; } @@ -365,18 +371,21 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard private void addViewerListeners() { fAvailableViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleAdd(); } }); fSelectedViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleRemove(); } }); fAvailableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (!fBlockSelectionListeners) updateSelectionBasedEnablement(event.getSelection(), true); @@ -384,6 +393,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard }); fSelectedViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { if (!fBlockSelectionListeners) updateSelectionBasedEnablement(event.getSelection(), false); @@ -391,6 +401,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard }); fFilterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fFilterJob.cancel(); fFilterJob.schedule(200); @@ -417,6 +428,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard fAddButton.setText(PDEUIMessages.ImportWizard_DetailedPage_add); fAddButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fAddButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleAdd(); } @@ -427,6 +439,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard fAddAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_addAll); fAddAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fAddAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleAddAll(); } @@ -437,6 +450,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard fRemoveButton.setText(PDEUIMessages.ImportWizard_DetailedPage_remove); fRemoveButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fRemoveButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleRemove(); } @@ -447,6 +461,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard fRemoveAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_removeAll); fRemoveAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fRemoveAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleRemoveAll(); } @@ -614,6 +629,7 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard } } + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); PDECore.getDefault().getModelManager().getExternalModelManager().removeModelProviderListener(this); @@ -623,10 +639,12 @@ public class InternationalizeWizardPluginPage extends InternationalizationWizard fBlockSelectionListeners = blockSelectionListeners; } + @Override public boolean isCurrentPage() { return super.isCurrentPage(); } + @Override public boolean canFlipToNextPage() { if (fSelectedViewer.getTable().getItems().length > 0 && getTemplate().length() > 0) { return true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ModelChangeLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ModelChangeLabelProvider.java index eb0d7e169b..5e0839f958 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ModelChangeLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/ModelChangeLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,6 +24,7 @@ public class ModelChangeLabelProvider extends PDELabelProvider { manifestImage = PDEPluginImages.DESC_PAGE_OBJ.createImage(); } + @Override public String getText(Object obj) { if (obj instanceof ModelChange) return getObjectText(((ModelChange) obj).getParentModel().getPluginBase()); @@ -46,6 +47,7 @@ public class ModelChangeLabelProvider extends PDELabelProvider { return text.toString(); } + @Override public Image getImage(Object obj) { if (obj instanceof ModelChange) { IPluginModelBase model = ((ModelChange) obj).getParentModel(); @@ -68,6 +70,7 @@ public class ModelChangeLabelProvider extends PDELabelProvider { return null; } + @Override public void dispose() { if (manifestImage != null) manifestImage.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/NLSFragmentGenerator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/NLSFragmentGenerator.java index 98ea3660a1..4183496895 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/NLSFragmentGenerator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/nls/NLSFragmentGenerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -80,6 +80,7 @@ public class NLSFragmentGenerator { private final Filters resourceFilter = new Filters(false) { { add(new AbstractFilter(false) { + @Override public boolean matches(Object object) { String resource = object.toString(); return resource.endsWith(PROPERTIES_EXTENSION) || resource.endsWith(CLASS_EXTENSION) || resource.endsWith(JAVA_EXTENSION); @@ -87,6 +88,7 @@ public class NLSFragmentGenerator { }); add(new AbstractFilter(false) { + @Override public boolean matches(Object object) { String path = object.toString(); return path.indexOf(BIN) != -1 || path.endsWith(SLASH) || path.endsWith(ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR); @@ -94,6 +96,7 @@ public class NLSFragmentGenerator { }); add(new AbstractFilter(true) { + @Override public boolean matches(Object object) { String path = object.toString(); return path.endsWith(XML_EXTENSION) || path.endsWith(HTML_EXTENSION); @@ -105,6 +108,7 @@ public class NLSFragmentGenerator { private final Filters propertiesFilter = new Filters(false) { { add(new AbstractFilter(false) { + @Override public boolean matches(Object object) { String path = object.toString(); return path.indexOf(BIN) != -1 || path.endsWith(ICoreConstants.BUILD_FILENAME_DESCRIPTOR); @@ -112,6 +116,7 @@ public class NLSFragmentGenerator { }); add(new AbstractFilter(true) { + @Override public boolean matches(Object object) { return object.toString().endsWith(PROPERTIES_EXTENSION); } @@ -140,12 +145,14 @@ public class NLSFragmentGenerator { final Map<String, Object> overwrites = promptForOverwrite(plugins, locales); container.run(false, false, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { setProgressMonitor(monitor); try { internationalizePlugins(plugins, locales, overwrites); } catch (final Exception ex) { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { PDEPlugin.logException(ex, ex.getMessage(), PDEUIMessages.InternationalizeWizard_NLSFragmentGenerator_errorMessage); } @@ -236,14 +243,17 @@ public class NLSFragmentGenerator { FragmentFieldData fragmentData = populateFieldData(plugin, locale); IProjectProvider projectProvider = new IProjectProvider() { + @Override public String getProjectName() { return project.getName(); } + @Override public IProject getProject() { return project; } + @Override public IPath getLocationPath() { return project.getLocation(); } @@ -363,6 +373,7 @@ public class NLSFragmentGenerator { //Case 1b: External plug-in has a folder structure else { Visitor visitor = new Visitor() { + @Override public void visit(File file) throws CoreException, FileNotFoundException { worked(); @@ -400,6 +411,7 @@ public class NLSFragmentGenerator { final IProject project = plugin.getUnderlyingResource().getProject(); project.accept(new IResourceVisitor() { + @Override public boolean visit(IResource resource) throws CoreException { worked(); @@ -502,6 +514,7 @@ public class NLSFragmentGenerator { } + @Override public boolean inclusive() { return inclusive; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/CheckboxTablePart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/CheckboxTablePart.java index 7212118038..787ef2b2b8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/CheckboxTablePart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/CheckboxTablePart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,6 +24,7 @@ public class CheckboxTablePart extends StructuredViewerPart { /* * @see StructuredViewerPart#createStructuredViewer(Composite, FormWidgetFactory) */ + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) { @@ -33,11 +34,13 @@ public class CheckboxTablePart extends StructuredViewerPart { } CheckboxTableViewer tableViewer = CheckboxTableViewer.newCheckList(parent, style); tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent e) { CheckboxTablePart.this.selectionChanged((IStructuredSelection) e.getSelection()); } }); tableViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { elementChecked(event.getElement(), event.getChecked()); } @@ -52,6 +55,7 @@ public class CheckboxTablePart extends StructuredViewerPart { /* * @see SharedPartWithButtons#buttonSelected(int) */ + @Override protected void buttonSelected(Button button, int index) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/ConditionalListSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/ConditionalListSelectionDialog.java index 7e5b2e9951..a560ac9c10 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/ConditionalListSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/ConditionalListSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -29,6 +29,7 @@ public class ConditionalListSelectionDialog extends ElementListSelectionDialog { fButtonText = buttonText; } + @Override protected Control createDialogArea(Composite parent) { Composite comp = (Composite) super.createDialogArea(parent); int size = ((fElements != null) ? fElements.length : 0) + ((fConditionalElements != null) ? fConditionalElements.length : 0); @@ -45,6 +46,7 @@ public class ConditionalListSelectionDialog extends ElementListSelectionDialog { Assert.isNotNull(fButtonText); button.setText(fButtonText); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (button.getSelection()) setListElements(allElements); @@ -55,6 +57,7 @@ public class ConditionalListSelectionDialog extends ElementListSelectionDialog { return comp; } + @Override public void setElements(Object[] elements) { super.setElements(elements); fElements = elements; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/EditableTablePart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/EditableTablePart.java index a961ccde6a..55dc1afb59 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/EditableTablePart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/EditableTablePart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,20 +28,24 @@ public class EditableTablePart extends TablePart { super(PDEUIMessages.EditableTablePart_renameAction); } + @Override public void run() { doRename(); } } class NameModifier implements ICellModifier { + @Override public boolean canModify(Object object, String property) { return true; } + @Override public void modify(Object object, String property, Object value) { entryModified(object, value.toString()); } + @Override public Object getValue(Object object, String property) { return object.toString(); } @@ -69,6 +73,7 @@ public class EditableTablePart extends TablePart { return renameAction; } + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { TableViewer tableViewer = (TableViewer) super.createStructuredViewer(parent, style, toolkit); return tableViewer; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormBrowser.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormBrowser.java index 8bab0f3e3e..121b971580 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormBrowser.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormBrowser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -53,6 +53,7 @@ public class FormBrowser { ftext.marginHeight = 2; ftext.setHyperlinkSettings(toolkit.getHyperlinkGroup()); formText.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { if (toolkit != null) { toolkit.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormEntry.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormEntry.java index e839cebd54..ec3c802a3f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormEntry.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/FormEntry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -92,6 +92,7 @@ public class FormEntry { if (browseText != null) { fBrowse = toolkit.createButton(parent, browseText, SWT.PUSH); fBrowse.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (fListener != null) fListener.browseButtonSelected(FormEntry.this); @@ -186,22 +187,26 @@ public class FormEntry { private void addListeners() { fText.addKeyListener(new KeyAdapter() { + @Override public void keyReleased(KeyEvent e) { keyReleaseOccured(e); } }); fText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { editOccured(e); } }); fText.addFocusListener(new FocusAdapter() { + @Override public void focusGained(FocusEvent e) { fText.selectAll(); if (fListener != null) fListener.focusGained(FormEntry.this); } + @Override public void focusLost(FocusEvent e) { if (fDirty) commit(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/MessageLine.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/MessageLine.java index 65a4ea88a8..2a2063435e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/MessageLine.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/MessageLine.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -82,6 +82,7 @@ public class MessageLine extends CLabel { /* * @see Widget#dispose() */ + @Override public void dispose() { if (fErrorMsgAreaBackground != null) { fErrorMsgAreaBackground.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PDESourceViewer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PDESourceViewer.java index 312f331b0f..875da5c0c1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PDESourceViewer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PDESourceViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -103,12 +103,14 @@ public class PDESourceViewer { // Create source viewer listeners // Create selection listener fViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { fPage.getPDEEditor().setSelection(event.getSelection()); } }); // Create focus listener fViewer.getTextWidget().addFocusListener(new FocusAdapter() { + @Override public void focusGained(FocusEvent e) { fPage.getPDEEditor().getContributor().updateSelectableActions(null); } @@ -122,6 +124,7 @@ public class PDESourceViewer { // When the last source viewer is diposed, dispose of the color manager // and source viewer configuration textWidget.addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { fSourceViewerCount--; if (fSourceViewerCount == 0) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java index b82c7549d0..0d54ddec82 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/PluginVersionPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -76,6 +76,7 @@ public class PluginVersionPart { private class PluginVersionContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object element) { if (element instanceof ModelEntry) { ModelEntry entry = (ModelEntry) element; @@ -84,9 +85,11 @@ public class PluginVersionPart { return new Object[0]; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/SharedPartWithButtons.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/SharedPartWithButtons.java index 3786ba4a0b..af907a9c95 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/SharedPartWithButtons.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/SharedPartWithButtons.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -29,10 +29,12 @@ public abstract class SharedPartWithButtons extends SharedPart { protected Composite fButtonContainer; private class SelectionHandler implements SelectionListener { + @Override public void widgetSelected(SelectionEvent e) { buttonSelected(e); } + @Override public void widgetDefaultSelected(SelectionEvent e) { buttonSelected(e); } @@ -72,6 +74,7 @@ public abstract class SharedPartWithButtons extends SharedPart { /* * @see SharedPart#createControl(Composite, FormWidgetFactory) */ + @Override public void createControl(Composite parent, int style, int span, FormToolkit toolkit) { createMainLabel(parent, span, toolkit); createMainControl(parent, style, span - 1, toolkit); @@ -126,6 +129,7 @@ public abstract class SharedPartWithButtons extends SharedPart { return button; } + @Override protected void updateEnabledState() { for (int i = 0; i < fButtons.length; i++) { fButtons[i].setEnabled(isEnabled()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StatusInfo.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StatusInfo.java index 24350cb23c..e330e565af 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StatusInfo.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StatusInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -45,6 +45,7 @@ public class StatusInfo implements IStatus { /** * Returns if the status' severity is OK. */ + @Override public boolean isOK() { return fSeverity == IStatus.OK; } @@ -73,6 +74,7 @@ public class StatusInfo implements IStatus { /** * @see IStatus#getMessage */ + @Override public String getMessage() { return fStatusMessage; } @@ -118,6 +120,7 @@ public class StatusInfo implements IStatus { /* * @see IStatus#matches(int) */ + @Override public boolean matches(int severityMask) { return (fSeverity & severityMask) != 0; } @@ -126,6 +129,7 @@ public class StatusInfo implements IStatus { * Returns always <code>false</code>. * @see IStatus#isMultiStatus() */ + @Override public boolean isMultiStatus() { return false; } @@ -133,6 +137,7 @@ public class StatusInfo implements IStatus { /* * @see IStatus#getSeverity() */ + @Override public int getSeverity() { return fSeverity; } @@ -140,6 +145,7 @@ public class StatusInfo implements IStatus { /* * @see IStatus#getPlugin() */ + @Override public String getPlugin() { return IPDEUIConstants.PLUGIN_ID; } @@ -148,6 +154,7 @@ public class StatusInfo implements IStatus { * Returns always <code>null</code>. * @see IStatus#getException() */ + @Override public Throwable getException() { return null; } @@ -156,6 +163,7 @@ public class StatusInfo implements IStatus { * Returns always the error severity. * @see IStatus#getCode() */ + @Override public int getCode() { return fSeverity; } @@ -164,6 +172,7 @@ public class StatusInfo implements IStatus { * Returns always <code>null</code>. * @see IStatus#getChildren() */ + @Override public IStatus[] getChildren() { return new IStatus[0]; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StructuredViewerPart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StructuredViewerPart.java index bfdc64a144..241c11e57e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StructuredViewerPart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/StructuredViewerPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public abstract class StructuredViewerPart extends SharedPartWithButtons { return fViewer.getControl(); } + @Override protected void createMainControl(Composite parent, int style, int span, FormToolkit toolkit) { fViewer = createStructuredViewer(parent, style, toolkit); Control control = fViewer.getControl(); @@ -58,6 +59,7 @@ public abstract class StructuredViewerPart extends SharedPartWithButtons { } } + @Override protected void updateEnabledState() { getControl().setEnabled(isEnabled()); super.updateEnabledState(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TablePart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TablePart.java index f8b8471b46..3c0231d771 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TablePart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TablePart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -29,6 +29,7 @@ public class TablePart extends StructuredViewerPart { /* * @see StructuredViewerPart#createStructuredViewer(Composite, FormWidgetFactory) */ + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) @@ -37,11 +38,13 @@ public class TablePart extends StructuredViewerPart { style |= toolkit.getBorderStyle(); TableViewer tableViewer = new TableViewer(parent, style); tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent e) { TablePart.this.selectionChanged((IStructuredSelection) e.getSelection()); } }); tableViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent e) { TablePart.this.handleDoubleClick((IStructuredSelection) e.getSelection()); } @@ -56,6 +59,7 @@ public class TablePart extends StructuredViewerPart { /* * @see SharedPartWithButtons#buttonSelected(int) */ + @Override protected void buttonSelected(Button button, int index) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreeMessageDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreeMessageDialog.java index 8a50e8d46a..7652cc4bfc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreeMessageDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreeMessageDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -27,6 +27,7 @@ public class TreeMessageDialog extends MessageDialog { super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex); } + @Override protected Control createCustomArea(Composite parent) { TreeViewer viewer = new TreeViewer(parent, SWT.BORDER); GridData gd = new GridData(GridData.FILL_BOTH); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreePart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreePart.java index 7e87b31458..634c1c2b66 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreePart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/TreePart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,6 +33,7 @@ public class TreePart extends StructuredViewerPart { /* * @see StructuredViewerPart#createStructuredViewer(Composite, FormWidgetFactory) */ + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { style |= SWT.H_SCROLL | SWT.V_SCROLL; if (toolkit == null) @@ -41,11 +42,13 @@ public class TreePart extends StructuredViewerPart { style |= toolkit.getBorderStyle(); TreeViewer treeViewer = createTreeViewer(parent, style); treeViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent e) { TreePart.this.selectionChanged((IStructuredSelection) e.getSelection()); } }); treeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent e) { TreePart.this.handleDoubleClick((IStructuredSelection) e.getSelection()); } @@ -60,6 +63,7 @@ public class TreePart extends StructuredViewerPart { /* * @see SharedPartWithButtons#buttonSelected(int) */ + @Override protected void buttonSelected(Button button, int index) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/WizardCheckboxTablePart.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/WizardCheckboxTablePart.java index 6d2c7ff96e..0cf0e6bee0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/WizardCheckboxTablePart.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/WizardCheckboxTablePart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -63,6 +63,7 @@ public class WizardCheckboxTablePart extends CheckboxTablePart { this.deselectIndex = index; } + @Override protected void buttonSelected(Button button, int index) { if (index == selectAllIndex) { handleSelectAll(true); @@ -115,18 +116,21 @@ public class WizardCheckboxTablePart extends CheckboxTablePart { updateCounter(0); } + @Override protected Button createButton(Composite parent, String label, int index, FormToolkit toolkit) { Button button = super.createButton(parent, label, index, toolkit); SWTUtil.setButtonDimensionHint(button); return button; } + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { StructuredViewer viewer = super.createStructuredViewer(parent, style, toolkit); viewer.setComparator(ListUtil.NAME_COMPARATOR); return viewer; } + @Override protected void createMainLabel(Composite parent, int span, FormToolkit toolkit) { if (tableName == null) return; @@ -190,6 +194,7 @@ public class WizardCheckboxTablePart extends CheckboxTablePart { } } + @Override protected void elementChecked(Object element, boolean checked) { int count = getSelectionCount(); updateCounter(checked ? count + 1 : count - 1); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/AddToJavaSearchJob.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/AddToJavaSearchJob.java index 96fc1a1c64..0b83481552 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/AddToJavaSearchJob.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/AddToJavaSearchJob.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -101,6 +101,7 @@ public class AddToJavaSearchJob extends WorkspaceJob { /* (non-Javadoc) * @see org.eclipse.core.resources.WorkspaceJob#runInWorkspace(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { int ticks = fTargetDefinition != null ? 100 : 25; SubMonitor subMon = SubMonitor.convert(monitor, ticks); @@ -168,6 +169,7 @@ public class AddToJavaSearchJob extends WorkspaceJob { /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object) */ + @Override public boolean belongsTo(Object family) { return JOB_FAMILY_ID.equals(family); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/CompilersPreferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/CompilersPreferencePage.java index 494e5c4665..86286f5b6e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/CompilersPreferencePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/CompilersPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -57,6 +57,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite composite) { super.createControl(composite); PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.COMPILERS_PREFERENCE_PAGE); @@ -67,6 +68,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc * * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createContents(Composite parent) { Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 0, 0); link = new Link(comp, SWT.NONE); @@ -74,6 +76,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc link.setFont(comp.getFont()); link.setText(PDEUIMessages.CompilersPreferencePage_configure_project_specific_settings); link.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { HashSet<IJavaProject> set = new HashSet<IJavaProject>(); try { @@ -113,6 +116,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc /* (non-Javadoc) * @see org.eclipse.jface.dialogs.DialogPage#dispose() */ + @Override public void dispose() { if (fBlock != null) { fBlock.dispose(); @@ -123,12 +127,14 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ + @Override public void init(IWorkbench workbench) { } /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#performCancel() */ + @Override public boolean performCancel() { fBlock.performCancel(); return super.performCancel(); @@ -137,6 +143,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#performOk() */ + @Override public boolean performOk() { fBlock.performOK(); return super.performOk(); @@ -145,6 +152,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#performApply() */ + @Override protected void performApply() { fBlock.performApply(); super.performApply(); @@ -153,6 +161,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc /** * @see org.eclipse.jface.preference.PreferencePage#performDefaults() */ + @Override protected void performDefaults() { fBlock.performDefaults(); super.performDefaults(); @@ -161,6 +170,7 @@ public class CompilersPreferencePage extends PreferencePage implements IWorkbenc /** * @see org.eclipse.jface.preference.PreferencePage#applyData(java.lang.Object) */ + @Override public void applyData(Object data) { if (data instanceof Map) { fPageData = (Map<?, ?>) data; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ConfigurationBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ConfigurationBlock.java index 28a5d6093e..59d013fd33 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ConfigurationBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 IBM Corporation and others. + * Copyright (c) 2012, 2015 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 @@ -40,18 +40,22 @@ public abstract class ConfigurationBlock { protected void addHighlight(final Composite parent, final Label labelControl, final Combo comboBox) { comboBox.addFocusListener(new FocusListener() { + @Override public void focusLost(FocusEvent e) { highlight(parent, labelControl, comboBox, HIGHLIGHT_NONE); } + @Override public void focusGained(FocusEvent e) { highlight(parent, labelControl, comboBox, HIGHLIGHT_FOCUS); } }); MouseTrackAdapter labelComboListener= new MouseTrackAdapter() { + @Override public void mouseEnter(MouseEvent e) { highlight(parent, labelControl, comboBox, comboBox.isFocusControl() ? HIGHLIGHT_FOCUS : HIGHLIGHT_MOUSE); } + @Override public void mouseExit(MouseEvent e) { if (! comboBox.isFocusControl()) highlight(parent, labelControl, comboBox, HIGHLIGHT_NONE); @@ -61,21 +65,26 @@ public abstract class ConfigurationBlock { labelControl.addMouseTrackListener(labelComboListener); class MouseMoveTrackListener extends MouseTrackAdapter implements MouseMoveListener, MouseListener { + @Override public void mouseExit(MouseEvent e) { if (! comboBox.isFocusControl()) highlight(parent, labelControl, comboBox, HIGHLIGHT_NONE); } + @Override public void mouseMove(MouseEvent e) { int color= comboBox.isFocusControl() ? HIGHLIGHT_FOCUS : isAroundLabel(e) ? HIGHLIGHT_MOUSE : HIGHLIGHT_NONE; highlight(parent, labelControl, comboBox, color); } + @Override public void mouseDown(MouseEvent e) { if (isAroundLabel(e)) comboBox.setFocus(); } + @Override public void mouseDoubleClick(MouseEvent e) { // not used } + @Override public void mouseUp(MouseEvent e) { // not used } @@ -94,6 +103,7 @@ public abstract class ConfigurationBlock { parent.addMouseListener(parentListener); MouseAdapter labelClickListener= new MouseAdapter() { + @Override public void mouseDown(MouseEvent e) { comboBox.setFocus(); } @@ -107,6 +117,7 @@ public abstract class ConfigurationBlock { private int fColor= color; + @Override public void paintControl(PaintEvent e) { if (((GridData) labelControl.getLayoutData()).exclude) { parent.removePaintListener(this); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java index 2e52e64b9e..9be403b24e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/EditorPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public class EditorPreferencePage extends PreferencePage implements IWorkbenchPr fColorManager = new ColorManager(); } + @Override public boolean performOk() { fXMLTab.performOk(); fManifestTab.performOk(); @@ -41,6 +42,7 @@ public class EditorPreferencePage extends PreferencePage implements IWorkbenchPr return super.performOk(); } + @Override public void dispose() { fColorManager.disposeColors(false); fXMLTab.dispose(); @@ -48,19 +50,23 @@ public class EditorPreferencePage extends PreferencePage implements IWorkbenchPr super.dispose(); } + @Override protected void performDefaults() { fXMLTab.performDefaults(); fManifestTab.performDefaults(); super.performDefaults(); } + @Override public void init(IWorkbench workbench) { } + @Override protected Control createContents(Composite parent) { final Link link = new Link(parent, SWT.NONE); link.setText(PDEUIMessages.EditorPreferencePage_link); link.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if ("org.eclipse.ui.preferencePages.GeneralTextEditor".equals(e.text)) //$NON-NLS-1$ PreferencesUtil.createPreferenceDialogOn(link.getShell(), e.text, null, null); @@ -76,6 +82,7 @@ public class EditorPreferencePage extends PreferencePage implements IWorkbenchPr foldingButton.setLayoutData(gd); foldingButton.setSelection(PDEPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceConstants.EDITOR_FOLDING_ENABLED)); foldingButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { IPreferenceStore store = PDEPlugin.getDefault().getPreferenceStore(); store.setValue(IPreferenceConstants.EDITOR_FOLDING_ENABLED, ((Button) e.getSource()).getSelection()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/MainPreferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/MainPreferencePage.java index e5fb833c3a..08226f7b18 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/MainPreferencePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/MainPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -312,6 +312,7 @@ public class MainPreferencePage extends PreferencePage implements IWorkbenchPref * (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ + @Override public void init(IWorkbench workbench) { } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ManifestSyntaxColorTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ManifestSyntaxColorTab.java index 5adf1aa02f..f6514fd744 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ManifestSyntaxColorTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ManifestSyntaxColorTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class ManifestSyntaxColorTab extends SyntaxColorTab { super(manager); } + @Override protected IDocument getDocument() { StringBuffer buffer = new StringBuffer(); String delimiter = System.getProperty("line.separator"); //$NON-NLS-1$ @@ -43,10 +44,12 @@ public class ManifestSyntaxColorTab extends SyntaxColorTab { return document; } + @Override protected ChangeAwareSourceViewerConfiguration getSourceViewerConfiguration() { return new ManifestConfiguration(fColorManager); } + @Override protected String[][] getColorStrings() { return COLOR_STRINGS; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/OSGiFrameworkPreferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/OSGiFrameworkPreferencePage.java index 66e30347fa..1b695a6ce3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/OSGiFrameworkPreferencePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/OSGiFrameworkPreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -66,6 +66,7 @@ public class OSGiFrameworkPreferencePage extends PreferencePage implements IWork /* (non-Javadoc) * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object) */ + @Override public Font getFont(Object element) { if (element instanceof IConfigurationElement) { String id = ((IConfigurationElement) element).getAttribute(OSGiFrameworkManager.ATT_ID); @@ -142,6 +143,7 @@ public class OSGiFrameworkPreferencePage extends PreferencePage implements IWork fTableViewer.setLabelProvider(new FrameworkLabelProvider()); fTableViewer.setInput(PDELaunchingPlugin.getDefault().getOSGiFrameworkManager().getSortedFrameworks()); fTableViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { IConfigurationElement element = (IConfigurationElement) event.getElement(); fTableViewer.setCheckedElements(new Object[] {element}); @@ -193,6 +195,7 @@ public class OSGiFrameworkPreferencePage extends PreferencePage implements IWork /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ + @Override public void init(IWorkbench workbench) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java index d57fa2dfdc..42c1c229a5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/PDECompilersConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -169,6 +169,7 @@ public class PDECompilersConfigurationBlock extends ConfigurationBlock { /* (non-Javadoc) * @see java.lang.Object#toString() */ + @Override public String toString() { return qualifier + '/' + this.key; } @@ -295,6 +296,7 @@ public class PDECompilersConfigurationBlock extends ConfigurationBlock { * Default selection listener for combo and check controls */ private SelectionListener selectionlistener = new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (e.widget instanceof Combo) { Combo combo = (Combo) e.widget; @@ -317,6 +319,7 @@ public class PDECompilersConfigurationBlock extends ConfigurationBlock { * Default modify listener for text controls */ private ModifyListener modifylistener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (e.widget instanceof Text) { Text text = (Text) e.widget; @@ -667,6 +670,7 @@ public class PDECompilersConfigurationBlock extends ConfigurationBlock { scomp.setLayout(new GridLayout(1, false)); scomp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scomp.addListener(SWT.Resize, new Listener() { + @Override public void handleEvent(Event event) { handleExpand(getScrollingParent(event.widget)); } @@ -683,6 +687,7 @@ public class PDECompilersConfigurationBlock extends ConfigurationBlock { private Composite createExpansibleComposite(Composite parent, String title) { ExpandableComposite ecomp = SWTFactory.createExpandibleComposite(parent, title, 1, GridData.FILL_HORIZONTAL); ecomp.addExpansionListener(new ExpansionAdapter() { + @Override public void expansionStateChanged(ExpansionEvent e) { Object obj = e.getSource(); handleExpand(getScrollingParent(obj)); @@ -892,10 +897,12 @@ public class PDECompilersConfigurationBlock extends ConfigurationBlock { */ private void doFullBuild() { Job buildJob = new Job(PDEUIMessages.CompilersConfigurationBlock_building) { + @Override public boolean belongsTo(Object family) { return ResourcesPlugin.FAMILY_MANUAL_BUILD == family; } + @Override protected IStatus run(IProgressMonitor monitor) { try { IProject[] projects = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ProjectSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ProjectSelectionDialog.java index 058afb21e5..51e05debe0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ProjectSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/ProjectSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -40,6 +40,7 @@ import org.eclipse.ui.dialogs.SelectionStatusDialog; public class ProjectSelectionDialog extends SelectionStatusDialog { class ApiJavaElementContentProvider extends StandardJavaElementContentProvider { + @Override public Object[] getChildren(Object element) { if (element instanceof IJavaModel) { IJavaModel model = (IJavaModel) element; @@ -89,6 +90,7 @@ public class ProjectSelectionDialog extends SelectionStatusDialog { fProjectsWithSpecifics = projectsWithSpecifics; fFilter = new ViewerFilter() { + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { return fProjectsWithSpecifics.contains(element); } @@ -98,6 +100,7 @@ public class ProjectSelectionDialog extends SelectionStatusDialog { /* (non-Javadoc) * Method declared on Dialog. */ + @Override protected Control createDialogArea(Composite parent) { // page group Composite composite = (Composite) super.createDialogArea(parent); @@ -109,11 +112,13 @@ public class ProjectSelectionDialog extends SelectionStatusDialog { fTableViewer = new TableViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { doSelectionChanged(((IStructuredSelection) event.getSelection()).toArray()); } }); fTableViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { okPressed(); } @@ -130,10 +135,12 @@ public class ProjectSelectionDialog extends SelectionStatusDialog { Button checkbox = SWTFactory.createCheckButton(composite, PDEUIMessages.ProjectSelectionDialog_settingsTitle, null, false, 1); checkbox.addSelectionListener(new SelectionListener() { + @Override public void widgetSelected(SelectionEvent e) { updateFilter(((Button) e.widget).getSelection()); } + @Override public void widgetDefaultSelected(SelectionEvent e) { updateFilter(((Button) e.widget).getSelection()); } @@ -182,6 +189,7 @@ public class ProjectSelectionDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() */ + @Override protected void computeResult() { } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/SyntaxColorTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/SyntaxColorTab.java index 32f65576ea..b47e8419ea 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/SyntaxColorTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/SyntaxColorTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -100,6 +100,7 @@ public abstract class SyntaxColorTab { return fItalic; } + @Override public String toString() { return getDisplayName(); } @@ -172,6 +173,7 @@ public abstract class SyntaxColorTab { colorButton.setLayoutData(new GridData(GridData.BEGINNING)); colorButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { ColorElement item = getColorElement(fElementViewer); item.setColorValue(colorSelector.getColorValue()); @@ -184,6 +186,7 @@ public abstract class SyntaxColorTab { fBoldButton.setLayoutData(gd); fBoldButton.setText(PDEUIMessages.SyntaxColorTab_bold); fBoldButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { ColorElement item = getColorElement(fElementViewer); item.setBold(fBoldButton.getSelection()); @@ -196,6 +199,7 @@ public abstract class SyntaxColorTab { fItalicButton.setLayoutData(gd); fItalicButton.setText(PDEUIMessages.SyntaxColorTab_italic); fItalicButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { ColorElement item = getColorElement(fElementViewer); item.setItalic(fItalicButton.getSelection()); @@ -203,6 +207,7 @@ public abstract class SyntaxColorTab { }); fElementViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { ColorElement item = getColorElement(fElementViewer); colorSelector.setColorValue(item.getColorValue()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TabFolderLayout.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TabFolderLayout.java index a45888cde1..00e9613b22 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TabFolderLayout.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TabFolderLayout.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.*; public class TabFolderLayout extends Layout { + @Override protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) return new Point(wHint, hHint); @@ -40,6 +41,7 @@ public class TabFolderLayout extends Layout { } + @Override protected void layout(Composite composite, boolean flushCache) { Rectangle rect = composite.getClientArea(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferenceNode.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferenceNode.java index 7acba84752..9800c90950 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferenceNode.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferenceNode.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -22,12 +22,14 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#add(org.eclipse.jface.preference.IPreferenceNode) */ + @Override public void add(IPreferenceNode node) { } /** * @see org.eclipse.jface.preference.IPreferenceNode#createPage() */ + @Override public void createPage() { fPage = new TargetPlatformPreferencePage(); } @@ -35,6 +37,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#disposeResources() */ + @Override public void disposeResources() { if (fPage != null) fPage.dispose(); @@ -44,6 +47,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#findSubNode(java.lang.String) */ + @Override public IPreferenceNode findSubNode(String id) { return null; } @@ -51,6 +55,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#getId() */ + @Override public String getId() { return "org.eclipse.pde.ui.TargetPlatformPreferencePage"; //$NON-NLS-1$ } @@ -58,6 +63,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#getLabelImage() */ + @Override public Image getLabelImage() { return null; } @@ -65,6 +71,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#getLabelText() */ + @Override public String getLabelText() { return Platform.getResourceString(PDEPlugin.getDefault().getBundle(), "%preferences.target.name"); //$NON-NLS-1$ } @@ -72,6 +79,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#getPage() */ + @Override public IPreferencePage getPage() { return fPage; } @@ -79,6 +87,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#getSubNodes() */ + @Override public IPreferenceNode[] getSubNodes() { return new IPreferenceNode[0]; } @@ -86,6 +95,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#remove(java.lang.String) */ + @Override public IPreferenceNode remove(String id) { return null; } @@ -93,6 +103,7 @@ public class TargetPlatformPreferenceNode implements IPreferenceNode { /** * @see org.eclipse.jface.preference.IPreferenceNode#remove(org.eclipse.jface.preference.IPreferenceNode) */ + @Override public boolean remove(IPreferenceNode node) { return false; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferencePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferencePage.java index e1928670ac..2fecc8c66c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferencePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/TargetPlatformPreferencePage.java @@ -187,6 +187,7 @@ public class TargetPlatformPreferencePage extends PreferencePage implements IWor super(PDEUIMessages.TargetPlatformPreferencePage_LoadDefaultTarget); } public TargetDefinition defaultTarget; + @Override public IStatus run(IProgressMonitor monitor) { SubMonitor subMon = SubMonitor.convert(monitor); ITargetPlatformService service = getTargetService(); @@ -306,6 +307,7 @@ public class TargetPlatformPreferencePage extends PreferencePage implements IWor fTableViewer.setLabelProvider(fLabelProvider); fTableViewer.setContentProvider(ArrayContentProvider.getInstance()); fTableViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { if (event.getChecked()) { fTableViewer.setCheckedElements(new Object[] {event.getElement()}); @@ -317,12 +319,14 @@ public class TargetPlatformPreferencePage extends PreferencePage implements IWor } }); fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateButtons(); updateDetails(); } }); fTableViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleEdit(); } @@ -474,6 +478,7 @@ public class TargetPlatformPreferencePage extends PreferencePage implements IWor }; try { dialog.run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { if (monitor.isCanceled()) { throw new InterruptedException(); @@ -680,6 +685,7 @@ public class TargetPlatformPreferencePage extends PreferencePage implements IWor /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) */ + @Override public void init(IWorkbench workbench) { // ensures default targets are created when page is opened (if not created yet) PluginModelManager manager = PDECore.getDefault().getModelManager(); @@ -852,6 +858,7 @@ public class TargetPlatformPreferencePage extends PreferencePage implements IWor bundleVersion = new Version(bundleVersion.getMajor(), bundleVersion.getMinor(), bundleVersion.getMicro()); if (platformOsgiVersion.compareTo(bundleVersion) < 0) { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { MessageDialog.openWarning(PDEPlugin.getActiveWorkbenchShell(), PDEUIMessages.TargetPlatformPreferencePage2_28, PDEUIMessages.TargetPlatformPreferencePage2_10); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/XMLSyntaxColorTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/XMLSyntaxColorTab.java index a5fcf068d0..14019817b1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/XMLSyntaxColorTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/preferences/XMLSyntaxColorTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -26,6 +26,7 @@ public class XMLSyntaxColorTab extends SyntaxColorTab { super(manager); } + @Override protected IDocument getDocument() { StringBuffer buffer = new StringBuffer(); String delimiter = System.getProperty("line.separator"); //$NON-NLS-1$ @@ -48,10 +49,12 @@ public class XMLSyntaxColorTab extends SyntaxColorTab { return document; } + @Override protected ChangeAwareSourceViewerConfiguration getSourceViewerConfiguration() { return new XMLConfiguration(fColorManager); } + @Override protected String[][] getColorStrings() { return COLOR_STRINGS; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/CompilersPropertyPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/CompilersPropertyPage.java index 3e56c2887c..eeef669128 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/CompilersPropertyPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/properties/CompilersPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -55,6 +55,7 @@ public class CompilersPropertyPage extends PropertyPage { * * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createContents(Composite parent) { Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 0, 0); Composite tcomp = SWTFactory.createComposite(comp, 2, 1, GridData.FILL_HORIZONTAL, 0, 0); @@ -62,6 +63,7 @@ public class CompilersPropertyPage extends PropertyPage { fProjectSpecific.setLayoutData(new GridData(SWT.BEGINNING, SWT.TOP, true, false)); fProjectSpecific.setText(PDEUIMessages.CompilersPropertyPage_useprojectsettings_label); fProjectSpecific.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean psp = fProjectSpecific.getSelection(); fBlock.useProjectSpecificSettings(psp); @@ -75,6 +77,7 @@ public class CompilersPropertyPage extends PropertyPage { fWorkspaceLink = new Link(tcomp, SWT.NONE); fWorkspaceLink.setText(PDEUIMessages.CompilersPropertyPage_useworkspacesettings_change); fWorkspaceLink.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { HashMap<String, Boolean> data = new HashMap<String, Boolean>(); data.put(CompilersPreferencePage.NO_LINK, Boolean.TRUE); @@ -107,6 +110,7 @@ public class CompilersPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#performCancel() */ + @Override public boolean performCancel() { fBlock.performCancel(); return super.performCancel(); @@ -115,6 +119,7 @@ public class CompilersPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#performOk() */ + @Override public boolean performOk() { fBlock.performOK(); return super.performOk(); @@ -123,6 +128,7 @@ public class CompilersPropertyPage extends PropertyPage { /** * @see org.eclipse.jface.preference.PreferencePage#performDefaults() */ + @Override protected void performDefaults() { fBlock.performDefaults(); super.performDefaults(); @@ -131,6 +137,7 @@ public class CompilersPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#performApply() */ + @Override protected void performApply() { fBlock.performApply(); super.performApply(); @@ -139,6 +146,7 @@ public class CompilersPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.DialogPage#dispose() */ + @Override public void dispose() { fBlock.dispose(); super.dispose(); @@ -154,6 +162,7 @@ public class CompilersPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#applyData(java.lang.Object) */ + @Override public void applyData(Object data) { if (data instanceof HashMap) { fPageData = (HashMap<?, ?>) data; 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 186dee9b68..6bc318bfc1 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, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -40,6 +40,7 @@ public class SelfHostingPropertyPage extends PropertyPage { private CheckboxTableViewer fViewer; class ContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object input) { return getOutputFolders(); } @@ -49,6 +50,7 @@ public class SelfHostingPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { return fImage; } @@ -84,6 +86,7 @@ public class SelfHostingPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#dispose() */ + @Override public void dispose() { if (fImage != null) fImage.dispose(); @@ -92,6 +95,7 @@ public class SelfHostingPropertyPage extends PropertyPage { /** * @see PreferencePage#createContents(Composite) */ + @Override protected Control createContents(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout()); @@ -124,6 +128,7 @@ public class SelfHostingPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.SELFHOSTING_PROPERTY_PAGE); @@ -149,10 +154,12 @@ public class SelfHostingPropertyPage extends PropertyPage { /* (non-Javadoc) * @see org.eclipse.jface.preference.PreferencePage#performDefaults() */ + @Override protected void performDefaults() { fViewer.setAllChecked(true); } + @Override public boolean performOk() { Preferences pref = getPreferences((IProject) getElement().getAdapter(IProject.class)); StringBuffer buffer = new StringBuffer(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerMoveParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerMoveParticipant.java index 9ce5cd3d85..511a60f290 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerMoveParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerMoveParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -14,6 +14,7 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; public class ContainerMoveParticipant extends ResourceMoveParticipant { + @Override public String getName() { return PDEUIMessages.ContainerRenameParticipant_renameFolders; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java index a2e0ca9567..9f080ff7f1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ContainerRenameParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -32,10 +32,12 @@ import org.osgi.framework.Constants; public class ContainerRenameParticipant extends PDERenameParticipant { + @Override public String getName() { return PDEUIMessages.ContainerRenameParticipant_renameFolders; } + @Override protected boolean initialize(Object element) { if (element instanceof IContainer) { IProject project = ((IContainer) element).getProject(); @@ -51,6 +53,7 @@ public class ContainerRenameParticipant extends PDERenameParticipant { return false; } + @Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { // for the special case of a project rename, we need to only check the manifest for changes if (fElements.size() == 1 && fElements.keySet().iterator().next() instanceof IProject) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java index 7449edab4e..4403996914 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/CreateHeaderChangeOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -39,6 +39,7 @@ public class CreateHeaderChangeOperation implements IWorkspaceRunnable { fNewValue = newValue; } + @Override public void run(IProgressMonitor monitor) throws CoreException { try { IResource res = fBase.getUnderlyingResource(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileMoveParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileMoveParticipant.java index 0a3872ca0c..21674dc5b1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileMoveParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileMoveParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -14,6 +14,7 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; public class FileMoveParticipant extends ResourceMoveParticipant { + @Override public String getName() { return PDEUIMessages.FileRenameParticipant_renameFiles; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileRenameParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileRenameParticipant.java index a86de6fd45..5823c79881 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileRenameParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FileRenameParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -19,10 +19,12 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; public class FileRenameParticipant extends PDERenameParticipant { + @Override public String getName() { return PDEUIMessages.FileRenameParticipant_renameFiles; } + @Override protected boolean initialize(Object element) { if (element instanceof IFile) { IProject project = ((IFile) element).getProject(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FindReferenceOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FindReferenceOperation.java index 1ad9d723a1..08421c5cca 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FindReferenceOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/FindReferenceOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -31,6 +31,7 @@ public class FindReferenceOperation implements IWorkspaceRunnable { fNewId = newId; } + @Override public void run(IProgressMonitor monitor) throws CoreException { ArrayList<TextFileChange> list = new ArrayList<TextFileChange>(); if (fDesc != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/GeneralRenameIDWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/GeneralRenameIDWizardPage.java index feacec2a01..00911eb8c8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/GeneralRenameIDWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/GeneralRenameIDWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -31,6 +31,7 @@ public abstract class GeneralRenameIDWizardPage extends UserInputWizardPage { fInfo = info; } + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); @@ -55,6 +56,7 @@ public abstract class GeneralRenameIDWizardPage extends UserInputWizardPage { fNewId.setText(fInfo.getCurrentValue()); fNewId.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fNewId.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fInfo.setNewValue(fNewId.getText()); validatePage(); @@ -67,6 +69,7 @@ public abstract class GeneralRenameIDWizardPage extends UserInputWizardPage { fUpdateReferences.setText(PDEUIMessages.RenamePluginWizardPage_updateReferences); fUpdateReferences.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false, 2, 1)); fUpdateReferences.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fInfo.setUpdateReferences(fUpdateReferences.getSelection()); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageMoveParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageMoveParticipant.java index 32a9a23dae..d7de3008d4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageMoveParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageMoveParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -21,6 +21,7 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; public class ManifestPackageMoveParticipant extends PDEMoveParticipant { + @Override protected boolean initialize(Object element) { if (element instanceof IPackageFragment) { IPackageFragment fragment = (IPackageFragment) element; @@ -36,10 +37,12 @@ public class ManifestPackageMoveParticipant extends PDEMoveParticipant { return false; } + @Override public String getName() { return PDEUIMessages.ManifestPackageRenameParticipant_packageRename; } + @Override protected void addChange(CompositeChange result, IProgressMonitor pm) throws CoreException { IFile file = PDEProject.getManifest(fProject); if (file.exists()) { @@ -69,6 +72,7 @@ public class ManifestPackageMoveParticipant extends PDEMoveParticipant { return null; } + @Override protected boolean isInterestingForExtensions() { return false; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageRenameParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageRenameParticipant.java index 42ecdcbd5c..86045b3daf 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageRenameParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestPackageRenameParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -27,6 +27,7 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; public class ManifestPackageRenameParticipant extends PDERenameParticipant { + @Override protected boolean initialize(Object element) { try { if (element instanceof IPackageFragment) { @@ -47,10 +48,12 @@ public class ManifestPackageRenameParticipant extends PDERenameParticipant { return false; } + @Override public String getName() { return PDEUIMessages.ManifestPackageRenameParticipant_packageRename; } + @Override protected void addBundleManifestChange(CompositeChange result, IProgressMonitor pm) throws CoreException { super.addBundleManifestChange(result, pm); IPluginModelBase model = PluginRegistry.findModel(fProject); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeMoveParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeMoveParticipant.java index ad5c53a9a4..f42c2f5e39 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeMoveParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeMoveParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; public class ManifestTypeMoveParticipant extends PDEMoveParticipant { + @Override protected boolean initialize(Object element) { if (element instanceof IType) { IType type = (IType) element; @@ -39,10 +40,12 @@ public class ManifestTypeMoveParticipant extends PDEMoveParticipant { return false; } + @Override public String getName() { return PDEUIMessages.ManifestTypeRenameParticipant_composite; } + @Override protected boolean isInterestingForExtensions() { Object dest = getArguments().getDestination(); if (dest instanceof IJavaElement) { @@ -53,6 +56,7 @@ public class ManifestTypeMoveParticipant extends PDEMoveParticipant { return false; } + @Override protected void addChange(CompositeChange result, IFile file, IProgressMonitor pm) throws CoreException { if (file.exists()) { Change change = PluginManifestChange.createRenameChange(file, fElements.keySet().toArray(), getNewNames(), getTextChange(file), pm); @@ -61,6 +65,7 @@ public class ManifestTypeMoveParticipant extends PDEMoveParticipant { } } + @Override protected String getNewName(Object destination, Object element) { if (destination instanceof IPackageFragment && element instanceof IJavaElement) { StringBuffer buffer = new StringBuffer(); @@ -72,6 +77,7 @@ public class ManifestTypeMoveParticipant extends PDEMoveParticipant { return super.getNewName(destination, element); } + @Override protected void addChange(CompositeChange result, IProgressMonitor pm) throws CoreException { IFile file = PDEProject.getManifest(fProject); if (file.exists()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeRenameParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeRenameParticipant.java index cfcb514a14..3dab86ed95 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeRenameParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ManifestTypeRenameParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -19,6 +19,7 @@ import org.eclipse.pde.internal.ui.PDEUIMessages; public class ManifestTypeRenameParticipant extends PDERenameParticipant { + @Override protected boolean initialize(Object element) { if (element instanceof IType) { IType type = (IType) element; @@ -42,6 +43,7 @@ public class ManifestTypeRenameParticipant extends PDERenameParticipant { return result; } + @Override protected String[] getNewNames() { String[] result = new String[fElements.size()]; Iterator<Object> iter = fElements.keySet().iterator(); @@ -56,6 +58,7 @@ public class ManifestTypeRenameParticipant extends PDERenameParticipant { return result; } + @Override public String getName() { return PDEUIMessages.ManifestTypeRenameParticipant_composite; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/MovedTextFileChange.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/MovedTextFileChange.java index 707ffa874a..2c975971d3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/MovedTextFileChange.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/MovedTextFileChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -37,6 +37,7 @@ public class MovedTextFileChange extends TextFileChange { * Override getCurrentDocument to return the document of the fCurrentFile instead of the fFile. Since fFile * does not exist, it creates problems when displaying preview information */ + @Override public IDocument getCurrentDocument(IProgressMonitor pm) throws CoreException { if (pm == null) pm = new NullProgressMonitor(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDEMoveParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDEMoveParticipant.java index b0f7b8a536..2dd4e946fc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDEMoveParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDEMoveParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,15 +24,18 @@ public abstract class PDEMoveParticipant extends MoveParticipant implements ISha protected IProject fProject; protected HashMap<Object, String> fElements; + @Override public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException { return new RefactoringStatus(); } + @Override public void addElement(Object element, RefactoringArguments arguments) { Object destination = ((MoveArguments) arguments).getDestination(); fElements.put(element, getNewName(destination, element)); } + @Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { CompositeChange result = new CompositeChange(getName()); addChange(result, pm); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactor.java index 7b4fbeab02..4255c486da 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -22,6 +22,7 @@ public class PDERefactor extends ProcessorBasedRefactoring { fProcessor = processor; } + @Override public RefactoringProcessor getProcessor() { return fProcessor; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactoringAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactoringAction.java index 002f608481..0402b0bfff 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactoringAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERefactoringAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -30,6 +30,7 @@ public abstract class PDERefactoringAction extends Action { fInfo.setSelection(selection); } + @Override public void run() { RefactoringProcessor processor = getRefactoringProcessor(fInfo); PDERefactor refactor = new PDERefactor(processor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java index 9b371b9bef..4e47e425bb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,10 +24,12 @@ public abstract class PDERenameParticipant extends RenameParticipant implements protected IProject fProject; protected HashMap<Object, String> fElements; + @Override public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context) throws OperationCanceledException { return new RefactoringStatus(); } + @Override public void addElement(Object element, RefactoringArguments arguments) { String newName = ((RenameArguments) arguments).getNewName(); if (element instanceof IResource) { @@ -37,6 +39,7 @@ public abstract class PDERenameParticipant extends RenameParticipant implements fElements.put(element, newName); } + @Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { if (!getArguments().getUpdateReferences()) return null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringActionFactory.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringActionFactory.java index c69159a148..24156e5aaa 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringActionFactory.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringActionFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -25,10 +25,12 @@ public class RefactoringActionFactory { public static PDERefactoringAction createRefactorPluginIdAction(String label) { return new PDERefactoringAction(label, new RefactoringPluginInfo()) { + @Override public RefactoringProcessor getRefactoringProcessor(RefactoringInfo info) { return new RenamePluginProcessor(info); } + @Override public RefactoringWizard getRefactoringWizard(PDERefactor refactor, RefactoringInfo info) { return new RenamePluginWizard(refactor, info); } @@ -39,10 +41,12 @@ public class RefactoringActionFactory { public static PDERefactoringAction createRefactorExtPointAction(String label) { return new PDERefactoringAction(label, getExtensionPointInfo()) { + @Override public RefactoringProcessor getRefactoringProcessor(RefactoringInfo info) { return new RenameExtensionPointProcessor(info); } + @Override public RefactoringWizard getRefactoringWizard(PDERefactor refactor, RefactoringInfo info) { return new RenameExtensionPointWizard(refactor, info); } @@ -53,6 +57,7 @@ public class RefactoringActionFactory { private static RefactoringInfo getExtensionPointInfo() { return new RefactoringInfo() { + @Override public IPluginModelBase getBase() { if (fSelection instanceof IPluginExtensionPoint) { return ((IPluginExtensionPoint) fSelection).getPluginModel(); @@ -60,6 +65,7 @@ public class RefactoringActionFactory { return null; } + @Override public String getCurrentValue() { if (fSelection instanceof IPluginExtensionPoint) { return ((IPluginExtensionPoint) fSelection).getId(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringPluginInfo.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringPluginInfo.java index 9b0522088d..e08b7f17bf 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringPluginInfo.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RefactoringPluginInfo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -26,6 +26,7 @@ public class RefactoringPluginInfo extends RefactoringInfo { fRenameProject = renameProject; } + @Override public String getCurrentValue() { IPluginModelBase base = getBase(); if (base == null) @@ -37,6 +38,7 @@ public class RefactoringPluginInfo extends RefactoringInfo { return pb.getId(); } + @Override public IPluginModelBase getBase() { return (fSelection instanceof IPluginModelBase) ? (IPluginModelBase) fSelection : null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointProcessor.java index c6d375e732..a11b41f4f4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -31,6 +31,7 @@ public class RenameExtensionPointProcessor extends RefactoringProcessor { fInfo = info; } + @Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException { RefactoringStatus status = new RefactoringStatus(); IResource res = fInfo.getBase().getUnderlyingResource(); @@ -39,10 +40,12 @@ public class RenameExtensionPointProcessor extends RefactoringProcessor { return status; } + @Override public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException { return null; } + @Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { CompositeChange change = new CompositeChange(MessageFormat.format(PDEUIMessages.RenameExtensionPointProcessor_changeTitle, new Object[] {fInfo.getCurrentValue(), fInfo.getNewValue()})); pm.beginTask("", 2); //$NON-NLS-1$ @@ -52,22 +55,27 @@ public class RenameExtensionPointProcessor extends RefactoringProcessor { return change; } + @Override public Object[] getElements() { return new Object[] {fInfo.getSelection()}; } + @Override public String getIdentifier() { return getClass().getName(); } + @Override public String getProcessorName() { return PDEUIMessages.RenameExtensionPointProcessor_processorName; } + @Override public boolean isApplicable() throws CoreException { return true; } + @Override public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException { return new RefactoringParticipant[0]; } @@ -119,6 +127,7 @@ public class RenameExtensionPointProcessor extends RefactoringProcessor { protected ModelModification getExtensionPointModification(IFile file) { return new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IPluginModelBase)) return; @@ -139,6 +148,7 @@ public class RenameExtensionPointProcessor extends RefactoringProcessor { protected ModelModification getExtensionModification(IFile file) { return new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IPluginModelBase)) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointWizard.java index 96b299c623..957bc1fa42 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameExtensionPointWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -24,10 +24,12 @@ public class RenameExtensionPointWizard extends RefactoringWizard { fInfo = info; } + @Override protected void addUserInputPages() { setDefaultPageTitle(getRefactoring().getName()); addPage(new GeneralRenameIDWizardPage(PDEUIMessages.RenameExtensionPointWizard_pageTitle, fInfo) { + @Override protected String validateId(String id) { String schemaVersion = fInfo.getBase().getPluginBase().getSchemaVersion(); if (schemaVersion == null || Float.parseFloat(schemaVersion) >= 3.2) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginProcessor.java index 0f4abd4888..0883459ca5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -31,6 +31,7 @@ public class RenamePluginProcessor extends RefactoringProcessor { fInfo = (RefactoringPluginInfo) info; } + @Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException { RefactoringStatus status = new RefactoringStatus(); IResource res = fInfo.getBase().getUnderlyingResource(); @@ -48,32 +49,39 @@ public class RenamePluginProcessor extends RefactoringProcessor { return status; } + @Override public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException { return null; } + @Override public Object[] getElements() { return new Object[] {fInfo.getBase()}; } + @Override public String getIdentifier() { return getClass().getName(); } + @Override public String getProcessorName() { return PDEUIMessages.RenamePluginProcessor_processorName; } + @Override public boolean isApplicable() throws CoreException { return true; } + @Override public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException { if (fInfo.isRenameProject()) { // filter out PDE's container rename refactor participant. We will already update the Manifest, so we don't need to run our participant IParticipantDescriptorFilter filter = new IParticipantDescriptorFilter() { static final String PDE_CONTAINER_RENAME_PARTICIPANT = "org.eclipse.pde.ui.manifestFolderRenameParticipant"; //$NON-NLS-1$ + @Override public boolean select(IConfigurationElement element, RefactoringStatus status) { if (PDE_CONTAINER_RENAME_PARTICIPANT.equals(element.getAttribute("id"))) //$NON-NLS-1$ return false; @@ -92,6 +100,7 @@ public class RenamePluginProcessor extends RefactoringProcessor { return project.getDescription().getNatureIds(); } + @Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { CompositeChange change = new CompositeChange(MessageFormat.format(PDEUIMessages.RenamePluginProcessor_changeTitle, new Object[] {fInfo.getCurrentValue(), fInfo.getNewValue()})); pm.beginTask("", getTotalWork()); //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizard.java index b792a594b7..1e90738de1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -22,6 +22,7 @@ public class RenamePluginWizard extends RefactoringWizard { fInfo = info; } + @Override protected void addUserInputPages() { setDefaultPageTitle(getRefactoring().getName()); addPage(new RenamePluginWizardPage(fInfo)); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizardPage.java index f891c34b6c..79425709c8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenamePluginWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -29,6 +29,7 @@ public class RenamePluginWizardPage extends GeneralRenameIDWizardPage { super("RenamePluginWizardPage", info); //$NON-NLS-1$ } + @Override protected void createMainControl(Composite composite) { createNewID(composite); createRenameProject(composite); @@ -40,6 +41,7 @@ public class RenamePluginWizardPage extends GeneralRenameIDWizardPage { fRenameProject.setText(PDEUIMessages.RenamePluginWizardPage_renameProject); fRenameProject.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false, 2, 1)); fRenameProject.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { ((RefactoringPluginInfo) fInfo).setRenameProject(fRenameProject.getSelection()); } @@ -49,11 +51,13 @@ public class RenamePluginWizardPage extends GeneralRenameIDWizardPage { ((RefactoringPluginInfo) fInfo).setRenameProject(checked); } + @Override public void dispose() { getRefactoringSettings().put(RENAME_PROJECT, fRenameProject.getSelection()); super.dispose(); } + @Override protected String validateId(String id) { return IdUtil.isValidCompositeID3_0(id) ? null : PDEUIMessages.RenamePluginWizardPage_invalidId; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameProjectChange.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameProjectChange.java index cbaaf2957e..36f643eefc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameProjectChange.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/RenameProjectChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -45,16 +45,19 @@ public final class RenameProjectChange extends Change { this(descriptor, resource.getFullPath(), newName, comment, IResource.NULL_STAMP); } + @Override public ChangeDescriptor getDescriptor() { if (fDescriptor != null) return new RefactoringChangeDescriptor(fDescriptor); return null; } + @Override public Object getModifiedElement() { return getResource(); } + @Override public String getName() { return MessageFormat.format(PDEUIMessages.RenameProjectChange_name, new Object[] {fResourcePath.lastSegment(), fNewName}); } @@ -67,6 +70,7 @@ public final class RenameProjectChange extends Change { return ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath); } + @Override public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { IResource resource = getResource(); if (resource == null || !resource.exists()) @@ -76,6 +80,7 @@ public final class RenameProjectChange extends Change { return new RefactoringStatus(); } + @Override public Change perform(IProgressMonitor pm) throws CoreException { try { pm.beginTask(PDEUIMessages.RenameProjectChange_taskTitle, 1); @@ -95,6 +100,7 @@ public final class RenameProjectChange extends Change { } } + @Override public void initializeValidationData(IProgressMonitor pm) { // nothing to do } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ResourceMoveParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ResourceMoveParticipant.java index 2550918ed1..e1c78081a6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ResourceMoveParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/ResourceMoveParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -22,10 +22,12 @@ import org.eclipse.pde.internal.core.project.PDEProject; public abstract class ResourceMoveParticipant extends PDEMoveParticipant { + @Override protected boolean isInterestingForExtensions() { return true; } + @Override protected boolean initialize(Object element) { if (element instanceof IResource) { IProject project = ((IResource) element).getProject(); @@ -39,6 +41,7 @@ public abstract class ResourceMoveParticipant extends PDEMoveParticipant { return false; } + @Override protected void addChange(CompositeChange result, IFile file, IProgressMonitor pm) throws CoreException { if (file.exists()) { Change change = PluginManifestChange.createRenameChange(file, fElements.keySet().toArray(), getNewNames(), getTextChange(file), pm); @@ -47,6 +50,7 @@ public abstract class ResourceMoveParticipant extends PDEMoveParticipant { } } + @Override protected String getNewName(Object destination, Object element) { if (destination instanceof IContainer && element instanceof IResource) { StringBuffer buffer = new StringBuffer(); @@ -58,6 +62,7 @@ public abstract class ResourceMoveParticipant extends PDEMoveParticipant { return super.getNewName(destination, element); } + @Override protected void addChange(CompositeChange result, IProgressMonitor pm) throws CoreException { IFile file = PDEProject.getBuildProperties(fProject); if (file.exists()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AbstractSearchResultPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AbstractSearchResultPage.java index 1d40473266..7548ade042 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AbstractSearchResultPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AbstractSearchResultPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public abstract class AbstractSearchResultPage extends AbstractTextSearchViewPag /* (non-Javadoc) * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof AbstractTextSearchResult) return ((AbstractTextSearchResult) inputElement).getElements(); @@ -33,12 +34,14 @@ public abstract class AbstractSearchResultPage extends AbstractTextSearchViewPag /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { fTableViewer = (TableViewer) viewer; fSearchResult = (AbstractTextSearchResult) newInput; @@ -71,6 +74,7 @@ public abstract class AbstractSearchResultPage extends AbstractTextSearchViewPag /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#elementsChanged(java.lang.Object[]) */ + @Override protected void elementsChanged(Object[] objects) { if (fContentProvider != null && fContentProvider.fSearchResult != null) fContentProvider.elementsChanged(objects); @@ -79,6 +83,7 @@ public abstract class AbstractSearchResultPage extends AbstractTextSearchViewPag /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#clear() */ + @Override protected void clear() { if (fContentProvider != null) fContentProvider.clear(); @@ -87,6 +92,7 @@ public abstract class AbstractSearchResultPage extends AbstractTextSearchViewPag /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer) */ + @Override protected void configureTreeViewer(TreeViewer viewer) { throw new IllegalStateException("Doesn't support tree mode."); //$NON-NLS-1$ } @@ -94,6 +100,7 @@ public abstract class AbstractSearchResultPage extends AbstractTextSearchViewPag /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTableViewer(org.eclipse.jface.viewers.TableViewer) */ + @Override protected void configureTableViewer(TableViewer viewer) { viewer.setComparator(createViewerComparator()); viewer.setLabelProvider(createLabelProvider()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AttributesMatch.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AttributesMatch.java index 7708b44040..0ab44c2b9c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AttributesMatch.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/AttributesMatch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2015 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 @@ -36,6 +36,7 @@ public class AttributesMatch extends Match { return searchPattern; } + @Override public int getBaseUnit() { return UNIT_ATTRIBUTE_SEARCH_PATTERN; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/BaseSearchAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/BaseSearchAction.java index 46c9ee7eef..6debb4f69f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/BaseSearchAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/BaseSearchAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,6 +23,7 @@ public abstract class BaseSearchAction extends Action { /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { NewSearchUI.activateSearchResultView(); NewSearchUI.runQueryInBackground(createSearchQuery()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java index 2d1d84dc8f..79acd1a19b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -67,6 +67,7 @@ public class ClassSearchParticipant implements IQueryParticipant { public ClassSearchParticipant() { } + @Override public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException { if (querySpecification.getLimitTo() != S_LIMIT_REF && querySpecification.getLimitTo() != S_LIMIT_ALL) @@ -112,6 +113,7 @@ public class ClassSearchParticipant implements IQueryParticipant { private void searchProject(IProject project, IProgressMonitor monitor) { ModelModification mod = new ModelModification(project) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) { IBundleModel bmodel = ((IBundlePluginModelBase) model).getBundleModel(); @@ -274,10 +276,12 @@ public class ClassSearchParticipant implements IQueryParticipant { return value; } + @Override public int estimateTicks(QuerySpecification specification) { return 100; } + @Override public IMatchPresentation getUIParticipant() { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ExtensionsPatternFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ExtensionsPatternFilter.java index e3cabe8f44..f4b2892cee 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ExtensionsPatternFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ExtensionsPatternFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2015 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 @@ -56,6 +56,7 @@ public class ExtensionsPatternFilter extends PatternFilter { * the tree element to check * @return true if the given element's label matches the filter text */ + @Override protected boolean isLeafMatch(Viewer viewer, Object element) { // match element name or extension point with wildcards; modified default behaviour if (isNameMatch(element)) { @@ -203,6 +204,7 @@ public class ExtensionsPatternFilter extends PatternFilter { return new String[] {text}; } + @Override public boolean isElementVisible(Viewer viewer, Object element) { if (fFoundAnyElementsCache.contains(element)) { return true; @@ -210,6 +212,7 @@ public class ExtensionsPatternFilter extends PatternFilter { return isLeafMatch(viewer, element); } + @Override public Object[] filter(Viewer viewer, Object parent, Object[] elements) { if (parent != null && parent instanceof BundlePlugin) { if (fFoundAnyElementsCache.size() == 0 && fSearchPattern != null && fSearchPattern.length() > 0) { @@ -314,6 +317,7 @@ public class ExtensionsPatternFilter extends PatternFilter { * * @see org.eclipse.ui.dialogs.PatternFilter#setPattern(java.lang.String) */ + @Override public final void setPattern(String patternString) { super.setPattern(patternString); fSearchPattern = patternString; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindDeclarationsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindDeclarationsAction.java index 3757c2b5b5..2048a7ed24 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindDeclarationsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindDeclarationsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -26,6 +26,7 @@ public class FindDeclarationsAction extends BaseSearchAction { this.fSelectedObject = object; } + @Override protected ISearchQuery createSearchQuery() { PluginSearchInput input = new PluginSearchInput(); PluginSearchScope scope = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindPluginReferencesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindPluginReferencesAction.java index c0d68df85b..e16ba905c2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindPluginReferencesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindPluginReferencesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -30,6 +30,7 @@ public class FindPluginReferencesAction implements IObjectActionDelegate { * (non-Javadoc) * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { } @@ -37,6 +38,7 @@ public class FindPluginReferencesAction implements IObjectActionDelegate { * (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ + @Override public void run(IAction action) { if (fSearchString != null) { NewSearchUI.activateSearchResultView(); @@ -57,6 +59,7 @@ public class FindPluginReferencesAction implements IObjectActionDelegate { * (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(IAction action, ISelection selection) { fSearchString = null; if (selection instanceof IStructuredSelection) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindReferencesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindReferencesAction.java index e7a011d528..2918a4f777 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindReferencesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/FindReferencesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -51,6 +51,7 @@ public class FindReferencesAction extends BaseSearchAction { setImageDescriptor(PDEPluginImages.DESC_PSEARCH_OBJ); } + @Override protected ISearchQuery createSearchQuery() { PluginSearchInput input = new PluginSearchInput(); PluginSearchScope scope = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/OpenPluginSearchPageAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/OpenPluginSearchPageAction.java index b9147ccbaf..cff2f3f4f8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/OpenPluginSearchPageAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/OpenPluginSearchPageAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -23,14 +23,17 @@ public class OpenPluginSearchPageAction implements IWorkbenchWindowActionDelegat private static final String PLUGIN_SEARCH_PAGE_ID = "org.eclipse.pde.internal.ui.search.SearchPage"; //$NON-NLS-1$ private IWorkbenchWindow fWindow; + @Override public void dispose() { fWindow = null; } + @Override public void init(IWorkbenchWindow window) { fWindow = window; } + @Override public void run(IAction action) { if (fWindow == null || fWindow.getActivePage() == null) { beep(); @@ -39,6 +42,7 @@ public class OpenPluginSearchPageAction implements IWorkbenchWindowActionDelegat NewSearchUI.openSearchDialog(fWindow, PLUGIN_SEARCH_PAGE_ID); } + @Override public void selectionChanged(IAction action, ISelection selection) { // do nothing since the action isn't selection dependent. } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchActionGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchActionGroup.java index f6a54e979c..09f3bac2bc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchActionGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchActionGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -34,6 +34,7 @@ public class PluginSearchActionGroup extends ActionGroup { /* (non-Javadoc) * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager) */ + @Override public void fillContextMenu(IMenuManager menu) { ActionContext context = getContext(); ISelection selection = context.getSelection(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchPage.java index ee488f17c4..79b20c36d4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -66,6 +66,7 @@ public class PluginSearchPage extends DialogPage implements ISearchPage { private Combo patternCombo; private Button[] searchForButtons = new Button[3]; + @Override public void createControl(Composite parent) { Composite result = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); @@ -246,12 +247,14 @@ public class PluginSearchPage extends DialogPage implements ISearchPage { }); patternCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { container.setPerformActionEnabled(patternCombo.getText().trim().length() > 0); } }); } + @Override public boolean performAction() { saveQueryData(); NewSearchUI.activateSearchResultView(); @@ -299,6 +302,7 @@ public class PluginSearchPage extends DialogPage implements ISearchPage { previousQueries.remove(0); } + @Override public void setContainer(ISearchPageContainer container) { this.container = container; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchQuery.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchQuery.java index 151c9bfe97..7b512479e5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchQuery.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -33,10 +33,12 @@ public class PluginSearchQuery implements ISearchQuery { * * @see org.eclipse.search.ui.ISearchQuery#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public IStatus run(IProgressMonitor monitor) { final AbstractTextSearchResult result = (AbstractTextSearchResult) getSearchResult(); result.removeAll(); ISearchResultCollector collector = new ISearchResultCollector() { + @Override public void accept(Object match) { if (match instanceof ISourceObject) { ISourceObject object = (ISourceObject) match; @@ -55,6 +57,7 @@ public class PluginSearchQuery implements ISearchQuery { * * @see org.eclipse.search.ui.ISearchQuery#getLabel() */ + @Override public String getLabel() { return fSearchInput.getSearchString(); } @@ -64,6 +67,7 @@ public class PluginSearchQuery implements ISearchQuery { * * @see org.eclipse.search.ui.ISearchQuery#canRerun() */ + @Override public boolean canRerun() { return true; } @@ -73,6 +77,7 @@ public class PluginSearchQuery implements ISearchQuery { * * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground() */ + @Override public boolean canRunInBackground() { return true; } @@ -82,6 +87,7 @@ public class PluginSearchQuery implements ISearchQuery { * * @see org.eclipse.search.ui.ISearchQuery#getSearchResult() */ + @Override public ISearchResult getSearchResult() { if (fSearchResult == null) fSearchResult = new SearchResult(this); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchResultPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchResultPage.java index 6734b1bada..369ae07dbc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchResultPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PluginSearchResultPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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,6 +28,7 @@ public class PluginSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { return PDEPlugin.getDefault().getLabelProvider().getImage(element); } @@ -35,6 +36,7 @@ public class PluginSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object object) { if (object instanceof IPluginBase) return ((IPluginBase) object).getId(); @@ -65,6 +67,7 @@ public class PluginSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#fillContextMenu(org.eclipse.jface.action.IMenuManager) */ + @Override protected void fillContextMenu(IMenuManager mgr) { super.fillContextMenu(mgr); mgr.add(new Separator()); @@ -89,6 +92,7 @@ public class PluginSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.search.AbstractSearchResultPage#createLabelProvider() */ + @Override protected ILabelProvider createLabelProvider() { return new SearchLabelProvider(); } @@ -96,6 +100,7 @@ public class PluginSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.search.AbstractSearchResultPage#createViewerSorter() */ + @Override protected ViewerComparator createViewerComparator() { return new ViewerComparator(); } @@ -103,6 +108,7 @@ public class PluginSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#showMatch(org.eclipse.search.ui.text.Match, int, int, boolean) */ + @Override protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException { ManifestEditorOpener.open(match, activate); } @@ -110,6 +116,7 @@ public class PluginSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PreviewReferenceAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PreviewReferenceAction.java index c8d2f07bc4..fe09df9633 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PreviewReferenceAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/PreviewReferenceAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -26,12 +26,14 @@ public class PreviewReferenceAction implements IObjectActionDelegate { /** * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { } /** * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ + @Override public void run(IAction action) { if (fFile == null) return; @@ -47,6 +49,7 @@ public class PreviewReferenceAction implements IObjectActionDelegate { /** * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(IAction action, ISelection selection) { fFile = null; if (selection instanceof IStructuredSelection) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/SearchResult.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/SearchResult.java index 28aea46267..6c39e37e80 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/SearchResult.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/SearchResult.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -39,6 +39,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getEditorMatchAdapter() */ + @Override public IEditorMatchAdapter getEditorMatchAdapter() { return this; } @@ -46,6 +47,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchResult#getLabel() */ + @Override public String getLabel() { int numMatches = getMatchCount(); return fQuery.getLabel() + " - " + numMatches + " " + (numMatches == 1 ? PDEUIMessages.SearchResult_match : PDEUIMessages.SearchResult_matches); //$NON-NLS-1$ //$NON-NLS-2$ @@ -54,6 +56,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchResult#getTooltip() */ + @Override public String getTooltip() { return null; } @@ -61,6 +64,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchResult#getImageDescriptor() */ + @Override public ImageDescriptor getImageDescriptor() { return PDEPluginImages.DESC_PSEARCH_OBJ; } @@ -68,6 +72,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchResult#getQuery() */ + @Override public ISearchQuery getQuery() { return fQuery; } @@ -75,6 +80,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.text.IEditorMatchAdapter#isShownInEditor(org.eclipse.search.ui.text.Match, org.eclipse.ui.IEditorPart) */ + @Override public boolean isShownInEditor(Match match, IEditorPart editor) { Object element = match.getElement(); if (element instanceof IPluginObject) @@ -85,6 +91,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.text.IEditorMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult, org.eclipse.ui.IEditorPart) */ + @Override public Match[] computeContainedMatches(AbstractTextSearchResult result, IEditorPart editor) { ArrayList<Match> list = new ArrayList<Match>(); Object[] objects = result.getElements(); @@ -107,6 +114,7 @@ public class SearchResult extends AbstractTextSearchResult implements IEditorMat /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getFileMatchAdapter() */ + @Override public IFileMatchAdapter getFileMatchAdapter() { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ShowDescriptionAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ShowDescriptionAction.java index c9045c2bd0..caeccec1ba 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ShowDescriptionAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ShowDescriptionAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -84,6 +84,7 @@ public class ShowDescriptionAction extends Action { fSchema = null; } + @Override public void run() { if (fSchema == null) { IPluginExtensionPoint point = PDECore.getDefault().getExtensionsRegistry().findExtensionPoint(fPointID); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewBinaryDependenciesOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewBinaryDependenciesOperation.java index 77d68bd345..8b4d2b4748 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewBinaryDependenciesOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewBinaryDependenciesOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -36,6 +36,7 @@ public class AddNewBinaryDependenciesOperation extends AddNewDependenciesOperati fClassFiles = classFiles; } + @Override protected void findSecondaryDependencies(String[] secDeps, Set<String> ignorePkgs, Map<ExportPackageDescription, String> additionalDeps, IBundle bundle, boolean useRequireBundle, IProgressMonitor monitor) { monitor.beginTask(PDEUIMessages.AddNewDependenciesOperation_searchProject, 100); Set<?> projectPkgs = PackageFinder.findPackagesInClassFiles(fClassFiles, new SubProgressMonitor(monitor, 75)); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewDependenciesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewDependenciesAction.java index a71029bed5..ce9c405c6c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewDependenciesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/AddNewDependenciesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -31,9 +31,11 @@ public class AddNewDependenciesAction extends Action { super(project, base); } + @Override protected void handleNewDependencies(final Map<ExportPackageDescription, String> additionalDeps, final boolean useRequireBundle, IProgressMonitor monitor) { if (!additionalDeps.isEmpty()) Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { addDependencies(additionalDeps, useRequireBundle); } @@ -50,15 +52,18 @@ public class AddNewDependenciesAction extends Action { fBase = base; } + @Override public void run() { Job job = new WorkspaceJob(PDEUIMessages.DependencyManagementSection_jobName) { + @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { try { AddNewDependenciesOperation op = getOperation(); op.run(monitor); if (!op.foundNewDependencies()) Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { MessageDialog.openInformation(PDEPlugin.getActiveWorkbenchShell(), PDEUIMessages.AddNewDependenciesAction_title, PDEUIMessages.AddNewDependenciesAction_notFound); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesAction.java index 8a15c8bbc6..996a9a3658 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -33,6 +33,7 @@ public class CalculateUsesAction extends Action { fModel = model; } + @Override public void run() { Job job = createJob(); job.setUser(true); @@ -43,6 +44,7 @@ public class CalculateUsesAction extends Action { protected Job createJob() { return new WorkspaceJob(PDEUIMessages.CalculateUsesAction_jobName) { + @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { CalculateUsesOperation op = getOperation(); try { @@ -60,8 +62,10 @@ public class CalculateUsesAction extends Action { protected CalculateUsesOperation getOperation() { return new CalculateUsesOperation(fProject, fModel) { + @Override protected void handleSetUsesDirectives(final Map<String, HashSet<String>> pkgsAndUses) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (pkgsAndUses.isEmpty()) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesOperation.java index 472ad001fa..c03fca0d1a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/CalculateUsesOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -34,6 +34,7 @@ public class CalculateUsesOperation extends WorkspaceModifyOperation { fModel = model; } + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { try { Collection<String> packages = getPublicExportedPackages(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentAction.java index d4c119a1df..73ee6f41b7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -27,6 +27,7 @@ public class DependencyExtentAction extends Action { setText(PDEUIMessages.DependencyExtentAction_label); } + @Override public void run() { NewSearchUI.activateSearchResultView(); NewSearchUI.runQueryInBackground(new DependencyExtentQuery(fProject, fImportID)); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentOperation.java index fcac925d98..b0cd69574b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -29,6 +29,7 @@ public class DependencyExtentOperation { /* (non-Javadoc) * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch) */ + @Override public void acceptSearchMatch(SearchMatch match) throws CoreException { if (match.getAccuracy() == SearchMatch.A_ACCURATE && !match.isInsideDocComment()) { fUsed = true; @@ -47,6 +48,7 @@ public class DependencyExtentOperation { /* (non-Javadoc) * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch) */ + @Override public void acceptSearchMatch(SearchMatch match) throws CoreException { if (!match.isInsideDocComment()) fMatch = new Match(match.getElement(), Match.UNIT_CHARACTER, match.getOffset(), match.getLength()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentQuery.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentQuery.java index c40518850b..e735a78788 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentQuery.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -35,6 +35,7 @@ public class DependencyExtentQuery implements ISearchQuery { /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchQuery#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public IStatus run(IProgressMonitor monitor) { final AbstractTextSearchResult result = (AbstractTextSearchResult) getSearchResult(); result.removeAll(); @@ -46,6 +47,7 @@ public class DependencyExtentQuery implements ISearchQuery { /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchQuery#getLabel() */ + @Override public String getLabel() { return PDEUIMessages.DependencyExtentQuery_label + " " + fImportID; //$NON-NLS-1$ } @@ -53,6 +55,7 @@ public class DependencyExtentQuery implements ISearchQuery { /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchQuery#canRerun() */ + @Override public boolean canRerun() { return true; } @@ -60,6 +63,7 @@ public class DependencyExtentQuery implements ISearchQuery { /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchQuery#canRunInBackground() */ + @Override public boolean canRunInBackground() { return true; } @@ -67,6 +71,7 @@ public class DependencyExtentQuery implements ISearchQuery { /* (non-Javadoc) * @see org.eclipse.search.ui.ISearchQuery#getSearchResult() */ + @Override public ISearchResult getSearchResult() { if (fSearchResult == null) fSearchResult = new DependencyExtentSearchResult(this); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentSearchResultPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentSearchResultPage.java index 0d1bf477d1..f3d963094b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentSearchResultPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/DependencyExtentSearchResultPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -31,6 +31,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerSorter#category(java.lang.Object) */ + @Override public int category(Object element) { try { if (element instanceof IType) { @@ -48,6 +49,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.jdt.ui.JavaElementLabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { if (element instanceof IPluginObject) return PDEPlugin.getDefault().getLabelProvider().getImage(element); @@ -57,6 +59,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.jdt.ui.JavaElementLabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { if (element instanceof IPluginExtensionPoint) return ((IPluginExtensionPoint) element).getFullId(); @@ -90,6 +93,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); @@ -98,6 +102,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#fillContextMenu(org.eclipse.jface.action.IMenuManager) */ + @Override protected void fillContextMenu(IMenuManager mgr) { super.fillContextMenu(mgr); mgr.add(new Separator()); @@ -117,6 +122,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { if (object instanceof IType) { mgr.add(new Separator()); mgr.add(new Action(PDEUIMessages.DependencyExtentSearchResultPage_referencesInPlugin) { + @Override public void run() { DependencyExtentQuery query = (DependencyExtentQuery) getInput().getQuery(); IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager(); @@ -132,6 +138,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#showMatch(org.eclipse.search.ui.text.Match, int, int, boolean) */ + @Override protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException { if (match.getElement() instanceof IPluginObject) { ManifestEditorOpener.open(match, activate); @@ -147,6 +154,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.search.AbstractSearchResultPage#createLabelProvider() */ + @Override protected ILabelProvider createLabelProvider() { return new LabelProvider(); } @@ -154,6 +162,7 @@ public class DependencyExtentSearchResultPage extends AbstractSearchResultPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.search.AbstractSearchResultPage#createViewerSorter() */ + @Override protected ViewerComparator createViewerComparator() { return new Comparator(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/GatherUnusedDependenciesOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/GatherUnusedDependenciesOperation.java index 26606cf163..c8579600a3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/GatherUnusedDependenciesOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/GatherUnusedDependenciesOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -33,6 +33,7 @@ public class GatherUnusedDependenciesOperation implements IRunnableWithProgress class Requestor extends SearchRequestor { boolean fFound = false; + @Override public void acceptSearchMatch(SearchMatch match) throws CoreException { fFound = true; } @@ -49,6 +50,7 @@ public class GatherUnusedDependenciesOperation implements IRunnableWithProgress fModel = model; } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { ImportPackageObject[] packages = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/ShowResultsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/ShowResultsAction.java index a43dbe0eaf..22d04c17b1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/ShowResultsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/ShowResultsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public class ShowResultsAction extends Action { /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { if (fUnusedImports.length == 0) { MessageDialog.openInformation(PDEPlugin.getActiveWorkbenchShell(), PDEUIMessages.UnusedDependencies_title, PDEUIMessages.UnusedDependencies_notFound); @@ -59,13 +60,16 @@ public class ShowResultsAction extends Action { ListDialog dialog = new ListDialog(PDEPlugin.getActiveWorkbenchShell()); dialog.setAddCancelButton(false); dialog.setContentProvider(new IStructuredContentProvider() { + @Override public Object[] getElements(Object inputElement) { return fUnusedImports; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } }); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesAction.java index 0aa81973e6..7e0704e7f2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -29,6 +29,7 @@ public class UnusedDependenciesAction extends Action { fReadOnly = readOnly; } + @Override public void run() { Job job = new UnusedDependenciesJob(PDEUIMessages.UnusedDependenciesAction_jobName, fModel, fReadOnly); job.setUser(true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesJob.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesJob.java index d0b2d8bce9..9c744b915a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesJob.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/UnusedDependenciesJob.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -33,6 +33,7 @@ public class UnusedDependenciesJob extends Job { /* (non-Javadoc) * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected IStatus run(IProgressMonitor monitor) { try { GatherUnusedDependenciesOperation udo = new GatherUnusedDependenciesOperation(fModel); @@ -53,6 +54,7 @@ public class UnusedDependenciesJob extends Job { protected void showResults(final Object[] unused) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { getShowResultsAction(unused).run(); } 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 139afd86ff..5470539346 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, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public class UnusedImportsDialog extends TrayDialog { static class Comparator extends PluginComparator { + @Override public int compare(Viewer viewer, Object e1, Object e2) { if (e1.getClass() == e2.getClass()) return super.compare(viewer, e1, e2); @@ -45,6 +46,7 @@ public class UnusedImportsDialog extends TrayDialog { } class ContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object parent) { return unused; } @@ -58,6 +60,7 @@ public class UnusedImportsDialog extends TrayDialog { checkboxTablePart = new WizardCheckboxTablePart(PDEUIMessages.UnusedDependencies_remove); } + @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); @@ -66,11 +69,13 @@ public class UnusedImportsDialog extends TrayDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.UNUSED_IMPORTS_DIALOG); } + @Override protected Control createDialogArea(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -95,6 +100,7 @@ public class UnusedImportsDialog extends TrayDialog { return container; } + @Override protected void okPressed() { GatherUnusedDependenciesOperation.removeDependencies(model, choiceViewer.getCheckedElements()); super.okPressed(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredIUSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredIUSelectionDialog.java index fb4e81f1dd..566f673451 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredIUSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredIUSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2010, 2012 EclipseSource and others. All rights reserved. This +* Copyright (c) 2010, 2015 EclipseSource 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 @@ -57,6 +57,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { labelProvider.connect(this); } + @Override public StyledString getStyledText(Object element) { StyledString styledString = new StyledString(); @@ -89,6 +90,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { return styledString; } + @Override public Image getImage(Object element) { if (element instanceof IUPackage) { return labelProvider.get(PDEPluginImages.DESC_PACKAGE_OBJ); @@ -101,11 +103,13 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { return null; } + @Override public String getText(Object element) { StyledString string = getStyledText(element); return string.getString(); } + @Override public void dispose() { labelProvider.disconnect(this); } @@ -120,6 +124,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { setDetailsLabelProvider(fLabelProvider); } + @Override protected Control createExtendedContentArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); @@ -128,6 +133,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { fShowLatestVersionOnlyButton.setText(PDEUIMessages.FilteredIUSelectionDialog_showLatestVersionOnly); fShowLatestVersionOnlyButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fShowLatestVersionOnly = fShowLatestVersionOnlyButton.getSelection(); applyFilter(); @@ -144,6 +150,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { latest = fShowLatestVersionOnly; } + @Override public boolean matchItem(Object item) { if (item instanceof IUPackage) return patternMatcher.matches(((IUPackage) item).getId()); @@ -153,16 +160,19 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { return false; } + @Override public boolean isConsistentItem(Object item) { return true; } + @Override public boolean isSubFilter(ItemsFilter filter) { if (latest != ((IUItemsFilter) filter).latest) return false; return super.isSubFilter(filter); } + @Override public boolean equalsFilter(ItemsFilter obj) { if (latest != ((IUItemsFilter) obj).latest) return false; @@ -188,6 +198,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createFilter() */ + @Override protected ItemsFilter createFilter() { return new IUItemsFilter(); } @@ -195,6 +206,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException { // TODO clean up this code a bit... IMetadataRepositoryManager manager = P2TargetUtils.getRepoManager(); @@ -226,6 +238,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getDialogSettings() */ + @Override protected IDialogSettings getDialogSettings() { return new DialogSettings("org.eclipse.pde.internal.ui.search.dialogs.FilteredTargetRepoIUSelectionDialog"); //$NON-NLS-1$ } @@ -233,6 +246,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getElementName(java.lang.Object) */ + @Override public String getElementName(Object item) { return null; } @@ -240,8 +254,10 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getItemsComparator() */ + @Override protected Comparator<Object> getItemsComparator() { return new Comparator<Object>() { + @Override public int compare(Object o1, Object o2) { String id1 = null; String id2 = null; @@ -270,6 +286,7 @@ public class FilteredIUSelectionDialog extends FilteredItemsSelectionDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#validateItem(java.lang.Object) */ + @Override protected IStatus validateItem(Object item) { return Status.OK_STATUS; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredPluginArtifactsSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredPluginArtifactsSelectionDialog.java index 36d8fe0dd5..6692a7bd33 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredPluginArtifactsSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/FilteredPluginArtifactsSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -60,6 +60,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private ILabelProvider detailsLabelProvider = new DetailedLabelProvider(); private class SearchLabelProvider extends LabelProvider implements ILabelDecorator { + @Override public Image getImage(Object element) { if (element instanceof ExportPackageDescription) { return JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_PACKAGE); @@ -67,6 +68,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti return PDEPlugin.getDefault().getLabelProvider().getImage(element); } + @Override public String getText(Object object) { if (object instanceof IPluginBase) return ((IPluginBase) object).getId(); @@ -99,10 +101,12 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti return PDEPlugin.getDefault().getLabelProvider().getText(object); } + @Override public Image decorateImage(Image image, Object element) { return null; } + @Override public String decorateText(String text, Object element) { if (element instanceof ExportPackageDescription) { ExportPackageDescription epd = (ExportPackageDescription) element; @@ -114,6 +118,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private class DetailedLabelProvider extends LabelProvider { + @Override public Image getImage(Object element) { if (element instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) element; @@ -137,6 +142,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti return null; } + @Override public String getText(Object element) { if (element instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) element; @@ -172,6 +178,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private boolean enabled = true; + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (enabled) // select everything return true; @@ -191,6 +198,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private boolean enabled = true; + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (enabled) // select everything return true; @@ -211,6 +219,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private boolean enabled = true; + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (enabled) // select everything return true; @@ -231,6 +240,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private boolean enabled = true; + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (enabled) // select everything return true; @@ -254,6 +264,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti setChecked(true); } + @Override public void run() { extensionsFilter.setEnabled(isChecked()); scheduleRefresh(); @@ -268,6 +279,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti setChecked(true); } + @Override public void run() { extensionPointsFilter.setEnabled(isChecked()); scheduleRefresh(); @@ -282,6 +294,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti setChecked(true); } + @Override public void run() { exportedPackagesFilter.setEnabled(isChecked()); scheduleRefresh(); @@ -296,6 +309,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti setChecked(true); } + @Override public void run() { featuresFilter.setEnabled(isChecked()); scheduleRefresh(); @@ -319,6 +333,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.FILTERED_PLUGIN_ARTIFACTS_DIALOG); @@ -327,6 +342,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createExtendedContentArea(Composite parent) { return null; } @@ -334,6 +350,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createFilter() */ + @Override protected ItemsFilter createFilter() { return new PluginSearchItemsFilter(); } @@ -341,6 +358,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected void fillContentProvider(AbstractContentProvider contentProvider, ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException { PluginModelManager manager = PDECore.getDefault().getModelManager(); @@ -398,6 +416,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getDialogSettings() */ + @Override protected IDialogSettings getDialogSettings() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS); @@ -411,6 +430,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getElementName(java.lang.Object) */ + @Override public String getElementName(Object item) { if (item instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) item; @@ -434,6 +454,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#getItemsComparator() */ + @Override protected Comparator<?> getItemsComparator() { return new PluginSearchComparator(); } @@ -441,10 +462,12 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#validateItem(java.lang.Object) */ + @Override protected IStatus validateItem(Object item) { return new Status(IStatus.OK, "org.eclipse.pde.ui", 0, "", null); //$NON-NLS-1$ //$NON-NLS-2$ } + @Override protected void fillViewMenu(IMenuManager menuManager) { super.fillViewMenu(menuManager); menuManager.add(new Separator()); @@ -454,6 +477,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti menuManager.add(featuresAction); } + @Override protected void restoreDialog(IDialogSettings settings) { super.restoreDialog(settings); @@ -484,6 +508,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti applyFilter(); } + @Override protected void storeDialog(IDialogSettings settings) { super.storeDialog(settings); settings.put(S_EXTENSIONS, extensionsAction.isChecked()); @@ -499,6 +524,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private static final String M_PLUGIN_ID = "p_id"; //$NON-NLS-1$ private static final String M_TYPE = "type"; //$NON-NLS-1$ + @Override protected Object restoreItemFromMemento(IMemento memento) { Integer itype = memento.getInteger(M_TYPE); if (itype == null) @@ -584,6 +610,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti return null; } + @Override protected void storeItemToMemento(Object item, IMemento memento) { if (item instanceof IPluginModelBase) { IPluginModelBase model = (IPluginModelBase) item; @@ -683,6 +710,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti private class PluginSearchComparator implements Comparator<Object> { + @Override public int compare(Object o1, Object o2) { int id1 = getId(o1); int id2 = getId(o2); @@ -757,6 +785,7 @@ public class FilteredPluginArtifactsSelectionDialog extends FilteredItemsSelecti } } + @Override public boolean close() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); return super.close(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/PluginArtifactSearchHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/PluginArtifactSearchHandler.java index 38a85e9200..f91819331b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/PluginArtifactSearchHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/PluginArtifactSearchHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2015 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,6 +28,7 @@ import org.eclipse.ui.handlers.HandlerUtil; public class PluginArtifactSearchHandler extends AbstractHandler { + @Override public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/TargetRepositorySearchHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/TargetRepositorySearchHandler.java index 53acfd48f3..6d211a74dc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/TargetRepositorySearchHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dialogs/TargetRepositorySearchHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2010, 2013 EclipseSource and others. All rights reserved. This +* Copyright (c) 2010, 2015 EclipseSource 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 @@ -35,6 +35,7 @@ import org.eclipse.ui.handlers.HandlerUtil; */ public class TargetRepositorySearchHandler extends AbstractHandler { + @Override public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/CachedCheckboxTreeViewer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/CachedCheckboxTreeViewer.java index ea0983c44d..6573a19016 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/CachedCheckboxTreeViewer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/CachedCheckboxTreeViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 IBM Corporation and others. + * Copyright (c) 2010, 2015 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 @@ -40,6 +40,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer { protected CachedCheckboxTreeViewer(Tree tree) { super(tree); addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { updateCheckState(event.getElement(), event.getChecked()); } @@ -153,6 +154,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ICheckable#setChecked(java.lang.Object, boolean) */ + @Override public boolean setChecked(Object element, boolean state) { updateCheckState(element, state); return super.setChecked(element, state); @@ -161,6 +163,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer { /* (non-Javadoc) * @see org.eclipse.jface.viewers.CheckboxTreeViewer#setCheckedElements(java.lang.Object[]) */ + @Override public void setCheckedElements(Object[] elements) { super.setCheckedElements(elements); if (checkState == null) { @@ -186,6 +189,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer { /* (non-Javadoc) * @see org.eclipse.jface.viewers.CheckboxTreeViewer#setAllChecked(boolean) */ + @Override public void setAllChecked(boolean state) { super.setAllChecked(state); if (state) { @@ -246,6 +250,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer { /* (non-Javadoc) * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object[]) */ + @Override public void remove(Object[] elementsOrTreePaths) { for (int i = 0; i < elementsOrTreePaths.length; i++) { updateCheckState(elementsOrTreePaths[i], false); @@ -256,6 +261,7 @@ public class CachedCheckboxTreeViewer extends ContainerCheckedTreeViewer { /* (non-Javadoc) * @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object) */ + @Override public void remove(Object elementsOrTreePaths) { updateCheckState(elementsOrTreePaths, false); super.remove(elementsOrTreePaths); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/FilteredCheckboxTree.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/FilteredCheckboxTree.java index d65477ded9..783d180869 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/FilteredCheckboxTree.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/FilteredCheckboxTree.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. + * Copyright (c) 2010, 2015 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 @@ -70,6 +70,7 @@ public class FilteredCheckboxTree extends FilteredTree { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredTree#doCreateTreeViewer(org.eclipse.swt.widgets.Composite, int) */ + @Override protected TreeViewer doCreateTreeViewer(Composite parent, int style) { int treeStyle = style | SWT.CHECK | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER; Tree tree = null; @@ -88,12 +89,15 @@ public class FilteredCheckboxTree extends FilteredTree { * to synchronous mode before a filter is done. * @see org.eclipse.ui.dialogs.FilteredTree#doCreateRefreshJob() */ + @Override protected WorkbenchJob doCreateRefreshJob() { WorkbenchJob filterJob = super.doCreateRefreshJob(); filterJob.addJobChangeListener(new JobChangeAdapter() { + @Override public void done(IJobChangeEvent event) { if (event.getResult().isOK()) { getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (checkboxViewer.getTree().isDisposed()) return; @@ -109,6 +113,7 @@ public class FilteredCheckboxTree extends FilteredTree { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredTree#doCreateFilterText(org.eclipse.swt.widgets.Composite) */ + @Override protected Text doCreateFilterText(Composite parent) { // Overridden so the text gets create using the toolkit if we have one Text parentText = super.doCreateFilterText(parent); @@ -128,6 +133,7 @@ public class FilteredCheckboxTree extends FilteredTree { * (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredTree#getRefreshJobDelay() */ + @Override protected long getRefreshJobDelay() { return FILTER_DELAY; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerSelectionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerSelectionPage.java index b1945dacb5..e753ef365f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerSelectionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -87,6 +87,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { /* (non-Javadoc) * @see org.eclipse.jface.wizard.WizardSelectionPage#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); @@ -95,6 +96,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 0, 0); @@ -109,6 +111,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { wizardSelectionViewer.setContentProvider(new ArrayContentProvider()); wizardSelectionViewer.setLabelProvider(new LabelProvider() { + @Override public String getText(Object element) { if (element instanceof AbstractBundleContainerNode) { return ((AbstractBundleContainerNode) element).getName(); @@ -116,6 +119,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { return super.getText(element); } + @Override public Image getImage(Object element) { if (element instanceof AbstractBundleContainerNode) { return ((AbstractBundleContainerNode) element).getImage(); @@ -124,6 +128,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { } }); wizardSelectionViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); if (!selection.isEmpty()) { @@ -133,6 +138,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { } }); wizardSelectionViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); if (!selection.isEmpty()) { @@ -175,10 +181,12 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { List<AbstractBundleContainerNode> standardChoices = new ArrayList<AbstractBundleContainerNode>(4); // Directory Containers standardChoices.add(new AbstractBundleContainerNode(Messages.AddBundleContainerSelectionPage_3, Messages.AddBundleContainerSelectionPage_4, PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER)) { + @Override public IWizard createWizard() { Wizard wizard = new Wizard() { private EditDirectoryContainerPage fPage1; + @Override public void addPages() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION); if (settings == null) { @@ -191,6 +199,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { setNeedsProgressMonitor(true); } + @Override public boolean performFinish() { ITargetLocation container = fPage1.getBundleContainer(); if (container != null) { @@ -214,10 +223,12 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { }); // Installation/Profile Containers standardChoices.add(new AbstractBundleContainerNode(Messages.AddBundleContainerSelectionPage_6, Messages.AddBundleContainerSelectionPage_7, PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_PRODUCT_DEFINITION)) { + @Override public IWizard createWizard() { Wizard wizard = new Wizard() { private EditProfileContainerPage fPage1; + @Override public void addPages() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION); if (settings == null) { @@ -231,6 +242,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { setNeedsProgressMonitor(true); } + @Override public boolean performFinish() { ITargetLocation container = fPage1.getBundleContainer(); if (container != null) { @@ -254,8 +266,10 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { }); // Feature Containers standardChoices.add(new AbstractBundleContainerNode(Messages.AddBundleContainerSelectionPage_9, Messages.AddBundleContainerSelectionPage_10, PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_FEATURE_OBJ)) { + @Override public IWizard createWizard() { Wizard wizard = new Wizard() { + @Override public void addPages() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION); if (settings == null) { @@ -265,6 +279,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { addPage(new AddFeatureContainersPage()); } + @Override public boolean performFinish() { try { ITargetLocation[] containers = ((AddFeatureContainersPage) getPages()[0]).getBundleContainers(); @@ -314,10 +329,12 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { final String pluginId = element.getPluginId(); final String contributionId = element.getID(); IPluginContribution pc = new IPluginContribution() { + @Override public String getLocalId() { return contributionId; } + @Override public String getPluginId() { return pluginId; } @@ -351,10 +368,12 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { final String pluginId = element.getPluginId(); final String contributionId = element.getID(); IPluginContribution pc = new IPluginContribution() { + @Override public String getLocalId() { return contributionId; } + @Override public String getPluginId() { return pluginId; } @@ -397,10 +416,12 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { */ private AbstractBundleContainerNode createTargetLocationProvisionerNode(final WizardElement element) { return new AbstractBundleContainerNode(element.getLabel(), element.getDescription(), element.getImage()) { + @Override public IWizard createWizard() { Wizard wizard = new Wizard() { private ITargetLocationWizard fWizard; + @Override public void addPages() { try { fWizard = (ITargetLocationWizard) element.createExecutableExtension(); @@ -416,6 +437,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { addPage(pages[i]); } + @Override public boolean performFinish() { if (fWizard != null) { if (!fWizard.performFinish()) { @@ -451,10 +473,12 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { */ private AbstractBundleContainerNode createDeprecatedExtensionNode(final WizardElement element) { return new AbstractBundleContainerNode(element.getLabel(), element.getDescription(), element.getImage()) { + @Override public IWizard createWizard() { Wizard wizard = new Wizard() { private IProvisionerWizard fWizard; + @Override public void addPages() { try { fWizard = (IProvisionerWizard) element.createExecutableExtension(); @@ -469,6 +493,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { addPage(pages[i]); } + @Override public boolean performFinish() { if (fWizard != null) { if (!fWizard.performFinish()) { @@ -526,6 +551,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { public abstract IWizard createWizard(); + @Override public void dispose() { if (fWizard != null) { fWizard.dispose(); @@ -533,10 +559,12 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { } } + @Override public Point getExtent() { return new Point(-1, -1); } + @Override public IWizard getWizard() { if (fWizard == null) { fWizard = createWizard(); @@ -544,6 +572,7 @@ public class AddBundleContainerSelectionPage extends WizardSelectionPage { return fWizard; } + @Override public boolean isContentCreated() { return fWizard != null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerWizard.java index f7d54c7d28..197f1c7e3b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddBundleContainerWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -35,6 +35,7 @@ public class AddBundleContainerWizard extends Wizard { /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#addPages() */ + @Override public void addPages() { addPage(new AddBundleContainerSelectionPage(fTarget)); } @@ -42,6 +43,7 @@ public class AddBundleContainerWizard extends Wizard { /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#performFinish() */ + @Override public boolean performFinish() { // Handled by the individual container wizards return true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddFeatureContainersPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddFeatureContainersPage.java index 4cef79adef..629ccccd90 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddFeatureContainersPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/AddFeatureContainersPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -51,6 +51,7 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#getDefaultTitle() */ + @Override protected String getDefaultTitle() { return Messages.AddFeatureContainerPage_0; } @@ -58,6 +59,7 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#getDefaultMessage() */ + @Override protected String getDefaultMessage() { return Messages.AddFeatureContainerPage_1; } @@ -65,6 +67,7 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#createLocationArea(org.eclipse.swt.widgets.Composite) */ + @Override protected void createLocationArea(Composite parent) { super.createLocationArea(parent); createTableArea(parent); @@ -92,11 +95,13 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { fFeatureTable.getControl().setFont(tableComp.getFont()); fFeatureTable.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { AddFeatureContainersPage.this.checkStateChanged(); } }); fFeatureTable.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { if (!event.getSelection().isEmpty()) { Object selection = ((IStructuredSelection) event.getSelection()).getFirstElement(); @@ -109,6 +114,7 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { Composite buttonComp = SWTFactory.createComposite(tableComp, 1, 1, GridData.FILL_VERTICAL, 0, 0); fSelectAllButton = SWTFactory.createPushButton(buttonComp, Messages.AddFeatureContainersPage_0, null); fSelectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fFeatureTable.setAllChecked(true); checkStateChanged(); @@ -116,6 +122,7 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { }); fDeselectAllButton = SWTFactory.createPushButton(buttonComp, Messages.AddFeatureContainersPage_1, null); fDeselectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fFeatureTable.setAllChecked(false); checkStateChanged(); @@ -146,6 +153,7 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#containerChanged(long) */ + @Override protected void containerChanged(long delay) { if (fInstallLocation.getText().trim().length() > 0) { try { @@ -203,6 +211,7 @@ public class AddFeatureContainersPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.DialogPage#dispose() */ + @Override public void dispose() { // Disconnect the label provider so it can be disposed PDEPlugin.getDefault().getLabelProvider().disconnect(this); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/ArgumentsFromContainerSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/ArgumentsFromContainerSelectionDialog.java index 61ca901475..3690c7f588 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/ArgumentsFromContainerSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/ArgumentsFromContainerSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -52,6 +52,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { /* (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(Messages.ArgumentsFromContainerSelectionDialog_0); @@ -60,6 +61,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) */ + @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); getButton(IDialogConstants.OK_ID).setEnabled(false); @@ -68,6 +70,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createDialogArea(Composite parent) { ITargetLocation[] containers = fTarget.getTargetLocations(); boolean foundArguments = false; @@ -102,6 +105,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { fTree.setLabelProvider(new StyledBundleLabelProvider(true, false)); fTree.setContentProvider(new ITreeContentProvider() { + @Override public Object[] getChildren(Object element) { if (element instanceof ITargetLocation) { Object args = fAllArguments.get(element); @@ -112,10 +116,12 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { return new Object[0]; } + @Override public boolean hasChildren(Object element) { return getChildren(element).length > 0; } + @Override public Object[] getElements(Object element) { if (element instanceof Map) { return ((Map<?, ?>) element).keySet().toArray(); @@ -123,24 +129,29 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { return new Object[0]; } + @Override public Object getParent(Object element) { return null; } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public void dispose() { } }); fTree.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { updateCheckState(event.getElement()); updateOKButton(); } }); fTree.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { if (!event.getSelection().isEmpty()) { Object selected = ((IStructuredSelection) event.getSelection()).getFirstElement(); @@ -157,6 +168,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { fSelectAllButton = SWTFactory.createPushButton(buttonComp, Messages.ArgumentsFromContainerSelectionDialog_3, null); fSelectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fTree.setAllChecked(true); // TODO These buttons don't update as the check state changes @@ -169,6 +181,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { fDeselectAllButton = SWTFactory.createPushButton(buttonComp, Messages.ArgumentsFromContainerSelectionDialog_4, null); fDeselectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fTree.setAllChecked(false); updateOKButton(); @@ -190,6 +203,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#isResizable() */ + @Override protected boolean isResizable() { return true; } @@ -258,6 +272,7 @@ public class ArgumentsFromContainerSelectionDialog extends TrayDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ + @Override protected void okPressed() { List<String> arguments = new ArrayList<String>(); Object[] checked = fTree.getCheckedElements(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditBundleContainerWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditBundleContainerWizard.java index b370944e9c..7d053e711b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditBundleContainerWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditBundleContainerWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -43,6 +43,7 @@ public class EditBundleContainerWizard extends Wizard { /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#addPages() */ + @Override public void addPages() { if (fContainer instanceof DirectoryBundleContainer) { fPage = new EditDirectoryContainerPage(fContainer); @@ -61,6 +62,7 @@ public class EditBundleContainerWizard extends Wizard { /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#performFinish() */ + @Override public boolean performFinish() { if (fPage != null) { fPage.storeSettings(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditDirectoryContainerPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditDirectoryContainerPage.java index 40473e3f83..56e07e3b65 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditDirectoryContainerPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditDirectoryContainerPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -83,6 +83,7 @@ public class EditDirectoryContainerPage extends WizardPage implements IEditBundl /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { setMessage(getDefaultMessage()); setTitle(getDefaultTitle()); @@ -129,6 +130,7 @@ public class EditDirectoryContainerPage extends WizardPage implements IEditBundl fInstallLocation = SWTFactory.createCombo(locationComp, SWT.BORDER, 1, getLocationComboItems()); fInstallLocation.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // If the text is a combo item, immediately try to resolve, otherwise wait in case they type more boolean isItem = false; @@ -158,6 +160,7 @@ public class EditDirectoryContainerPage extends WizardPage implements IEditBundl Button browseButton = SWTFactory.createPushButton(buttonComp, Messages.AddDirectoryContainerPage_3, null); browseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setFilterPath(fInstallLocation.getText()); @@ -171,6 +174,7 @@ public class EditDirectoryContainerPage extends WizardPage implements IEditBundl Button variablesButton = SWTFactory.createPushButton(buttonComp, Messages.EditDirectoryContainerPage_1, null); variablesButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell()); dialog.open(); @@ -247,6 +251,7 @@ public class EditDirectoryContainerPage extends WizardPage implements IEditBundl /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.IEditTargetLocationPage#storeSettings() */ + @Override public void storeSettings() { String newLocation = fInstallLocation.getText().trim(); @@ -278,6 +283,7 @@ public class EditDirectoryContainerPage extends WizardPage implements IEditBundl /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.IEditTargetLocationPage#getBundleContainer() */ + @Override public ITargetLocation getBundleContainer() { return fContainer; } @@ -367,6 +373,7 @@ public class EditDirectoryContainerPage extends WizardPage implements IEditBundl super(jobDisplay, name); } + @Override public IStatus runInUIThread(IProgressMonitor monitor) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditFeatureContainerPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditFeatureContainerPage.java index 2b75056d61..ee605acd43 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditFeatureContainerPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditFeatureContainerPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -33,6 +33,7 @@ public class EditFeatureContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#getDefaultTitle() */ + @Override protected String getDefaultTitle() { return Messages.EditFeatureContainerPage_0; } @@ -40,6 +41,7 @@ public class EditFeatureContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#getDefaultMessage() */ + @Override protected String getDefaultMessage() { return Messages.EditFeatureContainerPage_1; } @@ -47,6 +49,7 @@ public class EditFeatureContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.AddDirectoryContainerPage#createLocationArea(org.eclipse.swt.widgets.Composite) */ + @Override protected void createLocationArea(Composite parent) { FeatureBundleContainer container = (FeatureBundleContainer) getBundleContainer(); Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_HORIZONTAL); @@ -73,6 +76,7 @@ public class EditFeatureContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#initializeInputFields(org.eclipse.pde.core.target.ITargetLocation) */ + @Override protected void initializeInputFields(ITargetLocation container) { containerChanged(0); } @@ -80,6 +84,7 @@ public class EditFeatureContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#storeSettings() */ + @Override public void storeSettings() { // Do nothing, no settings } @@ -87,6 +92,7 @@ public class EditFeatureContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#validateInput() */ + @Override protected boolean validateInput() { return true; } @@ -94,6 +100,7 @@ public class EditFeatureContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#createContainer(org.eclipse.pde.core.target.ITargetLocation) */ + @Override protected ITargetLocation createContainer(ITargetLocation previous) throws CoreException { return getBundleContainer(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditIUContainerPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditIUContainerPage.java index 34e9c57a71..5c40adf410 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditIUContainerPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditIUContainerPage.java @@ -134,6 +134,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.IEditTargetLocationPage#getBundleContainer() */ + @Override public ITargetLocation getBundleContainer() { ITargetPlatformService service = (ITargetPlatformService) PDECore.getDefault().acquireService(ITargetPlatformService.class.getName()); if (service == null) { @@ -150,6 +151,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.IEditTargetLocationPage#storeSettings() */ + @Override public void storeSettings() { IDialogSettings settings = getDialogSettings(); if (settings != null) { @@ -162,6 +164,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 0, 0); @@ -189,6 +192,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai profileUI.getPolicy().setRepositoryPreferencePageId(null); fRepoSelector = new RepositorySelectionGroup(profileUI, getContainer(), parent, fQueryContext); fRepoSelector.addRepositorySelectionListener(new IRepositorySelectionListener() { + @Override public void repositorySelectionChanged(int repoChoice, URI repoLocation) { fAvailableIUGroup.setRepositoryFilter(repoChoice, repoLocation); fRepoLocation = repoChoice == AvailableIUGroup.AVAILABLE_SPECIFIED ? repoLocation : null; @@ -272,6 +276,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai filterConstant = AvailableIUGroup.AVAILABLE_ALL; fAvailableIUGroup = new AvailableIUGroup(profileUI, parent, parent.getFont(), fQueryContext, null, filterConstant); fAvailableIUGroup.getCheckboxTreeViewer().addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { IInstallableUnit[] units = fAvailableIUGroup.getCheckedLeafIUs(); if (units.length > 0) { @@ -294,6 +299,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai } }); fAvailableIUGroup.getCheckboxTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateDetails(); fPropertiesButton.setEnabled(fAvailableIUGroup.getSelectedIUElements().length == 1); @@ -391,6 +397,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai fPropertiesButton = SWTFactory.createPushButton(detailsGroup, Messages.EditIUContainerPage_13, null); ((GridData) fPropertiesButton.getLayoutData()).horizontalAlignment = SWT.RIGHT; fPropertiesButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent event) { fPropertyAction.run(); } @@ -408,12 +415,14 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai checkComp.setLayout(new GridLayout(2, true)); fShowCategoriesButton = SWTFactory.createCheckButton(checkComp, Messages.EditIUContainerPage_14, null, true, 1); fShowCategoriesButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateViewContext(); } }); fShowOldVersionsButton = SWTFactory.createCheckButton(checkComp, Messages.EditIUContainerPage_15, null, true, 1); fShowOldVersionsButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateViewContext(); } @@ -423,6 +432,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai SWTFactory.createWrapLabel(slicerGroup, Messages.EditIUContainerPage_2, 1, 400); fIncludeRequiredButton = SWTFactory.createCheckButton(slicerGroup, Messages.EditIUContainerPage_3, null, true, 1); fIncludeRequiredButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fAllPlatformsButton.setEnabled(!fIncludeRequiredButton.getSelection()); warnIfGlobalSettingChanged(); @@ -430,6 +440,7 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai }); fAllPlatformsButton = SWTFactory.createCheckButton(slicerGroup, Messages.EditIUContainerPage_8, null, false, 1); fAllPlatformsButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { warnIfGlobalSettingChanged(); } @@ -437,12 +448,14 @@ public class EditIUContainerPage extends WizardPage implements IEditBundleContai ((GridData) fAllPlatformsButton.getLayoutData()).horizontalIndent = 10; fIncludeSourceButton = SWTFactory.createCheckButton(slicerGroup, Messages.EditIUContainerPage_16, null, true, 1); fIncludeSourceButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { warnIfGlobalSettingChanged(); } }); fConfigurePhaseButton = SWTFactory.createCheckButton(slicerGroup, Messages.EditIUContainerPage_IncludeConfigurePhase, null, true, 1); fConfigurePhaseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { warnIfGlobalSettingChanged(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditProfileContainerPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditProfileContainerPage.java index d60dd9e17d..bbd86484f4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditProfileContainerPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/EditProfileContainerPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -70,6 +70,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#getDefaultTitle() */ + @Override protected String getDefaultTitle() { if (fContainer != null) { return Messages.EditProfileContainerPage_3; @@ -80,6 +81,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#getDefaultMessage() */ + @Override protected String getDefaultMessage() { return Messages.AddProfileContainerPage_1; } @@ -87,6 +89,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.AddDirectoryContainerPage#createLocationArea(org.eclipse.swt.widgets.Composite) */ + @Override protected void createLocationArea(Composite parent) { super.createLocationArea(parent); @@ -105,6 +108,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { fUseDefaultConfig.setFont(parent.getFont()); fUseDefaultConfig.setText(Messages.AddProfileContainerPage_2); fUseDefaultConfig.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateConfigEnablement(); containerChanged(0); @@ -116,6 +120,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { fConfigLocation = SWTFactory.createCombo(configComp, SWT.BORDER, 1, getConfigComboItems()); fConfigLocation.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // If the text is a combo item, immediately try to resolve, otherwise wait in case they type more boolean isItem = false; @@ -136,6 +141,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { fConfigBrowse = SWTFactory.createPushButton(buttonComp, Messages.AddProfileContainerPage_4, null); fConfigBrowse.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setFilterPath(fConfigLocation.getText()); @@ -149,6 +155,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { fConfigVariables = SWTFactory.createPushButton(buttonComp, Messages.EditProfileContainerPage_1, null); fConfigVariables.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell()); dialog.open(); @@ -185,6 +192,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#storeSettings() */ + @Override public void storeSettings() { super.storeSettings(); if (fConfigLocation.isEnabled()) { @@ -215,6 +223,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#initializeInputFields(org.eclipse.pde.core.target.ITargetLocation) */ + @Override protected void initializeInputFields(ITargetLocation container) { if (container instanceof ProfileBundleContainer) { String configLocation = ((ProfileBundleContainer) container).getConfigurationLocation(); @@ -245,6 +254,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#validateInput() */ + @Override protected boolean validateInput() { boolean valid = super.validateInput(); if (valid) { @@ -279,6 +289,7 @@ public class EditProfileContainerPage extends EditDirectoryContainerPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.shared.target.EditDirectoryContainerPage#createContainer(org.eclipse.pde.core.target.ITargetLocation) */ + @Override protected ITargetLocation createContainer(ITargetLocation previous) throws CoreException { return getTargetPlatformService().newProfileLocation(fInstallLocation.getText(), fConfigLocation.isEnabled() ? fConfigLocation.getText() : null); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUContentProvider.java index 4ca9edfb81..58dfeaa6ba 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUContentProvider.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011, 2012 IBM Corporation and others.
+ * Copyright (c) 2011, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.shared.target;
import java.util.ArrayList;
@@ -29,6 +29,7 @@ public class IUContentProvider extends DefaultTableProvider implements ITreeCont /* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return null;
}
@@ -36,6 +37,7 @@ public class IUContentProvider extends DefaultTableProvider implements ITreeCont /* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
IUBundleContainer location = (IUBundleContainer) parentElement;
if (location.isResolved()) {
@@ -63,6 +65,7 @@ public class IUContentProvider extends DefaultTableProvider implements ITreeCont /* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
if (element instanceof IUWrapper) {
return ((IUWrapper) element).getParent();
@@ -73,6 +76,7 @@ public class IUContentProvider extends DefaultTableProvider implements ITreeCont /* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
return false;
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUFactory.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUFactory.java index ce34297309..87517b4635 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUFactory.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/IUFactory.java @@ -34,6 +34,7 @@ public class IUFactory implements IAdapterFactory, ITargetLocationEditor, ITarge /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() */ + @Override public Class<?>[] getAdapterList() { return new Class[] {ILabelProvider.class, ITreeContentProvider.class, ITargetLocationEditor.class, ITargetLocationUpdater.class}; } @@ -41,6 +42,7 @@ public class IUFactory implements IAdapterFactory, ITargetLocationEditor, ITarge /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) */ + @Override @SuppressWarnings("unchecked") public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adaptableObject instanceof IUBundleContainer) { @@ -66,6 +68,7 @@ public class IUFactory implements IAdapterFactory, ITargetLocationEditor, ITarge /* (non-Javadoc) * @see org.eclipse.pde.ui.target.ITargetLocationEditor#canEdit(org.eclipse.pde.core.target.ITargetDefinition, org.eclipse.pde.core.target.ITargetLocation) */ + @Override public boolean canEdit(ITargetDefinition target, ITargetLocation targetLocation) { return targetLocation instanceof IUBundleContainer; } @@ -73,6 +76,7 @@ public class IUFactory implements IAdapterFactory, ITargetLocationEditor, ITarge /* (non-Javadoc) * @see org.eclipse.pde.ui.target.ITargetLocationEditor#getEditWizard(org.eclipse.pde.core.target.ITargetDefinition, org.eclipse.pde.core.target.ITargetLocation) */ + @Override public IWizard getEditWizard(ITargetDefinition target, ITargetLocation targetLocation) { return new EditBundleContainerWizard(target, targetLocation); } @@ -80,6 +84,7 @@ public class IUFactory implements IAdapterFactory, ITargetLocationEditor, ITarge /* (non-Javadoc) * @see org.eclipse.pde.ui.target.ITargetLocationUpdater#canUpdate(org.eclipse.pde.core.target.ITargetDefinition, org.eclipse.pde.core.target.ITargetLocation) */ + @Override public boolean canUpdate(ITargetDefinition target, ITargetLocation targetLocation) { return targetLocation instanceof IUBundleContainer; } @@ -87,6 +92,7 @@ public class IUFactory implements IAdapterFactory, ITargetLocationEditor, ITarge /* (non-Javadoc) * @see org.eclipse.pde.ui.target.ITargetLocationUpdater#update(org.eclipse.pde.core.target.ITargetDefinition, org.eclipse.pde.core.target.ITargetLocation, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public IStatus update(ITargetDefinition target, ITargetLocation targetLocation, IProgressMonitor monitor) { // This method has to run synchronously, so we do the update ourselves instead of using UpdateTargetJob if (targetLocation instanceof IUBundleContainer) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/InstallableUnitWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/InstallableUnitWizard.java index 5bb99f1db0..d2066c3775 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/InstallableUnitWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/InstallableUnitWizard.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.shared.target;
import org.eclipse.jface.dialogs.IDialogSettings;
@@ -43,6 +43,7 @@ public class InstallableUnitWizard extends Wizard implements ITargetLocationWiza /* (non-Javadoc)
* @see org.eclipse.pde.ui.target.ITargetLocationWizard#setTarget(org.eclipse.pde.core.target.ITargetDefinition)
*/
+ @Override
public void setTarget(ITargetDefinition target) {
fTarget = target;
}
@@ -50,6 +51,7 @@ public class InstallableUnitWizard extends Wizard implements ITargetLocationWiza /* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
+ @Override
public void addPages() {
IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION);
if (settings == null) {
@@ -62,6 +64,7 @@ public class InstallableUnitWizard extends Wizard implements ITargetLocationWiza /* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
fLocation = ((EditIUContainerPage) getPages()[0]).getBundleContainer();
return true;
@@ -70,6 +73,7 @@ public class InstallableUnitWizard extends Wizard implements ITargetLocationWiza /* (non-Javadoc)
* @see org.eclipse.pde.ui.ILocationWizard#getLocations()
*/
+ @Override
public ITargetLocation[] getLocations() {
return new ITargetLocation[] {fLocation};
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/PreviewContainerPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/PreviewContainerPage.java index 408dfe49ec..f07b9807bc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/PreviewContainerPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/PreviewContainerPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -46,6 +46,7 @@ public class PreviewContainerPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH); SWTFactory.createLabel(composite, Messages.PreviewContainerPage_3, 1); @@ -76,6 +77,7 @@ public class PreviewContainerPage extends WizardPage { try { getContainer().run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { IStatus result = container.resolve(fTarget, monitor); if (monitor.isCanceled()) { @@ -100,6 +102,7 @@ public class PreviewContainerPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean) */ + @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/StyledBundleLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/StyledBundleLabelProvider.java index 3904429cf6..a432839b06 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/StyledBundleLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/StyledBundleLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -56,6 +56,7 @@ public class StyledBundleLabelProvider extends StyledCellLabelProvider implement /* (non-Javadoc) * @see org.eclipse.jface.viewers.StyledCellLabelProvider#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); @@ -64,6 +65,7 @@ public class StyledBundleLabelProvider extends StyledCellLabelProvider implement /* (non-Javadoc) * @see org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell) */ + @Override public void update(ViewerCell cell) { Object element = cell.getElement(); StyledString styledString = getStyledString(element); @@ -227,6 +229,7 @@ public class StyledBundleLabelProvider extends StyledCellLabelProvider implement * @param element * @return image or <code>null</code> */ + @Override public Image getImage(Object element) { if (element instanceof TargetBundle) { @@ -299,6 +302,7 @@ public class StyledBundleLabelProvider extends StyledCellLabelProvider implement /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { StyledString string = getStyledString(element); return string.getString(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetContentsGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetContentsGroup.java index 6c89f9c9c6..0a84527707 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetContentsGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetContentsGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -259,6 +259,7 @@ public class TargetContentsGroup { } }); fTree.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { IStructuredSelection selection = (IStructuredSelection) event.getSelection(); Object first = selection.getFirstElement(); @@ -270,6 +271,7 @@ public class TargetContentsGroup { } }); fTree.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { saveIncludedBundleState(); contentChanged(); @@ -278,6 +280,7 @@ public class TargetContentsGroup { } }); fTree.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateButtons(); } @@ -738,6 +741,7 @@ public class TargetContentsGroup { private List<TargetBundle> getRequiredPlugins(final Collection<TargetBundle> allBundles, final Object[] checkedBundles) { final Set<String> dependencies = new HashSet<String>(); IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) { try { monitor.beginTask(Messages.TargetContentsGroup_5, 150); @@ -1194,14 +1198,17 @@ public class TargetContentsGroup { * */ class TreeContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parentElement) { return getBundleChildren(parentElement); } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { if (fFeaureModeButton.getSelection() && element == OTHER_CATEGORY) { return true; @@ -1215,6 +1222,7 @@ public class TargetContentsGroup { return false; } + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof ITargetDefinition) { List<Object> result = new ArrayList<Object>(); @@ -1265,9 +1273,11 @@ public class TargetContentsGroup { return new Object[] {inputElement}; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationContentProvider.java index ac77f601ea..30ffbf44da 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationContentProvider.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2013, 2014 IBM Corporation and others.
+ * Copyright (c) 2013, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.shared.target;
import java.util.ArrayList;
@@ -29,6 +29,7 @@ public class TargetLocationContentProvider implements ITreeContentProvider { /* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof ITargetDefinition) {
ITargetLocation[] containers = ((ITargetDefinition) parentElement).getTargetLocations();
@@ -72,6 +73,7 @@ public class TargetLocationContentProvider implements ITreeContentProvider { /* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
if (element instanceof IUWrapper) {
return ((IUWrapper) element).getParent();
@@ -82,6 +84,7 @@ public class TargetLocationContentProvider implements ITreeContentProvider { /* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
// Since we are already resolved we can't be more efficient
return getChildren(element).length > 0;
@@ -90,6 +93,7 @@ public class TargetLocationContentProvider implements ITreeContentProvider { /* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ITargetDefinition) {
boolean hasContainerStatus = false;
@@ -117,9 +121,11 @@ public class TargetLocationContentProvider implements ITreeContentProvider { return new Object[0];
}
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationLabelProvider.java index 6fcf703ff8..38e81979e6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationLabelProvider.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.shared.target;
import org.eclipse.core.runtime.Platform;
@@ -28,6 +28,7 @@ public class TargetLocationLabelProvider extends StyledBundleLabelProvider { /* (non-Javadoc)
* @see org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell)
*/
+ @Override
public void update(ViewerCell cell) {
Object element = cell.getElement();
cell.setText(getText(element));
@@ -37,6 +38,7 @@ public class TargetLocationLabelProvider extends StyledBundleLabelProvider { /* (non-Javadoc)
* @see org.eclipse.pde.internal.ui.shared.target.StyledBundleLabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
ILabelProvider provider = (ILabelProvider) Platform.getAdapterManager().getAdapter(element, ILabelProvider.class);
if (provider != null) {
@@ -51,6 +53,7 @@ public class TargetLocationLabelProvider extends StyledBundleLabelProvider { /* (non-Javadoc)
* @see org.eclipse.pde.internal.ui.shared.target.StyledBundleLabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
ILabelProvider provider = (ILabelProvider) Platform.getAdapterManager().getAdapter(element, ILabelProvider.class);
if (provider != null) {
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationsGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationsGroup.java index bc8d1507b6..6cc79a461b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationsGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetLocationsGroup.java @@ -215,11 +215,13 @@ public class TargetLocationsGroup { } }); fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateButtons(); } }); fTreeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { if (!event.getSelection().isEmpty()) { handleEdit(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetStatus.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetStatus.java index 202477f51c..d2b72cbf46 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetStatus.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/TargetStatus.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2014 IBM Corporation and others. + * Copyright (c) 2013, 2015 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 @@ -136,6 +136,7 @@ public class TargetStatus { } private final IPreferenceChangeListener prefListener = new IPreferenceChangeListener() { + @Override public void preferenceChange(PreferenceChangeEvent event) { if (ICoreConstants.WORKSPACE_TARGET_HANDLE.equals(event.getKey())) { update(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/UpdateTargetJob.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/UpdateTargetJob.java index bb4beefa30..123f1828ff 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/UpdateTargetJob.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/shared/target/UpdateTargetJob.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 EclipseSource Inc. and others. + * Copyright (c) 2010, 2015 EclipseSource Inc. 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 @@ -73,6 +73,7 @@ public class UpdateTargetJob extends Job { /* (non-Javadoc) * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected IStatus run(IProgressMonitor monitor) { SubMonitor progress = SubMonitor.convert(monitor, Messages.UpdateTargetJob_UpdatingTarget, toUpdate.size() * 100); MultiStatus errors = new MultiStatus(PDECore.PLUGIN_ID, 0, Messages.UpdateTargetJob_TargetUpdateFailedStatus, null); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AbstractOverlayIcon.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AbstractOverlayIcon.java index 4a2808f86a..28c5afd449 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AbstractOverlayIcon.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AbstractOverlayIcon.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -69,6 +69,7 @@ public abstract class AbstractOverlayIcon extends CompositeImageDescriptor { protected abstract ImageData getBaseImageData(); + @Override protected void drawCompositeImage(int width, int height) { ImageData base = getBaseImageData(); drawImage(base, 0, 0); @@ -115,6 +116,7 @@ public abstract class AbstractOverlayIcon extends CompositeImageDescriptor { } } + @Override protected Point getSize() { return fSize; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AcceleratedTreeScrolling.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AcceleratedTreeScrolling.java index 5dd420ed68..3bc5b1346d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AcceleratedTreeScrolling.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/AcceleratedTreeScrolling.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2015 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 @@ -35,6 +35,7 @@ public class AcceleratedTreeScrolling implements MouseWheelListener { fSkipLines = (skipLines > 1) ? skipLines : 2; } + @Override public void mouseScrolled(MouseEvent e) { // scroll only when MOD1 is pressed if ((e.stateMask & SWT.MOD1) == SWT.MOD1 && fTree != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ChoicePropertyDescriptor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ChoicePropertyDescriptor.java index 1f00fd4431..04fff31169 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ChoicePropertyDescriptor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ChoicePropertyDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,6 +44,7 @@ public class ChoicePropertyDescriptor extends PropertyDescriptor { * The editor is configured with the current validator if there is one. * </p> */ + @Override public CellEditor createPropertyEditor(Composite parent) { CellEditor editor = new ComboBoxCellEditor(parent, values, SWT.READ_ONLY); if (getValidator() != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionFilter.java index 75d805cbaa..812f6cf65b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -24,6 +24,7 @@ public class FileExtensionFilter extends ViewerFilter { fTargetExtension = targetExtension; } + @Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IFile) { return ((IFile) element).getName().toLowerCase(Locale.ENGLISH).endsWith("." + fTargetExtension); //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionsFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionsFilter.java index 4a6d3af50e..a6f50cb924 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionsFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileExtensionsFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -29,6 +29,7 @@ public class FileExtensionsFilter extends ViewerFilter { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { // Select based on type if (element instanceof IFile) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileNameFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileNameFilter.java index 3ea41385f8..ca75922787 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileNameFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileNameFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -23,6 +23,7 @@ public class FileNameFilter extends ViewerFilter { fTargetName = targetName; } + @Override public boolean select(Viewer viewer, Object parent, Object element) { if (element instanceof IFile) { return fTargetName.equals(((IFile) element).getName()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileValidator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileValidator.java index f03e5fb86e..f33c15addc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileValidator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/FileValidator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -18,6 +18,7 @@ import org.eclipse.ui.dialogs.ISelectionStatusValidator; public class FileValidator implements ISelectionStatusValidator { + @Override public IStatus validate(Object[] selection) { if (selection.length > 0 && selection[0] instanceof IFile) { return new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, "", //$NON-NLS-1$ diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ImageOverlayIcon.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ImageOverlayIcon.java index c4394e300b..b2744735ab 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ImageOverlayIcon.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/ImageOverlayIcon.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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,6 +28,7 @@ public class ImageOverlayIcon extends AbstractOverlayIcon { this.base = base; } + @Override protected ImageData getBaseImageData() { return base.getImageData(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsole.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsole.java index 5f657d62d5..eee9dc167e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsole.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsole.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 Red Hat and others. + * Copyright (c) 2010, 2015 Red Hat 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 @@ -35,20 +35,24 @@ public class OSGiConsole extends IOConsole { super(NLS.bind(PDEUIMessages.OSGiConsole_name, Platform.getInstallLocation().getURL().getPath()), TYPE, null, true); session = new ConsoleSession() { + @Override public OutputStream getOutput() { return newOutputStream(); } + @Override public InputStream getInput() { return getInputStream(); } + @Override protected void doClose() { factory.closeConsole(OSGiConsole.this); } }; } + @Override protected void init() { super.init(); IOConsoleOutputStream info = newOutputStream(); // create a stream to write info message to @@ -68,6 +72,7 @@ public class OSGiConsole extends IOConsole { context.registerService(ConsoleSession.class.getName(), session, null); } + @Override protected void dispose() { super.dispose(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java index e957351cd7..e48dbe0f9b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsoleFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Red Hat and others. + * Copyright (c) 2010, 2015 Red Hat 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 @@ -29,6 +29,7 @@ public class OSGiConsoleFactory implements IConsoleFactory { /* (non-Javadoc) * @see org.eclipse.ui.console.IConsoleFactory#openConsole() */ + @Override public void openConsole() { IOConsole console = getConsole(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java index 50790bdea4..f08b9189f7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OSGiConsolePageParticipant.java @@ -27,6 +27,7 @@ public class OSGiConsolePageParticipant implements IConsolePageParticipant { /* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ + @Override public <T> T getAdapter(Class<T> adapter) { return null; } @@ -34,6 +35,7 @@ public class OSGiConsolePageParticipant implements IConsolePageParticipant { /* (non-Javadoc) * @see org.eclipse.ui.console.IConsolePageParticipant#init(org.eclipse.ui.part.IPageBookViewPage, org.eclipse.ui.console.IConsole) */ + @Override public void init(IPageBookViewPage page, IConsole console) { fCloseAction = new CloseConsoleAction(console); IToolBarManager manager = page.getSite().getActionBars().getToolBarManager(); @@ -43,6 +45,7 @@ public class OSGiConsolePageParticipant implements IConsolePageParticipant { /* (non-Javadoc) * @see org.eclipse.ui.console.IConsolePageParticipant#dispose() */ + @Override public void dispose() { fCloseAction = null; @@ -51,12 +54,14 @@ public class OSGiConsolePageParticipant implements IConsolePageParticipant { /* (non-Javadoc) * @see org.eclipse.ui.console.IConsolePageParticipant#activated() */ + @Override public void activated() { } /* (non-Javadoc) * @see org.eclipse.ui.console.IConsolePageParticipant#deactivated() */ + @Override public void deactivated() { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OverlayIcon.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OverlayIcon.java index 19cbf44629..c05bc6a7ea 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OverlayIcon.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/OverlayIcon.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ public class OverlayIcon extends AbstractOverlayIcon { fBase = ImageDescriptor.getMissingImageDescriptor(); } + @Override protected ImageData getBaseImageData() { return fBase.getImageData(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java index a0557777b2..c4edb9c6f1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PDEModelUtility.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -284,6 +284,7 @@ public class PDEModelUtility { final PDEFormEditor editor = getOpenEditor(modification); if (editor != null) { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { if (editor.isDirty()) editor.flushEdits(); @@ -398,6 +399,7 @@ public class PDEModelUtility { private static void modifyEditorModel(final ModelModification mod, final PDEFormEditor editor, final IBaseModel model, final IProgressMonitor monitor) { getDisplay().syncExec(new Runnable() { + @Override public void run() { try { mod.modifyModel(model, monitor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PersistablePluginObject.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PersistablePluginObject.java index 049520048a..7fb2eacb3f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PersistablePluginObject.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PersistablePluginObject.java @@ -37,6 +37,7 @@ public class PersistablePluginObject extends PlatformObject implements IPersista /* (non-Javadoc) * @see org.eclipse.ui.IPersistableElement#getFactoryId() */ + @Override public String getFactoryId() { return FACTORY_ID; } @@ -44,6 +45,7 @@ public class PersistablePluginObject extends PlatformObject implements IPersista /* (non-Javadoc) * @see org.eclipse.ui.IPersistableElement#saveState(org.eclipse.ui.IMemento) */ + @Override public void saveState(IMemento memento) { memento.putString(KEY, fPluginID); } @@ -51,6 +53,7 @@ public class PersistablePluginObject extends PlatformObject implements IPersista /* (non-Javadoc) * @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento) */ + @Override public IAdaptable createElement(IMemento memento) { return new PersistablePluginObject(memento.getString(KEY)); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginAdapter.java index 0eab860502..6a0d20d716 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -25,6 +25,7 @@ public class PluginAdapter implements IWorkingSetElementAdapter { /* (non-Javadoc) * @see org.eclipse.ui.IWorkingSetElementAdapter#adaptElements(org.eclipse.ui.IWorkingSet, org.eclipse.core.runtime.IAdaptable[]) */ + @Override public IAdaptable[] adaptElements(IWorkingSet ws, IAdaptable[] elements) { HashSet<PersistablePluginObject> set = new HashSet<PersistablePluginObject>(); for (int i = 0; i < elements.length; i++) { @@ -46,6 +47,7 @@ public class PluginAdapter implements IWorkingSetElementAdapter { /* (non-Javadoc) * @see org.eclipse.ui.IWorkingSetElementAdapter#dispose() */ + @Override public void dispose() { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginContainmentAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginContainmentAdapter.java index 490cbdf37f..15770f3622 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginContainmentAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginContainmentAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -19,6 +19,7 @@ public class PluginContainmentAdapter implements IContainmentAdapter { super(); } + @Override public boolean contains(Object containmentContext, Object element, int flags) { if (!(containmentContext instanceof PersistablePluginObject) || element == null) return false; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginWorkingSet.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginWorkingSet.java index f63a3d546f..93b8758e19 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginWorkingSet.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/PluginWorkingSet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -33,18 +33,22 @@ import org.eclipse.ui.dialogs.*; public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { class ContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getElements(Object inputElement) { return PluginRegistry.getAllModels(); } + @Override public Object[] getChildren(Object parentElement) { return null; } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { return false; } @@ -61,6 +65,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { if (element instanceof IPluginModelBase) { IPluginBase plugin = ((IPluginModelBase) element).getPluginBase(); @@ -75,6 +80,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { return PDEPlugin.getDefault().getLabelProvider().getImage(element); } @@ -82,6 +88,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.jface.viewers.LabelProvider#dispose() */ + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); @@ -95,6 +102,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { super(parent, treeStyle, filter, true); } + @Override protected TreeViewer doCreateTreeViewer(Composite parent, int style) { return new CheckboxTreeViewer(parent, style); } @@ -118,6 +126,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.IWorkingSetPage#finish() */ + @Override public void finish() { Object[] checked = fTree.getCheckboxTreeViewer().getCheckedElements(); ArrayList<PersistablePluginObject> list = new ArrayList<PersistablePluginObject>(); @@ -141,6 +150,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.IWorkingSetPage#getSelection() */ + @Override public IWorkingSet getSelection() { return fWorkingSet; } @@ -148,6 +158,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.IWorkingSetPage#setSelection(org.eclipse.ui.IWorkingSet) */ + @Override public void setSelection(IWorkingSet workingSet) { fWorkingSet = workingSet; } @@ -155,6 +166,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout()); @@ -168,6 +180,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { fWorkingSetName = new Text(composite, SWT.SINGLE | SWT.BORDER); fWorkingSetName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fWorkingSetName.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -189,6 +202,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { fTree.getCheckboxTreeViewer().setInput(PDECore.getDefault()); fTree.getCheckboxTreeViewer().addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { validatePage(); } @@ -203,6 +217,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { selectAllButton.setText(PDEUIMessages.PluginWorkingSet_selectAll_label); selectAllButton.setToolTipText(PDEUIMessages.PluginWorkingSet_selectAll_toolTip); selectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent selectionEvent) { fTree.getCheckboxTreeViewer().setCheckedElements(fTableContentProvider.getElements(fTree.getCheckboxTreeViewer().getInput())); validatePage(); @@ -215,6 +230,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { deselectAllButton.setText(PDEUIMessages.PluginWorkingSet_deselectAll_label); deselectAllButton.setToolTipText(PDEUIMessages.PluginWorkingSet_deselectAll_toolTip); deselectAllButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent selectionEvent) { fTree.getCheckboxTreeViewer().setCheckedElements(new Object[0]); validatePage(); @@ -263,6 +279,7 @@ public class PluginWorkingSet extends WizardPage implements IWorkingSetPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SharedLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SharedLabelProvider.java index 689fc051b5..bcf5590bc5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SharedLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SharedLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -57,6 +57,7 @@ public class SharedLabelProvider extends LabelProvider implements ITableLabelPro } } + @Override public void dispose() { if (consumers.size() == 0) { for (Enumeration<Image> elements = images.elements(); elements.hasMoreElements();) { @@ -168,10 +169,12 @@ public class SharedLabelProvider extends LabelProvider implements ITableLabelPro return null; } + @Override public String getColumnText(Object obj, int index) { return getText(obj); } + @Override public Image getColumnImage(Object obj, int index) { return getImage(obj); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SourcePluginFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SourcePluginFilter.java index ace7e724ab..3f90dfcfba 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SourcePluginFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/SourcePluginFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 EclipseSource Corporation and others. + * Copyright (c) 2009, 2015 EclipseSource 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 @@ -39,6 +39,7 @@ public class SourcePluginFilter extends ViewerFilter { /* (non-Javadoc) * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IPluginModelBase) { IPreferenceStore store = PDEPlugin.getDefault().getPreferenceStore(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/TemplateFileGenerator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/TemplateFileGenerator.java index 85ed313e21..bf7a3b8226 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/TemplateFileGenerator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/util/TemplateFileGenerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -458,6 +458,7 @@ public class TemplateFileGenerator implements IVariableProvider { * @see IVariableProvider#getValue(String) */ + @Override public Object getValue(String key) { return getKeyValue(key); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesListContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesListContentProvider.java index 5a98f23a03..7e63e2a978 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesListContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesListContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -36,6 +36,7 @@ public class CalleesListContentProvider extends CalleesContentProvider implement /** * @see IStructuredContentProvider#getElements(Object) */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IPluginModelBase) { Map<String, Object> elements = new HashMap<String, Object>(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesTreeContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesTreeContentProvider.java index 0d97b24290..1511408a5d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesTreeContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CalleesTreeContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -25,6 +25,7 @@ public class CalleesTreeContentProvider extends CalleesContentProvider implement super(view); } + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof IPluginBase) { parentElement = ((IPluginBase) parentElement).getModel(); @@ -48,6 +49,7 @@ public class CalleesTreeContentProvider extends CalleesContentProvider implement * @see IStructuredContentProvider#getElements(Object) * @return Object[] of IPluginBase */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IPluginModelBase) { // need to use PluginBase. If we use BundleDescription, whenever the Manifest is update the tree refreshes and collapses @@ -60,6 +62,7 @@ public class CalleesTreeContentProvider extends CalleesContentProvider implement /** * @see ITreeContentProvider#getParent(Object) */ + @Override public Object getParent(Object element) { return null; } @@ -67,6 +70,7 @@ public class CalleesTreeContentProvider extends CalleesContentProvider implement /** * @see ITreeContentProvider#hasChildren(Object) */ + @Override public boolean hasChildren(Object element) { return getChildren(element).length > 0; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersListContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersListContentProvider.java index 6ac35b6cb0..9689c4a611 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersListContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersListContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,6 +24,7 @@ public class CallersListContentProvider extends CallersContentProvider implement /** * @see IStructuredContentProvider#getElements(Object) */ + @Override public Object[] getElements(Object inputElement) { // input IPluginModelBase BundleDescription desc = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersTreeContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersTreeContentProvider.java index 631adfc6b0..10e8fad4ff 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersTreeContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/CallersTreeContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -25,6 +25,7 @@ public class CallersTreeContentProvider extends CallersContentProvider implement super(view); } + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof IPluginBase) { parentElement = ((IPluginBase) parentElement).getModel(); @@ -42,6 +43,7 @@ public class CallersTreeContentProvider extends CallersContentProvider implement * @see IStructuredContentProvider#getElements(Object) * @return Object[] with 0 or 1 IPluginBase */ + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IPluginModelBase) { return new Object[] {((IPluginModelBase) inputElement).getPluginBase()}; @@ -52,6 +54,7 @@ public class CallersTreeContentProvider extends CallersContentProvider implement /** * @see ITreeContentProvider#getParent(Object) */ + @Override public Object getParent(Object element) { return null; } @@ -59,6 +62,7 @@ public class CallersTreeContentProvider extends CallersContentProvider implement /** * @see ITreeContentProvider#hasChildren(Object) */ + @Override public boolean hasChildren(Object element) { return getChildren(element).length > 0; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesLabelProvider.java index d49b54ca93..5d82662768 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,11 +33,13 @@ public class DependenciesLabelProvider extends LabelProvider { fSharedProvider.connect(this); } + @Override public void dispose() { fSharedProvider.disconnect(this); super.dispose(); } + @Override public String getText(Object obj) { if (obj instanceof IPluginImport) { return ((IPluginImport) obj).getId(); @@ -71,6 +73,7 @@ public class DependenciesLabelProvider extends LabelProvider { return name + ' ' + PDELabelProvider.formatVersion(version.toString()); } + @Override public Image getImage(Object obj) { int flags = 0; String id = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesView.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesView.java index 23362b329b..fe1e3fbde4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesView.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesView.java @@ -38,39 +38,49 @@ public class DependenciesView extends PageBookView implements IPreferenceConstan fSite = site; } + @Override public void addPropertyListener(IPropertyListener listener) {/* dummy */ } + @Override public void createPartControl(Composite parent) {/* dummy */ } + @Override public void dispose() { fSite = null; } + @Override public <T> T getAdapter(Class<T> adapter) { return null; } + @Override public IWorkbenchPartSite getSite() { return fSite; } + @Override public String getTitle() { return null; } + @Override public Image getTitleImage() { return null; } + @Override public String getTitleToolTip() { return null; } + @Override public void removePropertyListener(IPropertyListener listener) {/* dummy */ } + @Override public void setFocus() {/* dummy */ } } @@ -454,6 +464,7 @@ public class DependenciesView extends PageBookView implements IPreferenceConstan * * @see java.lang.Runnable#run() */ + @Override public void run() { IPlugin plugin = ((IPluginModel) fInput).getPlugin(); DependencyLoop[] loops = DependencyLoopFinder.findLoops(plugin); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewComparator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewComparator.java index 1c9e8ad897..9832c0f8ca 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewComparator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewComparator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -23,6 +23,7 @@ public class DependenciesViewComparator extends ViewerComparator { super(); } + @Override public int compare(Viewer viewer, Object e1, Object e2) { return getId(e1).compareTo(getId(e2)); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewListPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewListPage.java index 67b2348310..5d677fbede 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewListPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewListPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -31,6 +31,7 @@ public class DependenciesViewListPage extends DependenciesViewPage { * * @see org.eclipse.pde.internal.ui.view.DependenciesViewPage#createViewer(org.eclipse.swt.widgets.Composite) */ + @Override protected StructuredViewer createViewer(Composite parent) { Table table = new Table(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); @@ -39,6 +40,7 @@ public class DependenciesViewListPage extends DependenciesViewPage { final DependenciesLabelProvider labelProvider = new DependenciesLabelProvider(false); fViewer.setLabelProvider(labelProvider); fViewer.getControl().addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { labelProvider.dispose(); } @@ -47,6 +49,7 @@ public class DependenciesViewListPage extends DependenciesViewPage { return fViewer; } + @Override protected void handleShowOptional(boolean isChecked, boolean refreshIfNecessary) { if (fContentProvider instanceof CalleesListContentProvider) { ((CalleesListContentProvider) fContentProvider).setShowOptional(isChecked); @@ -55,6 +58,7 @@ public class DependenciesViewListPage extends DependenciesViewPage { } } + @Override protected boolean isShowingOptional() { if (fContentProvider instanceof CalleesListContentProvider) { return ((CalleesListContentProvider) fContentProvider).getShowOptional(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPage.java index a4706afa08..a2d6b6a6cb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -37,6 +37,7 @@ import org.eclipse.ui.part.Page; public abstract class DependenciesViewPage extends Page { class FocusOnSelectionAction extends Action { + @Override public void run() { handleFocusOn(getSelectedObject()); } @@ -77,6 +78,7 @@ public abstract class DependenciesViewPage extends Page { class FragmentFilter extends ViewerFilter { + @Override public boolean select(Viewer v, Object parent, Object element) { BundleDescription desc = null; if (element instanceof BundleSpecification) { @@ -103,6 +105,7 @@ public abstract class DependenciesViewPage extends Page { this.fView = view; this.fContentProvider = contentProvider; fPropertyListener = new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(IPreferenceConstants.PROP_SHOW_OBJECTS)) { @@ -117,6 +120,7 @@ public abstract class DependenciesViewPage extends Page { * * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { fViewer = createViewer(parent); fViewer.setComparator(DependenciesViewComparator.getViewerComparator()); @@ -126,6 +130,7 @@ public abstract class DependenciesViewPage extends Page { protected abstract StructuredViewer createViewer(Composite parent); + @Override public void dispose() { PDEPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPropertyListener); super.dispose(); @@ -201,6 +206,7 @@ public abstract class DependenciesViewPage extends Page { * * @see org.eclipse.ui.part.IPage#getControl() */ + @Override public Control getControl() { return fViewer.getControl(); } @@ -289,6 +295,7 @@ public abstract class DependenciesViewPage extends Page { MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { DependenciesViewPage.this.fillContextMenu(manager); } @@ -301,6 +308,7 @@ public abstract class DependenciesViewPage extends Page { private void hookDoubleClickAction() { fViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleDoubleClick(); } @@ -309,6 +317,7 @@ public abstract class DependenciesViewPage extends Page { private void makeActions() { fOpenAction = new Action() { + @Override public void run() { handleDoubleClick(); } @@ -318,6 +327,7 @@ public abstract class DependenciesViewPage extends Page { fFocusOnSelectionAction = new FocusOnSelectionAction(); fFocusOnAction = new Action() { + @Override public void run() { handleFocusOn(); } @@ -328,6 +338,7 @@ public abstract class DependenciesViewPage extends Page { fRefactorAction = RefactoringActionFactory.createRefactorPluginIdAction(); fHideFragmentFilterAction = new Action() { + @Override public void run() { boolean checked = fHideFragmentFilterAction.isChecked(); if (checked) @@ -340,6 +351,7 @@ public abstract class DependenciesViewPage extends Page { fHideFragmentFilterAction.setText(PDEUIMessages.DependenciesViewPage_showFragments); fHideOptionalFilterAction = new Action() { + @Override public void run() { boolean checked = isChecked(); handleShowOptional(isChecked(), true); @@ -360,6 +372,7 @@ public abstract class DependenciesViewPage extends Page { * org.eclipse.jface.action.IToolBarManager, * org.eclipse.jface.action.IStatusLineManager) */ + @Override public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { super.makeContributions(menuManager, toolBarManager, statusLineManager); makeActions(); @@ -373,6 +386,7 @@ public abstract class DependenciesViewPage extends Page { * * @see org.eclipse.ui.part.IPage#setFocus() */ + @Override public void setFocus() { if (fViewer != null) { Control c = fViewer.getControl(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPageContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPageContentProvider.java index 9598256d66..1986bfa499 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPageContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewPageContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -40,6 +40,7 @@ public class DependenciesViewPageContentProvider extends DefaultContentProvider PDECore.getDefault().getModelManager().removePluginModelListener(this); } + @Override public void dispose() { removeModelListener(); } @@ -76,16 +77,19 @@ public class DependenciesViewPageContentProvider extends DefaultContentProvider return false; } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { fView.updateTitle(newInput); this.fViewer = (StructuredViewer) viewer; } + @Override public void modelsChanged(final PluginModelDelta delta) { if (fViewer == null || fViewer.getControl().isDisposed()) return; fViewer.getControl().getDisplay().asyncExec(new Runnable() { + @Override public void run() { int kind = delta.getKind(); if (fViewer.getControl().isDisposed()) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewTreePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewTreePage.java index beb3749eab..de5d3e6cc4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewTreePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/DependenciesViewTreePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -38,6 +38,7 @@ public class DependenciesViewTreePage extends DependenciesViewPage { * * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { super.run(); fTreeViewer.collapseAll(); @@ -46,6 +47,7 @@ public class DependenciesViewTreePage extends DependenciesViewPage { class OptionalFilter extends ViewerFilter { + @Override public boolean select(Viewer v, Object parent, Object element) { if (element instanceof BundleSpecification) { return !((BundleSpecification) element).isOptional(); @@ -67,12 +69,14 @@ public class DependenciesViewTreePage extends DependenciesViewPage { * * @see org.eclipse.pde.internal.ui.view.DependenciesViewPage#createViewer(org.eclipse.swt.widgets.Composite) */ + @Override protected StructuredViewer createViewer(Composite parent) { fTreeViewer = new TreeViewer(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); fTreeViewer.setContentProvider(fContentProvider); final DependenciesLabelProvider labelProvider = new DependenciesLabelProvider(true); fTreeViewer.setLabelProvider(labelProvider); fTreeViewer.getControl().addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { labelProvider.dispose(); } @@ -89,6 +93,7 @@ public class DependenciesViewTreePage extends DependenciesViewPage { * org.eclipse.jface.action.IToolBarManager, * org.eclipse.jface.action.IStatusLineManager) */ + @Override public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) { super.makeContributions(menuManager, toolBarManager, statusLineManager); if (toolBarManager.find(DependenciesView.TREE_ACTION_GROUP) != null) @@ -97,6 +102,7 @@ public class DependenciesViewTreePage extends DependenciesViewPage { toolBarManager.add(new CollapseAllAction()); } + @Override protected void handleShowOptional(boolean isChecked, boolean refreshIfNecessary) { if (isChecked) fTreeViewer.removeFilter(fHideOptionalFilter); @@ -105,6 +111,7 @@ public class DependenciesViewTreePage extends DependenciesViewPage { // filter automatically refreshes tree, therefore can ignore refreshIfNecessary } + @Override protected boolean isShowingOptional() { ViewerFilter[] filters = fTreeViewer.getFilters(); for (int i = 0; i < filters.length; i++) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryAction.java index 8f878ea80e..e8801454c4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -41,6 +41,7 @@ public class HistoryAction extends Action { * * @see Object#equals(Object) */ + @Override public boolean equals(Object obj) { return (obj != null) && getClass().equals(obj.getClass()) && fImage.equals(((ImageImageDescriptor) obj).fImage); } @@ -50,6 +51,7 @@ public class HistoryAction extends Action { * * @see ImageDescriptor#getImageData() */ + @Override public ImageData getImageData() { return fImage.getImageData(); } @@ -59,6 +61,7 @@ public class HistoryAction extends Action { * * @see Object#hashCode() */ + @Override public int hashCode() { return fImage.hashCode(); } @@ -94,6 +97,7 @@ public class HistoryAction extends Action { /* * @see Action#run() */ + @Override public void run() { fView.gotoHistoryEntry(fElement); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryDropDownAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryDropDownAction.java index 6fd5c9503a..cee098b6eb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryDropDownAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryDropDownAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -51,6 +51,7 @@ public class HistoryDropDownAction extends Action implements IMenuCreator { return checked; } + @Override public void dispose() { // action is reused, can be called several times. if (fMenu != null) { @@ -59,6 +60,7 @@ public class HistoryDropDownAction extends Action implements IMenuCreator { } } + @Override public Menu getMenu(Control parent) { if (fMenu != null) { fMenu.dispose(); @@ -75,10 +77,12 @@ public class HistoryDropDownAction extends Action implements IMenuCreator { return fMenu; } + @Override public Menu getMenu(Menu parent) { return null; } + @Override public void run() { (new HistoryListAction(fView)).run(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListAction.java index f25a8cf166..bb139174c4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ public class HistoryListAction extends Action { /* * @see IAction#run() */ + @Override public void run() { String[] historyEntries = fView.getHistoryEntries(); HistoryListDialog dialog = new HistoryListDialog(PDEPlugin.getActiveWorkbenchShell(), historyEntries); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListDialog.java index 2bfb24ec48..cad24ae794 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/HistoryListDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ import org.eclipse.ui.PlatformUI; public class HistoryListDialog extends StatusDialog { class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object element) { return fHistoryList.toArray(); } @@ -55,6 +56,7 @@ public class HistoryListDialog extends StatusDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IHelpContextIds.HISTORY_LIST_DIALOG); @@ -65,6 +67,7 @@ public class HistoryListDialog extends StatusDialog { * * @see org.eclipse.jface.window.Window#create() */ + @Override public void create() { setShellStyle(getShellStyle() | SWT.RESIZE); super.create(); @@ -73,6 +76,7 @@ public class HistoryListDialog extends StatusDialog { /* * @see Dialog#createDialogArea(Composite) */ + @Override protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent); @@ -121,6 +125,7 @@ public class HistoryListDialog extends StatusDialog { * * @see org.eclipse.swt.events.SelectionAdapter#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent) */ + @Override public void widgetSelected(SelectionEvent e) { ISelection selection = fHistoryViewer.getSelection(); if (!selection.isEmpty() && selection instanceof IStructuredSelection) { @@ -145,6 +150,7 @@ public class HistoryListDialog extends StatusDialog { * * @see org.eclipse.swt.events.SelectionAdapter#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent) */ + @Override public void widgetDefaultSelected(SelectionEvent e) { if (fHistoryStatus.isOK()) { okPressed(); @@ -156,6 +162,7 @@ public class HistoryListDialog extends StatusDialog { final DependenciesLabelProvider labelProvider = new DependenciesLabelProvider(false); fHistoryViewer.setLabelProvider(labelProvider); fHistoryViewer.getControl().addDisposeListener(new DisposeListener() { + @Override public void widgetDisposed(DisposeEvent e) { labelProvider.dispose(); } @@ -178,6 +185,7 @@ public class HistoryListDialog extends StatusDialog { * * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void selectionChanged(SelectionChangedEvent event) { StatusInfo status = new StatusInfo(); ISelection selection = fHistoryViewer.getSelection(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenDependenciesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenDependenciesAction.java index 42bd57feb8..a10a012df2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenDependenciesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenDependenciesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,6 +24,7 @@ public class OpenDependenciesAction extends AbstractHandler { /* (non-Javadoc) * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) */ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); if (selection instanceof IStructuredSelection) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginDependenciesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginDependenciesAction.java index 31fb27f1eb..eb7c79db6f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginDependenciesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginDependenciesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -25,6 +25,7 @@ public class OpenPluginDependenciesAction extends Action { fModel = base; } + @Override public void run() { try { IViewPart view = PDEPlugin.getActivePage().showView(IPDEUIConstants.DEPENDENCIES_VIEW_ID); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginReferencesAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginReferencesAction.java index 51a096a4bc..1d473462ea 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginReferencesAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/dependencies/OpenPluginReferencesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -25,6 +25,7 @@ public class OpenPluginReferencesAction extends Action { fModel = base; } + @Override public void run() { try { IViewPart view = PDEPlugin.getActivePage().showView(IPDEUIConstants.DEPENDENCIES_VIEW_ID); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImagePropertyTester.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImagePropertyTester.java index c937f52e52..4a8eed9803 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImagePropertyTester.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImagePropertyTester.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -26,6 +26,7 @@ public class ActiveImagePropertyTester extends PropertyTester { public ActiveImagePropertyTester() { } + @Override public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) { if (EXISTS.equals(property)) return receiver != null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImageSourceProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImageSourceProvider.java index 7da12da060..490cf22ade 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImageSourceProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ActiveImageSourceProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -27,18 +27,21 @@ public class ActiveImageSourceProvider extends AbstractSourceProvider { private ImageElement mImageData = null; + @Override public void dispose() { } /* (non-Javadoc) * @see org.eclipse.ui.ISourceProvider#getCurrentState() */ + @Override public Map getCurrentState() { HashMap<String, Object> map = new HashMap<String, Object>(); map.put(ACTIVE_IMAGE, mImageData); return map; } + @Override public String[] getProvidedSourceNames() { return new String[] {ACTIVE_IMAGE}; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ImageBrowserView.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ImageBrowserView.java index cb06c71767..dc954265c3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ImageBrowserView.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/ImageBrowserView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2014 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -102,6 +102,7 @@ public class ImageBrowserView extends ViewPart implements IImageTarget { sourceCombo = new ComboViewer(SWTFactory.createCombo(sourceComp, SWT.READ_ONLY, 1, null)); sourceCombo.setContentProvider(new ArrayContentProvider()); sourceCombo.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { scanImages(); } @@ -218,6 +219,7 @@ public class ImageBrowserView extends ViewPart implements IImageTarget { } } + @Override public void notifyImage(final ImageElement element) { for (final IFilter filter : mFilters) { if (!filter.accept(element)) @@ -230,6 +232,7 @@ public class ImageBrowserView extends ViewPart implements IImageTarget { if (mImageCounter <= 0) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { nextButton.setEnabled(true); } @@ -237,6 +240,7 @@ public class ImageBrowserView extends ViewPart implements IImageTarget { } } + @Override public boolean needsMore() { return mImageCounter > 0; } @@ -308,6 +312,7 @@ public class ImageBrowserView extends ViewPart implements IImageTarget { Display.getDefault().asyncExec(this); } + @Override public synchronized void run() { if (!mElements.isEmpty()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/SaveToWorkspace.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/SaveToWorkspace.java index 355c523d1b..770c0e988b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/SaveToWorkspace.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/SaveToWorkspace.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -39,6 +39,7 @@ import org.eclipse.ui.services.ISourceProviderService; */ public class SaveToWorkspace extends AbstractHandler { + @Override public Object execute(final ExecutionEvent event) throws ExecutionException { ISourceProviderService service = (ISourceProviderService) PlatformUI.getWorkbench().getService(ISourceProviderService.class); ISourceProvider provider = service.getSourceProvider(ActiveImageSourceProvider.ACTIVE_IMAGE); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/AndFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/AndFilter.java index cb3a866c4e..5bc2164223 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/AndFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/AndFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -22,6 +22,7 @@ public class AndFilter implements IFilter { mFilter = filter; } + @Override public boolean accept(final ImageElement element) { for (IFilter filter : mFilter) { if (!filter.accept(element)) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/ElementsFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/ElementsFilter.java index d1c63ba997..42fb14e8b4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/ElementsFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/ElementsFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -26,6 +26,7 @@ public class ElementsFilter implements IFilter { mElements.add(element); } + @Override public boolean accept(final ImageElement element) { return mElements.contains(element); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/NotFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/NotFilter.java index 096b493438..fde336faa7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/NotFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/NotFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -22,6 +22,7 @@ public class NotFilter implements IFilter { mFilter = filter; } + @Override public boolean accept(final ImageElement element) { return !mFilter.accept(element); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/OrFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/OrFilter.java index acf21a88be..e9a9177678 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/OrFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/OrFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -22,6 +22,7 @@ public class OrFilter implements IFilter { mFilter = filter; } + @Override public boolean accept(final ImageElement element) { for (IFilter filter : mFilter) { if (filter.accept(element)) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/PatternFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/PatternFilter.java index b42cf2cbed..0d293bda15 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/PatternFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/PatternFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -23,6 +23,7 @@ public class PatternFilter implements IFilter { mPattern = Pattern.compile(pattern); } + @Override public boolean accept(final ImageElement element) { return mPattern.matcher(element.getPlugin() + "/" + element.getPath()).matches(); //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/SizeFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/SizeFilter.java index 196ec815f0..a5bde13f33 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/SizeFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/filter/SizeFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -31,6 +31,7 @@ public class SizeFilter implements IFilter { mHeightType = heightType; } + @Override public boolean accept(final ImageElement element) { boolean accept = true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/TargetPlatformRepository.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/TargetPlatformRepository.java index 7e9c054d0c..6a7bbaf56a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/TargetPlatformRepository.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/TargetPlatformRepository.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2014 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -41,6 +41,7 @@ public class TargetPlatformRepository extends AbstractRepository { fUseCurrent = useCurrent; } + @Override protected boolean populateCache(final IProgressMonitor monitor) { if (fBundles == null) initialize(monitor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java index 0d6593dc94..9d032843df 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2014 Christian Pontesegger and others. + * Copyright (c) 2012, 2015 Christian Pontesegger 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 @@ -47,6 +47,7 @@ public class WorkspaceRepository extends AbstractRepository { // parse all folders project.accept(new IResourceProxyVisitor() { + @Override public boolean visit(IResourceProxy proxy) throws CoreException { switch (proxy.getType()) { @@ -109,6 +110,7 @@ public class WorkspaceRepository extends AbstractRepository { } + @Override public String toString() { return "Workspace"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/AddAllPluginsToJavaSearchHandler.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/AddAllPluginsToJavaSearchHandler.java index ef968163dc..371031269d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/AddAllPluginsToJavaSearchHandler.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/AddAllPluginsToJavaSearchHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 EclipseSource Corporation and others. + * Copyright (c) 2009, 2015 EclipseSource 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 @@ -20,6 +20,7 @@ import org.eclipse.ui.PlatformUI; public class AddAllPluginsToJavaSearchHandler extends AbstractHandler { + @Override public Object execute(ExecutionEvent event) throws ExecutionException { IPluginModelBase[] models = PluginRegistry.getExternalModels(); IRunnableWithProgress op = new JavaSearchOperation(models, true); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/CopyToClipboardAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/CopyToClipboardAction.java index 0367a4c3e4..56cb7b7254 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/CopyToClipboardAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/CopyToClipboardAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -54,6 +54,7 @@ public class CopyToClipboardAction extends Action { return true; } + @Override public void run() { if (selection.isEmpty()) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/ImportFromRepositoryActionDelegate.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/ImportFromRepositoryActionDelegate.java index deb7578b99..29a67f2893 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/ImportFromRepositoryActionDelegate.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/ImportFromRepositoryActionDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. + * Copyright (c) 2011, 2015 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 @@ -24,6 +24,7 @@ import org.eclipse.ui.handlers.HandlerUtil; */ public class ImportFromRepositoryActionDelegate extends AbstractHandler { + @Override public Object execute(ExecutionEvent event) throws ExecutionException { // enable = ImportActionGroup.canImport((IStructuredSelection) selection); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchActionGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchActionGroup.java index bb783d024c..27d4457409 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchActionGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchActionGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -42,6 +42,7 @@ public class JavaSearchActionGroup extends ActionGroup { setText(PDEUIMessages.PluginsView_removeFromJavaSearch); } + @Override public void run() { IPreferenceStore store = PDEPlugin.getDefault().getPreferenceStore(); if (!add && store.getBoolean(IPreferenceConstants.ADD_TO_JAVA_SEARCH)) { @@ -56,6 +57,7 @@ public class JavaSearchActionGroup extends ActionGroup { } } + @Override public void fillContextMenu(IMenuManager menu) { ActionContext context = getContext(); ISelection selection = context.getSelection(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchOperation.java index ac15b64286..22a11db6ea 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/JavaSearchOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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,6 +28,7 @@ public class JavaSearchOperation implements IRunnableWithProgress { fAdd = add; } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException { try { SearchablePluginsManager manager = PDECore.getDefault().getSearchablePluginsManager(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsContentProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsContentProvider.java index 98a1316b16..7221bf9b80 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsContentProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsContentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -53,6 +53,7 @@ public class PluginsContentProvider extends DefaultContentProvider implements IT * (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof IDeferredWorkbenchAdapter) { if (PDECore.getDefault().getModelManager().isInitialized()) @@ -83,6 +84,7 @@ public class PluginsContentProvider extends DefaultContentProvider implements IT * (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) */ + @Override public Object getParent(Object element) { if (element instanceof PluginModelManager) { return null; @@ -106,6 +108,7 @@ public class PluginsContentProvider extends DefaultContentProvider implements IT * (non-Javadoc) * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ + @Override public boolean hasChildren(Object element) { if (element instanceof IDeferredWorkbenchAdapter) return fManager.mayHaveChildren(element); @@ -125,6 +128,7 @@ public class PluginsContentProvider extends DefaultContentProvider implements IT /** * @see IStructuredContentProvider#getElements(Object) */ + @Override public Object[] getElements(Object inputElement) { return getChildren(inputElement); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsDragAdapter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsDragAdapter.java index e3e481396a..249ad65acb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsDragAdapter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsDragAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -32,6 +32,7 @@ public class PluginsDragAdapter extends DragSourceAdapter { * Returns the data to be transferred in a drag and drop * operation. */ + @Override public void dragSetData(DragSourceEvent event) { //resort to a file transfer @@ -52,6 +53,7 @@ public class PluginsDragAdapter extends DragSourceAdapter { /** * All selection must be files or folders. */ + @Override public void dragStart(DragSourceEvent event) { // Workaround for 1GEUS9V diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsLabelProvider.java index 1197e67cc9..8ba0b1e261 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,11 +43,13 @@ public class PluginsLabelProvider extends LabelProvider { sharedProvider.connect(this); } + @Override public void dispose() { sharedProvider.disconnect(this); super.dispose(); } + @Override public String getText(Object obj) { if (obj instanceof IPluginModelBase) { return getText((IPluginModelBase) obj); @@ -77,6 +79,7 @@ public class PluginsLabelProvider extends LabelProvider { return super.getText(obj); } + @Override public Image getImage(Object obj) { if (obj instanceof IPluginModelBase) { return getImage((IPluginModelBase) obj); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsView.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsView.java index 3b4ce7f545..266fdf818e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsView.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/plugins/PluginsView.java @@ -153,6 +153,7 @@ public class PluginsView extends ViewPart implements IPluginModelListener { */ public PluginsView() { fPropertyListener = new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(IPreferenceConstants.PROP_SHOW_OBJECTS)) { @@ -207,6 +208,7 @@ public class PluginsView extends ViewPart implements IPluginModelListener { hookContextMenu(); hookDoubleClickAction(); fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent e) { handleSelectionChanged(e.getSelection()); } @@ -578,6 +580,7 @@ public class PluginsView extends ViewPart implements IPluginModelListener { MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { PluginsView.this.fillContextMenu(manager); } @@ -715,6 +718,7 @@ public class PluginsView extends ViewPart implements IPluginModelListener { final File file = localFile; final boolean result[] = new boolean[1]; BusyIndicator.showWhile(fTreeViewer.getTree().getDisplay(), new Runnable() { + @Override public void run() { // Open file using shell. String path = file.getAbsolutePath(); @@ -779,6 +783,7 @@ public class PluginsView extends ViewPart implements IPluginModelListener { private void hookDoubleClickAction() { fTreeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleDoubleClick(); } @@ -836,11 +841,13 @@ public class PluginsView extends ViewPart implements IPluginModelListener { setContentDescription(NLS.bind(PDEUIMessages.PluginsView_description, visible, total)); } + @Override public void modelsChanged(final PluginModelDelta delta) { if (fTreeViewer == null || fTreeViewer.getTree().isDisposed()) return; fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() { + @Override public void run() { int kind = delta.getKind(); if (fTreeViewer.getTree().isDisposed()) @@ -897,6 +904,7 @@ public class PluginsView extends ViewPart implements IPluginModelListener { */ protected IShowInSource getShowInSource() { return new IShowInSource() { + @Override public ShowInContext getShowInContext() { ArrayList<IResource> resourceList = new ArrayList<IResource>(); IStructuredSelection selection = (IStructuredSelection) fTreeViewer.getSelection(); @@ -924,6 +932,7 @@ public class PluginsView extends ViewPart implements IPluginModelListener { */ protected IShowInTargetList getShowInTargetList() { return new IShowInTargetList() { + @Override public String[] getShowInTargetIds() { return new String[] {JavaUI.ID_PACKAGES, IPageLayout.ID_PROJECT_EXPLORER}; } @@ -936,32 +945,39 @@ public class PluginsView extends ViewPart implements IPluginModelListener { private IDeferredWorkbenchAdapter getDeferredTreeRoot() { return new IDeferredWorkbenchAdapter() { + @Override public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) { Object[] bases = getChildren(object); collector.add(bases, monitor); monitor.done(); } + @Override public ISchedulingRule getRule(Object object) { return null; } + @Override public boolean isContainer() { return true; } + @Override public Object[] getChildren(Object o) { return PDECore.getDefault().getModelManager().getAllModels(); } + @Override public ImageDescriptor getImageDescriptor(Object object) { return null; } + @Override public String getLabel(Object o) { return PDEUIMessages.PluginsView_deferredLabel0; } + @Override public Object getParent(Object o) { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/StateViewPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/StateViewPage.java index 3e08104781..9f63a49883 100755 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/StateViewPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/StateViewPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -90,6 +90,7 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM class StateContentProvider extends DefaultContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parentElement) { if (parentElement instanceof BundleDescription) { BundleDescription desc = (BundleDescription) parentElement; @@ -110,14 +111,17 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM return new Object[0]; } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { return getChildren(element).length > 0; } + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof State) return ((State) inputElement).getBundles(); @@ -190,6 +194,7 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM } } + @Override public Image getImage(Object element) { if (element instanceof DependencyGroup) element = ((DependencyGroup) element).getChildren()[0]; @@ -209,6 +214,7 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM return null; } + @Override public String getText(Object element) { String result = element.toString(); if (element instanceof ImportPackageSpecification) { @@ -232,6 +238,7 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM public StateViewPage(PageBookView view) { fView = view; fPropertyListener = new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); if (property.equals(IPreferenceConstants.PROP_SHOW_OBJECTS)) { @@ -287,6 +294,7 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM fTreeViewer.setComparator(DependenciesViewComparator.getViewerComparator()); fTreeViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleDoubleClick(); } @@ -395,6 +403,7 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$ menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager manager) { fillContextMenu(manager); } @@ -435,11 +444,13 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM super.dispose(); } + @Override public void stateResolved(final StateDelta delta) { if (!fView.getCurrentPage().equals(this) || fTreeViewer == null || fTreeViewer.getTree().isDisposed()) // if this page is not active, then wait until we call refresh on next activation return; fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() { + @Override public void run() { if (delta == null) { fTreeViewer.refresh(); @@ -457,11 +468,13 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM }); } + @Override public void stateChanged(final State newState) { if (!this.equals(fView.getCurrentPage()) || fTreeViewer == null || fTreeViewer.getTree().isDisposed()) // if this page is not active, then wait until we call refresh on next activation return; fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() { + @Override public void run() { fTreeViewer.setInput(newState); } @@ -477,11 +490,13 @@ public class StateViewPage extends Page implements IStateDeltaListener, IPluginM return section; } + @Override public void modelsChanged(PluginModelDelta delta) { if (fTreeViewer == null || fTreeViewer.getTree().isDisposed()) return; if (delta.getAddedEntries().length > 0 || delta.getChangedEntries().length > 0 || delta.getRemovedEntries().length > 0) fTreeViewer.getTree().getDisplay().asyncExec(new Runnable() { + @Override public void run() { fTreeViewer.refresh(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/TargetStateView.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/TargetStateView.java index ff7ca720cf..a770c1e945 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/TargetStateView.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/target/TargetStateView.java @@ -32,39 +32,49 @@ public class TargetStateView extends PageBookView { fSite = site; } + @Override public void addPropertyListener(IPropertyListener listener) {/* dummy */ } + @Override public void createPartControl(Composite parent) {/* dummy */ } + @Override public void dispose() { fSite = null; } + @Override public <T> T getAdapter(Class<T> adapter) { return null; } + @Override public IWorkbenchPartSite getSite() { return fSite; } + @Override public String getTitle() { return null; } + @Override public Image getTitleImage() { return null; } + @Override public String getTitleToolTip() { return null; } + @Override public void removePropertyListener(IPropertyListener listener) {/* dummy */ } + @Override public void setFocus() {/* dummy */ } } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/ListUtil.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/ListUtil.java index f379fa760a..f3b8f72131 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/ListUtil.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/ListUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -27,6 +27,7 @@ public class ListUtil { private static final Comparator<String> stringComparator = new Comparator<String>() { + @Override public int compare(String arg0, String arg1) { return arg0.compareToIgnoreCase(arg1); } @@ -63,6 +64,7 @@ public class ListUtil { private static IPropertyChangeListener listener = new IPropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent event) { if (IPreferenceConstants.PROP_SHOW_OBJECTS.equals(event.getProperty())) { cachedIsFullNameModelEnabled = IPreferenceConstants.VALUE_USE_NAMES.equals(event.getNewValue()); @@ -112,10 +114,12 @@ public class ListUtil { public static final ViewerComparator FEATURE_COMPARATOR = new FeatureComparator(); static class TableLabelProvider extends ElementLabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object o, int index) { return getText(o); } + @Override public Image getColumnImage(Object o, int index) { return getImage(o); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/NewWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/NewWizard.java index cb72753d0a..0384e7d4d4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/NewWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/NewWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,11 +35,13 @@ public class NewWizard extends Wizard implements INewWizard, IDefaultValueConsum return workbench; } + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; } + @Override public boolean performFinish() { return true; } @@ -49,6 +51,7 @@ public class NewWizard extends Wizard implements INewWizard, IDefaultValueConsum * * @see org.eclipse.pde.internal.ui.wizards.IDefaultValueConsumer#getDefaultValue(java.lang.String) */ + @Override public final String getDefaultValue(String key) { if (defaultValues == null) return null; @@ -60,6 +63,7 @@ public class NewWizard extends Wizard implements INewWizard, IDefaultValueConsum * * @see org.eclipse.pde.internal.ui.wizards.IDefaultValueConsumer#init(java.util.Dictionary) */ + @Override public final void init(Dictionary<?, ?> defaultValues) { this.defaultValues = defaultValues; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/PDEWizardNewFileCreationPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/PDEWizardNewFileCreationPage.java index 5a3b875097..29ac6c9358 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/PDEWizardNewFileCreationPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/PDEWizardNewFileCreationPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -35,6 +35,7 @@ public class PDEWizardNewFileCreationPage extends WizardNewFileCreationPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#validatePage() */ + @Override protected boolean validatePage() { String filename = getFileName().trim(); // Verify the filename is non-empty @@ -55,6 +56,7 @@ public class PDEWizardNewFileCreationPage extends WizardNewFileCreationPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#validateLinkedResource() */ + @Override protected IStatus validateLinkedResource() { return new Status(IStatus.OK, PDEPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$ } @@ -62,6 +64,7 @@ public class PDEWizardNewFileCreationPage extends WizardNewFileCreationPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createLinkTarget() */ + @Override protected void createLinkTarget() { // NOOP } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RenameDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RenameDialog.java index 39323465e1..1671aa42f6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RenameDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RenameDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -86,11 +86,13 @@ public class RenameDialog extends SelectionStatusDialog { /* * @see org.eclipse.jface.window.Window#configureShell(Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.RENAME_DIALOG); } + @Override protected Control createDialogArea(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -106,6 +108,7 @@ public class RenameDialog extends SelectionStatusDialog { text = new Text(container, SWT.SINGLE | SWT.BORDER); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { textChanged(text.getText()); } @@ -116,6 +119,7 @@ public class RenameDialog extends SelectionStatusDialog { return container; } + @Override public int open() { text.setText(oldName); text.selectAll(); @@ -160,6 +164,7 @@ public class RenameDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#okPressed() */ + @Override protected void okPressed() { newName = text.getText().trim(); super.okPressed(); @@ -168,9 +173,11 @@ public class RenameDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() */ + @Override protected void computeResult() { } + @Override public void setTitle(String title) { getShell().setText(title); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RequiredPluginsContainerPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RequiredPluginsContainerPage.java index 6247c03a17..6f48506764 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RequiredPluginsContainerPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/RequiredPluginsContainerPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,6 +43,7 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa private IJavaProject javaProject; class EntryContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (realEntries != null) return realEntries; @@ -60,6 +61,7 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa // } class EntryLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getText(Object obj) { IClasspathEntry entry = (IClasspathEntry) obj; int kind = entry.getEntryKind(); @@ -71,6 +73,7 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa + path.uptoSegment(path.segmentCount() - 1).toOSString(); } + @Override public Image getImage(Object obj) { IClasspathEntry entry = (IClasspathEntry) obj; int kind = entry.getEntryKind(); @@ -83,10 +86,12 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa return null; } + @Override public String getColumnText(Object obj, int col) { return getText(obj); } + @Override public Image getColumnImage(Object obj, int col) { return getImage(obj); } @@ -110,6 +115,7 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa * Insert the method's description here. * @see WizardPage#createControl */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout()); @@ -138,6 +144,7 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa * Insert the method's description here. * @see WizardPage#finish */ + @Override public boolean finish() { return true; } @@ -146,10 +153,12 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa * Insert the method's description here. * @see WizardPage#getSelection */ + @Override public IClasspathEntry getSelection() { return entry; } + @Override public void initialize(IJavaProject project, IClasspathEntry[] currentEntries) { javaProject = project; } @@ -158,6 +167,7 @@ public class RequiredPluginsContainerPage extends WizardPage implements IClasspa * Insert the method's description here. * @see WizardPage#setSelection */ + @Override public void setSelection(IClasspathEntry containerEntry) { this.entry = containerEntry; createRealEntries(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionComparator.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionComparator.java index d31b628510..e4eb0a7551 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionComparator.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionComparator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -20,6 +20,7 @@ public class WizardCollectionComparator extends ViewerComparator { this.baseCategory = baseCategory; } + @Override public int compare(Viewer viewer, Object o1, Object o2) { String name2 = ((WizardCollectionElement) o2).getLabel(); String name1 = ((WizardCollectionElement) o1).getLabel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionElement.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionElement.java index 4dcc4003e0..994926f28b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionElement.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardCollectionElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -82,6 +82,7 @@ public class WizardCollectionElement extends ElementList implements IPluginContr /* (non-Javadoc) * @see org.eclipse.ui.IPluginContribution#getLocalId() */ + @Override public String getLocalId() { return getId(); } @@ -89,6 +90,7 @@ public class WizardCollectionElement extends ElementList implements IPluginContr /* (non-Javadoc) * @see org.eclipse.ui.IPluginContribution#getPluginId() */ + @Override public String getPluginId() { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardElement.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardElement.java index c8b3aa43a9..f6bc9c7f2a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardElement.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -155,6 +155,7 @@ public class WizardElement extends NamedElement implements IPluginContribution { /* (non-Javadoc) * @see org.eclipse.ui.IPluginContribution#getLocalId() */ + @Override public String getLocalId() { return getID(); } @@ -162,6 +163,7 @@ public class WizardElement extends NamedElement implements IPluginContribution { /* (non-Javadoc) * @see org.eclipse.ui.IPluginContribution#getPluginId() */ + @Override public String getPluginId() { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardListSelectionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardListSelectionPage.java index b58a35af96..41d559586e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardListSelectionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardListSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -55,6 +55,7 @@ public abstract class WizardListSelectionPage extends BaseWizardSelectionPage im return wizardElements; } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -82,6 +83,7 @@ public abstract class WizardListSelectionPage extends BaseWizardSelectionPage im wizardSelectionViewer.setLabelProvider(ListUtil.TABLE_LABEL_PROVIDER); wizardSelectionViewer.setComparator(ListUtil.NAME_COMPARATOR); wizardSelectionViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { doubleClickAction.run(); } @@ -104,6 +106,7 @@ public abstract class WizardListSelectionPage extends BaseWizardSelectionPage im protected void initializeViewer() { } + @Override public void selectionChanged(SelectionChangedEvent event) { setErrorMessage(null); IStructuredSelection selection = (IStructuredSelection) event.getSelection(); @@ -152,6 +155,7 @@ public abstract class WizardListSelectionPage extends BaseWizardSelectionPage im /* (non-Javadoc) * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) */ + @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardNode.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardNode.java index 4d08fac21d..4d956ddaea 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardNode.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardNode.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -30,6 +30,7 @@ public abstract class WizardNode implements IWizardNode { protected abstract IBasePluginWizard createWizard() throws CoreException; + @Override public void dispose() { if (wizard != null) { wizard.dispose(); @@ -41,10 +42,12 @@ public abstract class WizardNode implements IWizardNode { return wizardElement; } + @Override public Point getExtent() { return new Point(-1, -1); } + @Override public IWizard getWizard() { if (wizard != null) return wizard; // we've already created it @@ -65,6 +68,7 @@ public abstract class WizardNode implements IWizardNode { return wizard; } + @Override public boolean isContentCreated() { return wizard != null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardTreeSelectionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardTreeSelectionPage.java index 4acb647e21..5768de69ce 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardTreeSelectionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/WizardTreeSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -37,6 +37,7 @@ public abstract class WizardTreeSelectionPage extends BaseWizardSelectionPage { getContainer().showPage(getNextPage()); } + @Override public void createControl(Composite parent) { // top level group Composite container = new Composite(parent, SWT.NULL); @@ -71,8 +72,10 @@ public abstract class WizardTreeSelectionPage extends BaseWizardSelectionPage { wizardSelectionViewer.setComparator(ListUtil.NAME_COMPARATOR); wizardSelectionViewer.addSelectionChangedListener(this); wizardSelectionViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { BusyIndicator.showWhile(wizardSelectionViewer.getControl().getDisplay(), new Runnable() { + @Override public void run() { selectionChanged(new SelectionChangedEvent(wizardSelectionViewer, wizardSelectionViewer.getSelection())); advanceToNextPage(); @@ -148,6 +151,7 @@ public abstract class WizardTreeSelectionPage extends BaseWizardSelectionPage { categoryTreeViewer.getTree().setFocus(); } + @Override public void selectionChanged(SelectionChangedEvent selectionEvent) { if (selectionEvent.getSelectionProvider().equals(categoryTreeViewer)) handleCategorySelection(selectionEvent); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/CategoryDefinitionWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/CategoryDefinitionWizardPage.java index 0e639c03be..d558016ef5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/CategoryDefinitionWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/CategoryDefinitionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -34,11 +34,13 @@ public class CategoryDefinitionWizardPage extends PDEWizardNewFileCreationPage { setFileName("category.xml"); //$NON-NLS-1$ } + @Override public void createControl(Composite parent) { super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.CATEGORY_FILE_PAGE); } + @Override protected void createAdvancedControls(Composite parent) { // do nothing } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryCreationOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryCreationOperation.java index 08ef35d2f3..a8fa32a875 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryCreationOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryCreationOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -38,6 +38,7 @@ public class NewCategoryCreationOperation extends WorkspaceModifyOperation { /* (non-Javadoc) * @see org.eclipse.ui.actions.WorkspaceModifyOperation#execute(org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { monitor.beginTask(PDEUIMessages.NewCategoryDefinitionWizard_creatingManifest, 2); @@ -69,6 +70,7 @@ public class NewCategoryCreationOperation extends WorkspaceModifyOperation { private void openFile(final IFile file) { fDisplay.asyncExec(new Runnable() { + @Override public void run() { IWorkbenchWindow ww = PDEPlugin.getActiveWorkbenchWindow(); if (ww == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryDefinitionWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryDefinitionWizard.java index 0776b188cd..5b1d22dba7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryDefinitionWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/category/NewCategoryDefinitionWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2009 EclipseSource and others. All rights reserved. This +* Copyright (c) 2009, 2015 EclipseSource 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 @@ -25,15 +25,18 @@ public class NewCategoryDefinitionWizard extends NewWizard implements IExecutabl private IConfigurationElement fConfig; private CategoryDefinitionWizardPage fPage; + @Override public void setInitializationData(IConfigurationElement config, String property, Object data) throws CoreException { this.fConfig = config; } + @Override public void addPages() { fPage = new CategoryDefinitionWizardPage("profile", getSelection()); //$NON-NLS-1$ addPage(fPage); } + @Override public boolean performFinish() { System.out.println(fConfig); @@ -52,6 +55,7 @@ public class NewCategoryDefinitionWizard extends NewWizard implements IExecutabl return true; } + @Override public void init(IWorkbench workbench, IStructuredSelection currentSelection) { super.init(workbench, currentSelection); setWindowTitle(PDEUIMessages.NewCategoryDefinitionWizard_title); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/AntGeneratingExportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/AntGeneratingExportWizard.java index 8d2b10952e..905d0577a4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/AntGeneratingExportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/AntGeneratingExportWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -46,6 +46,7 @@ public abstract class AntGeneratingExportWizard extends BaseExportWizard { protected BaseExportWizardPage fPage; + @Override public void addPages() { fPage = createPage1(); addPage(fPage); @@ -56,6 +57,7 @@ public abstract class AntGeneratingExportWizard extends BaseExportWizard { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.exports.BaseExportWizard#performPreliminaryChecks() */ + @Override protected boolean performPreliminaryChecks() { // Check if we are going to overwrite an existing build.xml file if (!MessageDialogWithToggle.ALWAYS.equals(PDEPlugin.getDefault().getPreferenceStore().getString(IPreferenceConstants.OVERWRITE_BUILD_FILES_ON_EXPORT))) { @@ -114,6 +116,7 @@ public abstract class AntGeneratingExportWizard extends BaseExportWizard { return true; } + @Override protected boolean confirmDelete() { if (!fPage.doExportToDirectory()) { File zipFile = new File(fPage.getDestination(), fPage.getFileName()); @@ -177,6 +180,7 @@ public abstract class AntGeneratingExportWizard extends BaseExportWizard { fLogLocation = logLocation; } + @Override protected Control createMessageArea(Composite composite) { Link link = new Link(composite, SWT.WRAP); try { @@ -188,6 +192,7 @@ public abstract class AntGeneratingExportWizard extends BaseExportWizard { data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); link.setLayoutData(data); link.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { try { Program.launch(fLogLocation.getCanonicalPath()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizard.java index 6671dda34f..2bc2f2c857 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public abstract class BaseExportWizard extends Wizard implements IExportWizard, setWindowTitle(PDEUIMessages.BaseExportWizard_wtitle); } + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); super.dispose(); @@ -53,10 +54,12 @@ public abstract class BaseExportWizard extends Wizard implements IExportWizard, protected abstract String getSettingsSectionName(); + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { fSelection = selection; } + @Override public boolean performFinish() { saveSettings(); if (!PlatformUI.getWorkbench().saveAllEditors(true)) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizardPage.java index c38a1abc0f..bda1f07e05 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/BaseExportWizardPage.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.exports;
import java.util.ArrayList;
@@ -43,6 +43,7 @@ public abstract class BaseExportWizardPage extends AbstractExportWizardPage { protected TabFolder fTabFolder;
class ExportListProvider extends DefaultContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(Object parent) {
return getListElements();
}
@@ -53,11 +54,13 @@ public abstract class BaseExportWizardPage extends AbstractExportWizardPage { super(label, buttonLabels);
}
+ @Override
public void updateCounter(int count) {
super.updateCounter(count);
pageChanged();
}
+ @Override
protected void buttonSelected(Button button, int index) {
switch (index) {
case 0 :
@@ -79,6 +82,7 @@ public abstract class BaseExportWizardPage extends AbstractExportWizardPage { setDescription(PDEUIMessages.ExportWizard_Plugin_description);
}
+ @Override
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
@@ -154,6 +158,7 @@ public abstract class BaseExportWizardPage extends AbstractExportWizardPage { viewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider());
viewer.setComparator(ListUtil.PLUGIN_COMPARATOR);
viewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
if (event.getSource() instanceof CheckboxTableViewer) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
@@ -218,6 +223,7 @@ public abstract class BaseExportWizardPage extends AbstractExportWizardPage { return fExportPart.getSelection();
}
+ @Override
protected void pageChanged() {
if (getMessage() != null)
setMessage(null);
@@ -252,6 +258,7 @@ public abstract class BaseExportWizardPage extends AbstractExportWizardPage { protected abstract IModel findModelFor(IAdaptable object);
+ @Override
protected void saveSettings(IDialogSettings settings) {
fDestinationTab.saveSettings(settings);
fOptionsTab.saveSettings(settings);
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/CrossPlatformExportPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/CrossPlatformExportPage.java index 0062562fbf..7f48300bd0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/CrossPlatformExportPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/CrossPlatformExportPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -57,6 +57,7 @@ public class CrossPlatformExportPage extends AbstractExportWizardPage { } class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { return getListElements(); } @@ -97,6 +98,7 @@ public class CrossPlatformExportPage extends AbstractExportWizardPage { fModel = model; } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(2, false)); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportDestinationTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportDestinationTab.java index e4b8e0547a..4f2730836b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportDestinationTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportDestinationTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -47,6 +47,7 @@ public class ExportDestinationTab extends AbstractExportTab { super(page); } + @Override public Control createControl(Composite parent) { Composite composite = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_HORIZONTAL); @@ -77,6 +78,7 @@ public class ExportDestinationTab extends AbstractExportTab { return composite; } + @Override protected void initialize(IDialogSettings settings) { String exportType = settings.get(S_EXPORT_TYPE); int exportTypeCode = 1; @@ -101,6 +103,7 @@ public class ExportDestinationTab extends AbstractExportTab { hookListeners(); } + @Override protected void initializeCombo(IDialogSettings settings, String key, Combo combo) { super.initializeCombo(settings, key, combo); if (!isValidLocation(combo.getText().trim())) // If default value is invalid, make it blank @@ -121,35 +124,41 @@ public class ExportDestinationTab extends AbstractExportTab { protected void hookListeners() { fArchiveFileButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateExportType(); fPage.pageChanged(); } }); fBrowseFile.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseFile(fArchiveCombo, new String[] {"*" + ZIP_EXTENSION}); //$NON-NLS-1$ } }); fArchiveCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } }); fDirectoryCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } }); fBrowseDirectory.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseDestination(fDirectoryCombo); } }); fInstallButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateExportType(); if (fInstallCombo.getText().trim().length() == 0 && fInstallCombo.getItemCount() > 0) { @@ -158,11 +167,13 @@ public class ExportDestinationTab extends AbstractExportTab { } }); fInstallCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } }); fBrowseInstall.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseDestination(fInstallCombo); } @@ -185,6 +196,7 @@ public class ExportDestinationTab extends AbstractExportTab { } } + @Override protected void saveSettings(IDialogSettings settings) { int type = fDirectoryButton.getSelection() ? 1 : 3; if (fArchiveFileButton.getSelection()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportOptionsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportOptionsTab.java index 5daf6bb600..b8aab9b51d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportOptionsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ExportOptionsTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -50,6 +50,7 @@ public class ExportOptionsTab extends AbstractExportTab { super(page); } + @Override protected Control createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); container.setLayout(new GridLayout()); @@ -87,6 +88,7 @@ public class ExportOptionsTab extends AbstractExportTab { fJarButton = new Button(comp, SWT.CHECK); fJarButton.setText(getJarButtonText()); fJarButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { } }); @@ -149,12 +151,14 @@ public class ExportOptionsTab extends AbstractExportTab { fQualifierText = new Text(comp, SWT.SINGLE | SWT.BORDER); fQualifierText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fQualifierText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } }); } + @Override protected void initialize(IDialogSettings settings) { fIncludeSourceButton.setSelection(settings.getBoolean(S_EXPORT_SOURCE)); fIncludeSourceCombo.setItems(new String[] {PDEUIMessages.ExportWizard_generateAssociatedSourceBundles, PDEUIMessages.ExportWizard_includeSourceInBinaryBundles}); @@ -174,6 +178,7 @@ public class ExportOptionsTab extends AbstractExportTab { hookListeners(); } + @Override protected void saveSettings(IDialogSettings settings) { settings.put(S_JAR_FORMAT, fJarButton.getSelection()); settings.put(S_EXPORT_SOURCE, fIncludeSourceButton.getSelection()); @@ -210,17 +215,20 @@ public class ExportOptionsTab extends AbstractExportTab { protected void hookListeners() { fIncludeSourceButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fIncludeSourceCombo.setEnabled(fIncludeSourceButton.getSelection()); } }); fJarButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { ((BaseExportWizardPage) fPage).adjustAdvancedTabsVisibility(); } }); fSaveAsAntButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fAntCombo.setEnabled(fSaveAsAntButton.getSelection()); fBrowseAnt.setEnabled(fSaveAsAntButton.getSelection()); @@ -229,23 +237,27 @@ public class ExportOptionsTab extends AbstractExportTab { }); fBrowseAnt.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseFile(fAntCombo, new String[] {"*.xml"}); //$NON-NLS-1$ } }); fAntCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fPage.pageChanged(); } }); fAntCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } }); fQualifierButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fQualifierText.setEnabled(fQualifierButton.getSelection()); fPage.pageChanged(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureDestinationTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureDestinationTab.java index 8e41f51bf0..ea8a49faea 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureDestinationTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureDestinationTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -19,9 +19,11 @@ public class FeatureDestinationTab extends ExportDestinationTab { super(page); } + @Override protected void hookListeners() { super.hookListeners(); fDirectoryButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { ((FeatureExportWizardPage) fPage).adjustJNLPTabVisibility(); fPage.pageChanged(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java index d2ec4d21c1..eba5474733 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizard.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.exports;
import java.io.File;
@@ -40,6 +40,7 @@ public class FeatureExportWizard extends AntGeneratingExportWizard { setDefaultPageImageDescriptor(PDEPluginImages.DESC_FEATURE_EXPORT_WIZ);
}
+ @Override
public void addPages() {
super.addPages();
FeatureModelManager manager = PDECore.getDefault().getFeatureModelManager();
@@ -50,14 +51,17 @@ public class FeatureExportWizard extends AntGeneratingExportWizard { }
}
+ @Override
protected BaseExportWizardPage createPage1() {
return new FeatureExportWizardPage(getSelection());
}
+ @Override
protected String getSettingsSectionName() {
return STORE_SECTION;
}
+ @Override
protected void scheduleExportJob() {
// NOTE: Any changes to the content here must also be copied to generateAntTask() and FeatureExportTask
final FeatureExportInfo info = new FeatureExportInfo();
@@ -94,12 +98,14 @@ public class FeatureExportWizard extends AntGeneratingExportWizard { job.setRule(ResourcesPlugin.getWorkspace().getRoot());
job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_FEATURE_OBJ);
job.addJobChangeListener(new JobChangeAdapter() {
+ @Override
public void done(IJobChangeEvent event) {
if (job.hasAntErrors()) {
// If there were errors when running the ant scripts, inform the user where the logs can be found.
final File logLocation = new File(info.destinationDirectory, "logs.zip"); //$NON-NLS-1$
if (logLocation.exists()) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
AntErrorDialog dialog = new AntErrorDialog(logLocation);
dialog.open();
@@ -118,6 +124,7 @@ public class FeatureExportWizard extends AntGeneratingExportWizard { job.schedule();
}
+ @Override
protected Document generateAntTask() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java index eae0e1c286..6135b7a3d2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureExportWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -36,23 +36,28 @@ public class FeatureExportWizardPage extends BaseExportWizardPage { setTitle(PDEUIMessages.ExportWizard_Feature_pageTitle); } + @Override protected Object getInput() { return PDECore.getDefault().getFeatureModelManager(); } + @Override public Object[] getListElements() { FeatureModelManager manager = PDECore.getDefault().getFeatureModelManager(); return manager.getWorkspaceModels(); } + @Override protected void hookHelpContext(Control control) { PlatformUI.getWorkbench().getHelpSystem().setHelp(control, IHelpContextIds.FEATURE_EXPORT_WIZARD); } + @Override protected boolean isValidModel(IModel model) { return model instanceof IFeatureModel; } + @Override protected void createTabs(TabFolder folder, IDialogSettings settings) { super.createTabs(folder, settings); if (fDestinationTab.doExportToDirectory() && fOptionsTab.useJARFormat()) { @@ -61,6 +66,7 @@ public class FeatureExportWizardPage extends BaseExportWizardPage { } } + @Override protected void createDestinationTab(TabFolder folder) { fDestinationTab = new FeatureDestinationTab(this); TabItem item = new TabItem(folder, SWT.NONE); @@ -68,6 +74,7 @@ public class FeatureExportWizardPage extends BaseExportWizardPage { item.setText(PDEUIMessages.ExportWizard_destination); } + @Override protected void createOptionsTab(TabFolder folder) { fOptionsTab = new FeatureOptionsTab(this); TabItem item = new TabItem(folder, SWT.NONE); @@ -82,6 +89,7 @@ public class FeatureExportWizardPage extends BaseExportWizardPage { item.setText(PDEUIMessages.AdvancedFeatureExportPage_jnlp); } + @Override protected IModel findModelFor(IAdaptable object) { IProject project = (IProject) object.getAdapter(IProject.class); if (project != null) @@ -89,12 +97,14 @@ public class FeatureExportWizardPage extends BaseExportWizardPage { return null; } + @Override protected void saveSettings(IDialogSettings settings) { super.saveSettings(settings); if (fJNLPTab != null) fJNLPTab.saveSettings(settings); } + @Override protected String validateTabs() { String message = super.validateTabs(); if (message == null && fTabFolder.getItemCount() > 3) @@ -102,6 +112,7 @@ public class FeatureExportWizardPage extends BaseExportWizardPage { return message; } + @Override protected void adjustAdvancedTabsVisibility() { adjustJARSigningTabVisibility(); adjustJNLPTabVisibility(); @@ -154,6 +165,7 @@ public class FeatureExportWizardPage extends BaseExportWizardPage { return null; } + @Override public IWizardPage getNextPage() { return doMultiPlatform() ? getWizard().getNextPage(this) : null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java index 3ce56dc870..bbcef4fb86 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/FeatureOptionsTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -55,6 +55,7 @@ public class FeatureOptionsTab extends ExportOptionsTab { super(shell, multi, container, typesMask); addListFilter(new ViewerFilter() { + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { IResource resource = (IResource) element; if (resource != null && resource instanceof IFile) { @@ -70,6 +71,7 @@ public class FeatureOptionsTab extends ExportOptionsTab { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.FilteredResourcesSelectionDialog#validateItem(java.lang.Object) */ + @Override protected IStatus validateItem(Object item) { if (item instanceof IResource) { IResource resource = (IResource) item; @@ -96,8 +98,10 @@ public class FeatureOptionsTab extends ExportOptionsTab { super(page); } + @Override protected void addAdditionalOptions(Composite comp) { fJarButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fExportMetadata.setEnabled(fJarButton.getSelection()); fCategoryButton.setEnabled(fExportMetadata.getSelection() && fJarButton.getSelection()); @@ -143,6 +147,7 @@ public class FeatureOptionsTab extends ExportOptionsTab { } + @Override protected String getJarButtonText() { return PDEUIMessages.BaseExportWizardPage_fPackageJARs; } @@ -170,6 +175,7 @@ public class FeatureOptionsTab extends ExportOptionsTab { return doExportMetadata() && fCategoryButton.getSelection() && fCategoryCombo.getText().trim().length() > 0; } + @Override protected void initialize(IDialogSettings settings) { super.initialize(settings); if (fMultiPlatform != null) { @@ -201,6 +207,7 @@ public class FeatureOptionsTab extends ExportOptionsTab { updateCategoryGeneration(); } + @Override protected void saveSettings(IDialogSettings settings) { super.saveSettings(settings); if (fMultiPlatform != null) { @@ -211,10 +218,12 @@ public class FeatureOptionsTab extends ExportOptionsTab { settings.put(S_CATEGORY_FILE, fCategoryCombo.getText()); } + @Override protected void hookListeners() { super.hookListeners(); if (fMultiPlatform != null) { fMultiPlatform.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fPage.pageChanged(); } @@ -222,18 +231,21 @@ public class FeatureOptionsTab extends ExportOptionsTab { } fExportMetadata.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fCategoryButton.setEnabled(fExportMetadata.getSelection() && fJarButton.getSelection()); updateCategoryGeneration(); } }); fCategoryButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateCategoryGeneration(); } }); fCategoryBrowse.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { openFile(fCategoryCombo); } @@ -249,6 +261,7 @@ public class FeatureOptionsTab extends ExportOptionsTab { return fMultiPlatform != null && fMultiPlatform.getSelection(); } + @Override protected void setEnabledForInstall(boolean enabled) { super.setEnabledForInstall(enabled); fExportMetadata.setEnabled(enabled); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JARSigningTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JARSigningTab.java index 36545d2669..ba5668453b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JARSigningTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JARSigningTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -61,6 +61,7 @@ public class JARSigningTab { gd.horizontalSpan = 3; fButton.setLayoutData(gd); fButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateGroup(fButton.getSelection()); fPage.pageChanged(); @@ -75,6 +76,7 @@ public class JARSigningTab { fBrowseButton.setLayoutData(new GridData()); SWTUtil.setButtonDimensionHint(fBrowseButton); fBrowseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { FileDialog dialog = new FileDialog(fPage.getShell(), SWT.OPEN); String path = fKeystoreText.getText(); @@ -133,6 +135,7 @@ public class JARSigningTab { gd.horizontalSpan = span; text.setLayoutData(gd); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JNLPTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JNLPTab.java index 311aeb7cbe..47e48aa96a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JNLPTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/JNLPTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -48,6 +48,7 @@ public class JNLPTab { gd.horizontalSpan = 2; fButton.setLayoutData(gd); fButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateGroup(fButton.getSelection()); fPage.pageChanged(); @@ -77,6 +78,7 @@ public class JNLPTab { Text text = new Text(parent, SWT.SINGLE | SWT.BORDER); text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizard.java index fe92884d68..66a1105661 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizard.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.exports;
import java.io.File;
@@ -32,14 +32,17 @@ public class PluginExportWizard extends AntGeneratingExportWizard { setDefaultPageImageDescriptor(PDEPluginImages.DESC_PLUGIN_EXPORT_WIZ);
}
+ @Override
protected BaseExportWizardPage createPage1() {
return new PluginExportWizardPage(getSelection());
}
+ @Override
protected String getSettingsSectionName() {
return STORE_SECTION;
}
+ @Override
protected void scheduleExportJob() {
// NOTE: Any changes to the content here must also be copied to generateAntTask() and PluginExportTask
final FeatureExportInfo info = new FeatureExportInfo();
@@ -65,12 +68,14 @@ public class PluginExportWizard extends AntGeneratingExportWizard { job.setRule(ResourcesPlugin.getWorkspace().getRoot());
job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_PLUGIN_OBJ);
job.addJobChangeListener(new JobChangeAdapter() {
+ @Override
public void done(IJobChangeEvent event) {
if (job.hasAntErrors()) {
// If there were errors when running the ant scripts, inform the user where the logs can be found.
final File logLocation = new File(info.destinationDirectory, "logs.zip"); //$NON-NLS-1$
if (logLocation.exists()) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
AntErrorDialog dialog = new AntErrorDialog(logLocation);
dialog.open();
@@ -89,6 +94,7 @@ public class PluginExportWizard extends AntGeneratingExportWizard { job.schedule();
}
+ @Override
protected Document generateAntTask() {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizardPage.java index 0b6e211faa..965900afe6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/PluginExportWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,10 +35,12 @@ public class PluginExportWizardPage extends BaseExportWizardPage { setTitle(PDEUIMessages.ExportWizard_Plugin_pageTitle); } + @Override protected Object getInput() { return PDECore.getDefault().getModelManager(); } + @Override public Object[] getListElements() { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); ArrayList<IModel> result = new ArrayList<IModel>(); @@ -53,6 +55,7 @@ public class PluginExportWizardPage extends BaseExportWizardPage { return result.toArray(); } + @Override protected void hookHelpContext(Control control) { PlatformUI.getWorkbench().getHelpSystem().setHelp(control, IHelpContextIds.PLUGIN_EXPORT_WIZARD); } @@ -65,6 +68,7 @@ public class PluginExportWizardPage extends BaseExportWizardPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.exports.BaseExportWizardPage#isValidModel(org.eclipse.pde.core.IModel) */ + @Override protected boolean isValidModel(IModel model) { return model != null && model instanceof IPluginModelBase; } @@ -72,6 +76,7 @@ public class PluginExportWizardPage extends BaseExportWizardPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.exports.BaseExportWizardPage#findModelFor(org.eclipse.core.runtime.IAdaptable) */ + @Override protected IModel findModelFor(IAdaptable object) { if (object instanceof IJavaProject) object = ((IJavaProject) object).getProject(); @@ -90,6 +95,7 @@ public class PluginExportWizardPage extends BaseExportWizardPage { return getSelectedItems().length <= 1; } + @Override protected void adjustAdvancedTabsVisibility() { adjustJARSigningTabVisibility(); pageChanged(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductConfigurationSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductConfigurationSection.java index 4fa69ee708..1915a3f164 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductConfigurationSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductConfigurationSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -57,6 +57,7 @@ public class ProductConfigurationSection { browse.setText(PDEUIMessages.ProductExportWizardPage_browse); browse.setLayoutData(new GridData()); browse.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleBrowse(); } @@ -98,6 +99,7 @@ public class ProductConfigurationSection { protected void hookListeners() { fProductCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { updateProductFields(); fPage.pageChanged(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductDestinationGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductDestinationGroup.java index a6be29d06c..5279a078ac 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductDestinationGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductDestinationGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -43,6 +43,7 @@ public class ProductDestinationGroup extends AbstractExportTab { super(page); } + @Override public Control createControl(Composite parent) { Group group = new Group(parent, SWT.NONE); group.setText(PDEUIMessages.ExportWizard_destination); @@ -74,6 +75,7 @@ public class ProductDestinationGroup extends AbstractExportTab { return group; } + @Override protected void initialize(IDialogSettings settings) { initialize(settings, null); } @@ -97,6 +99,7 @@ public class ProductDestinationGroup extends AbstractExportTab { } } + @Override protected void initializeCombo(IDialogSettings settings, String key, Combo combo) { super.initializeCombo(settings, key, combo); if (!isValidLocation(combo.getText().trim())) // If default value is invalid, make it blank @@ -135,6 +138,7 @@ public class ProductDestinationGroup extends AbstractExportTab { protected void hookListeners() { fArchiveFileButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { toggleDestinationGroup(!fArchiveFileButton.getSelection()); fPage.pageChanged(); @@ -142,24 +146,28 @@ public class ProductDestinationGroup extends AbstractExportTab { }); fBrowseFile.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseFile(fArchiveCombo, new String[] {"*" + ZIP_EXTENSION, "*" + WAR_EXTENSION}); //$NON-NLS-1$ //$NON-NLS-2$ } }); fArchiveCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } }); fDirectoryCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fPage.pageChanged(); } }); fBrowseDirectory.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseDestination(); } @@ -169,6 +177,7 @@ public class ProductDestinationGroup extends AbstractExportTab { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.exports.AbstractExportTab#saveSettings(org.eclipse.jface.dialogs.IDialogSettings) */ + @Override protected void saveSettings(IDialogSettings settings) { settings.put(S_EXPORT_DIRECTORY, fDirectoryButton.getSelection()); saveCombo(settings, S_DESTINATION, fDirectoryCombo); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizard.java index 422c0f815a..c8d9142bca 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizard.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.exports;
import java.io.File;
@@ -50,6 +50,7 @@ public class ProductExportWizard extends BaseExportWizard { fProject = project;
}
+ @Override
public void addPages() {
fPage = new ProductExportWizardPage(getSelection());
addPage(fPage);
@@ -61,10 +62,12 @@ public class ProductExportWizard extends BaseExportWizard { }
}
+ @Override
protected String getSettingsSectionName() {
return STORE_SECTION;
}
+ @Override
protected void scheduleExportJob() {
FeatureExportInfo info = new FeatureExportInfo();
info.toDirectory = fPage.doExportToDirectory();
@@ -122,6 +125,7 @@ public class ProductExportWizard extends BaseExportWizard { return list.toArray(new BundleDescription[list.size()]);
}
+ @Override
protected boolean performPreliminaryChecks() {
fProductModel = new WorkspaceProductModel(fPage.getProductFile(), false);
try {
@@ -148,6 +152,7 @@ public class ProductExportWizard extends BaseExportWizard { return true;
}
+ @Override
protected boolean confirmDelete() {
if (!fPage.doExportToDirectory()) {
File zipFile = new File(fPage.getDestination(), fPage.getFileName());
@@ -160,6 +165,7 @@ public class ProductExportWizard extends BaseExportWizard { return true;
}
+ @Override
public boolean canFinish() {
return (fPage.getNextPage() != null) ? super.canFinish() : fPage.isPageComplete();
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java index 536970f3dc..8c9b6cbc70 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/ProductExportWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -52,6 +52,7 @@ public class ProductExportWizardPage extends AbstractExportWizardPage { setDescription(PDEUIMessages.ProductExportWizardPage_desc); } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -130,6 +131,7 @@ public class ProductExportWizardPage extends AbstractExportWizardPage { fMultiPlatform = new Button(group, SWT.CHECK); fMultiPlatform.setText(PDEUIMessages.ExportWizard_multi_platform); fMultiPlatform.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { getContainer().updateButtons(); } @@ -169,6 +171,7 @@ public class ProductExportWizardPage extends AbstractExportWizardPage { protected void hookListeners() { fExportSourceButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fExportSourceCombo.setEnabled(fExportSourceButton.getSelection()); } @@ -179,6 +182,7 @@ public class ProductExportWizardPage extends AbstractExportWizardPage { fExportGroup.updateDestination(fConfigurationGroup.getProductFile()); } + @Override protected void pageChanged() { if (getMessage() != null) setMessage(null); @@ -192,6 +196,7 @@ public class ProductExportWizardPage extends AbstractExportWizardPage { setPageComplete(error == null); } + @Override public IWizardPage getNextPage() { return doMultiPlatform() ? getWizard().getNextPage(this) : null; } @@ -200,6 +205,7 @@ public class ProductExportWizardPage extends AbstractExportWizardPage { PlatformUI.getWorkbench().getHelpSystem().setHelp(control, IHelpContextIds.PRODUCT_EXPORT_WIZARD); } + @Override protected void saveSettings(IDialogSettings settings) { fConfigurationGroup.saveSettings(settings); settings.put(S_SYNC_PRODUCT, fSyncButton.getSelection()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizard.java index f28ca5ef5c..49f0a5a1f9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2013 EclipseSource Corporation and others. + * Copyright (c) 2010, 2015 EclipseSource 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 @@ -67,6 +67,7 @@ public class TargetDefinitionExportWizard extends Wizard implements IExportWizar /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#addPages() */ + @Override public void addPages() { IDialogSettings settings = PDEPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION); if (settings == null) { @@ -81,6 +82,7 @@ public class TargetDefinitionExportWizard extends Wizard implements IExportWizar /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#performFinish() */ + @Override public boolean performFinish() { fPage.storeSettings(); String destDir = fPage.getDestinationDirectory(); @@ -96,6 +98,7 @@ public class TargetDefinitionExportWizard extends Wizard implements IExportWizar /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizardPage.java index 0363d37144..22b0011779 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/exports/TargetDefinitionExportWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 EclipseSource Corporation and others. + * Copyright (c) 2010, 2015 EclipseSource 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 @@ -62,6 +62,7 @@ public class TargetDefinitionExportWizardPage extends WizardPage { setMessage(PDEUIMessages.ExportActiveTargetDefinition_message); } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, false); @@ -86,6 +87,7 @@ public class TargetDefinitionExportWizardPage extends WizardPage { fDestinationCombo = SWTFactory.createCombo(parent, SWT.BORDER, 1, null); fDestinationCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { controlChanged(); } @@ -94,6 +96,7 @@ public class TargetDefinitionExportWizardPage extends WizardPage { fBrowseButton = new Button(parent, SWT.PUSH); fBrowseButton.setText(PDEUIMessages.ExportTargetBrowse); fBrowseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { DirectoryDialog dialog = new DirectoryDialog(getShell()); dialog.setText(PDEUIMessages.ExportTargetSelectDestination); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/BaseExtensionPointMainPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/BaseExtensionPointMainPage.java index 2ccf8f1158..17176b0414 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/BaseExtensionPointMainPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/BaseExtensionPointMainPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -66,6 +66,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { fContainer = container; } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -84,6 +85,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { gd.widthHint = 275; fPluginIdText.setLayoutData(gd); fPluginIdText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -96,6 +98,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { fPluginBrowseButton.setText(PDEUIMessages.BaseExtensionPointMainPage_pluginBrowse); fPluginBrowseButton.setToolTipText(PDEUIMessages.BaseExtensionPointMainPage_pluginId_tooltip); fPluginBrowseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handlePluginBrowse(); } @@ -109,6 +112,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { gd.horizontalSpan = 2; fIdText.setLayoutData(gd); fIdText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // setting the text will trigger validation // do not implicitly validate here @@ -122,6 +126,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { gd.horizontalSpan = 2; fNameText.setLayoutData(gd); fNameText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -135,6 +140,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { gd.grabExcessHorizontalSpace = true; fSchemaLocationText.setLayoutData(gd); fSchemaLocationText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -146,6 +152,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { fFindLocationButton.setText(PDEUIMessages.BaseExtensionPointMainPage_findBrowse); fFindLocationButton.setToolTipText(PDEUIMessages.BaseExtensionPointMainPage_schemaLocation_tooltip); fFindLocationButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleSchemaLocation(); } @@ -159,6 +166,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { gd.horizontalSpan = 2; fSchemaText.setLayoutData(gd); fSchemaText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -280,10 +288,12 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { final String schema = fSchemaText.getText(); final boolean shared = fSharedSchemaButton != null ? fSharedSchemaButton.getSelection() : false; IRunnableWithProgress operation = new WorkspaceModifyOperation() { + @Override public void execute(final IProgressMonitor monitor) { try { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { String schemaName = schema; if (!schema.endsWith(".exsd")) //$NON-NLS-1$ @@ -354,6 +364,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { final IWorkbenchWindow ww = PDEPlugin.getActiveWorkbenchWindow(); Display d = ww.getShell().getDisplay(); d.asyncExec(new Runnable() { + @Override public void run() { try { String editorId = IPDEUIConstants.SCHEMA_EDITOR_ID; @@ -437,6 +448,7 @@ public abstract class BaseExtensionPointMainPage extends WizardPage { dialog.setDoubleClickSelects(false); dialog.setAllowMultiple(false); dialog.addFilter(new ViewerFilter() { + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (element instanceof IFile) return false; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorSelectionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorSelectionPage.java index 9719f56a0b..5cff2bdd78 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorSelectionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -46,8 +46,10 @@ public class ExtensionEditorSelectionPage extends WizardListSelectionPage { this.fSelection = selection; } + @Override protected IWizardNode createWizardNode(WizardElement element) { return new WizardNode(this, element) { + @Override public IBasePluginWizard createWizard() throws CoreException { IExtensionEditorWizard wizard = createWizard(wizardElement); wizard.init(fProject, fPluginBase.getPluginModel(), fSelection); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorWizard.java index ebf08547dc..e3e9f7ad63 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionEditorWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -37,6 +37,7 @@ public class ExtensionEditorWizard extends Wizard { loadWizardCollection(); } + @Override public void addPages() { pointPage = new ExtensionEditorSelectionPage(wizards); pointPage.init(project, model.getPluginBase(), selection); @@ -48,10 +49,12 @@ public class ExtensionEditorWizard extends Wizard { wizards = reader.readRegistry(PDEPlugin.getPluginId(), PLUGIN_POINT, true); } + @Override public boolean performFinish() { return true; } + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionTreeSelectionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionTreeSelectionPage.java index 1ba95be4d4..a3d0c63498 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionTreeSelectionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/ExtensionTreeSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,8 +43,10 @@ public class ExtensionTreeSelectionPage extends WizardTreeSelectionPage { this.fPluginBase = pluginBase; } + @Override protected IWizardNode createWizardNode(WizardElement element) { return new WizardNode(this, element) { + @Override public IBasePluginWizard createWizard() throws CoreException { IExtensionWizard wizard = createWizard(wizardElement); wizard.init(fProject, fPluginBase.getPluginModel()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointMainPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointMainPage.java index ba8771c0e5..8b5bac842a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointMainPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointMainPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -38,6 +38,7 @@ public class NewExtensionPointMainPage extends BaseExtensionPointMainPage { setDescription(PDEUIMessages.NewExtensionPointWizard_desc); } + @Override protected boolean isPluginIdFinal() { return true; } @@ -77,10 +78,12 @@ public class NewExtensionPointMainPage extends BaseExtensionPointMainPage { return true; } + @Override public String getPluginId() { return fModel.getPluginBase().getId(); } + @Override protected void initializeValues() { if (fPoint == null) return; @@ -92,6 +95,7 @@ public class NewExtensionPointMainPage extends BaseExtensionPointMainPage { fSchemaText.setText(fPoint.getSchema()); } + @Override protected String validateFieldContents() { String message = validateExtensionPointID(); if (message != null) @@ -108,6 +112,7 @@ public class NewExtensionPointMainPage extends BaseExtensionPointMainPage { return null; } + @Override protected String validateExtensionPointSchema() { // Do not validate "Extension Point Schema" Field return null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointWizard.java index d82d3102b0..762eabb395 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionPointWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,11 +43,13 @@ public class NewExtensionPointWizard extends NewWizard { setNeedsProgressMonitor(true); } + @Override public void addPages() { mainPage = new NewExtensionPointMainPage(project, model, point); addPage(mainPage); } + @Override public boolean performFinish() { if (editor != null) editor.ensurePluginContextPresence(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionWizard.java index 4caf36fd96..5e7a1b8d46 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewExtensionWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ public class NewExtensionWizard extends NewWizard { loadWizardCollection(); } + @Override public void addPages() { fPointPage = new PointSelectionPage(fProject, fModel, fWizardCollection, getTemplates(), this); addPage(fPointPage); @@ -65,6 +66,7 @@ public class NewExtensionWizard extends NewWizard { } } + @Override public boolean performFinish() { fPointPage.checkModel(); if (fPointPage.canFinish()) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileMainPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileMainPage.java index f89d60db77..d23816605c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileMainPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileMainPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -57,18 +57,22 @@ public class NewSchemaFileMainPage extends BaseExtensionPointMainPage { return true; } + @Override protected boolean isPluginIdNeeded() { return true; } + @Override protected boolean isPluginIdFinal() { return isPluginIdFinal; } + @Override protected boolean isSharedSchemaSwitchNeeded() { return true; } + @Override public void initializeValues() { if (fContainer != null) { fPluginIdText.setText(fContainer.getProject().getName()); @@ -88,6 +92,7 @@ public class NewSchemaFileMainPage extends BaseExtensionPointMainPage { fPluginBrowseButton.setEnabled(!isPluginIdFinal); } + @Override protected String validateFieldContents() { String message = validatePluginID(); if (message != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileWizard.java index b26bc7b341..ef291d02e9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/NewSchemaFileWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -45,6 +45,7 @@ public class NewSchemaFileWizard extends Wizard implements INewWizard { setNeedsProgressMonitor(true); } + @Override public void addPages() { mainPage = new NewSchemaFileMainPage(container, point, isPluginIdFinal); addPage(mainPage); @@ -58,6 +59,7 @@ public class NewSchemaFileWizard extends Wizard implements INewWizard { return section; } + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { Object sel = selection.getFirstElement(); if (sel instanceof IJavaProject) { @@ -66,6 +68,7 @@ public class NewSchemaFileWizard extends Wizard implements INewWizard { container = (IContainer) sel; } + @Override public boolean performFinish() { return mainPage.finish(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/PointSelectionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/PointSelectionPage.java index d5a007a1d5..a438f7d51c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/PointSelectionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/extension/PointSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -78,6 +78,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { private Browser fPointDescBrowser; class PointFilter extends ViewerFilter { + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { if (!fFilterCheck.getSelection()) return true; @@ -100,6 +101,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { wMatch = match + "*"; //$NON-NLS-1$ } + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { String text = ((PointLabelProvider) fPointListViewer.getLabelProvider()).getColumnText(element, 0); Pattern pattern = null; @@ -113,6 +115,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { } class TemplateContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof IPluginExtensionPoint) { IPluginExtensionPoint point = (IPluginExtensionPoint) inputElement; @@ -135,6 +138,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { } class PointContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { ArrayList<IPluginExtensionPoint> extPoints = new ArrayList<IPluginExtensionPoint>(); IPluginModelBase[] plugins = PluginRegistry.getActiveModels(); @@ -156,10 +160,12 @@ public class PointSelectionPage extends BaseWizardSelectionPage { } class PointLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getText(Object obj) { return getColumnText(obj, 0); } + @Override public String getColumnText(Object obj, int index) { IPluginExtensionPoint extPoint = (IPluginExtensionPoint) obj; PDELabelProvider provider = PDEPlugin.getDefault().getLabelProvider(); @@ -169,10 +175,12 @@ public class PointSelectionPage extends BaseWizardSelectionPage { return IdUtil.getFullId(extPoint, fModel); } + @Override public Image getImage(Object obj) { return getColumnImage(obj, 0); } + @Override public Image getColumnImage(Object obj, int index) { IPluginExtensionPoint exp = (IPluginExtensionPoint) obj; @@ -206,6 +214,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { setDescription(PDEUIMessages.NewExtensionWizard_PointSelectionPage_desc); } + @Override public void createControl(Composite parent) { // tab folder final TabFolder tabFolder = new TabFolder(parent, SWT.FLAT); @@ -215,6 +224,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { secondTab.setText(PDEUIMessages.PointSelectionPage_tab2); secondTab.setControl(createWizardsPage(tabFolder)); tabFolder.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateTabSelection(tabFolder.getSelectionIndex()); } @@ -248,17 +258,20 @@ public class PointSelectionPage extends BaseWizardSelectionPage { fFilterText = new Text(labelContainer, SWT.BORDER); fFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fFilterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fWildCardFilter.setMatchText(fFilterText.getText()); fPointListViewer.refresh(); } }); fFilterText.addKeyListener(new KeyListener() { + @Override public void keyPressed(KeyEvent e) { if (e.keyCode == SWT.ARROW_DOWN) fPointListViewer.getControl().setFocus(); } + @Override public void keyReleased(KeyEvent e) { } }); @@ -269,6 +282,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { fFilterCheck.setLayoutData(gd); fFilterCheck.setSelection(true); fFilterCheck.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fPointListViewer.refresh(); } @@ -279,6 +293,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { fPointListViewer.setLabelProvider(new PointLabelProvider()); fPointListViewer.addSelectionChangedListener(this); fPointListViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { if (canFinish()) { fWizard.performFinish(); @@ -305,6 +320,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { fDescLink = new Link(templateComposite, SWT.NONE); fDescLink.setText(NLS.bind(PDEUIMessages.PointSelectionPage_extPointDesc, "")); //$NON-NLS-1$ fDescLink.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (fCurrentPoint != null) new ShowDescriptionAction(fCurrentPoint, true).run(); @@ -360,6 +376,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { if (selection != null && selection.length > 0) fTemplateViewer.setInput(selection[0]); fTemplateViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { if (canFlipToNextPage()) { advanceToNextPage(); @@ -395,6 +412,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { getContainer().showPage(getNextPage()); } + @Override public boolean canFlipToNextPage() { return getNextPage() != null; } @@ -419,6 +437,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { return false; } + @Override public void dispose() { fWizardsPage.dispose(); super.dispose(); @@ -477,6 +496,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { fPointListViewer.getTable().setFocus(); } + @Override public void selectionChanged(SelectionChangedEvent event) { ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection) { @@ -571,8 +591,10 @@ public class PointSelectionPage extends BaseWizardSelectionPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.BaseWizardSelectionPage#createWizardNode(org.eclipse.pde.internal.ui.wizards.WizardElement) */ + @Override protected IWizardNode createWizardNode(WizardElement element) { return new WizardNode(this, element) { + @Override public IBasePluginWizard createWizard() throws CoreException { IExtensionWizard wizard = createWizard(wizardElement); if (wizard == null) @@ -608,6 +630,7 @@ public class PointSelectionPage extends BaseWizardSelectionPage { } } + @Override public void setVisible(boolean visible) { if (visible) fFilterText.setFocus(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractCreateFeatureOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractCreateFeatureOperation.java index f064d462ca..900bdded82 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractCreateFeatureOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractCreateFeatureOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -49,6 +49,7 @@ public abstract class AbstractCreateFeatureOperation extends WorkspaceModifyOper fShell = shell; } + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { try { createFeature(monitor); @@ -189,6 +190,7 @@ public abstract class AbstractCreateFeatureOperation extends WorkspaceModifyOper if (activePart instanceof ISetSelectionTarget) { fShell.getDisplay().asyncExec(new Runnable() { + @Override public void run() { ((ISetSelectionTarget) activePart).selectReveal(selection); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractFeatureSpecPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractFeatureSpecPage.java index 9fbbdaf580..4dad97ed12 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractFeatureSpecPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractFeatureSpecPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -41,6 +41,7 @@ public abstract class AbstractFeatureSpecPage extends WizardNewProjectCreationPa super("specPage"); //$NON-NLS-1$ } + @Override public void createControl(Composite parent) { super.createControl(parent); Composite comp = (Composite) getControl(); @@ -85,6 +86,7 @@ public abstract class AbstractFeatureSpecPage extends WizardNewProjectCreationPa protected abstract void updateNameRelativeFields(); + @Override protected boolean validatePage() { boolean valid = super.validatePage(); if (!valid) @@ -169,6 +171,7 @@ public abstract class AbstractFeatureSpecPage extends WizardNewProjectCreationPa private void attachListeners() { ModifyListener listener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (!fSelfModification) { fUpdateName = false; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractNewFeatureWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractNewFeatureWizard.java index 5e2d55012f..d8c41d0564 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractNewFeatureWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/AbstractNewFeatureWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -40,14 +40,17 @@ public abstract class AbstractNewFeatureWizard extends NewWizard implements IExe super(); } + @Override public String getProjectName() { return fSpecPage.getProjectName(); } + @Override public IProject getProject() { return fSpecPage.getProjectHandle(); } + @Override public IPath getLocationPath() { return fSpecPage.getLocationPath(); } @@ -79,6 +82,7 @@ public abstract class AbstractNewFeatureWizard extends NewWizard implements IExe setNeedsProgressMonitor(true); } + @Override public void addPages() { fSpecPage = createFirstPage(); String pname = getDefaultValue(DEF_PROJECT_NAME); @@ -94,6 +98,7 @@ public abstract class AbstractNewFeatureWizard extends NewWizard implements IExe protected abstract AbstractFeatureSpecPage createFirstPage(); + @Override public boolean canFinish() { IWizardPage page = getContainer().getCurrentPage(); return ((page == fSpecPage && page.isPageComplete()) || (page == fSecondPage && page.isPageComplete())); @@ -102,6 +107,7 @@ public abstract class AbstractNewFeatureWizard extends NewWizard implements IExe // get creation operation protected abstract IRunnableWithProgress getOperation(); + @Override public boolean performFinish() { try { IDialogSettings settings = getDialogSettings(); @@ -120,6 +126,7 @@ public abstract class AbstractNewFeatureWizard extends NewWizard implements IExe return true; } + @Override public void setInitializationData(IConfigurationElement config, String property, Object data) throws CoreException { this.fConfig = config; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/BasePluginListPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/BasePluginListPage.java index 62d035bfcf..f5931d669b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/BasePluginListPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/BasePluginListPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,15 +43,18 @@ public class BasePluginListPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { } + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); } + @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeaturePatchOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeaturePatchOperation.java index cee4999384..7bf73475cd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeaturePatchOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeaturePatchOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -27,6 +27,7 @@ public class CreateFeaturePatchOperation extends AbstractCreateFeatureOperation fFeatureModel = featureModel; } + @Override protected void configureFeature(IFeature feature, WorkspaceFeatureModel model) throws CoreException { FeatureImport featureImport = (FeatureImport) model.getFactory().createImport(); if (fFeatureModel != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java index d4dbcb49f7..b61ccefb0f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectFromLaunchOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -37,6 +37,7 @@ public class CreateFeatureProjectFromLaunchOperation extends CreateFeatureProjec fLaunchConfig = launchConfig; } + @Override protected void configureFeature(IFeature feature, WorkspaceFeatureModel model) throws CoreException { fPlugins = getPlugins(); super.configureFeature(feature, model); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java index e445caccc4..f39da6e02a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/CreateFeatureProjectOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class CreateFeatureProjectOperation extends AbstractCreateFeatureOperatio fPlugins = plugins != null ? plugins : new IPluginBase[0]; } + @Override protected void configureFeature(IFeature feature, WorkspaceFeatureModel model) throws CoreException { IFeaturePlugin[] added = new IFeaturePlugin[fPlugins.length]; for (int i = 0; i < fPlugins.length; i++) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/FeatureSpecPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/FeatureSpecPage.java index 486df39c9c..91159b819c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/FeatureSpecPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/FeatureSpecPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,6 +33,7 @@ public class FeatureSpecPage extends AbstractFeatureSpecPage { setDescription(PDEUIMessages.NewFeatureWizard_SpecPage_desc); } + @Override protected void initialize() { String projectName = getProjectName(); if (fInitialId == null) @@ -43,6 +44,7 @@ public class FeatureSpecPage extends AbstractFeatureSpecPage { setMessage(PDEUIMessages.NewFeatureWizard_MainPage_desc); } + @Override public FeatureData getFeatureData() { FeatureData data = new FeatureData(); data.id = fFeatureIdText.getText(); @@ -53,15 +55,18 @@ public class FeatureSpecPage extends AbstractFeatureSpecPage { return data; } + @Override protected String validateContent() { setMessage(null); return null; } + @Override protected String getHelpId() { return IHelpContextIds.NEW_FEATURE_DATA; } + @Override protected void createContents(Composite container) { Group group = new Group(container, SWT.NULL); group.setLayout(new GridLayout(2, false)); @@ -86,15 +91,18 @@ public class FeatureSpecPage extends AbstractFeatureSpecPage { createInstallHandlerText(group); } + @Override protected void attachListeners(ModifyListener listener) { fFeatureProviderCombo.addModifyListener(listener); fFeatureIdText.addModifyListener(listener); } + @Override protected String getFeatureId() { return fFeatureIdText.getText(); } + @Override protected void updateNameRelativeFields() { if (fFeatureIdText == null || fFeatureNameText == null) return; @@ -111,6 +119,7 @@ public class FeatureSpecPage extends AbstractFeatureSpecPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.feature.AbstractFeatureSpecPage#saveSettings(org.eclipse.jface.dialogs.IDialogSettings) */ + @Override protected void saveSettings(IDialogSettings settings) { BundleProviderHistoryUtil.saveHistory(fFeatureProviderCombo, settings); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/NewFeaturePatchWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/NewFeaturePatchWizard.java index d779f0512b..0dfc1279f5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/NewFeaturePatchWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/NewFeaturePatchWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -22,10 +22,12 @@ public class NewFeaturePatchWizard extends AbstractNewFeatureWizard { setWindowTitle(PDEUIMessages.FeaturePatch_wtitle); } + @Override protected AbstractFeatureSpecPage createFirstPage() { return new PatchSpecPage(); } + @Override protected IRunnableWithProgress getOperation() { return new CreateFeaturePatchOperation(fProvider.getProject(), fProvider.getLocationPath(), fProvider.getFeatureData(), fProvider.getFeatureToPatch(), getShell()); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/OpenProjectWizardAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/OpenProjectWizardAction.java index f15389b673..bff3a7b5d5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/OpenProjectWizardAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/OpenProjectWizardAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -35,6 +35,7 @@ public class OpenProjectWizardAction extends Action implements ICheatSheetAction /** * @see IActionDelegate#run(IAction) */ + @Override public void run() { run(new String[] {}, null); } @@ -42,6 +43,7 @@ public class OpenProjectWizardAction extends Action implements ICheatSheetAction /* (non-Javadoc) * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatSheetManager) */ + @Override public void run(String[] params, ICheatSheetManager manager) { Hashtable<String, String> defValues = new Hashtable<String, String>(); if (params.length > 0) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PatchSpecPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PatchSpecPage.java index caad8c2d1f..bf8a3e2992 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PatchSpecPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PatchSpecPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,6 +44,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { setDescription(PDEUIMessages.NewFeatureWizard_SpecPage_desc); } + @Override protected void initialize() { String projectName = getProjectName(); if (fInitialId == null) @@ -53,6 +54,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { setMessage(PDEUIMessages.FeaturePatch_MainPage_desc); } + @Override protected String validateContent() { fFeatureToPatch = PDECore.getDefault().getFeatureModelManager().findFeatureModel(fFeatureIdText.getText(), fFeatureVersionText.getText()); if (fFeatureToPatch != null) { @@ -68,6 +70,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { /* (non-Javadoc) * @see org.eclipse.jface.wizard.WizardPage#getNextPage() */ + @Override public IWizardPage getNextPage() { if (fFeatureToPatch == null) return null; @@ -92,6 +95,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { return fPatchProviderCombo.getText(); } + @Override public FeatureData getFeatureData() { FeatureData data = new FeatureData(); data.id = getPatchId(); @@ -105,6 +109,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { return data; } + @Override protected String verifyIdRules() { String id = fPatchIdText.getText(); if (id == null || id.length() == 0) @@ -115,6 +120,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { return super.verifyIdRules(); } + @Override protected String getHelpId() { return IHelpContextIds.NEW_PATCH_REQUIRED_DATA; } @@ -145,6 +151,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { createInstallHandlerText(patchGroup); } + @Override protected void createContents(Composite container) { createTopGroup(container); @@ -174,6 +181,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { fBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); fBrowseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { FeatureSelectionDialog dialog = new FeatureSelectionDialog(getShell(), PDECore.getDefault().getFeatureModelManager().getModels(), false); dialog.create(); @@ -197,6 +205,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { createCommonInput(group); } + @Override protected void attachListeners(ModifyListener listener) { fPatchIdText.addModifyListener(listener); fPatchNameText.addModifyListener(listener); @@ -204,10 +213,12 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { fFeatureIdText.addModifyListener(listener); } + @Override protected String getFeatureId() { return fFeatureIdText.getText(); } + @Override protected void updateNameRelativeFields() { if (fPatchIdText == null || fPatchNameText == null) return; @@ -221,6 +232,7 @@ public class PatchSpecPage extends AbstractFeatureSpecPage { fSelfModification = false; } + @Override protected void saveSettings(IDialogSettings settings) { BundleProviderHistoryUtil.saveHistory(fPatchProviderCombo, settings); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PluginListPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PluginListPage.java index d6cf3ea5e0..a75af11ff8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PluginListPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/feature/PluginListPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -38,6 +38,7 @@ import org.eclipse.ui.PlatformUI; public class PluginListPage extends BasePluginListPage { class PluginContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { return PluginRegistry.getActiveModels(); } @@ -48,6 +49,7 @@ public class PluginListPage extends BasePluginListPage { if (newInput != null && !PDECore.getDefault().areModelsInitialized()) { try { getContainer().run(true, false, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { // Target reloaded method clears existing models (which don't exist currently) and inits them with a progress monitor PDECore.getDefault().getModelManager().targetReloaded(monitor); @@ -138,6 +140,7 @@ public class PluginListPage extends BasePluginListPage { Dialog.applyDialogFont(container); PlatformUI.getWorkbench().getHelpSystem().setHelp(container, IHelpContextIds.NEW_FEATURE_REFERENCED_PLUGINS); pluginViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { TableItem firstTI = pluginViewer.getTable().getSelection()[0]; if (firstTI.getChecked()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/AlternateSourceLocations.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/AlternateSourceLocations.java index 93c6805e8d..36362c14f1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/AlternateSourceLocations.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/AlternateSourceLocations.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -58,6 +58,7 @@ public class AlternateSourceLocations extends SourceLocationManager { * platform. * @return bundle manifest source location manager */ + @Override protected BundleManifestSourceLocationManager initializeBundleManifestLocations() { BundleManifestSourceLocationManager manager = new BundleManifestSourceLocationManager(); manager.setPlugins(models); @@ -72,6 +73,7 @@ public class AlternateSourceLocations extends SourceLocationManager { * @return collection of old-style source locations that have been contributed via * extension point */ + @Override public List<SourceLocation> getExtensionLocations() { if (oldSourceRoots == null) { oldSourceRoots = new ArrayList<SourceLocation>(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BaseImportWizardSecondPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BaseImportWizardSecondPage.java index f9f3554fe1..8a244c2094 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BaseImportWizardSecondPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BaseImportWizardSecondPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -47,6 +47,7 @@ public abstract class BaseImportWizardSecondPage extends WizardPage implements I private boolean fRefreshNeeded = true; class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object element) { return new Object[0]; } @@ -94,10 +95,12 @@ public abstract class BaseImportWizardSecondPage extends WizardPage implements I } } + @Override public void dispose() { PDECore.getDefault().getModelManager().getExternalModelManager().removeModelProviderListener(this); } + @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible && isRefreshNeeded()) { @@ -248,6 +251,7 @@ public abstract class BaseImportWizardSecondPage extends WizardPage implements I /* (non-Javadoc) * @see org.eclipse.pde.core.IModelProviderListener#modelsChanged(org.eclipse.pde.core.IModelProviderEvent) */ + @Override public void modelsChanged(IModelProviderEvent event) { fRefreshNeeded = true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BinaryProjectFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BinaryProjectFilter.java index 31f6e64998..68d706a7c2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BinaryProjectFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/BinaryProjectFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -24,6 +24,7 @@ public class BinaryProjectFilter extends ViewerFilter { * * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { IProject project = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/ExternalPluginLibrariesFilter.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/ExternalPluginLibrariesFilter.java index 174e25aa49..139cea2807 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/ExternalPluginLibrariesFilter.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/ExternalPluginLibrariesFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -25,6 +25,7 @@ public class ExternalPluginLibrariesFilter extends ViewerFilter { * * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) */ + @Override public boolean select(Viewer viewer, Object parentElement, Object element) { IProject project = null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportOperation.java index b10ccf888c..b2124e9c6c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -68,6 +68,7 @@ public class FeatureImportOperation implements IWorkspaceRunnable { /* * @see IWorkspaceRunnable#run(IProgressMonitor) */ + @Override public void run(IProgressMonitor monitor) throws CoreException, OperationCanceledException { if (monitor == null) { monitor = new NullProgressMonitor(); @@ -158,6 +159,7 @@ public class FeatureImportOperation implements IWorkspaceRunnable { private void importContent(Object source, IPath destPath, IImportStructureProvider provider, List<?> filesToImport, IProgressMonitor monitor) throws CoreException { IOverwriteQuery query = new IOverwriteQuery() { + @Override public String queryOverwrite(String file) { return ALL; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizard.java index 6363a43f93..7a8839142a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -40,12 +40,14 @@ public class FeatureImportWizard extends Wizard implements IImportWizard { /* * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection) */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { } /* * @see org.eclipse.jface.wizard.IWizard#addPages */ + @Override public void addPages() { setNeedsProgressMonitor(false); @@ -64,6 +66,7 @@ public class FeatureImportWizard extends Wizard implements IImportWizard { /* * @see Wizard#performFinish() */ + @Override public boolean performFinish() { IFeatureModel[] models = fPage.getSelectedModels(); fPage.storeSettings(true); @@ -72,6 +75,7 @@ public class FeatureImportWizard extends Wizard implements IImportWizard { IReplaceQuery query = new ReplaceQuery(getShell()); final FeatureImportOperation op = new FeatureImportOperation(models, fPage.isBinary(), targetPath, query); Job job = new Job(PDEUIMessages.FeatureImportWizard_title) { + @Override protected IStatus run(IProgressMonitor monitor) { try { PDEPlugin.getWorkspace().run(op, monitor); @@ -111,6 +115,7 @@ public class FeatureImportWizard extends Wizard implements IImportWizard { private int yesToAll = 0; private int[] RETURNCODES = {IReplaceQuery.YES, IReplaceQuery.YES, IReplaceQuery.NO, IReplaceQuery.NO, IReplaceQuery.CANCEL}; + @Override public int doQuery(IProject project) { if (yesToAll != 0) return yesToAll > 0 ? IReplaceQuery.YES : IReplaceQuery.NO; @@ -119,6 +124,7 @@ public class FeatureImportWizard extends Wizard implements IImportWizard { final int[] result = {IReplaceQuery.CANCEL}; Display.getDefault().syncExec(new Runnable() { + @Override public void run() { ReplaceDialog dialog = new ReplaceDialog(Display.getDefault().getActiveShell(), message); int retVal = dialog.open(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizardPage.java index f7f768d12c..ce4e905057 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/FeatureImportWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -78,6 +78,7 @@ public class FeatureImportWizardPage extends WizardPage { private Button fBinaryButton; class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (fModels != null) return fModels; @@ -119,6 +120,7 @@ public class FeatureImportWizardPage extends WizardPage { /* * @see IDialogPage#createControl(Composite) */ + @Override public void createControl(Composite parent) { initializeDialogUnits(parent); @@ -193,6 +195,7 @@ public class FeatureImportWizardPage extends WizardPage { }); fDropLocation.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { // If the text is a combo item, immediately try to resolve, otherwise wait in case they type more boolean isItem = false; @@ -382,12 +385,15 @@ public class FeatureImportWizardPage extends WizardPage { FilteredCheckboxTree tree = new FilteredCheckboxTree(container, null, SWT.NONE, filter); fFeatureViewer = tree.getCheckboxTreeViewer(); fFeatureViewer.setContentProvider(new ITreeContentProvider() { + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } + @Override public void dispose() { } + @Override public Object[] getElements(Object inputElement) { if (inputElement instanceof Object[]) { return (Object[]) inputElement; @@ -395,14 +401,17 @@ public class FeatureImportWizardPage extends WizardPage { return new Object[0]; } + @Override public boolean hasChildren(Object element) { return false; } + @Override public Object getParent(Object element) { return null; } + @Override public Object[] getChildren(Object parentElement) { return new Object[0]; } @@ -410,12 +419,14 @@ public class FeatureImportWizardPage extends WizardPage { fFeatureViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider()); fFeatureViewer.setComparator(ListUtil.FEATURE_COMPARATOR); fFeatureViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { updateCounter(); dialogChanged(); } }); fFeatureViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { ISelection selection = fFeatureViewer.getSelection(); if (!selection.isEmpty()) { @@ -448,6 +459,7 @@ public class FeatureImportWizardPage extends WizardPage { final IPath home = getDropLocation(); final boolean useRuntimeLocation = fRuntimeLocationButton.getSelection() || TargetPlatform.getLocation().equals(fDropLocation.getText().trim()); IRunnableWithProgress runnable = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask(PDEUIMessages.FeatureImportWizard_messages_updating, IProgressMonitor.UNKNOWN); ArrayList<IFeatureModel> result = new ArrayList<IFeatureModel>(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/OverwriteProjectsSelectionDialog.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/OverwriteProjectsSelectionDialog.java index 9e1d6f4369..702d26bfb1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/OverwriteProjectsSelectionDialog.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/OverwriteProjectsSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -44,25 +44,31 @@ public class OverwriteProjectsSelectionDialog extends SelectionStatusDialog { private class PluginContentProvider implements ITreeContentProvider { + @Override public Object[] getChildren(Object parentElement) { return new Object[0]; } + @Override public Object getParent(Object element) { return null; } + @Override public boolean hasChildren(Object element) { return false; } + @Override public Object[] getElements(Object inputElement) { return (IPluginModelBase[]) inputElement; } + @Override public void dispose() { } + @Override public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } @@ -70,10 +76,12 @@ public class OverwriteProjectsSelectionDialog extends SelectionStatusDialog { private class StyledPluginLabelProvider extends StyledCellLabelProvider implements ILabelProvider { + @Override public Image getImage(Object element) { return PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT); } + @Override public String getText(Object element) { return getStyledText(element).getString(); } @@ -81,6 +89,7 @@ public class OverwriteProjectsSelectionDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell) */ + @Override public void update(ViewerCell cell) { StyledString string = getStyledText(cell.getElement()); cell.setText(string.getString()); @@ -114,6 +123,7 @@ public class OverwriteProjectsSelectionDialog extends SelectionStatusDialog { * Common listener for the Select All and Deselect All buttons */ private class ButtonSelectionListener extends SelectionAdapter { + @Override public void widgetSelected(SelectionEvent e) { String buttonID = (String) e.widget.getData(ID); if (PDEUIMessages.DuplicatePluginResolutionDialog_selectAll.equals(buttonID)) { @@ -143,6 +153,7 @@ public class OverwriteProjectsSelectionDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.SelectionStatusDialog#configureShell(org.eclipse.swt.widgets.Shell) */ + @Override protected void configureShell(Shell shell) { super.configureShell(shell); PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpContextIds.PLUGIN_IMPORT_OVERWRITE_DIALOG); @@ -151,6 +162,7 @@ public class OverwriteProjectsSelectionDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult() */ + @Override protected void computeResult() { java.util.List<Object> result = Arrays.asList(fCheckboxTreeViewer.getCheckedLeafElements()); setResult(result); @@ -159,6 +171,7 @@ public class OverwriteProjectsSelectionDialog extends SelectionStatusDialog { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) */ + @Override protected Control createDialogArea(Composite parent) { Composite tableComposite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 15, 15); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); 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 213188b3fb..3fcbeb3c00 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, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -32,6 +32,7 @@ public class PluginImportFinishDialog extends TitleAreaDialog { private String fMessage; private boolean fConfigured; + @Override protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); super.setTitle(fTitle); @@ -51,12 +52,14 @@ public class PluginImportFinishDialog extends TitleAreaDialog { } + @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText(PDEUIMessages.ImportWizard_title); PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IHelpContextIds.PLUGIN_IMPORT_FINISH_DIALOG); } + @Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); } @@ -72,17 +75,20 @@ public class PluginImportFinishDialog extends TitleAreaDialog { static private class PluginImportTableContentProvider extends DefaultTableProvider { + @Override public Object[] getElements(Object inputElement) { return ((List<?>) inputElement).toArray(); } } + @Override public void setMessage(String newMessage) { fMessage = newMessage; if (fConfigured) super.setMessage(fMessage, IMessageProvider.INFORMATION); } + @Override public void setTitle(String newTitle) { fTitle = newTitle; if (fConfigured) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportHelper.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportHelper.java index 1e1967c6ba..7dc5c45869 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportHelper.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -38,6 +38,7 @@ public class PluginImportHelper { */ public static void importContent(Object source, IPath dstPath, IImportStructureProvider provider, List<Object> filesToImport, IProgressMonitor monitor) throws CoreException { IOverwriteQuery query = new IOverwriteQuery() { + @Override public String queryOverwrite(String file) { return ALL; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportLabelProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportLabelProvider.java index d2f9882eb4..619e89f718 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportLabelProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2015 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,6 +28,7 @@ public class PluginImportLabelProvider extends StyledCellLabelProvider implement /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) */ + @Override public Image getImage(Object element) { return PDEPlugin.getDefault().getLabelProvider().getImage(element); } @@ -35,6 +36,7 @@ public class PluginImportLabelProvider extends StyledCellLabelProvider implement /* (non-Javadoc) * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ + @Override public String getText(Object element) { return getStyledText(element).getString(); } @@ -42,6 +44,7 @@ public class PluginImportLabelProvider extends StyledCellLabelProvider implement /* (non-Javadoc) * @see org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell) */ + @Override public void update(ViewerCell cell) { StyledString string = getStyledText(cell.getElement()); cell.setText(string.getString()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizard.java index 8e26046e7a..201dad5ff2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -48,6 +48,7 @@ public class PluginImportWizard extends Wizard implements IImportWizard, IPageCh setWindowTitle(PDEUIMessages.ImportWizard_title); } + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.selection = selection; } @@ -225,6 +226,7 @@ public class PluginImportWizard extends Wizard implements IImportWizard, IPageCh /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IPageChangingListener#handlePageChanging(org.eclipse.jface.dialogs.PageChangingEvent) */ + @Override public void handlePageChanging(PageChangingEvent event) { if (event.getCurrentPage() instanceof BaseImportWizardSecondPage && event.getTargetPage() instanceof IScmUrlImportWizardPage) { IPluginModelBase[] models = getModelsToImport(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardDetailedPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardDetailedPage.java index 14b1895d56..5c8e6d9ae4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardDetailedPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardDetailedPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -45,6 +45,7 @@ import org.osgi.framework.Version; public class PluginImportWizardDetailedPage extends BaseImportWizardSecondPage { class ContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object element) { return fModels; } @@ -159,6 +160,7 @@ public class PluginImportWizardDetailedPage extends BaseImportWizardSecondPage { fSelected = new HashSet<Object>(); } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -238,30 +240,35 @@ public class PluginImportWizardDetailedPage extends BaseImportWizardSecondPage { private void addViewerListeners() { fAvailableListViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleAdd(); } }); fImportListViewer.addDoubleClickListener(new IDoubleClickListener() { + @Override public void doubleClick(DoubleClickEvent event) { handleRemove(); } }); fAvailableListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateSelectionBasedEnablement(event.getSelection(), true); } }); fImportListViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateSelectionBasedEnablement(event.getSelection(), false); } }); fFilterText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { fFilterJob.cancel(); fFilterJob.schedule(200); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardExpressPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardExpressPage.java index 05db7951ce..3a42e5fad4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardExpressPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardExpressPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -44,6 +44,7 @@ public class PluginImportWizardExpressPage extends BaseImportWizardSecondPage { private Label fCounterLabel; class PluginContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { IProject[] projects = PDEPlugin.getWorkspace().getRoot().getProjects(); ArrayList<IPluginModelBase> result = new ArrayList<IPluginModelBase>(); @@ -63,20 +64,24 @@ public class PluginImportWizardExpressPage extends BaseImportWizardSecondPage { super(mainLabel, buttonLabels); } + @Override public void updateCounter(int count) { super.updateCounter(count); } + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { StructuredViewer viewer = super.createStructuredViewer(parent, style, toolkit); return viewer; } + @Override protected void elementChecked(Object element, boolean checked) { super.elementChecked(element, checked); pageChanged(); } + @Override protected void handleSelectAll(boolean select) { super.handleSelectAll(select); pageChanged(); @@ -90,6 +95,7 @@ public class PluginImportWizardExpressPage extends BaseImportWizardSecondPage { setMessage(PDEUIMessages.ImportWizard_expressPage_desc); } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -108,6 +114,7 @@ public class PluginImportWizardExpressPage extends BaseImportWizardSecondPage { createComputationsOption(optionsComp); fAddFragmentsButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { pageChanged(); } @@ -132,6 +139,7 @@ public class PluginImportWizardExpressPage extends BaseImportWizardSecondPage { selectAll.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); selectAll.setText(PDEUIMessages.WizardCheckboxTablePart_selectAll); selectAll.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fTablePart.handleSelectAll(true); pageChanged(); @@ -141,6 +149,7 @@ public class PluginImportWizardExpressPage extends BaseImportWizardSecondPage { deselectAll.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); deselectAll.setText(PDEUIMessages.WizardCheckboxTablePart_deselectAll); deselectAll.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fTablePart.handleSelectAll(false); pageChanged(); @@ -262,6 +271,7 @@ public class PluginImportWizardExpressPage extends BaseImportWizardSecondPage { } } + @Override protected void refreshPage() { pageChanged(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardFirstPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardFirstPage.java index d5ff1e009a..ecaa2ac369 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardFirstPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/imports/PluginImportWizardFirstPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -114,6 +114,7 @@ public class PluginImportWizardFirstPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH); GridLayout layout = (GridLayout) container.getLayout(); @@ -236,6 +237,7 @@ public class PluginImportWizardFirstPage extends WizardPage { } Collections.sort(targetDefinitions, new Comparator<Object>() { + @Override public int compare(Object o1, Object o2) { ITargetDefinition td1 = (ITargetDefinition) o1; ITargetDefinition td2 = (ITargetDefinition) o2; @@ -346,6 +348,7 @@ public class PluginImportWizardFirstPage extends WizardPage { importDirectory = SWTFactory.createCombo(composite, SWT.DROP_DOWN, 1, GridData.FILL_HORIZONTAL, null); importDirectory.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validateDropLocation(); } @@ -368,6 +371,7 @@ public class PluginImportWizardFirstPage extends WizardPage { final PreferenceDialog dialog = new PreferenceDialog(shell, manager); final boolean[] result = new boolean[] {false}; BusyIndicator.showWhile(shell.getDisplay(), new Runnable() { + @Override public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); @@ -544,6 +548,7 @@ public class PluginImportWizardFirstPage extends WizardPage { */ private void resolveTargetDefinition(final ITargetDefinition target, final int type) { IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException { SubMonitor subMon = SubMonitor.convert(monitor); subMon.beginTask(PDEUIMessages.PluginImportWizardFirstPage_1, 100); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/AbstractFieldData.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/AbstractFieldData.java index 148e79d497..0267559371 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/AbstractFieldData.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/AbstractFieldData.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#getId() */ + @Override public String getId() { return fId; } @@ -41,6 +42,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#getVersion() */ + @Override public String getVersion() { return fVersion; } @@ -48,6 +50,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#getName() */ + @Override public String getName() { return fName; } @@ -55,10 +58,12 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#getProvider() */ + @Override public String getProvider() { return fProvider; } + @Override public boolean isLegacy() { return fLegacy; } @@ -66,6 +71,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#getLibraryName() */ + @Override public String getLibraryName() { return fLibraryName; } @@ -73,6 +79,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#getSourceFolderName() */ + @Override public String getSourceFolderName() { return fSourceFolderName; } @@ -80,6 +87,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#getOutputFolderName() */ + @Override public String getOutputFolderName() { return fOutputFolderName; } @@ -87,6 +95,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#hasBundleStructure() */ + @Override public boolean hasBundleStructure() { return fHasBundleStructure; } @@ -94,6 +103,7 @@ public abstract class AbstractFieldData implements IFieldData { /* (non-Javadoc) * @see org.eclipse.pde.ui.IFieldData2#isSimple() */ + @Override public boolean isSimple() { return fSimple; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java index c1129d4caa..515930e5db 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/ContentPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,6 +44,7 @@ public abstract class ContentPage extends WizardPage { protected int fChangedGroups = 0; protected ModifyListener propertiesListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (fInitialized) fChangedGroups |= PROPERTIES_GROUP; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentContentPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentContentPage.java index fed26acffc..aa76303d21 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentContentPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentContentPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -62,6 +62,7 @@ public class FragmentContentPage extends ContentPage { private final static String NO_EXECUTION_ENVIRONMENT = PDEUIMessages.PluginContentPage_noEE; protected ModifyListener listener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -78,6 +79,7 @@ public class FragmentContentPage extends ContentPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.plugin.ContentPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -226,6 +228,7 @@ public class FragmentContentPage extends ContentPage { fExeEnvButton.setLayoutData(new GridData()); fExeEnvButton.setText(PDEUIMessages.NewProjectCreationPage_environmentsButton); fExeEnvButton.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event event) { PreferencesUtil.createPreferenceDialogOn(getShell(), "org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$ new String[] {"org.eclipse.jdt.debug.ui.jreProfiles"}, null).open(); //$NON-NLS-1$ @@ -246,6 +249,7 @@ public class FragmentContentPage extends ContentPage { if (!PDECore.getDefault().areModelsInitialized()) { try { getContainer().run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { // Target reloaded method clears existing models (which don't exist currently) and inits them with a progress monitor PDECore.getDefault().getModelManager().targetReloaded(monitor); @@ -261,6 +265,7 @@ public class FragmentContentPage extends ContentPage { } BusyIndicator.showWhile(pluginText.getDisplay(), new Runnable() { + @Override public void run() { PluginSelectionDialog dialog = new PluginSelectionDialog(pluginText.getShell(), false, false); dialog.create(); @@ -333,6 +338,7 @@ public class FragmentContentPage extends ContentPage { if (!PDECore.getDefault().areModelsInitialized()) { try { getContainer().run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { // Target reloaded method clears existing models (which don't exist currently) and inits them with a progress monitor PDECore.getDefault().getModelManager().targetReloaded(monitor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentFieldData.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentFieldData.java index c9fd1f7d9b..0bc01283c9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentFieldData.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/FragmentFieldData.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -21,6 +21,7 @@ public class FragmentFieldData extends AbstractFieldData implements IFragmentFie /* (non-Javadoc) * @see org.eclipse.pde.ui.IFragmentFieldData#getPluginId() */ + @Override public String getPluginId() { return fPluginId; } @@ -28,6 +29,7 @@ public class FragmentFieldData extends AbstractFieldData implements IFragmentFie /* (non-Javadoc) * @see org.eclipse.pde.ui.IFragmentFieldData#getPluginVersion() */ + @Override public String getPluginVersion() { return fPluginVersion; } @@ -35,6 +37,7 @@ public class FragmentFieldData extends AbstractFieldData implements IFragmentFie /* (non-Javadoc) * @see org.eclipse.pde.ui.IFragmentFieldData#getMatch() */ + @Override public int getMatch() { return fMatch; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/LibraryPluginJarsPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/LibraryPluginJarsPage.java index 7470b97cf4..a427a95f48 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/LibraryPluginJarsPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/LibraryPluginJarsPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -96,6 +96,7 @@ public class LibraryPluginJarsPage extends WizardPage { } } + @Override public void createControl(Composite parent) { Composite control = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -110,11 +111,13 @@ public class LibraryPluginJarsPage extends WizardPage { l.setLayoutData(data); fTableViewer = new TableViewer(control, SWT.MULTI | SWT.BORDER); fTableViewer.setContentProvider(new DefaultTableProvider() { + @Override public Object[] getElements(Object inputElement) { return fJarPaths.toArray(); } }); fTableViewer.setLabelProvider(new LabelProvider() { + @Override public String getText(Object obj) { String name; String location; @@ -131,6 +134,7 @@ public class LibraryPluginJarsPage extends WizardPage { } + @Override public Image getImage(Object obj) { if (obj instanceof IFile) { return PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_JAR_OBJ); @@ -144,6 +148,7 @@ public class LibraryPluginJarsPage extends WizardPage { fTableViewer.getControl().setLayoutData(data); fTableViewer.setInput(fJarPaths); fTableViewer.getTable().addKeyListener(new KeyAdapter() { + @Override public void keyPressed(KeyEvent event) { if (event.character == SWT.DEL && event.stateMask == 0) { handleRemove(); @@ -166,6 +171,7 @@ public class LibraryPluginJarsPage extends WizardPage { browseWorkspace.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL)); SWTUtil.setButtonDimensionHint(browseWorkspace); browseWorkspace.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseWorkspaceFile(); } @@ -176,6 +182,7 @@ public class LibraryPluginJarsPage extends WizardPage { browseFile.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); SWTUtil.setButtonDimensionHint(browseFile); browseFile.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { chooseFile(); } @@ -188,6 +195,7 @@ public class LibraryPluginJarsPage extends WizardPage { fRemove.setEnabled(fJarPaths.size() > 0); setPageComplete(fJarPaths.size() > 0); fRemove.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleRemove(); } @@ -213,6 +221,7 @@ public class LibraryPluginJarsPage extends WizardPage { } } + @Override public boolean isPageComplete() { return fJarPaths.size() > 0; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewFragmentProjectWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewFragmentProjectWizard.java index c412d4d942..4a3bcd3734 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewFragmentProjectWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewFragmentProjectWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -41,6 +41,7 @@ public class NewFragmentProjectWizard extends NewWizard implements IExecutableEx /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#addPages() */ + @Override public void addPages() { fMainPage = new NewProjectCreationPage("main", fFragmentData, true, getSelection()); //$NON-NLS-1$ fMainPage.setTitle(PDEUIMessages.NewProjectWizard_MainPage_ftitle); @@ -48,14 +49,17 @@ public class NewFragmentProjectWizard extends NewWizard implements IExecutableEx addPage(fMainPage); fProjectProvider = new IProjectProvider() { + @Override public String getProjectName() { return fMainPage.getProjectName(); } + @Override public IProject getProject() { return fMainPage.getProjectHandle(); } + @Override public IPath getLocationPath() { return fMainPage.getLocationPath(); } @@ -67,6 +71,7 @@ public class NewFragmentProjectWizard extends NewWizard implements IExecutableEx /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#canFinish() */ + @Override public boolean canFinish() { IWizardPage page = getContainer().getCurrentPage(); return (page.isPageComplete() && page != fMainPage); @@ -77,6 +82,7 @@ public class NewFragmentProjectWizard extends NewWizard implements IExecutableEx * * @see org.eclipse.pde.internal.ui.wizards.NewWizard#performFinish() */ + @Override public boolean performFinish() { try { fMainPage.updateData(); @@ -104,6 +110,7 @@ public class NewFragmentProjectWizard extends NewWizard implements IExecutableEx /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#dispose() */ + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); @@ -112,6 +119,7 @@ public class NewFragmentProjectWizard extends NewWizard implements IExecutableEx /* (non-Javadoc) * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) */ + @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { fConfig = config; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationOperation.java index 916e61609d..7a0196c58c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -365,6 +365,7 @@ public class NewLibraryPluginCreationOperation extends NewProjectCreationOperati input = new ZipFile(jar); ZipFileStructureProvider provider = new ZipFileStructureProvider(input); ImportOperation op = new ImportOperation(destination.getFullPath(), provider.getRoot(), provider, new IOverwriteQuery() { + @Override public String queryOverwrite(String pathString) { return IOverwriteQuery.ALL; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationPage.java index df9e01a897..c99e0b7a94 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -51,6 +51,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { return fChanged; } + @Override public void modifyText(ModifyEvent e) { if (!fBlocked) { fChanged = true; @@ -88,6 +89,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { setDescription(PDEUIMessages.NewLibraryPluginCreationPage_desc); } + @Override public void createControl(Composite parent) { super.createControl(parent); Composite control = (Composite) getControl(); @@ -126,6 +128,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { fEclipseButton.setText(PDEUIMessages.NewProjectCreationPage_pDependsOnRuntime); fEclipseButton.setSelection(fData.getOSGiFramework() == null); fEclipseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateRuntimeDependency(); } @@ -164,6 +167,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { //enable by default fUpdateRefsCheck.setSelection(false); fUpdateRefsCheck.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (getNextPage() instanceof NewLibraryPluginCreationUpdateRefPage) { ((NewLibraryPluginCreationUpdateRefPage) getNextPage()).setEnable(fUpdateRefsCheck.getSelection()); @@ -198,6 +202,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { // Set data fEEChoice.setItems(availableEEs.toArray(new String[availableEEs.size() - 1])); fEEChoice.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { validatePage(); } @@ -220,6 +225,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { fExeEnvButton.setLayoutData(new GridData()); fExeEnvButton.setText(PDEUIMessages.NewProjectCreationPage_environmentsButton); fExeEnvButton.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event event) { PreferencesUtil.createPreferenceDialogOn(getShell(), "org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$ new String[] {"org.eclipse.jdt.debug.ui.jreProfiles"}, null).open(); //$NON-NLS-1$ @@ -275,6 +281,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { * * @see org.eclipse.jface.wizard.WizardPage#getNextPage() */ + @Override public IWizardPage getNextPage() { updateData(); return super.getNextPage(); @@ -335,6 +342,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { return null; } + @Override protected boolean validatePage() { String id = IdUtil.getValidId(getProjectName()); @@ -410,6 +418,7 @@ public class NewLibraryPluginCreationPage extends WizardNewProjectCreationPage { } } + @Override public boolean canFlipToNextPage() { return isPageComplete() && fUpdateRefsCheck.getSelection(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationUpdateRefPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationUpdateRefPage.java index 95dc68bd51..fac740a7e5 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationUpdateRefPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginCreationUpdateRefPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -40,6 +40,7 @@ public class NewLibraryPluginCreationUpdateRefPage extends WizardPage { private LibraryPluginFieldData fData; public class BuildpathContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (fUnmigrated != null) return fUnmigrated; @@ -52,6 +53,7 @@ public class NewLibraryPluginCreationUpdateRefPage extends WizardPage { super(mainLabel); } + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { StructuredViewer viewer = super.createStructuredViewer(parent, style, toolkit); viewer.setComparator(ListUtil.PLUGIN_COMPARATOR); @@ -88,6 +90,7 @@ public class NewLibraryPluginCreationUpdateRefPage extends WizardPage { } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginProjectWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginProjectWizard.java index a55d95a6a5..d152db9e58 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginProjectWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewLibraryPluginProjectWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -70,6 +70,7 @@ public class NewLibraryPluginProjectWizard extends NewWizard implements IExecuta * * @see org.eclipse.jface.wizard.Wizard#addPages() */ + @Override public void addPages() { fJarsPage = new LibraryPluginJarsPage("jars", fPluginData, fInitialJarPaths); //$NON-NLS-1$ fMainPage = new NewLibraryPluginCreationPage("main", fPluginData, getSelection()); //$NON-NLS-1$ @@ -79,14 +80,17 @@ public class NewLibraryPluginProjectWizard extends NewWizard implements IExecuta fMainPage.setInitialProjectName(pname); fProjectProvider = new IProjectProvider() { + @Override public IPath getLocationPath() { return fMainPage.getLocationPath(); } + @Override public IProject getProject() { return fMainPage.getProjectHandle(); } + @Override public String getProjectName() { return fMainPage.getProjectName(); } @@ -117,6 +121,7 @@ public class NewLibraryPluginProjectWizard extends NewWizard implements IExecuta * * @see org.eclipse.jface.wizard.Wizard#dispose() */ + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); @@ -127,6 +132,7 @@ public class NewLibraryPluginProjectWizard extends NewWizard implements IExecuta * * @see org.eclipse.pde.internal.ui.wizards.NewWizard#performFinish() */ + @Override public boolean performFinish() { try { fJarsPage.updateData(); @@ -150,17 +156,21 @@ public class NewLibraryPluginProjectWizard extends NewWizard implements IExecuta * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, * java.lang.String, java.lang.Object) */ + @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { fConfig = config; } + @Override public void createPageControls(Composite pageContainer) { super.createPageControls(pageContainer); fMainPage.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(SelectionEvent e) { } + @Override public void widgetSelected(SelectionEvent e) { Button updateRefsCheck = (Button) e.getSource(); if (updateRefsCheck.getSelection()) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewPluginProjectWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewPluginProjectWizard.java index c2f6094fc4..d77a827299 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewPluginProjectWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewPluginProjectWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -65,14 +65,17 @@ public class NewPluginProjectWizard extends NewWizard implements IExecutableExte addPage(fMainPage); fProjectProvider = new IProjectProvider() { + @Override public String getProjectName() { return fMainPage.getProjectName(); } + @Override public IProject getProject() { return fMainPage.getProjectHandle(); } + @Override public IPath getLocationPath() { return fMainPage.getLocationPath(); } @@ -119,6 +122,7 @@ public class NewPluginProjectWizard extends NewWizard implements IExecutableExte if (!PDECore.getDefault().areModelsInitialized()) { try { getContainer().run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { // Target reloaded method clears existing models (which don't exist currently) and inits them with a progress monitor PDECore.getDefault().getModelManager().targetReloaded(monitor); @@ -150,6 +154,7 @@ public class NewPluginProjectWizard extends NewWizard implements IExecutableExte /* (non-Javadoc) * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) */ + @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { fConfig = config; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationFromTemplatePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationFromTemplatePage.java index be3e129e7d..2ac16b0185 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationFromTemplatePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationFromTemplatePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -26,6 +26,7 @@ public class NewProjectCreationFromTemplatePage extends NewProjectCreationPage { fTemplateWizard = templateWizard; } + @Override protected void createFormatGroup(Composite container) { super.createFormatGroup(container); Boolean osgiFlag = TemplateWizardHelper.getFlag(fTemplateWizard, TemplateWizardHelper.FLAG_OSGI); @@ -40,6 +41,7 @@ public class NewProjectCreationFromTemplatePage extends NewProjectCreationPage { } } + @Override protected void createProjectTypeGroup(Composite container) { super.createProjectTypeGroup(container); Boolean javaFlag = TemplateWizardHelper.getFlag(fTemplateWizard, TemplateWizardHelper.FLAG_JAVA); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java index c6956016f9..a641a60ef1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -266,6 +266,7 @@ public class NewProjectCreationOperation extends WorkspaceModifyOperation { * * @see org.eclipse.ui.actions.WorkspaceModifyOperation#execute(org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { // start task @@ -457,6 +458,7 @@ public class NewProjectCreationOperation extends WorkspaceModifyOperation { */ private void openFile(final IFile file) { PDEPlugin.getDefault().getWorkbench().getDisplay().asyncExec(new Runnable() { + @Override public void run() { final IWorkbenchWindow ww = PDEPlugin.getActiveWorkbenchWindow(); final IWorkbenchPage page = ww.getActivePage(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java index c1321ab421..2d9432921d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/NewProjectCreationPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -53,6 +53,7 @@ public class NewProjectCreationPage extends WizardNewProjectCreationPage { fSelection = selection; } + @Override public void createControl(Composite parent) { super.createControl(parent); Composite control = (Composite) getControl(); @@ -83,6 +84,7 @@ public class NewProjectCreationPage extends WizardNewProjectCreationPage { fJavaButton.setText(PDEUIMessages.ProjectStructurePage_java); fJavaButton.setSelection(true); fJavaButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean enabled = fJavaButton.getSelection(); fSourceLabel.setEnabled(enabled); @@ -125,6 +127,7 @@ public class NewProjectCreationPage extends WizardNewProjectCreationPage { fEclipseButton.setText(PDEUIMessages.NewProjectCreationPage_pDependsOnRuntime); fEclipseButton.setSelection(!osgiProject); fEclipseButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateRuntimeDependency(); } @@ -193,6 +196,7 @@ public class NewProjectCreationPage extends WizardNewProjectCreationPage { gd.widthHint = 300; text.setLayoutData(gd); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { setPageComplete(validatePage()); } @@ -219,6 +223,7 @@ public class NewProjectCreationPage extends WizardNewProjectCreationPage { fData.setWorkingSets(getSelectedWorkingSets()); } + @Override protected boolean validatePage() { if (!super.validatePage()) return false; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/OpenProjectWizardAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/OpenProjectWizardAction.java index e5c2147839..9ced1dcc46 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/OpenProjectWizardAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/OpenProjectWizardAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -34,6 +34,7 @@ public class OpenProjectWizardAction extends Action implements ICheatSheetAction /** * @see IActionDelegate#run(IAction) */ + @Override public void run() { run(new String[] {}, null); } @@ -41,6 +42,7 @@ public class OpenProjectWizardAction extends Action implements ICheatSheetAction /* (non-Javadoc) * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatSheetManager) */ + @Override public void run(String[] params, ICheatSheetManager manager) { Hashtable<String, String> defValues = new Hashtable<String, String>(); if (params.length > 0) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentFromTemplatePage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentFromTemplatePage.java index 5abcadc6c5..ed824ea2ab 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentFromTemplatePage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentFromTemplatePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -26,6 +26,7 @@ public class PluginContentFromTemplatePage extends PluginContentPage { fTemplateWizard = templateWizard; } + @Override protected void createRCPQuestion(Composite parent, int horizontalSpan) { super.createRCPQuestion(parent, horizontalSpan); Boolean rcpFlag = TemplateWizardHelper.getFlag(fTemplateWizard, TemplateWizardHelper.FLAG_RCP); @@ -38,6 +39,7 @@ public class PluginContentFromTemplatePage extends PluginContentPage { } } + @Override protected void createPluginClassGroup(Composite container) { super.createPluginClassGroup(container); Boolean activatorFlag = TemplateWizardHelper.getFlag(fTemplateWizard, TemplateWizardHelper.FLAG_ACTIVATOR); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java index c99a852ebe..f89f17652b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginContentPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -68,6 +68,7 @@ public class PluginContentPage extends ContentPage { * default tText modify listener */ private ModifyListener classListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (fInitialized) fChangedGroups |= P_CLASS_GROUP; @@ -91,6 +92,7 @@ public class PluginContentPage extends ContentPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.plugin.ContentPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); container.setLayout(new GridLayout()); @@ -154,6 +156,7 @@ public class PluginContentPage extends ContentPage { // Set data fEEChoice.setItems(availableEEs.toArray(new String[availableEEs.size() - 1])); fEEChoice.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { validatePage(); } @@ -176,6 +179,7 @@ public class PluginContentPage extends ContentPage { fExeEnvButton.setLayoutData(new GridData()); fExeEnvButton.setText(PDEUIMessages.NewProjectCreationPage_environmentsButton); fExeEnvButton.addListener(SWT.Selection, new Listener() { + @Override public void handleEvent(Event event) { PreferencesUtil.createPreferenceDialogOn(getShell(), "org.eclipse.jdt.debug.ui.jreProfiles", //$NON-NLS-1$ new String[] {"org.eclipse.jdt.debug.ui.jreProfiles"}, null).open(); //$NON-NLS-1$ @@ -194,6 +198,7 @@ public class PluginContentPage extends ContentPage { fGenerateActivator = SWTFactory.createCheckButton(classGroup, PDEUIMessages.ContentPage_generate, null, (settings != null) ? !settings.getBoolean(S_GENERATE_ACTIVATOR) : true, 2); fGenerateActivator.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fClassLabel.setEnabled(fGenerateActivator.getSelection()); fClassText.setEnabled(fGenerateActivator.getSelection()); @@ -211,6 +216,7 @@ public class PluginContentPage extends ContentPage { fUIPlugin = SWTFactory.createCheckButton(classGroup, PDEUIMessages.ContentPage_uicontribution, null, (settings != null) ? !settings.getBoolean(S_UI_PLUGIN) : true, 2); fUIPlugin.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateData(); validatePage(); @@ -220,6 +226,7 @@ public class PluginContentPage extends ContentPage { fApiAnalysisButton = SWTFactory.createCheckButton(classGroup, PDEUIMessages.PluginContentPage_enable_api_analysis, null, false, 2); fApiAnalysisButton.setSelection((settings != null) ? settings.getBoolean(S_API_ANALYSIS) : false); fApiAnalysisButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateData(); validatePage(); @@ -230,6 +237,7 @@ public class PluginContentPage extends ContentPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.plugin.ContentPage#updateData() */ + @Override public void updateData() { super.updateData(); PluginFieldData data = (PluginFieldData) fData; @@ -275,6 +283,7 @@ public class PluginContentPage extends ContentPage { gd.widthHint = SWTFactory.getButtonWidthHint(fYesButton, 50); fYesButton.setLayoutData(gd); fYesButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateData(); getContainer().updateButtons(); @@ -292,6 +301,7 @@ public class PluginContentPage extends ContentPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.plugin.ContentPage#setVisible(boolean) */ + @Override public void setVisible(boolean visible) { if (visible) { fMainPage.updateData(); @@ -349,6 +359,7 @@ public class PluginContentPage extends ContentPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.plugin.ContentPage#validatePage() */ + @Override protected void validatePage() { String errorMessage = validateProperties(); if (errorMessage == null && fGenerateActivator.getSelection()) { @@ -376,6 +387,7 @@ public class PluginContentPage extends ContentPage { * Saves the current state of widgets of interest in the dialog settings for the wizard * @param settings */ + @Override public void saveSettings(IDialogSettings settings) { super.saveSettings(settings); if (fGenerateActivator.isEnabled()) { @@ -393,6 +405,7 @@ public class PluginContentPage extends ContentPage { /* (non-Javadoc) * @see org.eclipse.jface.wizard.WizardPage#canFlipToNextPage() */ + @Override public boolean canFlipToNextPage() { if (getNextPage() instanceof TemplateListSelectionPage) { TemplateListSelectionPage templatePage = (TemplateListSelectionPage) getNextPage(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginFieldData.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginFieldData.java index 08f0db30a0..5e9990e765 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginFieldData.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/PluginFieldData.java @@ -28,6 +28,7 @@ public class PluginFieldData extends AbstractFieldData implements IPluginFieldDa /* (non-Javadoc) * @see org.eclipse.pde.ui.IPluginFieldData#getClassname() */ + @Override public String getClassname() { return fClassname; } @@ -39,6 +40,7 @@ public class PluginFieldData extends AbstractFieldData implements IPluginFieldDa /* (non-Javadoc) * @see org.eclipse.pde.ui.IPluginFieldData#isUIPlugin() */ + @Override public boolean isUIPlugin() { return fIsUIPlugin; } @@ -63,6 +65,7 @@ public class PluginFieldData extends AbstractFieldData implements IPluginFieldDa /* (non-Javadoc) * @see org.eclipse.pde.ui.IPluginFieldData#doGenerateClass() */ + @Override public boolean doGenerateClass() { return fDoGenerateClass; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/TemplateWizardHelper.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/TemplateWizardHelper.java index 94349c2a75..fe5d029f63 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/TemplateWizardHelper.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/plugin/TemplateWizardHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -44,10 +44,12 @@ public class TemplateWizardHelper { final String pluginId = config.getNamespaceIdentifier(); final String contributionId = config.getAttribute("id"); //$NON-NLS-1$ IPluginContribution contribution = new IPluginContribution() { + @Override public String getLocalId() { return contributionId; } + @Override public String getPluginId() { return pluginId; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseManifestOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseManifestOperation.java index e0721882cc..88ace351da 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseManifestOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseManifestOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -65,6 +65,7 @@ public abstract class BaseManifestOperation implements IRunnableWithProgress { throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.pde.ui", IStatus.ERROR, NLS.bind(PDEUIMessages.ProductDefinitionOperation_readOnly, fPluginId), null)); //$NON-NLS-1$ ModelModification mod = new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IBundlePluginModelBase)) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java index 8e9141b5cf..961307ed90 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/BaseProductCreationOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -204,6 +204,7 @@ public class BaseProductCreationOperation extends WorkspaceModifyOperation { private void openFile() { Display.getCurrent().asyncExec(new Runnable() { + @Override public void run() { IWorkbenchWindow ww = PDEPlugin.getActiveWorkbenchWindow(); if (ww == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileAction.java index f1601c5ae1..9bcba73118 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -31,6 +31,7 @@ public class NewProductFileAction extends Action implements ICheatSheetAction { /** * @see IActionDelegate#run(IAction) */ + @Override public void run() { run(new String[] {}, null); } @@ -38,6 +39,7 @@ public class NewProductFileAction extends Action implements ICheatSheetAction { /* (non-Javadoc) * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatSheetManager) */ + @Override public void run(String[] params, ICheatSheetManager manager) { NewProductFileWizard wizard = new NewProductFileWizard(); wizard.init(PlatformUI.getWorkbench(), new StructuredSelection()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileWizard.java index 314864b2aa..a1d4848820 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/NewProductFileWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -25,6 +25,7 @@ public class NewProductFileWizard extends BasicNewResourceWizard { /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#addPages() */ + @Override public void addPages() { fMainPage = new ProductFileWizardPage("product", getSelection()); //$NON-NLS-1$ addPage(fMainPage); @@ -33,6 +34,7 @@ public class NewProductFileWizard extends BasicNewResourceWizard { /* (non-Javadoc) * @see org.eclipse.jface.wizard.IWizard#performFinish() */ + @Override public boolean performFinish() { try { getContainer().run(false, true, getOperation()); @@ -58,6 +60,7 @@ public class NewProductFileWizard extends BasicNewResourceWizard { /* (non-Javadoc) * @see org.eclipse.ui.wizards.newresource.BasicNewResourceWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) */ + @Override public void init(IWorkbench workbench, IStructuredSelection currentSelection) { super.init(workbench, currentSelection); setWindowTitle(PDEUIMessages.NewProductFileWizard_windowTitle); @@ -67,6 +70,7 @@ public class NewProductFileWizard extends BasicNewResourceWizard { /* (non-Javadoc) * @see org.eclipse.ui.wizards.newresource.BasicNewResourceWizard#initializeDefaultPageImageDescriptor() */ + @Override protected void initializeDefaultPageImageDescriptor() { setDefaultPageImageDescriptor(PDEPluginImages.DESC_PRODUCT_WIZ); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionOperation.java index 792fcc735a..2009b3fd2c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -265,6 +265,7 @@ public class ProductDefinitionOperation extends BaseManifestOperation { fUpdateSplashAction.hasException(); } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { IFile file = getFile(); @@ -460,6 +461,7 @@ public class ProductDefinitionOperation extends BaseManifestOperation { throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.pde.ui", IStatus.ERROR, NLS.bind(PDEUIMessages.ProductDefinitionOperation_readOnly, fPluginId), null)); //$NON-NLS-1$ ModelModification mod = new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IPluginModelBase)) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionWizard.java index 8376bb46d4..fb515c3205 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitionWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,11 +32,13 @@ public class ProductDefinitionWizard extends Wizard { setWindowTitle(PDEUIMessages.ProductDefinitionWizard_title); } + @Override public void addPages() { fMainPage = new ProductDefinitonWizardPage("product", fProduct); //$NON-NLS-1$ addPage(fMainPage); } + @Override public boolean performFinish() { try { fProductId = fMainPage.getProductId(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitonWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitonWizardPage.java index b4b6cd32ee..27894d8d5c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitonWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductDefinitonWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -47,6 +47,7 @@ public class ProductDefinitonWizardPage extends WizardPage implements IHyperlink private IProduct fProduct; private ModifyListener fListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -62,6 +63,7 @@ public class ProductDefinitonWizardPage extends WizardPage implements IHyperlink setDescription(PDEUIMessages.ProductDefinitonWizardPage_descNoName); } + @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -120,6 +122,7 @@ public class ProductDefinitonWizardPage extends WizardPage implements IHyperlink button.setText(PDEUIMessages.ProductDefinitonWizardPage_browse); SWTUtil.setButtonDimensionHint(button); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleBrowse(); } @@ -165,6 +168,7 @@ public class ProductDefinitonWizardPage extends WizardPage implements IHyperlink fApplicationCombo.setText(fApplicationCombo.getItem(0)); } + @Override public void setVisible(boolean visible) { if (visible) { if (fProductName != null) @@ -217,12 +221,15 @@ public class ProductDefinitonWizardPage extends WizardPage implements IHyperlink return null; } + @Override public void linkEntered(HyperlinkEvent e) { } + @Override public void linkExited(HyperlinkEvent e) { } + @Override public void linkActivated(HyperlinkEvent e) { String extPoint = Platform.PI_RUNTIME + "." + e.getHref().toString(); //$NON-NLS-1$ IPluginExtensionPoint point = PDECore.getDefault().getExtensionsRegistry().findExtensionPoint(extPoint); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java index e4aa5802db..99da68e94d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFileWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -75,6 +75,7 @@ public class ProductFileWizardPage extends PDEWizardNewFileCreationPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createAdvancedControls(org.eclipse.swt.widgets.Composite) */ + @Override protected void createAdvancedControls(Composite parent) { fGroup = new Group(parent, SWT.NONE); fGroup.setText(PDEUIMessages.ProductFileWizadPage_groupTitle); @@ -90,6 +91,7 @@ public class ProductFileWizardPage extends PDEWizardNewFileCreationPage { fProductButton = new Button(fGroup, SWT.RADIO); fProductButton.setText(PDEUIMessages.ProductFileWizadPage_existingProduct); fProductButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fProductCombo.setEnabled(fProductButton.getSelection()); } @@ -102,6 +104,7 @@ public class ProductFileWizardPage extends PDEWizardNewFileCreationPage { fLaunchConfigButton = new Button(fGroup, SWT.RADIO); fLaunchConfigButton.setText(PDEUIMessages.ProductFileWizadPage_existingLaunchConfig); fLaunchConfigButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fLaunchConfigCombo.setEnabled(fLaunchConfigButton.getSelection()); } @@ -204,6 +207,7 @@ public class ProductFileWizardPage extends PDEWizardNewFileCreationPage { return USE_LAUNCH_CONFIG; } + @Override public void createControl(Composite parent) { super.createControl(parent); Dialog.applyDialogFont(fGroup); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFromExtensionOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFromExtensionOperation.java index 1fd40b9ce7..88dd14efc9 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFromExtensionOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductFromExtensionOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -29,6 +29,7 @@ public class ProductFromExtensionOperation extends BaseProductCreationOperation /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.product.BaseProductCreationOperation#initializeProduct(org.eclipse.pde.internal.core.iproduct.IProduct) */ + @Override protected void initializeProduct(IProduct product) { if (fId == null) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroOperation.java index 3c8c426f30..d52f030a0b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -49,6 +49,7 @@ public class ProductIntroOperation extends BaseManifestOperation implements IVar fProject = PluginRegistry.findModel(pluginId).getUnderlyingResource().getProject(); } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { IFile file = getFile(); @@ -141,6 +142,7 @@ public class ProductIntroOperation extends BaseManifestOperation implements IVar throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.pde.ui", IStatus.ERROR, NLS.bind(PDEUIMessages.ProductDefinitionOperation_readOnly, fPluginId), null)); //$NON-NLS-1$ ModelModification mod = new ModelModification(file) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IPluginModelBase)) return; @@ -317,6 +319,7 @@ public class ProductIntroOperation extends BaseManifestOperation implements IVar return key; } + @Override public Object getValue(String variable) { return null; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizard.java index 9113379cb1..6f2b1b2c89 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -37,6 +37,7 @@ public class ProductIntroWizard extends Wizard { setWindowTitle(PDEUIMessages.ProductIntroWizard_title); } + @Override public void addPages() { if (fNeedNewProduct) { fProductDefinitionPage = new ProductDefinitonWizardPage("product", fProduct); //$NON-NLS-1$ @@ -46,6 +47,7 @@ public class ProductIntroWizard extends Wizard { addPage(fNewIntroPage); } + @Override public boolean performFinish() { try { if (fNeedNewProduct) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizardPage.java index 1e58db6344..18c544cbdc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/ProductIntroWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -44,6 +44,7 @@ public class ProductIntroWizardPage extends WizardPage implements IHyperlinkList private IProduct fProduct; private ModifyListener fListener = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validatePage(); } @@ -57,6 +58,7 @@ public class ProductIntroWizardPage extends WizardPage implements IHyperlinkList fProduct = product; } + @Override public void createControl(Composite parent) { Composite comp = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -98,6 +100,7 @@ public class ProductIntroWizardPage extends WizardPage implements IHyperlinkList button.setText(PDEUIMessages.ProductIntroWizardPage_browse); SWTUtil.setButtonDimensionHint(button); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleBrowse(); } @@ -120,6 +123,7 @@ public class ProductIntroWizardPage extends WizardPage implements IHyperlinkList fIntroIdText.addModifyListener(fListener); } + @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { @@ -213,12 +217,15 @@ public class ProductIntroWizardPage extends WizardPage implements IHyperlinkList return (model == null) ? null : model.getPluginBase().getId(); } + @Override public void linkEntered(HyperlinkEvent e) { } + @Override public void linkExited(HyperlinkEvent e) { } + @Override public void linkActivated(HyperlinkEvent e) { String extPoint = "org.eclipse.ui." + e.getHref().toString(); //$NON-NLS-1$ IPluginExtensionPoint point = PDECore.getDefault().getExtensionsRegistry().findExtensionPoint(extPoint); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/RemoveSplashHandlerBindingAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/RemoveSplashHandlerBindingAction.java index 8a5fa1ae64..294a630fc4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/RemoveSplashHandlerBindingAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/RemoveSplashHandlerBindingAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -58,6 +58,7 @@ public class RemoveSplashHandlerBindingAction extends Action implements ISplashH /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { try { updateModel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/SynchronizationOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/SynchronizationOperation.java index 1a06ab3bbb..4c8e548586 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/SynchronizationOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/SynchronizationOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -39,6 +39,7 @@ public class SynchronizationOperation extends ProductDefinitionOperation { return index != -1 ? full.substring(0, index) : full; } + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { IPluginModelBase model = PluginRegistry.findModel(fPluginId); if (model == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashHandlerAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashHandlerAction.java index ca41f7ad05..8cbcb60761 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashHandlerAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashHandlerAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -112,6 +112,7 @@ public class UpdateSplashHandlerAction extends Action implements ISplashHandlerC /* (non-Javadoc) * @see org.eclipse.jface.action.Action#run() */ + @Override public void run() { try { updateModel(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashProgressOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashProgressOperation.java index 7da0b5c7ec..e51fb28410 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashProgressOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/product/UpdateSplashProgressOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -100,6 +100,7 @@ public class UpdateSplashProgressOperation implements IWorkspaceRunnable { /* (non-Javadoc) * @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void run(IProgressMonitor monitor) throws CoreException { // Set the progress monitor setMonitor(monitor); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationOperation.java index 647cdc1dfc..f980ec1616 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -93,6 +93,7 @@ public class NewSiteProjectCreationOperation extends WorkspaceModifyOperation { private void openFile(final IFile file) { fDisplay.asyncExec(new Runnable() { + @Override public void run() { IWorkbenchWindow ww = PDEPlugin.getActiveWorkbenchWindow(); if (ww == null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationPage.java index f2ae473336..3c0cbe9e54 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectCreationPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -40,6 +40,7 @@ public class NewSiteProjectCreationPage extends WizardNewProjectCreationPage { /** (non-Javadoc) * Method declared on IDialogPage. */ + @Override public void createControl(Composite parent) { super.createControl(parent); Composite control = (Composite) getControl(); @@ -62,6 +63,7 @@ public class NewSiteProjectCreationPage extends WizardNewProjectCreationPage { gd.horizontalSpan = 2; fWebButton.setLayoutData(gd); fWebButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fWebLabel.setEnabled(fWebButton.getSelection()); fWebText.setEnabled(fWebButton.getSelection()); @@ -78,6 +80,7 @@ public class NewSiteProjectCreationPage extends WizardNewProjectCreationPage { fWebText.setText("web"); //$NON-NLS-1$ fWebText.setEnabled(false); fWebText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { setPageComplete(validatePage()); } @@ -104,6 +107,7 @@ public class NewSiteProjectCreationPage extends WizardNewProjectCreationPage { return text.trim(); } + @Override protected boolean validatePage() { if (!super.validatePage()) return false; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectWizard.java index 00907fd24a..c3eeaed5b3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/NewSiteProjectWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -32,6 +32,7 @@ public class NewSiteProjectWizard extends NewWizard implements IExecutableExtens setWindowTitle(PDEUIMessages.NewSiteWizard_wtitle); } + @Override public void addPages() { fMainPage = new NewSiteProjectCreationPage("main"); //$NON-NLS-1$ fMainPage.setTitle(PDEUIMessages.NewSiteWizard_MainPage_title); @@ -42,6 +43,7 @@ public class NewSiteProjectWizard extends NewWizard implements IExecutableExtens addPage(fMainPage); } + @Override public boolean performFinish() { try { BasicNewProjectResourceWizard.updatePerspective(fConfig); @@ -59,6 +61,7 @@ public class NewSiteProjectWizard extends NewWizard implements IExecutableExtens return true; } + @Override public void setInitializationData(IConfigurationElement config, String property, Object data) throws CoreException { this.fConfig = config; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/OpenProjectWizardAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/OpenProjectWizardAction.java index a8adcfc87e..8a1a07e3ee 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/OpenProjectWizardAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/site/OpenProjectWizardAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2012 IBM Corporation and others. + * Copyright (c) 2003, 2015 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 @@ -35,6 +35,7 @@ public class OpenProjectWizardAction extends Action implements ICheatSheetAction /** * @see IActionDelegate#run(IAction) */ + @Override public void run() { run(new String[] {}, null); } @@ -42,6 +43,7 @@ public class OpenProjectWizardAction extends Action implements ICheatSheetAction /* (non-Javadoc) * @see org.eclipse.ui.cheatsheets.ICheatSheetAction#run(java.lang.String[], org.eclipse.ui.cheatsheets.ICheatSheetManager) */ + @Override public void run(String[] params, ICheatSheetManager manager) { Hashtable<String, String> defValues = new Hashtable<String, String>(); if (params.length > 0) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetDefinitionWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetDefinitionWizard.java index 2e7c8a6314..13293ee00b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetDefinitionWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetDefinitionWizard.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
+ * Copyright (c) 2009, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.target;
import org.eclipse.pde.core.target.ITargetDefinition;
@@ -44,6 +44,7 @@ public class EditTargetDefinitionWizard extends Wizard { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
// Do nothing, edited target is available
return true;
@@ -53,6 +54,7 @@ public class EditTargetDefinitionWizard extends Wizard { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
+ @Override
public void addPages() {
addPage(new TargetDefinitionContentPage(fDefinition));
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetNode.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetNode.java index 997c7a56f0..5e372f84ce 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetNode.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/EditTargetNode.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
+ * Copyright (c) 2009, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.target;
import org.eclipse.pde.core.target.ITargetDefinition;
@@ -28,6 +28,7 @@ public class EditTargetNode implements IWizardNode { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardNode#dispose()
*/
+ @Override
public void dispose() {
if (fWizard != null) {
fWizard.dispose();
@@ -39,6 +40,7 @@ public class EditTargetNode implements IWizardNode { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardNode#getExtent()
*/
+ @Override
public Point getExtent() {
return new Point(-1, -1);
}
@@ -46,6 +48,7 @@ public class EditTargetNode implements IWizardNode { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardNode#getWizard()
*/
+ @Override
public IWizard getWizard() {
if (fWizard == null) {
fWizard = new EditTargetDefinitionWizard(fDefinition, false);
@@ -57,6 +60,7 @@ public class EditTargetNode implements IWizardNode { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizardNode#isContentCreated()
*/
+ @Override
public boolean isContentCreated() {
return fWizard != null;
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionPage.java index dce817b2fe..1a5a2fb3ba 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -41,6 +41,7 @@ public class MoveTargetDefinitionPage extends PDEWizardNewFileCreationPage { /* (non-Javadoc) * @see org.eclipse.ui.dialogs.WizardNewFileCreationPage#createAdvancedControls(org.eclipse.swt.widgets.Composite) */ + @Override protected void createAdvancedControls(Composite parent) { //Hide the advanced control buttons } @@ -57,6 +58,7 @@ public class MoveTargetDefinitionPage extends PDEWizardNewFileCreationPage { /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.wizards.PDEWizardNewFileCreationPage#validatePage() */ + @Override protected boolean validatePage() { IPath path = getContainerFullPath(); if (fFilterList != null && path != null) { @@ -70,6 +72,7 @@ public class MoveTargetDefinitionPage extends PDEWizardNewFileCreationPage { return super.validatePage(); } + @Override public void createControl(Composite parent) { super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.MOVE_TARGET_WIZARD); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionWizard.java index adc2f42208..b600842ae7 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/MoveTargetDefinitionWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -36,6 +36,7 @@ public class MoveTargetDefinitionWizard extends BasicNewResourceWizard { setNeedsProgressMonitor(true); } + @Override public void addPages() { fPage = new MoveTargetDefinitionPage("New Target Definition", StructuredSelection.EMPTY); //$NON-NLS-1$ addPage(fPage); @@ -45,6 +46,7 @@ public class MoveTargetDefinitionWizard extends BasicNewResourceWizard { /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#performFinish() */ + @Override public boolean performFinish() { fPath = fPage.getContainerFullPath().append(fPage.getFileName()); return true; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard.java index c187e0c2b1..406c135711 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -30,6 +30,7 @@ public class NewTargetDefinitionWizard extends BasicNewResourceWizard { IPath fInitialPath = null; IPath fFilePath = null; + @Override public void addPages() { ftargetCreationPage = new TargetCreationPage("profile"); //$NON-NLS-1$ fPage = new TargetDefinitionWizardPage("profile", getSelection()); //$NON-NLS-1$ @@ -38,6 +39,7 @@ public class NewTargetDefinitionWizard extends BasicNewResourceWizard { addPage(fPage); } + @Override public boolean performFinish() { try { int option = fPage.getInitializationOption(); @@ -75,12 +77,14 @@ public class NewTargetDefinitionWizard extends BasicNewResourceWizard { return true; } + @Override public void init(IWorkbench workbench, IStructuredSelection currentSelection) { super.init(workbench, currentSelection); setWindowTitle(PDEUIMessages.NewTargetProfileWizard_title); setNeedsProgressMonitor(true); } + @Override protected void initializeDefaultPageImageDescriptor() { setDefaultPageImageDescriptor(PDEPluginImages.DESC_TARGET_WIZ); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard2.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard2.java index 63aeaf2c6d..dd29f728db 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard2.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/NewTargetDefinitionWizard2.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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,7 +7,7 @@ *
* Contributors:
* IBM Corporation - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/ package org.eclipse.pde.internal.ui.wizards.target;
import org.eclipse.pde.core.target.ITargetDefinition;
@@ -32,6 +32,7 @@ public class NewTargetDefinitionWizard2 extends Wizard { setNeedsProgressMonitor(true);
}
+ @Override
public void addPages() {
fPage = new TargetCreationPage("profile"); //$NON-NLS-1$
addPage(fPage);
@@ -41,6 +42,7 @@ public class NewTargetDefinitionWizard2 extends Wizard { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#canFinish()
*/
+ @Override
public boolean canFinish() {
return false;
}
@@ -48,6 +50,7 @@ public class NewTargetDefinitionWizard2 extends Wizard { /* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
return true;
}
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetCreationPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetCreationPage.java index e513d838cb..013ce51a7d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetCreationPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetCreationPage.java @@ -64,6 +64,7 @@ public class TargetCreationPage extends WizardSelectionPage { /* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
SWTFactory.createLabel(comp, PDEUIMessages.TargetCreationPage_0, 3);
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 80b52de9af..80ac148f0d 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 @@ -133,6 +133,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH, 0, 0); @@ -142,6 +143,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fNameText = SWTFactory.createSingleText(nameComp, 1); fNameText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String name = fNameText.getText().trim(); if (name.length() == 0) { @@ -202,11 +204,13 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { private void initializeListeners() { ITargetChangedListener listener = new ITargetChangedListener() { + @Override public void contentsChanged(ITargetDefinition definition, Object source, boolean resolve, boolean forceResolve) { boolean setCancelled = false; if (forceResolve || (resolve && !definition.isResolved())) { try { getContainer().run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { getTargetDefinition().resolve(new ResolutionProgressMonitor(monitor)); if (monitor.isCanceled()) { @@ -256,6 +260,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { if (!definition.isResolved()) { try { getContainer().run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { getTargetDefinition().resolve(new ResolutionProgressMonitor(monitor)); if (monitor.isCanceled()) { @@ -347,6 +352,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fOSCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER, 1, fOSChoices.toArray(new String[fOSChoices.size()])); fOSCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { getTargetDefinition().setOS(getModelValue(fOSCombo.getText())); } @@ -356,6 +362,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fWSCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER, 1, fWSChoices.toArray(new String[fWSChoices.size()])); fWSCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { getTargetDefinition().setWS(getModelValue(fWSCombo.getText())); } @@ -365,6 +372,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fArchCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER, 1, fArchChoices.toArray(new String[fArchChoices.size()])); fArchCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { getTargetDefinition().setArch(getModelValue(fArchCombo.getText())); } @@ -374,6 +382,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fNLCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER, 1, fNLChoices.toArray(new String[fNLChoices.size()])); fNLCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String value = fNLCombo.getText(); int index = value.indexOf("-"); //$NON-NLS-1$ @@ -487,6 +496,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fNamedJREsCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, VMUtil.getVMInstallNames()); fNamedJREsCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getVMInstall(fNamedJREsCombo.getText()))); } @@ -503,6 +513,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fExecEnvsCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, fExecEnvChoices.toArray(new String[fExecEnvChoices.size()])); fExecEnvsCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getText()))); } @@ -535,6 +546,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fProgramArgs = SWTFactory.createText(programGroup, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL, 1, 200, 60, GridData.FILL_BOTH); fProgramArgs.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { getTargetDefinition().setProgramArguments(fProgramArgs.getText().trim()); } @@ -553,6 +565,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fVMArgs = SWTFactory.createText(vmGroup, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL, 1, 200, 60, GridData.FILL_BOTH); fVMArgs.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { getTargetDefinition().setVMArguments(fVMArgs.getText().trim()); } @@ -646,6 +659,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { fElementViewer.getControl().setLayoutData(gd); fElementViewer.getControl().setFont(container.getFont()); fElementViewer.setContentProvider(new DefaultTableProvider() { + @Override public Object[] getElements(Object inputElement) { ITargetDefinition target = getTargetDefinition(); if (target != null) { @@ -668,6 +682,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { } }); fElementViewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { updateImpButtons(); } @@ -851,6 +866,7 @@ public class TargetDefinitionContentPage extends TargetDefinitionPage { * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean) */ + @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionWizardPage.java index c528e49bd9..524e3e7e17 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/target/TargetDefinitionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -47,12 +47,14 @@ public class TargetDefinitionWizardPage extends PDEWizardNewFileCreationPage { setFileExtension(EXTENSION); } + @Override public void createControl(Composite parent) { super.createControl(parent); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.TARGET_DEFINITION_PAGE); } + @Override protected void createAdvancedControls(Composite parent) { Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH); SWTFactory.createLabel(comp, PDEUIMessages.TargetCreationPage_0, 2); @@ -62,6 +64,7 @@ public class TargetDefinitionWizardPage extends PDEWizardNewFileCreationPage { fCurrentTPButton = SWTFactory.createRadioButton(comp, PDEUIMessages.TargetCreationPage_3, 2); fExistingTargetButton = SWTFactory.createRadioButton(comp, PDEUIMessages.TargetCreationPage_4, 1); fExistingTargetButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { boolean enabled = fExistingTargetButton.getSelection(); fTargets.setEnabled(enabled); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewExtensionTemplateWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewExtensionTemplateWizard.java index 2524b9e4e3..09e447b0cb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewExtensionTemplateWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewExtensionTemplateWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -55,11 +55,13 @@ public class NewExtensionTemplateWizard extends Wizard implements IExtensionWiza fSection = section; } + @Override public void init(IProject project, IPluginModelBase model) { this.fProject = project; this.fModel = model; } + @Override public void addPages() { fSection.addPages(this); setWindowTitle(fSection.getLabel()); @@ -68,8 +70,10 @@ public class NewExtensionTemplateWizard extends Wizard implements IExtensionWiza } } + @Override public boolean performFinish() { IRunnableWithProgress operation = new WorkspaceModifyOperation() { + @Override public void execute(IProgressMonitor monitor) { try { int totalWork = fSection.getNumberOfWorkUnits(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewPluginTemplateChoiceWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewPluginTemplateChoiceWizard.java index 40fc22728f..055eb13240 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewPluginTemplateChoiceWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/NewPluginTemplateChoiceWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -26,6 +26,7 @@ public class NewPluginTemplateChoiceWizard extends AbstractNewPluginTemplateWiza public NewPluginTemplateChoiceWizard() { } + @Override public ITemplateSection[] getTemplateSections() { if (fSelectionPage != null) { return fSelectionPage.getSelectedTemplates(); @@ -33,17 +34,20 @@ public class NewPluginTemplateChoiceWizard extends AbstractNewPluginTemplateWiza return getCandidates(); } + @Override public void addAdditionalPages() { fSelectionPage = new TemplateSelectionPage(getCandidates()); addPage(fSelectionPage); } + @Override public IWizardPage getNextPage(IWizardPage page) { if (fSelectionPage == null) return null; return fSelectionPage.getNextVisiblePage(page); } + @Override public IWizardPage getPreviousPage(IWizardPage page) { return null; } @@ -57,6 +61,7 @@ public class NewPluginTemplateChoiceWizard extends AbstractNewPluginTemplateWiza } // calculate canFinish only on selected templateSections and the status of their pages + @Override public boolean canFinish() { ITemplateSection[] sections = fSelectionPage.getSelectedTemplates(); for (int i = 0; i < sections.length; i++) { @@ -98,6 +103,7 @@ public class NewPluginTemplateChoiceWizard extends AbstractNewPluginTemplateWiza // by default, all pages in wizard get created. We add all the pages from the template sections and we don't want to initialize them yet // Therefore, the createPageControls only initializes the first page, allowing the other to be created as needed. + @Override public void createPageControls(Composite pageContainer) { fSelectionPage.createControl(pageContainer); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/PreprocessorParser.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/PreprocessorParser.java index 1d7e30fa05..c914672b7b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/PreprocessorParser.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/PreprocessorParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -152,6 +152,7 @@ public class PreprocessorParser { vars.put("b", "3"); //$NON-NLS-1$ //$NON-NLS-2$ vars.put("c", Boolean.TRUE); //$NON-NLS-1$ PreprocessorParser parser = new PreprocessorParser(new IVariableProvider() { + @Override public Object getValue(String variable) { return vars.get(variable); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/TemplateSelectionPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/TemplateSelectionPage.java index 04fc526c8b..78b1acf930 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/TemplateSelectionPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/templates/TemplateSelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -41,10 +41,12 @@ public class TemplateSelectionPage extends WizardPage { super(mainLabel); } + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { return super.createStructuredViewer(parent, style | SWT.FULL_SELECTION, toolkit); } + @Override protected void updateCounter(int amount) { super.updateCounter(amount); if (getContainer() != null) @@ -53,12 +55,14 @@ public class TemplateSelectionPage extends WizardPage { } class ListContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { return fCandidates; } } class ListLabelProvider extends LabelProvider implements ITableLabelProvider { + @Override public String getColumnText(Object obj, int index) { ITemplateSection section = (ITemplateSection) obj; if (index == 0) @@ -66,6 +70,7 @@ public class TemplateSelectionPage extends WizardPage { return section.getUsedExtensionPoint(); } + @Override public Image getColumnImage(Object obj, int index) { if (index == 0) return PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_EXTENSION_OBJ); @@ -93,6 +98,7 @@ public class TemplateSelectionPage extends WizardPage { fVisiblePages = new ArrayList<WizardPage>(); } + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); @@ -101,6 +107,7 @@ public class TemplateSelectionPage extends WizardPage { /** * @see IDialogPage#createControl(Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); @@ -113,6 +120,7 @@ public class TemplateSelectionPage extends WizardPage { initializeTable(viewer.getTable()); viewer.addSelectionChangedListener(new ISelectionChangedListener() { + @Override public void selectionChanged(SelectionChangedEvent event) { IStructuredSelection sel = (IStructuredSelection) event.getSelection(); handleSelectionChanged((ITemplateSection) sel.getFirstElement()); @@ -169,12 +177,14 @@ public class TemplateSelectionPage extends WizardPage { fDescriptionBrowser.setText(text); } + @Override public boolean canFlipToNextPage() { if (fTablePart.getSelectionCount() == 0) return false; return super.canFlipToNextPage(); } + @Override public IWizardPage getNextPage() { ITemplateSection[] sections = getSelectedTemplates(); fVisiblePages.clear(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertJarsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertJarsAction.java index a124071902..eafabba424 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertJarsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertJarsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2013 IBM Corporation and others. + * Copyright (c) 2008, 2015 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 @@ -41,6 +41,7 @@ public class ConvertJarsAction implements IObjectActionDelegate { /** * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { workbench = targetPart.getSite().getWorkbenchWindow().getWorkbench(); } @@ -48,6 +49,7 @@ public class ConvertJarsAction implements IObjectActionDelegate { /** * @see IActionDelegate#run(IAction) */ + @Override public void run(IAction action) { Map<Manifest, Object> filesMap = new HashMap<Manifest, Object>(); Set<IProject> projectSelection = new HashSet<IProject>(); @@ -94,6 +96,7 @@ public class ConvertJarsAction implements IObjectActionDelegate { /** * @see IActionDelegate#selectionChanged(IAction, ISelection) */ + @Override public void selectionChanged(IAction action, ISelection s) { boolean enabled = true; if (s instanceof IStructuredSelection) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizard.java index cbf0953ef4..6148427fa8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Rapicorp Corporation and others. + * Copyright (c) 2014, 2015 Rapicorp 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 @@ -64,6 +64,7 @@ public class ConvertPreferencesWizard extends Wizard { setNeedsProgressMonitor(true); } + @Override public boolean performFinish() { this.fPluginCustomizeFilePath = page.getPluginCustomizeFile().getFullPath().toString(); this.fPreferencesFilePath = page.getPreferencesFile().getAbsolutePath(); @@ -79,6 +80,7 @@ public class ConvertPreferencesWizard extends Wizard { return true; } + @Override public void addPages() { page = new ConvertPreferencesWizardPage(fPluginCustomizeFilePath, fPreferencesFilePath, fOverwrite); addPage(page); @@ -87,6 +89,7 @@ public class ConvertPreferencesWizard extends Wizard { private IRunnableWithProgress getGenerateOperation() { return new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask(PDEUIMessages.ConvertPreferencesWizard_progress, 100); File prefsFile = page.getPreferencesFile(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizardPage.java index c9fb819836..8b3f92be25 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertPreferencesWizardPage.java @@ -50,11 +50,13 @@ public class ConvertPreferencesWizardPage extends WizardPage { this.fOverwrite = overwrite; } + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -79,6 +81,7 @@ public class ConvertPreferencesWizardPage extends WizardPage { browse.setText(PDEUIMessages.ConvertPreferencesWizardPage_source_browse); browse.setLayoutData(new GridData()); browse.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleBrowsePreferences(); } @@ -94,6 +97,7 @@ public class ConvertPreferencesWizardPage extends WizardPage { } } fPreferenceCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent event) { pageChanged(true); } @@ -118,6 +122,7 @@ public class ConvertPreferencesWizardPage extends WizardPage { } fPluginCustomizeCombo.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent event) { pageChanged(true); } @@ -127,6 +132,7 @@ public class ConvertPreferencesWizardPage extends WizardPage { browse.setText(PDEUIMessages.ConvertPreferencesWizardPage_target_browse); browse.setLayoutData(new GridData()); browse.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { handleBrowsePluginCustomization(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectToPluginOperation.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectToPluginOperation.java index 918c03c9be..6a50a11499 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectToPluginOperation.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectToPluginOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -70,6 +70,7 @@ public class ConvertProjectToPluginOperation extends WorkspaceModifyOperation { * @param monitor * Progress monitor */ + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { try { @@ -201,6 +202,7 @@ public class ConvertProjectToPluginOperation extends WorkspaceModifyOperation { private void organizeExports(final IProject project) { PDEModelUtility.modifyModel(new ModelModification(PDEProject.getManifest(project)) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IBundlePluginModelBase)) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectsAction.java index a0f6ba4322..976377366a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertProjectsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -38,6 +38,7 @@ public class ConvertProjectsAction implements IObjectActionDelegate { * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, * org.eclipse.ui.IWorkbenchPart) */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { } @@ -46,6 +47,7 @@ public class ConvertProjectsAction implements IObjectActionDelegate { * * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ + @Override public void run(IAction action) { IProject[] unconverted = getUnconvertedProjects(); if (unconverted.length == 0) { @@ -78,6 +80,7 @@ public class ConvertProjectsAction implements IObjectActionDelegate { final Display display = getDisplay(); final WizardDialog dialog = new WizardDialog(display.getActiveShell(), wizard); BusyIndicator.showWhile(display, new Runnable() { + @Override public void run() { dialog.open(); } @@ -91,6 +94,7 @@ public class ConvertProjectsAction implements IObjectActionDelegate { * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, * org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(IAction action, ISelection selection) { fSelection = selection; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectWizard.java index c5487fbe73..d6c5faa4c6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,11 +44,13 @@ public class ConvertedProjectWizard extends NewWizard { this.fUnconverted = projects; } + @Override public void addPages() { mainPage = new ConvertedProjectsPage(fUnconverted, selected); addPage(mainPage); } + @Override public boolean performFinish() { return mainPage.finish(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectsPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectsPage.java index 944fdf305e..2f568d5885 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectsPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/ConvertedProjectsPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -56,10 +56,12 @@ public class ConvertedProjectsPage extends WizardPage { * Label provider for the table */ public class ProjectLabelProvider extends LabelProvider { + @Override public Image getImage(Object element) { return PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT); } + @Override public String getText(Object element) { return ((IProject) element).getName(); } @@ -76,6 +78,7 @@ public class ConvertedProjectsPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH); @@ -88,6 +91,7 @@ public class ConvertedProjectsPage extends WizardPage { fProjectViewer.setInput(fAllUnconvertedProjects); fProjectViewer.setCheckedElements(fInitialSelection); fProjectViewer.addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { updateButtons(); } @@ -97,6 +101,7 @@ public class ConvertedProjectsPage extends WizardPage { fSelectButton = SWTFactory.createPushButton(buttonContainer, PDEUIMessages.ConvertedProjectsPage_SelectAll, null); fSelectButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fProjectViewer.setAllChecked(true); updateButtons(); @@ -104,6 +109,7 @@ public class ConvertedProjectsPage extends WizardPage { }); fDeselectButton = SWTFactory.createPushButton(buttonContainer, PDEUIMessages.ConvertedProjectsPage_DeselectAll, null); fDeselectButton.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { fProjectViewer.setAllChecked(false); updateButtons(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java index c786777b4f..314809ce6e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -202,6 +202,7 @@ public class OrganizeManifest implements IOrganizeManifestsSettings { return new TextFileChange[0]; return PDEModelUtility.changesForModelModication(new ModelModification(propertiesFile) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (!(model instanceof IBuildModel)) return; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsAction.java index beb1f4f977..26a425e3fd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -36,6 +36,7 @@ public class OrganizeManifestsAction extends AbstractHandler { /* (non-Javadoc) * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) */ + @Override public Object execute(ExecutionEvent event) throws ExecutionException { runOrganizeManfestsAction(HandlerUtil.getCurrentSelection(event)); return null; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java index c405749239..58e95c86bd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -54,6 +54,7 @@ public class OrganizeManifestsProcessor extends RefactoringProcessor implements fProjectList = projects; } + @Override public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException, OperationCanceledException { RefactoringStatus status = new RefactoringStatus(); for (Iterator<?> i = fProjectList.iterator(); i.hasNext();) { @@ -63,10 +64,12 @@ public class OrganizeManifestsProcessor extends RefactoringProcessor implements return status; } + @Override public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException { return null; } + @Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { CompositeChange change = new CompositeChange(""); //$NON-NLS-1$ change.markAsSynthetic(); @@ -87,6 +90,7 @@ public class OrganizeManifestsProcessor extends RefactoringProcessor implements final Change[] result = {null, null}; final Exception[] ee = new Exception[1]; ModelModification modification = new ModelModification(fCurrentProject) { + @Override protected void modifyModel(IBaseModel model, IProgressMonitor monitor) throws CoreException { if (model instanceof IBundlePluginModelBase) try { @@ -209,22 +213,27 @@ public class OrganizeManifestsProcessor extends RefactoringProcessor implements } } + @Override public Object[] getElements() { return fProjectList.toArray(); } + @Override public String getIdentifier() { return getClass().getName(); } + @Override public String getProcessorName() { return PDEUIMessages.OrganizeManifestsWizardPage_title; } + @Override public boolean isApplicable() throws CoreException { return true; } + @Override public RefactoringParticipant[] loadParticipants(RefactoringStatus status, SharableParticipants sharedParticipants) throws CoreException { return new RefactoringParticipant[0]; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java index 40bd7d3f4e..c3883a5ed2 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -37,11 +37,13 @@ public class OrganizeManifestsWizard extends RefactoringWizard { setDefaultPageImageDescriptor(PDEPluginImages.DESC_ORGANIZE_MANIFESTS); } + @Override public boolean performFinish() { fMainPage.performOk(); return super.performFinish(); } + @Override protected void addUserInputPages() { setDefaultPageTitle(getRefactoring().getName()); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java index 7ee54b5d98..ef63c79233 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/OrganizeManifestsWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -61,6 +61,7 @@ public class OrganizeManifestsWizardPage extends UserInputWizardPage implements fCustomProjects = customProjects; } + @Override public void createControl(Composite parent) { Composite container = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL); @@ -307,23 +308,27 @@ public class OrganizeManifestsWizardPage extends UserInputWizardPage implements private void hookListeners() { hookSelectionListener(new Button[] {fMarkInternal, fModifyDependencies}, new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { setEnabledStates(); doProcessorSetting(e.getSource()); } }); hookSelectionListener(fTopLevelButtons, new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { setPageComplete(); doProcessorSetting(e.getSource()); } }); hookSelectionListener(new Button[] {fRemoveImport, fOptionalImport}, new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { doProcessorSetting(e.getSource()); } }); hookTextListener(new Text[] {fPackageFilter}, new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { doProcessorSetting(e.getSource()); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizard.java index 5cf6a348d4..633154006f 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -41,6 +41,7 @@ public class UpdateBuildpathWizard extends Wizard { return setting; } + @Override public boolean performFinish() { if (!PlatformUI.getWorkbench().saveAllEditors(true)) return false; @@ -55,6 +56,7 @@ public class UpdateBuildpathWizard extends Wizard { return true; } + @Override public void addPages() { page1 = new UpdateBuildpathWizardPage(fUnupdated, fSelected); addPage(page1); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizardPage.java index cb32509484..9920109ec1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateBuildpathWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -32,6 +32,7 @@ public class UpdateBuildpathWizardPage extends WizardPage { private TablePart tablePart; public class BuildpathContentProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object parent) { if (fUnmigrated != null) return fUnmigrated; @@ -44,11 +45,13 @@ public class UpdateBuildpathWizardPage extends WizardPage { super(mainLabel); } + @Override public void updateCounter(int count) { super.updateCounter(count); dialogChanged(); } + @Override protected StructuredViewer createStructuredViewer(Composite parent, int style, FormToolkit toolkit) { StructuredViewer viewer = super.createStructuredViewer(parent, style, toolkit); viewer.setComparator(ListUtil.PLUGIN_COMPARATOR); @@ -66,11 +69,13 @@ public class UpdateBuildpathWizardPage extends WizardPage { PDEPlugin.getDefault().getLabelProvider().connect(this); } + @Override public void dispose() { super.dispose(); PDEPlugin.getDefault().getLabelProvider().disconnect(this); } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -111,6 +116,7 @@ public class UpdateBuildpathWizardPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.wizard.WizardPage#isPageComplete() */ + @Override public boolean isPageComplete() { return tablePart.getSelectionCount() > 0; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathAction.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathAction.java index 948ad811e6..3465a15f5d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathAction.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -35,6 +35,7 @@ import org.eclipse.ui.handlers.HandlerUtil; */ public class UpdateClasspathAction extends AbstractHandler { + @Override public Object execute(ExecutionEvent event) throws ExecutionException { IPluginModelBase[] fUnupdated = getModelsToUpdate(); if (fUnupdated.length == 0) { @@ -74,6 +75,7 @@ public class UpdateClasspathAction extends AbstractHandler { UpdateBuildpathWizard wizard = new UpdateBuildpathWizard(fUnupdated, modelArray); final WizardDialog dialog = new WizardDialog(PDEPlugin.getActiveWorkbenchShell(), wizard); BusyIndicator.showWhile(PDEPlugin.getActiveWorkbenchShell().getDisplay(), new Runnable() { + @Override public void run() { dialog.open(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java index 3359c8bcf1..96d0c9d77b 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/wizards/tools/UpdateClasspathJob.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -68,6 +68,7 @@ public class UpdateClasspathJob extends Job { class UpdateClasspathWorkspaceRunnable implements IWorkspaceRunnable { boolean fCanceled = false; + @Override public void run(IProgressMonitor monitor) throws CoreException { fCanceled = doUpdateClasspath(monitor, fModels); } @@ -80,6 +81,7 @@ public class UpdateClasspathJob extends Job { /* (non-Javadoc) * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override protected IStatus run(IProgressMonitor monitor) { try { UpdateClasspathWorkspaceRunnable runnable = new UpdateClasspathWorkspaceRunnable(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/IProvisionerWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/IProvisionerWizard.java index 31725de430..aec402c9bd 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/IProvisionerWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/IProvisionerWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -24,6 +24,7 @@ import org.eclipse.pde.ui.target.ITargetLocationWizard; * @since 3.3 */ +@Deprecated public interface IProvisionerWizard extends IBasePluginWizard { /** diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractLauncherTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractLauncherTab.java index 2195532751..44fc340669 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractLauncherTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractLauncherTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -34,6 +34,7 @@ public abstract class AbstractLauncherTab extends AbstractLaunchConfigurationTab * @param span the span of the label * @deprecated */ + @Deprecated protected void createStartingSpace(Composite parent, int span) { Label label = new Label(parent, SWT.NULL); GridData data = new GridData(); @@ -47,6 +48,7 @@ public abstract class AbstractLauncherTab extends AbstractLaunchConfigurationTab * @return <code>true</code> if the tab is valid, <code>false</code> otherwise * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public boolean isValid(ILaunchConfiguration config) { return getErrorMessage() == null; } @@ -54,12 +56,14 @@ public abstract class AbstractLauncherTab extends AbstractLaunchConfigurationTab /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void activated(ILaunchConfigurationWorkingCopy workingCopy) { } /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) { } @@ -68,6 +72,7 @@ public abstract class AbstractLauncherTab extends AbstractLaunchConfigurationTab * * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog() */ + @Override public void updateLaunchConfigurationDialog() { validateTab(); super.updateLaunchConfigurationDialog(); @@ -76,6 +81,7 @@ public abstract class AbstractLauncherTab extends AbstractLaunchConfigurationTab /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#scheduleUpdateJob() */ + @Override public void scheduleUpdateJob() { super.scheduleUpdateJob(); } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfiguration.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfiguration.java index 426837c4b5..a1d6e3556d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfiguration.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -19,6 +19,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link org.eclipse.pde.launching.AbstractPDELaunchConfiguration} * @see org.eclipse.pde.launching.AbstractPDELaunchConfiguration */ +@Deprecated public abstract class AbstractPDELaunchConfiguration extends org.eclipse.pde.launching.AbstractPDELaunchConfiguration { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfigurationTabGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfigurationTabGroup.java index ccfaa4d2a8..1216ccf68c 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfigurationTabGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/AbstractPDELaunchConfigurationTabGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -46,10 +46,12 @@ public abstract class AbstractPDELaunchConfigurationTabGroup extends AbstractLau * * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration configuration) { final ILaunchConfiguration config = configuration; final ILaunchConfigurationTab[] tabs = getTabs(); BusyIndicator.showWhile(Display.getCurrent(), new Runnable() { + @Override public void run() { try { if (config instanceof ILaunchConfigurationWorkingCopy) { @@ -110,6 +112,7 @@ public abstract class AbstractPDELaunchConfigurationTabGroup extends AbstractLau * * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { super.setDefaults(configuration); if (TargetPlatformHelper.usesNewApplicationModel()) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/BundlesTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/BundlesTab.java index 94ff12b955..294dde69cc 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/BundlesTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/BundlesTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -55,6 +55,7 @@ public class BundlesTab extends AbstractLauncherTab { * Dispose images * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose() */ + @Override public void dispose() { fBlock.dispose(); fImage.dispose(); @@ -65,6 +66,7 @@ public class BundlesTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); @@ -82,6 +84,7 @@ public class BundlesTab extends AbstractLauncherTab { * * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration config) { try { int index = PLUGIN_SELECTION; @@ -102,6 +105,7 @@ public class BundlesTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { fBlock.setDefaults(config); } @@ -110,6 +114,7 @@ public class BundlesTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy config) { fFrameworkBlock.performApply(config); fBlock.performApply(config); @@ -119,6 +124,7 @@ public class BundlesTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return PDEUIMessages.BundlesTab_title; } @@ -127,6 +133,7 @@ public class BundlesTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() */ + @Override public Image getImage() { return fImage; } @@ -135,6 +142,7 @@ public class BundlesTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void activated(ILaunchConfigurationWorkingCopy config) { } @@ -142,12 +150,14 @@ public class BundlesTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab() */ + @Override public void validateTab() { } /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() */ + @Override public String getId() { return IPDELauncherConstants.TAB_BUNDLES_ID; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/ConfigurationTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/ConfigurationTab.java index f12dfcef3d..a65fbde5f3 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/ConfigurationTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/ConfigurationTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -67,6 +67,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); container.setLayout(new GridLayout()); @@ -84,6 +85,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { fConfigurationArea.setDefaults(configuration, fJUnitConfig); fTemplateArea.setDefaults(configuration); @@ -93,6 +95,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration configuration) { try { fConfigurationArea.initializeFrom(configuration); @@ -106,6 +109,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { fConfigurationArea.performApply(configuration); fTemplateArea.performApply(configuration); @@ -116,6 +120,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return PDEUIMessages.ConfigurationTab_name; } @@ -124,6 +129,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage() */ + @Override public Image getImage() { return fImage; } @@ -132,6 +138,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#dispose() */ + @Override public void dispose() { if (fImage != null) fImage.dispose(); @@ -143,6 +150,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche * * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab() */ + @Override public void validateTab() { String error = fConfigurationArea.validate(); if (error == null) @@ -156,6 +164,7 @@ public class ConfigurationTab extends AbstractLauncherTab implements IPDELaunche /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() */ + @Override public String getId() { return org.eclipse.pde.launching.IPDELauncherConstants.TAB_CONFIGURATION_ID; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java index ae835a7a34..3444554b2e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLaunchShortcut.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -60,6 +60,7 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String) */ + @Override public void launch(IEditorPart editor, String mode) { fApplicationName = null; fModel = null; @@ -70,6 +71,7 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String) */ + @Override public void launch(ISelection selection, String mode) { IPluginModelBase model = null; if (selection instanceof IStructuredSelection) { @@ -122,6 +124,7 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { /* (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLaunchShortcut#findLaunchConfiguration(java.lang.String) */ + @Override protected ILaunchConfiguration findLaunchConfiguration(String mode) { ILaunchConfiguration config = super.findLaunchConfiguration(mode); if (config != null) { @@ -191,6 +194,7 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { * @return <code>true</coded> if the launch configuration is suitable for the application * or product to launch with, <code>false</code> otherwise. */ + @Override protected boolean isGoodMatch(ILaunchConfiguration configuration) { try { if (!configuration.getAttribute(IPDELauncherConstants.USE_PRODUCT, false)) { @@ -221,6 +225,7 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { * * @since 3.3 */ + @Override protected void initializeConfiguration(ILaunchConfigurationWorkingCopy wc) { if (TargetPlatformHelper.usesNewApplicationModel()) wc.setAttribute(IPDEConstants.LAUNCHER_PDE_VERSION, "3.3"); //$NON-NLS-1$ @@ -272,6 +277,7 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { * * @return the Eclipse application configuration type ID */ + @Override protected String getLaunchConfigurationTypeName() { return CONFIGURATION_TYPE; } @@ -279,6 +285,7 @@ public class EclipseLaunchShortcut extends AbstractLaunchShortcut { /* (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLaunchShortcut#getName(org.eclipse.debug.core.ILaunchConfigurationType) */ + @Override protected String getName(ILaunchConfigurationType type) { // if launching default product, use default naming convention if (fApplicationName == null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLauncherTabGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLauncherTabGroup.java index 4d55c63e3a..0f150aec6e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLauncherTabGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EclipseLauncherTabGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -31,6 +31,7 @@ public class EclipseLauncherTabGroup extends AbstractPDELaunchConfigurationTabGr * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) */ + @Override public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ILaunchConfigurationTab[] tabs = null; tabs = new ILaunchConfigurationTab[] {new MainTab(), new JavaArgumentsTab(), new PluginsTab(), new ConfigurationTab(), new TracingTab(), new EnvironmentTab(), new CommonTab()}; @@ -40,6 +41,7 @@ public class EclipseLauncherTabGroup extends AbstractPDELaunchConfigurationTabGr /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { super.performApply(configuration); try { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxPluginsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxPluginsTab.java index 92ad5c57b3..179e122ddb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxPluginsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxPluginsTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -20,6 +20,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link BundlesTab} * @noextend This class is not intended to be subclassed by clients. */ +@Deprecated public class EquinoxPluginsTab extends BundlesTab { /** diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxSettingsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxSettingsTab.java index 1ffe84fe9f..17134fae4d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxSettingsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/EquinoxSettingsTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -20,6 +20,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link OSGiSettingsTab} * @noextend This class is not intended to be subclassed by clients. */ +@Deprecated public class EquinoxSettingsTab extends OSGiSettingsTab { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/IPDELauncherConstants.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/IPDELauncherConstants.java index a664283c71..121ea86eeb 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/IPDELauncherConstants.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/IPDELauncherConstants.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -22,6 +22,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link org.eclipse.pde.launching.IPDELauncherConstants} instead. * @see org.eclipse.pde.launching.IPDELauncherConstants */ +@Deprecated public interface IPDELauncherConstants extends org.eclipse.pde.launching.IPDELauncherConstants { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java index 34c81d2520..e348d73e53 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitLaunchConfigurationDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -20,6 +20,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate} instead. * @see org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate */ +@Deprecated public class JUnitLaunchConfigurationDelegate extends org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitTabGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitTabGroup.java index a55eaaaacc..9aee17b55d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitTabGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitTabGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -26,6 +26,7 @@ public class JUnitTabGroup extends AbstractPDELaunchConfigurationTabGroup { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) */ + @Override public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ILaunchConfigurationTab[] tabs = null; tabs = new ILaunchConfigurationTab[] {new TestTab(), new PluginJUnitMainTab(), new JavaArgumentsTab(), new PluginsTab(), new ConfigurationTab(true), new TracingTab(), new EnvironmentTab(), new CommonTab()}; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java index 6a71a9061b..f6f5969aa6 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/JUnitWorkbenchLaunchShortcut.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -36,6 +36,7 @@ public class JUnitWorkbenchLaunchShortcut extends JUnitLaunchShortcut { /* (non-Javadoc) * @see org.eclipse.jdt.junit.JUnitLaunchShortcut#getLaunchConfigurationTypeId() */ + @Override protected String getLaunchConfigurationTypeId() { return "org.eclipse.pde.ui.JunitLaunchConfig"; //$NON-NLS-1$ } @@ -43,6 +44,7 @@ public class JUnitWorkbenchLaunchShortcut extends JUnitLaunchShortcut { /* (non-Javadoc) * @see org.eclipse.jdt.junit.JUnitLaunchShortcut#createLaunchConfiguration(org.eclipse.jdt.core.IJavaElement) */ + @Override protected ILaunchConfigurationWorkingCopy createLaunchConfiguration(IJavaElement element) throws CoreException { ILaunchConfigurationWorkingCopy configuration = super.createLaunchConfiguration(element); String configName = configuration.getName(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/MainTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/MainTab.java index 6ba9d01d8c..540abec6be 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/MainTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/MainTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2012 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -57,6 +57,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose() */ + @Override public void dispose() { fImage.dispose(); super.dispose(); @@ -66,6 +67,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { final ScrolledComposite scrollContainer = new ScrolledComposite(parent, SWT.V_SCROLL); scrollContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); @@ -82,6 +84,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant // Add listener for each control to recalculate scroll bar when it is entered. // This results in scrollbar scrolling when user tabs to a control that is not in the field of view. Listener listener = new Listener() { + @Override public void handleEvent(Event e) { Control child = (Control) e.widget; Rectangle bounds = child.getBounds(); @@ -126,6 +129,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration config) { try { fDataBlock.initializeFrom(config, false); @@ -141,6 +145,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { fDataBlock.setDefaults(config, false); fProgramBlock.setDefaults(config); @@ -151,6 +156,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy config) { fDataBlock.performApply(config, false); fProgramBlock.performApply(config); @@ -161,6 +167,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return PDEUIMessages.MainTab_name; } @@ -169,6 +176,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() */ + @Override public Image getImage() { return fImage; } @@ -201,6 +209,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab() */ + @Override public void validateTab() { String error = fDataBlock.validate(); if (error == null) @@ -211,6 +220,7 @@ public class MainTab extends AbstractLauncherTab implements IPDELauncherConstant /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() */ + @Override public String getId() { return org.eclipse.pde.launching.IPDELauncherConstants.TAB_MAIN_ID; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationDelegate.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationDelegate.java index f22bf9c164..b618fe4f18 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationDelegate.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -19,6 +19,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link org.eclipse.pde.launching.OSGiLaunchConfigurationDelegate} instead. * @see org.eclipse.pde.launching.OSGiLaunchConfigurationDelegate */ +@Deprecated public class OSGiLaunchConfigurationDelegate extends org.eclipse.pde.launching.OSGiLaunchConfigurationDelegate { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationInitializer.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationInitializer.java index 2979d01aa7..efa9c9a5e8 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationInitializer.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchConfigurationInitializer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -22,6 +22,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link org.eclipse.pde.launching.OSGiLaunchConfigurationInitializer} instead. * @see org.eclipse.pde.launching.OSGiLaunchConfigurationInitializer */ +@Deprecated public class OSGiLaunchConfigurationInitializer extends org.eclipse.pde.launching.OSGiLaunchConfigurationInitializer { } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchShortcut.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchShortcut.java index 96b198f81d..7dc5b83ed1 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchShortcut.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLaunchShortcut.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class OSGiLaunchShortcut extends AbstractLaunchShortcut { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String) */ + @Override public void launch(ISelection selection, String mode) { launch(mode); } @@ -40,6 +41,7 @@ public class OSGiLaunchShortcut extends AbstractLaunchShortcut { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String) */ + @Override public void launch(IEditorPart editor, String mode) { launch(mode); } @@ -48,6 +50,7 @@ public class OSGiLaunchShortcut extends AbstractLaunchShortcut { * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLaunchShortcut#getLaunchConfigurationTypeName() */ + @Override protected String getLaunchConfigurationTypeName() { return IPDELauncherConstants.OSGI_CONFIGURATION_TYPE; } @@ -60,6 +63,7 @@ public class OSGiLaunchShortcut extends AbstractLaunchShortcut { * </p> * @see org.eclipse.pde.ui.launcher.AbstractLaunchShortcut#initializeConfiguration(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override protected void initializeConfiguration(ILaunchConfigurationWorkingCopy configuration) { OSGiFrameworkManager manager = PDELaunchingPlugin.getDefault().getOSGiFrameworkManager(); manager.getDefaultInitializer().initialize(configuration); @@ -69,6 +73,7 @@ public class OSGiLaunchShortcut extends AbstractLaunchShortcut { * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLaunchShortcut#isGoodMatch(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override protected boolean isGoodMatch(ILaunchConfiguration configuration) { return true; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLauncherTabGroup.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLauncherTabGroup.java index 611da43759..2a540321e0 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLauncherTabGroup.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiLauncherTabGroup.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class OSGiLauncherTabGroup extends AbstractLaunchConfigurationTabGroup { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) */ + @Override public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {new BundlesTab(), new JavaArgumentsTab(), new OSGiSettingsTab(), new TracingTab(), new EnvironmentTab(), new CommonTab()}; setTabs(tabs); @@ -47,6 +48,7 @@ public class OSGiLauncherTabGroup extends AbstractLaunchConfigurationTabGroup { * * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { super.setDefaults(configuration); OSGiFrameworkManager manager = PDELaunchingPlugin.getDefault().getOSGiFrameworkManager(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java index 98498d2d8c..e60ab5cd84 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -57,6 +57,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); container.setLayout(new GridLayout()); @@ -73,6 +74,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { fJREBlock.setDefaults(configuration); fConfigurationBlock.setDefaults(configuration, false); @@ -81,6 +83,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration configuration) { try { fInitializing = true; @@ -94,6 +97,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { fJREBlock.performApply(configuration); fConfigurationBlock.performApply(configuration); @@ -103,6 +107,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return PDEUIMessages.EquinoxSettingsTab_name; } @@ -111,6 +116,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getImage() */ + @Override public Image getImage() { return fImage; } @@ -119,6 +125,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#dispose() */ + @Override public void dispose() { if (fImage != null) fImage.dispose(); @@ -128,6 +135,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab() */ + @Override public void validateTab() { } @@ -135,6 +143,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#updateLaunchConfigurationDialog() */ + @Override public void updateLaunchConfigurationDialog() { if (!fInitializing) super.updateLaunchConfigurationDialog(); @@ -143,6 +152,7 @@ public class OSGiSettingsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() */ + @Override public String getId() { return IPDELauncherConstants.TAB_OSGI_SETTINGS_ID; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PDESourcePathProvider.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PDESourcePathProvider.java index 6b11c0c00b..ef4fc7f3f4 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PDESourcePathProvider.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PDESourcePathProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -19,6 +19,7 @@ package org.eclipse.pde.ui.launcher; * @deprecated use {@link org.eclipse.pde.launching.PDESourcePathProvider} instead. * @see org.eclipse.pde.launching.PDESourcePathProvider */ +@Deprecated public class PDESourcePathProvider extends org.eclipse.pde.launching.PDESourcePathProvider { }
\ No newline at end of file diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginJUnitMainTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginJUnitMainTab.java index c04dcdf772..193fa61369 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginJUnitMainTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginJUnitMainTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -32,6 +32,7 @@ public class PluginJUnitMainTab extends MainTab { /** * Overrides the implementation of the basis MainTab. */ + @Override protected void createProgramBlock() { fProgramBlock = new JUnitProgramBlock(this); } @@ -40,6 +41,7 @@ public class PluginJUnitMainTab extends MainTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration config) { try { fDataBlock.initializeFrom(config, true); @@ -55,6 +57,7 @@ public class PluginJUnitMainTab extends MainTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { fDataBlock.setDefaults(config, true); fProgramBlock.setDefaults(config); @@ -65,6 +68,7 @@ public class PluginJUnitMainTab extends MainTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy config) { fDataBlock.performApply(config, true); fProgramBlock.performApply(config); @@ -74,6 +78,7 @@ public class PluginJUnitMainTab extends MainTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() */ + @Override public String getId() { return IPDELauncherConstants.TAB_PLUGIN_JUNIT_MAIN_ID; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java index dd8fb81bbd..8d03fda31d 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/PluginsTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -49,6 +49,7 @@ public class PluginsTab extends AbstractLauncherTab { private static final int FEATURE_SELECTION = 2; class Listener extends SelectionAdapter implements ModifyListener { + @Override public void widgetSelected(SelectionEvent e) { int index = fSelectionCombo.getSelectionIndex(); try { @@ -60,6 +61,7 @@ public class PluginsTab extends AbstractLauncherTab { updateLaunchConfigurationDialog(); } + @Override public void modifyText(ModifyEvent e) { updateLaunchConfigurationDialog(); } @@ -84,6 +86,7 @@ public class PluginsTab extends AbstractLauncherTab { * self-hosting option. * @deprecated As of 3.6 the feature-based workspace launch option is no longer available, so there is no need to set this flag */ + @Deprecated public PluginsTab(boolean showFeatures) { this(); } @@ -92,6 +95,7 @@ public class PluginsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose() */ + @Override public void dispose() { fBlock.dispose(); fImage.dispose(); @@ -102,6 +106,7 @@ public class PluginsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL); @@ -145,6 +150,7 @@ public class PluginsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration configuration) { try { int index = DEFAULT_SELECTION; @@ -172,6 +178,7 @@ public class PluginsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { configuration.setAttribute(IPDELauncherConstants.USE_DEFAULT, true); // The use features option was removed in 3.6 @@ -184,6 +191,7 @@ public class PluginsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy configuration) { int index = fSelectionCombo.getSelectionIndex(); configuration.setAttribute(IPDELauncherConstants.USE_DEFAULT, index == DEFAULT_SELECTION); @@ -211,6 +219,7 @@ public class PluginsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return PDEUIMessages.AdvancedLauncherTab_name; } @@ -219,6 +228,7 @@ public class PluginsTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() */ + @Override public Image getImage() { return fImage; } @@ -229,6 +239,7 @@ public class PluginsTab extends AbstractLauncherTab { * * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab() */ + @Override public void validateTab() { String errorMessage = null; setErrorMessage(errorMessage); @@ -237,6 +248,7 @@ public class PluginsTab extends AbstractLauncherTab { /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() */ + @Override public String getId() { return IPDELauncherConstants.TAB_PLUGINS_ID; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TestTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TestTab.java index 54b21ff890..4c78493559 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TestTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TestTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 ThoughtWorks, Inc. and others. + * Copyright (c) 2009, 2015 ThoughtWorks, Inc. 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 @@ -50,6 +50,7 @@ public class TestTab extends AbstractLaunchConfigurationTab { this.junitLaunchTab = new JUnitLaunchConfigurationTab(); } + @Override public void createControl(Composite parent) { junitLaunchTab.createControl(parent); @@ -61,6 +62,7 @@ public class TestTab extends AbstractLaunchConfigurationTab { private void createRunInUIThreadGroup(Composite comp) { runInUIThread = new Button(comp, SWT.CHECK); runInUIThread.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { updateLaunchConfigurationDialog(); } @@ -74,6 +76,7 @@ public class TestTab extends AbstractLaunchConfigurationTab { GridDataFactory.fillDefaults().span(3, 0).applyTo(label); } + @Override public void initializeFrom(ILaunchConfiguration config) { junitLaunchTab.initializeFrom(config); updateRunInUIThreadGroup(config); @@ -88,65 +91,80 @@ public class TestTab extends AbstractLaunchConfigurationTab { runInUIThread.setSelection(shouldRunInUIThread); } + @Override public void performApply(ILaunchConfigurationWorkingCopy config) { junitLaunchTab.performApply(config); boolean selection = runInUIThread.getSelection(); config.setAttribute(IPDELauncherConstants.RUN_IN_UI_THREAD, selection); } + @Override public String getId() { return IPDELauncherConstants.TAB_TEST_ID; } + @Override public void activated(ILaunchConfigurationWorkingCopy workingCopy) { junitLaunchTab.activated(workingCopy); } + @Override public boolean canSave() { return junitLaunchTab.canSave(); } + @Override public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) { junitLaunchTab.deactivated(workingCopy); } + @Override public void dispose() { junitLaunchTab.dispose(); } + @Override public String getErrorMessage() { return junitLaunchTab.getErrorMessage(); } + @Override public Image getImage() { return junitLaunchTab.getImage(); } + @Override public String getMessage() { return junitLaunchTab.getMessage(); } + @Override public String getName() { return junitLaunchTab.getName(); } + @Override public boolean isValid(ILaunchConfiguration config) { return junitLaunchTab.isValid(config); } + @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { junitLaunchTab.setDefaults(config); } + @Override public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) { junitLaunchTab.setLaunchConfigurationDialog(dialog); this.fLaunchConfigurationDialog = dialog; } + @Override public Control getControl() { return junitLaunchTab.getControl(); } + @Override protected ILaunchConfigurationDialog getLaunchConfigurationDialog() { return fLaunchConfigurationDialog; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TracingTab.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TracingTab.java index 90ca849583..c084648afe 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TracingTab.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/TracingTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2015 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 @@ -52,6 +52,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout()); @@ -65,6 +66,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void activated(ILaunchConfigurationWorkingCopy workingCopy) { fTracingBlock.activated(workingCopy); } @@ -73,6 +75,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose() */ + @Override public void dispose() { fTracingBlock.dispose(); if (fImage != null) @@ -85,6 +88,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) */ + @Override public void initializeFrom(ILaunchConfiguration config) { fTracingBlock.initializeFrom(config); } @@ -93,6 +97,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void performApply(ILaunchConfigurationWorkingCopy config) { fTracingBlock.performApply(config); } @@ -101,6 +106,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) */ + @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { fTracingBlock.setDefaults(config); } @@ -109,6 +115,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() */ + @Override public String getName() { return PDEUIMessages.TracingLauncherTab_name; } @@ -117,6 +124,7 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() */ + @Override public Image getImage() { return fImage; } @@ -125,12 +133,14 @@ public class TracingTab extends AbstractLauncherTab { * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractLauncherTab#validateTab() */ + @Override public void validateTab() { } /* (non-Javadoc) * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() */ + @Override public String getId() { return IPDELauncherConstants.TAB_TRACING_ID; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractChoiceOption.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractChoiceOption.java index c416cea19d..928dcd26cf 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractChoiceOption.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractChoiceOption.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -62,6 +62,7 @@ public abstract class AbstractChoiceOption extends TemplateOption { * @param value * the new value. */ + @Override public void setValue(Object value) { setValue(value, true); } @@ -90,6 +91,7 @@ public abstract class AbstractChoiceOption extends TemplateOption { /* (non-Javadoc) * @see org.eclipse.pde.ui.templates.TemplateOption#setEnabled(boolean) */ + @Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); setOptionEnabled(enabled); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractNewPluginTemplateWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractNewPluginTemplateWizard.java index 694edf346f..e0eff59b35 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractNewPluginTemplateWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractNewPluginTemplateWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -44,6 +44,7 @@ public abstract class AbstractNewPluginTemplateWizard extends Wizard implements /* (non-Javadoc) * @see org.eclipse.pde.ui.IPluginContentWizard#init(org.eclipse.pde.ui.IFieldData) */ + @Override public void init(IFieldData data) { this.data = data; setWindowTitle(PDEUIMessages.PluginCodeGeneratorWizard_title); @@ -67,6 +68,7 @@ public abstract class AbstractNewPluginTemplateWizard extends Wizard implements /** * Implements wizard method. Subclasses cannot override it. */ + @Override public final void addPages() { addAdditionalPages(); } @@ -74,6 +76,7 @@ public abstract class AbstractNewPluginTemplateWizard extends Wizard implements /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#performFinish() */ + @Override public boolean performFinish() { // do nothing - all the work is in the other 'performFinish' return true; @@ -93,6 +96,7 @@ public abstract class AbstractNewPluginTemplateWizard extends Wizard implements * @return <code>true</code> if the wizard completed the operation with * success, <code>false</code> otherwise. */ + @Override public boolean performFinish(IProject project, IPluginModelBase model, IProgressMonitor monitor) { try { ITemplateSection[] sections = getTemplateSections(); @@ -121,6 +125,7 @@ public abstract class AbstractNewPluginTemplateWizard extends Wizard implements /* (non-Javadoc) * @see org.eclipse.pde.ui.IPluginContentWizard#getDependencies(java.lang.String) */ + @Override public IPluginReference[] getDependencies(String schemaVersion) { ArrayList<IPluginReference> result = new ArrayList<IPluginReference>(); ITemplateSection[] sections = getTemplateSections(); @@ -137,6 +142,7 @@ public abstract class AbstractNewPluginTemplateWizard extends Wizard implements /* (non-Javadoc) * @see org.eclipse.pde.ui.IPluginContentWizard#getNewFiles() */ + @Override public String[] getNewFiles() { ArrayList<String> result = new ArrayList<String>(); ITemplateSection[] sections = getTemplateSections(); @@ -158,6 +164,7 @@ public abstract class AbstractNewPluginTemplateWizard extends Wizard implements return getTemplateSections().length > 0; } + @Override public String[] getImportPackages() { return new String[0]; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractTemplateSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractTemplateSection.java index 3b278f4164..b2d9ff3e6a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractTemplateSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/AbstractTemplateSection.java @@ -84,6 +84,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari * * @see ITemplateSection#getReplacementString(String,String) */ + @Override public String getReplacementString(String fileName, String key) { String result = getKeyValue(key); return result != null ? result : key; @@ -93,6 +94,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari * @see IVariableProvider#getValue(String) */ + @Override public Object getValue(String key) { return getKeyValue(key); } @@ -137,6 +139,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari /** * @see ITemplateSection#getTemplateLocation() */ + @Override public URL getTemplateLocation() { return null; } @@ -144,6 +147,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari /** * @see ITemplateSection#getDescription() */ + @Override public String getDescription() { return ""; //$NON-NLS-1$ } @@ -182,6 +186,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari /* (non-Javadoc) * @see org.eclipse.pde.ui.templates.ITemplateSection#addPages(org.eclipse.jface.wizard.Wizard) */ + @Override public void addPages(Wizard wizard) { } @@ -191,6 +196,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari * @return <code>true</code> if wizard pages for this section have been * added, <code>false</code> otherwise. */ + @Override public boolean getPagesAdded() { return pagesAdded; } @@ -211,6 +217,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari * * @see ITemplateSection#getNumberOfWorkUnits() */ + @Override public int getNumberOfWorkUnits() { return 1; } @@ -218,6 +225,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari /* (non-Javadoc) * @see org.eclipse.pde.ui.templates.ITemplateSection#getDependencies(java.lang.String) */ + @Override public IPluginReference[] getDependencies(String schemaVersion) { return new IPluginReference[] {new PluginReference("org.eclipse.ui", //$NON-NLS-1$ null, 0)}; @@ -390,6 +398,7 @@ public abstract class AbstractTemplateSection implements ITemplateSection, IVari * @see ITemplateSection#execute(IProject, IPluginModelBase, * IProgressMonitor) */ + @Override public void execute(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException { this.project = project; this.model = model; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BaseOptionTemplateSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BaseOptionTemplateSection.java index e9267dd535..1f9553939e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BaseOptionTemplateSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BaseOptionTemplateSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -241,6 +241,7 @@ public abstract class BaseOptionTemplateSection extends AbstractTemplateSection * @return the current value of the option with a specified name or * <samp>null </samp> if not found or not applicable. */ + @Override public Object getValue(String name) { TemplateOption option = options.get(name); if (option != null) @@ -320,6 +321,7 @@ public abstract class BaseOptionTemplateSection extends AbstractTemplateSection * * @see AbstractTemplateSection#getReplacementString(String, String) */ + @Override public String getReplacementString(String fileName, String key) { String value = getStringOption(key); if (value != null) @@ -330,6 +332,7 @@ public abstract class BaseOptionTemplateSection extends AbstractTemplateSection /* (non-Javadoc) * @see org.eclipse.pde.ui.templates.AbstractTemplateSection#execute(org.eclipse.core.resources.IProject, org.eclipse.pde.core.plugin.IPluginModelBase, org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void execute(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException { /* * Modifies the superclass implementation by adding the initialization step diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BlankField.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BlankField.java index c236fb49f7..5266c0e3af 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BlankField.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BlankField.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -65,6 +65,7 @@ public class BlankField extends TemplateOption { * @param span * the number of columns that the widget should span */ + @Override public void createControl(Composite parent, int span) { fblankLabel = createLabel(parent, span); GridData gd = new GridData(GridData.FILL_HORIZONTAL); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BooleanOption.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BooleanOption.java index dd4c6931b9..8e0889de7e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BooleanOption.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/BooleanOption.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -67,6 +67,7 @@ public class BooleanOption extends TemplateOption { * @param value * the new option value */ + @Override public void setValue(Object value) { super.setValue(value); if (button != null) @@ -82,6 +83,7 @@ public class BooleanOption extends TemplateOption { * @param span * the number of columns that the widget should span */ + @Override public void createControl(Composite parent, int span) { button = new Button(parent, SWT.CHECK); button.setText(getLabel()); @@ -90,6 +92,7 @@ public class BooleanOption extends TemplateOption { button.setLayoutData(gd); button.setSelection(isSelected()); button.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { BooleanOption.super.setValue(button.getSelection() ? Boolean.TRUE : Boolean.FALSE); getSection().validateOptions(BooleanOption.this); @@ -105,6 +108,7 @@ public class BooleanOption extends TemplateOption { * @param enabled * the new enabled state. */ + @Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (button != null) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ChoiceOption.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ChoiceOption.java index 5e190796ad..02cf2b7886 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ChoiceOption.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ChoiceOption.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -23,6 +23,7 @@ import org.eclipse.swt.widgets.*; * @since 2.0 * @deprecated see {@link RadioChoiceOption} and {@link ComboChoiceOption} */ +@Deprecated public class ChoiceOption extends TemplateOption { private String[][] choices; private Control labelControl; @@ -52,6 +53,7 @@ public class ChoiceOption extends TemplateOption { /* (non-Javadoc) * @see org.eclipse.pde.ui.templates.TemplateField#createControl(org.eclipse.swt.widgets.Composite, int) */ + @Override public void createControl(Composite parent, int span) { Composite container = createComposite(parent, span); fill(container, span); @@ -65,6 +67,7 @@ public class ChoiceOption extends TemplateOption { buttons = new Button[choices.length]; SelectionListener listener = new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { Button b = (Button) e.widget; if (blockListener) @@ -103,6 +106,7 @@ public class ChoiceOption extends TemplateOption { * @param value * the new value. */ + @Override public void setValue(Object value) { super.setValue(value); if (buttons != null && value != null) { @@ -113,6 +117,7 @@ public class ChoiceOption extends TemplateOption { /* (non-Javadoc) * @see org.eclipse.pde.ui.templates.TemplateOption#setEnabled(boolean) */ + @Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (labelControl != null) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ComboChoiceOption.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ComboChoiceOption.java index 8636b8c85e..5f6d58c283 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ComboChoiceOption.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/ComboChoiceOption.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -46,6 +46,7 @@ public class ComboChoiceOption extends AbstractChoiceOption { super(section, name, label, choices); } + @Override public void createControl(Composite parent, int span) { fLabel = createLabel(parent, 1); fLabel.setEnabled(isEnabled()); @@ -59,6 +60,7 @@ public class ComboChoiceOption extends AbstractChoiceOption { fCombo.setEnabled(isEnabled()); } fCombo.addSelectionListener(new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { if (isBlocked()) return; @@ -76,12 +78,14 @@ public class ComboChoiceOption extends AbstractChoiceOption { selectChoice(getChoice()); } + @Override protected void setOptionValue(Object value) { if (fCombo != null && value != null) { selectChoice(value.toString()); } } + @Override protected void setOptionEnabled(boolean enabled) { if (fLabel != null) { fLabel.setEnabled(enabled); @@ -89,6 +93,7 @@ public class ComboChoiceOption extends AbstractChoiceOption { } } + @Override protected void selectOptionChoice(String choice) { // choice is the value not the description int index = getIndexOfChoice(choice); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginProjectFromTemplateWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginProjectFromTemplateWizard.java index cb2cc9cefa..556f4b5eec 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginProjectFromTemplateWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginProjectFromTemplateWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2013 IBM Corporation and others. + * Copyright (c) 2009, 2015 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 @@ -104,14 +104,17 @@ public abstract class NewPluginProjectFromTemplateWizard extends NewWizard imple addPage(fProjectPage); fProjectProvider = new IProjectProvider() { + @Override public String getProjectName() { return fProjectPage.getProjectName(); } + @Override public IProject getProject() { return fProjectPage.getProjectHandle(); } + @Override public IPath getLocationPath() { return fProjectPage.getLocationPath(); } @@ -167,6 +170,7 @@ public abstract class NewPluginProjectFromTemplateWizard extends NewWizard imple if (!PDECore.getDefault().areModelsInitialized()) { try { getContainer().run(true, true, new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { // Target reloaded method clears existing models (which don't exist currently) and inits them with a progress monitor PDECore.getDefault().getModelManager().targetReloaded(monitor); @@ -198,6 +202,7 @@ public abstract class NewPluginProjectFromTemplateWizard extends NewWizard imple /* (non-Javadoc) * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object) */ + @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { fConfig = config; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginTemplateWizard.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginTemplateWizard.java index 69e67d8d64..10b34ed708 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginTemplateWizard.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/NewPluginTemplateWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -45,6 +45,7 @@ public abstract class NewPluginTemplateWizard extends AbstractNewPluginTemplateW * * @return an array of templates */ + @Override public final ITemplateSection[] getTemplateSections() { return sections; } @@ -53,6 +54,7 @@ public abstract class NewPluginTemplateWizard extends AbstractNewPluginTemplateW * Implemented by asking templates in this wizard to contribute pages. * */ + @Override protected final void addAdditionalPages() { // add template pages for (int i = 0; i < sections.length; i++) { diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateSection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateSection.java index 3f225fe15f..b07cc854cf 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateSection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateSection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -99,6 +99,7 @@ public abstract class OptionTemplateSection extends BaseOptionTemplateSection { * @return the URL of the location where files to be emitted by this * template are located. */ + @Override public URL getTemplateLocation() { URL url = getInstallURL(); try { @@ -119,6 +120,7 @@ public abstract class OptionTemplateSection extends BaseOptionTemplateSection { * invalid index. * @see #createPage(int) */ + @Override public WizardPage getPage(int pageIndex) { if (pageIndex < 0 || pageIndex >= pages.size()) return null; @@ -182,6 +184,7 @@ public abstract class OptionTemplateSection extends BaseOptionTemplateSection { * @return the number of pages * @see #setPageCount(int) */ + @Override public int getPageCount() { return pages.size(); } @@ -260,6 +263,7 @@ public abstract class OptionTemplateSection extends BaseOptionTemplateSection { * * @return the translated label of this template */ + @Override public String getLabel() { String key = "template." + getSectionId() + ".name"; //$NON-NLS-1$ //$NON-NLS-2$ return getPluginResourceString(key); @@ -274,6 +278,7 @@ public abstract class OptionTemplateSection extends BaseOptionTemplateSection { * * @return the translated description of this template */ + @Override public String getDescription() { String key = "template." + getSectionId() + ".desc"; //$NON-NLS-1$ //$NON-NLS-2$ return getPluginResourceString(key); @@ -319,6 +324,7 @@ public abstract class OptionTemplateSection extends BaseOptionTemplateSection { currentPage.setPageComplete(true); } + @Override protected void registerOption(TemplateOption option, Object value, int pageIndex) { super.registerOption(option, value, pageIndex); if (pageIndex >= 0 && pageIndex < pages.size()) { @@ -332,6 +338,7 @@ public abstract class OptionTemplateSection extends BaseOptionTemplateSection { * * @param source the template option to validate */ + @Override public void validateOptions(TemplateOption source) { if (source.isRequired() && source.isEmpty()) { flagMissingRequiredOption(source); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateWizardPage.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateWizardPage.java index a0ab550c43..fbdf57f1ab 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateWizardPage.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/OptionTemplateWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -56,6 +56,7 @@ public class OptionTemplateWizardPage extends WizardPage { * * @param composite */ + @Override public void createControl(Composite composite) { Composite container = new Composite(composite, SWT.NULL); GridLayout layout = new GridLayout(); @@ -80,6 +81,7 @@ public class OptionTemplateWizardPage extends WizardPage { * * @param visible */ + @Override public void setVisible(boolean visible) { if (visible && section.isDependentOnParentWizard()) { IWizard wizard = getWizard(); diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/PluginReference.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/PluginReference.java index e8d5d542c7..6294e8464e 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/PluginReference.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/PluginReference.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2015 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 @@ -73,6 +73,7 @@ public class PluginReference implements IPluginReference { /* * @see IPluginReference#getMatch() */ + @Override public int getMatch() { return match; } @@ -80,6 +81,7 @@ public class PluginReference implements IPluginReference { /* * @see IPluginReference#getVersion() */ + @Override public String getVersion() { return version; } @@ -87,6 +89,7 @@ public class PluginReference implements IPluginReference { /* * @see IPluginReference#setMatch(int) */ + @Override public void setMatch(int match) throws CoreException { this.match = match; } @@ -94,6 +97,7 @@ public class PluginReference implements IPluginReference { /* * @see IPluginReference#setVersion(String) */ + @Override public void setVersion(String version) throws CoreException { this.version = version; } @@ -101,6 +105,7 @@ public class PluginReference implements IPluginReference { /* * @see IIdentifiable#getId() */ + @Override public String getId() { return id; } @@ -108,6 +113,7 @@ public class PluginReference implements IPluginReference { /* * @see IIdentifiable#setId(String) */ + @Override public void setId(String id) throws CoreException { this.id = id; } diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/RadioChoiceOption.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/RadioChoiceOption.java index 8976826344..d1b86fb6df 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/RadioChoiceOption.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/RadioChoiceOption.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 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 @@ -59,6 +59,7 @@ public class RadioChoiceOption extends AbstractChoiceOption { return button; } + @Override public void createControl(Composite parent, int span) { fLabel = createLabel(parent, 1); @@ -75,6 +76,7 @@ public class RadioChoiceOption extends AbstractChoiceOption { fButtons = new Button[fChoices.length]; SelectionListener listener = new SelectionAdapter() { + @Override public void widgetSelected(SelectionEvent e) { Button b = (Button) e.widget; if (isBlocked()) @@ -96,12 +98,14 @@ public class RadioChoiceOption extends AbstractChoiceOption { selectChoice(getChoice()); } + @Override protected void setOptionValue(Object value) { if (fButtons != null && value != null) { selectChoice(value.toString()); } } + @Override protected void setOptionEnabled(boolean enabled) { if (fLabel != null) { fLabel.setEnabled(enabled); @@ -111,6 +115,7 @@ public class RadioChoiceOption extends AbstractChoiceOption { } } + @Override protected void selectOptionChoice(String choice) { for (int i = 0; i < fButtons.length; i++) { Button button = fButtons[i]; diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/StringOption.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/StringOption.java index c6a6f3437d..a1f86c5430 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/StringOption.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/templates/StringOption.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -90,6 +90,7 @@ public class StringOption extends TemplateOption { * @param value * the new option value */ + @Override public void setValue(Object value) { super.setValue(value); if (text != null) { @@ -108,6 +109,7 @@ public class StringOption extends TemplateOption { * @param span * the number of columns that the widget should span */ + @Override public void createControl(Composite parent, int span) { labelControl = createLabel(parent, 1); labelControl.setEnabled(isEnabled()); @@ -119,6 +121,7 @@ public class StringOption extends TemplateOption { text.setLayoutData(gd); text.setEnabled(isEnabled()); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { if (ignoreListener) return; @@ -133,6 +136,7 @@ public class StringOption extends TemplateOption { * * @return true if there is no text in the text field. */ + @Override public boolean isEmpty() { return getValue() == null || getValue().toString().length() == 0; } @@ -143,6 +147,7 @@ public class StringOption extends TemplateOption { * * @param enabled */ + @Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (labelControl != null) { diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ProjectNamesPage.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ProjectNamesPage.java index fa63f2c03e..4a0739e518 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ProjectNamesPage.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ProjectNamesPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -43,6 +43,7 @@ public class ProjectNamesPage extends WizardPage { setDescription(PDEUIMessages.ProjectNamesPage_desc); } + @Override public void setVisible(boolean visible) { setPageComplete(wizard.getSelection() != null); if (container != null) @@ -103,6 +104,7 @@ public class ProjectNamesPage extends WizardPage { final Text text = new Text(container, SWT.SINGLE | SWT.BORDER); text.setText(projectName); text.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { validateEntries(); } @@ -150,6 +152,7 @@ public class ProjectNamesPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ReviewPage.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ReviewPage.java index d9ad1b2238..4e7298886b 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ReviewPage.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ReviewPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -38,6 +38,7 @@ public class ReviewPage extends WizardPage { setDescription(PDEUIMessages.ReviewPage_desc); } + @Override public void setVisible(boolean visible) { setPageComplete(wizard.getSelection() != null); if (formText != null) @@ -66,6 +67,7 @@ public class ReviewPage extends WizardPage { /* (non-Javadoc) * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleEditor.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleEditor.java index 11a8b307aa..59b87a0fc4 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleEditor.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -45,6 +45,7 @@ public class SampleEditor extends EditorPart { private InputFileListener inputFileListener; class InputFileListener implements IResourceChangeListener, IResourceDeltaVisitor { + @Override public void resourceChanged(IResourceChangeEvent event) { if (event.getType() == IResourceChangeEvent.POST_CHANGE) { IResourceDelta delta = event.getDelta(); @@ -56,6 +57,7 @@ public class SampleEditor extends EditorPart { } } + @Override public boolean visit(IResourceDelta delta) throws CoreException { IResource resource = delta.getResource(); if (resource instanceof IFile) { @@ -81,6 +83,7 @@ public class SampleEditor extends EditorPart { /** * @see EditorPart#createPartControl */ + @Override public void createPartControl(Composite parent) { toolkit = new FormToolkit(parent.getDisplay()); form = toolkit.createScrolledForm(parent); @@ -106,6 +109,7 @@ public class SampleEditor extends EditorPart { if (helpURL != null) { Hyperlink moreLink = toolkit.createHyperlink(form.getBody(), "Read More", SWT.NULL); //$NON-NLS-1$ moreLink.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpURL); } @@ -117,6 +121,7 @@ public class SampleEditor extends EditorPart { buf.append(PDEUIMessages.SampleEditor_content); instText.setText(buf.toString(), true, false); instText.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { Object href = e.getHref(); if (href.equals("help")) { //$NON-NLS-1$ @@ -142,6 +147,7 @@ public class SampleEditor extends EditorPart { selection = new StructuredSelection(); final ILaunchShortcut fshortcut = shortcut; BusyIndicator.showWhile(form.getDisplay(), new Runnable() { + @Override public void run() { fshortcut.launch(selection, debug ? ILaunchManager.DEBUG_MODE : ILaunchManager.RUN_MODE); } @@ -164,6 +170,7 @@ public class SampleEditor extends EditorPart { return properties; } + @Override public void dispose() { if (inputFileListener != null) { PDEPlugin.getWorkspace().removeResourceChangeListener(inputFileListener); @@ -177,6 +184,7 @@ public class SampleEditor extends EditorPart { /** * @see EditorPart#setFocus */ + @Override public void setFocus() { form.setFocus(); } @@ -184,18 +192,21 @@ public class SampleEditor extends EditorPart { /** * @see EditorPart#doSave */ + @Override public void doSave(IProgressMonitor monitor) { } /** * @see EditorPart#doSaveAs */ + @Override public void doSaveAs() { } /** * @see EditorPart#isDirty */ + @Override public boolean isDirty() { return false; } @@ -203,6 +214,7 @@ public class SampleEditor extends EditorPart { /** * @see EditorPart#isSaveAsAllowed */ + @Override public boolean isSaveAsAllowed() { return false; } @@ -210,6 +222,7 @@ public class SampleEditor extends EditorPart { /** * @see EditorPart#init */ + @Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { setSite(site); setInput(input); @@ -220,6 +233,7 @@ public class SampleEditor extends EditorPart { public void close() { Display display = getSite().getShell().getDisplay(); display.asyncExec(new Runnable() { + @Override public void run() { if (toolkit != null) { getSite().getPage().closeEditor(SampleEditor.this, false); diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleOperation.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleOperation.java index 12b65e8ed0..61c046ec45 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleOperation.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -63,9 +63,11 @@ public class SampleOperation implements IRunnableWithProgress { * * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { IWorkspaceRunnable op = new IWorkspaceRunnable() { + @Override public void run(IProgressMonitor monitor) throws CoreException { IConfigurationElement[] projects = sample.getChildren("project"); //$NON-NLS-1$ monitor.beginTask(PDEUIMessages.SampleOperation_creating, 4 * projects.length); diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleStandbyContent.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleStandbyContent.java index 582fa8075c..e59823aa84 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleStandbyContent.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleStandbyContent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -64,6 +64,7 @@ public class SampleStandbyContent implements IStandbyContentPart { * @see org.eclipse.ui.intro.internal.parts.IStandbyContentPart#createPartControl(org.eclipse.swt.widgets.Composite, * org.eclipse.ui.forms.widgets.FormToolkit) */ + @Override public void createPartControl(Composite parent, FormToolkit toolkit) { form = toolkit.createScrolledForm(parent); //form.setBackgroundImage(PDEPlugin.getDefault().getLabelProvider().get( @@ -81,6 +82,7 @@ public class SampleStandbyContent implements IStandbyContentPart { moreLink = toolkit.createHyperlink(form.getBody(), "Read More", //$NON-NLS-1$ SWT.NULL); moreLink.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { if (helpURL != null) PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(helpURL); @@ -92,6 +94,7 @@ public class SampleStandbyContent implements IStandbyContentPart { buf.append(PDEUIMessages.SampleStandbyContent_content); instText.setText(buf.toString(), true, false); instText.addHyperlinkListener(new HyperlinkAdapter() { + @Override public void linkActivated(HyperlinkEvent e) { Object href = e.getHref(); if (href.equals("help")) { //$NON-NLS-1$ @@ -122,6 +125,7 @@ public class SampleStandbyContent implements IStandbyContentPart { selection = new StructuredSelection(); final ILaunchShortcut fshortcut = shortcut; BusyIndicator.showWhile(form.getDisplay(), new Runnable() { + @Override public void run() { fshortcut.launch(selection, debug ? ILaunchManager.DEBUG_MODE : ILaunchManager.RUN_MODE); } @@ -197,6 +201,7 @@ public class SampleStandbyContent implements IStandbyContentPart { * * @see org.eclipse.ui.intro.internal.parts.IStandbyContentPart#getControl() */ + @Override public Control getControl() { return form; } @@ -214,6 +219,7 @@ public class SampleStandbyContent implements IStandbyContentPart { * * @see org.eclipse.ui.intro.internal.parts.IStandbyContentPart#setInput(java.lang.Object) */ + @Override public void setInput(Object input) { // if the new input is null, use cached input from momento. if (input != null) @@ -263,6 +269,7 @@ public class SampleStandbyContent implements IStandbyContentPart { * * @see org.eclipse.ui.intro.internal.parts.IStandbyContentPart#setFocus() */ + @Override public void setFocus() { form.setFocus(); } @@ -272,6 +279,7 @@ public class SampleStandbyContent implements IStandbyContentPart { * * @see org.eclipse.ui.intro.internal.parts.IStandbyContentPart#dispose() */ + @Override public void dispose() { PDEPlugin.getDefault().getLabelProvider().disconnect(this); } @@ -279,6 +287,7 @@ public class SampleStandbyContent implements IStandbyContentPart { /* (non-Javadoc) * @see org.eclipse.ui.intro.config.IStandbyContentPart#init(org.eclipse.ui.intro.IIntroPart, org.eclipse.ui.IMemento) */ + @Override public void init(IIntroPart introPart, IMemento memento) { // try to restore last state. input = getCachedInput(memento); @@ -300,6 +309,7 @@ public class SampleStandbyContent implements IStandbyContentPart { /* (non-Javadoc) * @see org.eclipse.ui.intro.config.IStandbyContentPart#saveState(org.eclipse.ui.IMemento) */ + @Override public void saveState(IMemento memento) { String currentSampleId = input; if (input != null) diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleWizard.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleWizard.java index c46ca6d333..07a6472325 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleWizard.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SampleWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -38,6 +38,7 @@ public class SampleWizard extends Wizard implements INewWizard, IExecutableExten private boolean activitiesEnabled = true; private class ImportOverwriteQuery implements IOverwriteQuery { + @Override public String queryOverwrite(String file) { String[] returnCodes = {YES, NO, ALL, CANCEL}; int returnVal = openDialog(file); @@ -47,6 +48,7 @@ public class SampleWizard extends Wizard implements INewWizard, IExecutableExten private int openDialog(final String file) { final int[] result = {IDialogConstants.CANCEL_ID}; getShell().getDisplay().syncExec(new Runnable() { + @Override public void run() { String title = PDEUIMessages.SampleWizard_title; String msg = NLS.bind(PDEUIMessages.SampleWizard_overwrite, file); @@ -193,6 +195,7 @@ public class SampleWizard extends Wizard implements INewWizard, IExecutableExten /** * */ + @Override public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException { String variable = data != null && data instanceof String ? data.toString() : null; if (variable != null) { @@ -207,6 +210,7 @@ public class SampleWizard extends Wizard implements INewWizard, IExecutableExten } } + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { } diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SelectionPage.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SelectionPage.java index b57b0ace4b..ee87d29b78 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SelectionPage.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/SelectionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -33,20 +33,24 @@ public class SelectionPage extends WizardPage { super(new String[] {"More Info"}); //$NON-NLS-1$ } + @Override protected void buttonSelected(Button button, int index) { if (index == 0) doMoreInfo(); } + @Override protected void selectionChanged(IStructuredSelection selection) { updateSelection(selection); } + @Override protected void handleDoubleClick(IStructuredSelection selection) { } } class SampleProvider extends DefaultContentProvider implements IStructuredContentProvider { + @Override public Object[] getElements(Object input) { return wizard.getSamples(); } @@ -59,11 +63,13 @@ public class SelectionPage extends WizardPage { image = PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_NEWEXP_TOOL); } + @Override public String getText(Object obj) { IConfigurationElement sample = (IConfigurationElement) obj; return sample.getAttribute("name"); //$NON-NLS-1$ } + @Override public Image getImage(Object obj) { return image; } @@ -80,6 +86,7 @@ public class SelectionPage extends WizardPage { part = new SelectionPart(); } + @Override public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); GridLayout layout = new GridLayout(); diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowSampleAction.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowSampleAction.java index 44f052fa9d..bcb120d433 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowSampleAction.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowSampleAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -56,12 +56,14 @@ public class ShowSampleAction extends Action implements IIntroAction { provUI = ProvisioningUI.getDefaultUI(); } + @Override public void run(IIntroSite site, Properties params) { sampleId = params.getProperty("id"); //$NON-NLS-1$ if (sampleId == null) return; Runnable r = new Runnable() { + @Override public void run() { if (!ensureSampleFeaturePresent()) return; @@ -170,6 +172,7 @@ public class ShowSampleAction extends Action implements IIntroAction { */ private boolean downloadFeature() { IRunnableWithProgress op = new IRunnableWithProgress() { + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { SubMonitor sub = SubMonitor.convert(monitor, PDEUIMessages.ShowSampleAction_installing, 100); diff --git a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowTargetPlatformAction.java b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowTargetPlatformAction.java index c314681c4e..61313112d7 100644 --- a/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowTargetPlatformAction.java +++ b/ui/org.eclipse.pde.ui/src_samples/org/eclipse/pde/internal/ui/samples/ShowTargetPlatformAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2015 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 @@ -21,6 +21,7 @@ import org.eclipse.ui.PlatformUI; public class ShowTargetPlatformAction extends Action { // Bring up Target Platform prefrences page + @Override public void run() { final IPreferenceNode targetNode = new TargetPlatformPreferenceNode(); PreferenceManager manager = new PreferenceManager(); @@ -28,6 +29,7 @@ public class ShowTargetPlatformAction extends Action { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); final PreferenceDialog dialog = new PreferenceDialog(shell, manager); BusyIndicator.showWhile(Display.getCurrent(), new Runnable() { + @Override public void run() { dialog.create(); dialog.setMessage(targetNode.getLabelText()); |