Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2016-06-28 04:10:04 -0400
committerAlexander Kurtakov2016-06-28 04:10:04 -0400
commite0e489b726c0822d4cdc1a60521fde1cbb943e03 (patch)
tree204e09d148b6dad16d6bf28036d678acc4fc58f1
parent30efbb124f709648585612e5dd65ed492f3830ba (diff)
downloadeclipse.platform.ua-e0e489b726c0822d4cdc1a60521fde1cbb943e03.tar.gz
eclipse.platform.ua-e0e489b726c0822d4cdc1a60521fde1cbb943e03.tar.xz
eclipse.platform.ua-e0e489b726c0822d4cdc1a60521fde1cbb943e03.zip
Bug 496890 - Update o.e.help.ui to Java 8
Enable missing Override warning and fix them by using one of the following approaches: * Listener -> Adapter to remove empty methods. * Convert to lambdas. * Add the annotation. Change-Id: Ie597574da8ecfdc09db34e3421ff89cb2d57917d Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.help.ui/.settings/org.eclipse.jdt.core.prefs4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java10
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java22
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java3
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java69
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java43
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java14
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java20
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java30
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java14
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkAdapter.java7
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java15
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java98
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java14
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java51
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java16
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java11
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserAdapter.java39
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserFactory.java19
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java145
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java62
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java38
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java10
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java3
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java3
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java46
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java2
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java3
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java9
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java5
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java12
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java11
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java17
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java97
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java86
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java25
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java10
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java11
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java6
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java49
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java13
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java65
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java121
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java3
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java49
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java5
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java81
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java8
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java43
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java36
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java9
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java30
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java73
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java6
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java219
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IgnoreMissingPlaceholderHandler.java3
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java19
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java31
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java5
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java16
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java4
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java23
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java36
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java96
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java17
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java18
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java17
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java58
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java8
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java101
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java65
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java55
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java6
80 files changed, 1267 insertions, 1249 deletions
diff --git a/org.eclipse.help.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.help.ui/.settings/org.eclipse.jdt.core.prefs
index ea255e86c..45f18e11d 100644
--- a/org.eclipse.help.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.help.ui/.settings/org.eclipse.jdt.core.prefs
@@ -42,10 +42,10 @@ org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java
index 642f9f038..a057b8e75 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java
@@ -64,11 +64,7 @@ public abstract class RootScopePage extends PreferencePage implements
public RootScopePage() {
}
- /*
- * (non-Javadoc)
- *
- * @see ISearchScopePage#init(IEngineDescriptor, String)
- */
+ @Override
public void init(IEngineDescriptor ed, String scopeSetName) {
this.ed = ed;
this.scopeSetName = scopeSetName;
@@ -83,6 +79,7 @@ public abstract class RootScopePage extends PreferencePage implements
* the page parent
* @return the page client control
*/
+ @Override
protected final Control createContents(Composite parent) {
initializeDefaults(getPreferenceStore());
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
@@ -108,6 +105,7 @@ public abstract class RootScopePage extends PreferencePage implements
masterButton.setSelection(masterValue);
masterButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
masterValueChanged(masterButton.getSelection());
}
@@ -228,6 +226,7 @@ public abstract class RootScopePage extends PreferencePage implements
* <code>false</code> otherwise.
*/
+ @Override
public boolean performOk() {
getPreferenceStore().setValue(ScopeSet.getMasterKey(ed.getId()),
isEngineEnabled());
@@ -242,6 +241,7 @@ public abstract class RootScopePage extends PreferencePage implements
* Sets the value of the master switch to the initial value from the
* extension. Subclasses may override but must call 'super'.
*/
+ @Override
protected void performDefaults() {
getPreferenceStore().setToDefault(ScopeSet.getMasterKey(ed.getId()));
updateControls(false);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java
index e7728b443..1824266bd 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java
@@ -22,7 +22,6 @@ import org.eclipse.help.ui.internal.Messages;
import org.eclipse.help.ui.internal.util.ErrorUtil;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
@@ -52,22 +51,15 @@ public class LaunchURL implements IWorkbenchWindowActionDelegate,
IExecutableExtension {
private String url;
- /**
- * @see IWorkbenchWindowActionDelegate#dispose()
- */
+ @Override
public void dispose() {
}
- /**
- * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
+ @Override
public void init(IWorkbenchWindow window) {
}
- /**
- * @see IExecutableExtension#setInitializationData(IConfigurationElement,
- * String, Object)
- */
+ @Override
@SuppressWarnings("unchecked")
public void setInitializationData(IConfigurationElement config,
String propertyName, Object data) throws CoreException {
@@ -78,9 +70,7 @@ public class LaunchURL implements IWorkbenchWindowActionDelegate,
url = config.getAttribute("url"); //$NON-NLS-1$
}
- /**
- * @see IActionDelegate#run(IAction)
- */
+ @Override
public void run(IAction action) {
if (url == null || "".equals(url)) { //$NON-NLS-1$
return;
@@ -95,9 +85,7 @@ public class LaunchURL implements IWorkbenchWindowActionDelegate,
}
}
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java
index 77049c67e..9b6621bc7 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@ public class CloseHelpTrayHandler extends AbstractHandler {
/**
* Executes the command.
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Display display = Display.getCurrent();
if (display == null) {
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java
index d5982c751..4cbfde99b 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,8 +30,6 @@ import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.TraverseEvent;
-import org.eclipse.swt.events.TraverseListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -42,9 +40,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
@@ -81,6 +77,7 @@ public class ContextHelpDialog {
this.topic = topic;
}
+ @Override
public void linkActivated(Control c) {
launchLinks(topic);
}
@@ -127,29 +124,26 @@ public class ContextHelpDialog {
}
PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IHelpUIConstants.F1_SHELL);
- shell.addListener(SWT.Deactivate, new Listener() {
- public void handleEvent(Event e) {
- if (HelpUIPlugin.DEBUG_INFOPOP) {
- System.out
- .println("ContextHelpDialog shell deactivate listener: SWT.Deactivate called. "); //$NON-NLS-1$
- }
- close();
+ shell.addListener(SWT.Deactivate, e -> {
+ if (HelpUIPlugin.DEBUG_INFOPOP) {
+ System.out.println("ContextHelpDialog shell deactivate listener: SWT.Deactivate called. "); //$NON-NLS-1$
}
+ close();
});
- shell.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_ESCAPE) {
- if (HelpUIPlugin.DEBUG_INFOPOP) {
- System.out
- .println("ContextHelpDialog: shell traverse listener: SWT.TRAVERSE_ESCAPE called. "); //$NON-NLS-1$
- }
- e.doit = true;
+ shell.addTraverseListener(e -> {
+ if (e.detail == SWT.TRAVERSE_ESCAPE) {
+ if (HelpUIPlugin.DEBUG_INFOPOP) {
+ System.out.println(
+ "ContextHelpDialog: shell traverse listener: SWT.TRAVERSE_ESCAPE called. "); //$NON-NLS-1$
}
+ e.doit = true;
}
});
shell.addControlListener(new ControlAdapter() {
+
+ @Override
public void controlMoved(ControlEvent e) {
if (HelpUIPlugin.DEBUG_INFOPOP) {
System.out
@@ -234,15 +228,13 @@ public class ContextHelpDialog {
styledText = Messages.ContextHelpPart_noDescription;
}
Description text = new Description(parent, SWT.MULTI | SWT.READ_ONLY);
- text.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_ESCAPE) {
- if (HelpUIPlugin.DEBUG_INFOPOP) {
- System.out
- .println("ContextHelpDialog text TraverseListener.handleEvent(): SWT.TRAVERSE_ESCAPE."); //$NON-NLS-1$
- }
- e.doit = true;
+ text.addTraverseListener(e -> {
+ if (e.detail == SWT.TRAVERSE_ESCAPE) {
+ if (HelpUIPlugin.DEBUG_INFOPOP) {
+ System.out.println(
+ "ContextHelpDialog text TraverseListener.handleEvent(): SWT.TRAVERSE_ESCAPE."); //$NON-NLS-1$
}
+ e.doit = true;
}
});
@@ -371,6 +363,8 @@ public class ContextHelpDialog {
link.setForeground(linkColour);
link.setFont(parent.getFont());
linkManager.registerHyperlink(link, new HyperlinkAdapter() {
+
+ @Override
public void linkActivated(Control label) {
openDynamicHelp();
}
@@ -396,11 +390,9 @@ public class ContextHelpDialog {
}
private void openDynamicHelp() {
- BusyIndicator.showWhile(shell.getDisplay(), new Runnable() {
- public void run() {
- close();
- DefaultHelpUI.getInstance().displayContext(context, 0, 0, true);
- }
+ BusyIndicator.showWhile(shell.getDisplay(), () -> {
+ close();
+ DefaultHelpUI.getInstance().displayContext(context, 0, 0, true);
});
}
@@ -432,22 +424,28 @@ public class ContextHelpDialog {
private void initAccessible(final Control control) {
Accessible accessible = control.getAccessible();
accessible.addAccessibleListener(new AccessibleAdapter() {
+
+ @Override
public void getName(AccessibleEvent e) {
e.result = infopopText;
}
+ @Override
public void getHelp(AccessibleEvent e) {
e.result = control.getToolTipText();
}
});
accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
+
+ @Override
public void getChildAtPoint(AccessibleControlEvent e) {
Point pt = control.toControl(new Point(e.x, e.y));
e.childID = (control.getBounds().contains(pt)) ? ACC.CHILDID_MULTIPLE
: ACC.CHILDID_NONE;
}
+ @Override
public void getLocation(AccessibleControlEvent e) {
Rectangle location = control.getBounds();
Point pt = control.toDisplay(new Point(location.x, location.y));
@@ -457,14 +455,17 @@ public class ContextHelpDialog {
e.height = location.height;
}
+ @Override
public void getChildCount(AccessibleControlEvent e) {
e.detail = 1;
}
+ @Override
public void getRole(AccessibleControlEvent e) {
e.detail = ACC.ROLE_LABEL;
}
+ @Override
public void getState(AccessibleControlEvent e) {
e.detail = ACC.STATE_READONLY;
}
@@ -480,10 +481,12 @@ public class ContextHelpDialog {
super(parent, style);
}
+ @Override
public boolean setFocus() {
return false;
}
+ @Override
public boolean isFocusControl() {
return false;
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java
index aece9b2e5..d1355cc74 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java
@@ -1,16 +1,19 @@
/***************************************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved. This program and the
- * accompanying materials are made available under the terms of the Eclipse Public License v1.0
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors: IBM Corporation - initial API and implementation Sebastian Davids <sdavids@gmx.de> -
- * bug 93374
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Sebastian Davids <sdavids@gmx.de> - bug 93374
**************************************************************************************************/
package org.eclipse.help.ui.internal;
import java.net.URL;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.help.IContext;
import org.eclipse.help.IHelpResource;
import org.eclipse.help.browser.IBrowser;
@@ -23,19 +26,14 @@ import org.eclipse.help.ui.internal.views.ContextHelpPart;
import org.eclipse.help.ui.internal.views.HelpTray;
import org.eclipse.help.ui.internal.views.HelpView;
import org.eclipse.help.ui.internal.views.ReusableHelpPart;
+import org.eclipse.jface.dialogs.DialogTray;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.osgi.service.environment.Constants;
-
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jface.dialogs.DialogTray;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.TrayDialog;
-
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
@@ -75,13 +73,16 @@ public class DefaultHelpUI extends AbstractHelpUI {
return support.getExternalBrowser();
}
+ @Override
public void close() {
}
+ @Override
public boolean isCloseSupported() {
return false;
}
+ @Override
public void displayURL(String url) throws Exception {
try {
IWebBrowser browser = getExternalBrowser();
@@ -93,17 +94,21 @@ public class DefaultHelpUI extends AbstractHelpUI {
}
}
+ @Override
public boolean isSetLocationSupported() {
return false;
}
+ @Override
public boolean isSetSizeSupported() {
return false;
}
+ @Override
public void setLocation(int x, int y) {
}
+ @Override
public void setSize(int width, int height) {
}
}
@@ -126,6 +131,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
/**
* Displays help.
*/
+ @Override
public void displayHelp() {
BaseHelpSystem.getHelpDisplay().displayHelp(useExternalBrowser(null));
}
@@ -133,6 +139,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
/**
* Displays search.
*/
+ @Override
public void displaySearch() {
search(null);
}
@@ -140,6 +147,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
/**
* Displays dynamic help.
*/
+ @Override
public void displayDynamicHelp() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
Shell activeShell = getActiveShell();
@@ -174,7 +182,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
/**
* Starts the search.
*/
-
+ @Override
public void search(final String expression) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
Shell activeShell = getActiveShell();
@@ -270,6 +278,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
* <em>toc="/myplugin/mytoc.xml"&amp;topic="/myplugin/references/myclass.html"</em> is valid.
* </ul>
*/
+ @Override
public void displayHelpResource(String href) {
BaseHelpSystem.getHelpDisplay().displayHelpResource(href, useExternalBrowser(href));
}
@@ -284,6 +293,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
* @param y
* int positioning information
*/
+ @Override
public void displayContext(IContext context, int x, int y) {
displayContext(context, x, y, false);
}
@@ -352,11 +362,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
displayContextAsInfopop(context, x, y, null);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.help.AbstractHelpUI#resolve(java.lang.String, boolean)
- */
+ @Override
public URL resolve(String href, boolean documentOnly) {
return BaseHelpSystem.resolve(href, documentOnly);
}
@@ -441,6 +447,7 @@ public class DefaultHelpUI extends AbstractHelpUI {
* Returns <code>true</code> if the context-sensitive help window is currently being
* displayed, <code>false</code> if not.
*/
+ @Override
public boolean isContextHelpDisplayed() {
if (f1Dialog == null) {
return false;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java
index 7e933c901..0f6e22d60 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,16 +21,20 @@ public class DynamicHelpAction implements IWorkbenchWindowActionDelegate {
public DynamicHelpAction() {
}
- public void dispose() {
+ @Override
+ public void dispose() {
}
- public void init(IWorkbenchWindow window) {
+ @Override
+ public void init(IWorkbenchWindow window) {
}
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
PlatformUI.getWorkbench().getHelpSystem().displayDynamicHelp();
}
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
}
} \ No newline at end of file
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java
index 3de23d128..b5b76aff3 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -39,10 +39,12 @@ public class ExecuteCommandAction implements ILiveHelpAction {
*/
private String serializedCommand;
+ @Override
public void setInitializationString(String data) {
serializedCommand = data;
}
+ @Override
public void run() {
if (serializedCommand == null) {
@@ -61,20 +63,14 @@ public class ExecuteCommandAction implements ILiveHelpAction {
// this will happen when there is no workbench
}
if (workbench == null) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(null, Messages.Help_Error,
- Messages.NoWorkbenchForExecuteCommand_msg);
- }
- });
+ Display.getDefault().syncExec(() -> MessageDialog.openError(null, Messages.Help_Error,
+ Messages.NoWorkbenchForExecuteCommand_msg));
return;
}
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- forceDialogsOnTop();
- executeSerializedCommand();
- }
+ Display.getDefault().syncExec(() -> {
+ forceDialogsOnTop();
+ executeSerializedCommand();
});
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java
index 7e114f4c7..b93bc637e 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java
@@ -134,9 +134,13 @@ public class HelpActivitySupport implements IHelpActivitySupport {
.equalsIgnoreCase(showDisabledActivities);
filteringEnabled = filteringEnabled && isWorkbenchFiltering();
}
+
+ @Override
public boolean isFilteringEnabled() {
return filteringEnabled;
}
+
+ @Override
public void setFilteringEnabled(boolean enabled) {
if (userCanToggleFiltering) {
filteringEnabled = enabled;
@@ -154,14 +158,12 @@ public class HelpActivitySupport implements IHelpActivitySupport {
}
}
}
+
+ @Override
public boolean isUserCanToggleFiltering() {
return userCanToggleFiltering;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.internal.base.IHelpActivitySupport#isEnabled()
- */
+ @Override
public boolean isEnabled(String href) {
if (!isFilteringEnabled()) {
return true;
@@ -169,9 +171,7 @@ public class HelpActivitySupport implements IHelpActivitySupport {
return isRoleEnabled(href);
}
- /* (non-Javadoc)
- * @see org.eclipse.help.internal.base.IHelpActivitySupport#isRoleEnabled(java.lang.String)
- */
+ @Override
public boolean isRoleEnabled(String href) {
if (href.startsWith("/")) { //$NON-NLS-1$
href = href.substring(1);
@@ -191,6 +191,7 @@ public class HelpActivitySupport implements IHelpActivitySupport {
* @param locale
* locale for which TOCs are checked
*/
+ @Override
public boolean isEnabledTopic(String href, String locale) {
if (href == null) {
return false;
@@ -246,11 +247,8 @@ public class HelpActivitySupport implements IHelpActivitySupport {
}
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.internal.base.IHelpActivitySupport#enableActivities(java.lang.String)
- */
+
+ @Override
@SuppressWarnings("unchecked")
public void enableActivities(String href) {
if (href.startsWith("/")) { //$NON-NLS-1$
@@ -279,12 +277,18 @@ public class HelpActivitySupport implements IHelpActivitySupport {
return !PlatformUI.getWorkbench().getActivitySupport()
.getActivityManager().getDefinedActivityIds().isEmpty();
}
+
+ @Override
public String getShowAllMessage() {
return activityDescriptor.getShowAllMessage();
}
+
+ @Override
public String getDocumentMessage(boolean embedded) {
return activityDescriptor.getDocumentMessage(embedded);
}
+
+ @Override
public boolean getDocumentMessageUsesLiveHelp(boolean embedded) {
return activityDescriptor.needsLiveHelp(embedded);
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java
index c3d7cd336..5f67a79d6 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -32,6 +32,8 @@ public final class HelpUIEvaluationContext {
public static EvaluationContext getContext() {
if (context == null) {
context = new EvaluationContext(null, Platform.class) {
+
+ @Override
public Object getVariable(String name) {
if (VARIABLE_PLATFORM.equals(name)) {
return Platform.class;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java
index f6f9fbe11..7379ce59a 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -67,11 +67,7 @@ public class HelpUIPlugin extends AbstractUIPlugin {
return plugin;
}
- /*
- * (non-Javadoc)
- *
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
// Make sure we cancel indexer if it is currently running
@@ -79,11 +75,7 @@ public class HelpUIPlugin extends AbstractUIPlugin {
super.stop(context);
}
- /*
- * (non-Javadoc)
- *
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkAdapter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkAdapter.java
index fa6fcce36..30d17da17 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkAdapter.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.help.ui.internal;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Control;
public class HyperlinkAdapter implements IHyperlinkListener {
/**
* HyperlinkAdapter constructor comment.
@@ -21,18 +21,21 @@ public class HyperlinkAdapter implements IHyperlinkListener {
* @param linkLabel
* org.eclipse.swt.widgets.Label
*/
+ @Override
public void linkActivated(Control linkLabel) {
}
/**
* @param linkLabel
* org.eclipse.swt.widgets.Label
*/
+ @Override
public void linkEntered(Control linkLabel) {
}
/**
* @param linkLabel
* org.eclipse.swt.widgets.Label
*/
+ @Override
public void linkExited(Control linkLabel) {
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java
index a0e2163c5..fdac10127 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java
@@ -116,13 +116,19 @@ public class HyperlinkHandler
public boolean isHyperlinkCursorUsed() {
return hyperlinkCursorUsed;
}
+
+ @Override
public void mouseDoubleClick(MouseEvent e) {
}
+
+ @Override
public void mouseDown(MouseEvent e) {
if (e.button == 1)
return;
lastLink = (Control) e.widget;
}
+
+ @Override
public void mouseEnter(MouseEvent e) {
Control control = (Control) e.widget;
@@ -138,6 +144,8 @@ public class HyperlinkHandler
if (action != null)
action.linkEntered(control);
}
+
+ @Override
public void mouseExit(MouseEvent e) {
Control control = (Control) e.widget;
@@ -153,8 +161,12 @@ public class HyperlinkHandler
if (action != null)
action.linkExited(control);
}
+
+ @Override
public void mouseHover(MouseEvent e) {
}
+
+ @Override
public void mouseUp(MouseEvent e) {
if (e.button != 1)
return;
@@ -168,6 +180,8 @@ public class HyperlinkHandler
c.setCursor(isHyperlinkCursorUsed() ? hyperlinkCursor : null);
}
}
+
+ @Override
public void paintControl(PaintEvent e) {
Control control = (Control) e.widget;
if (hyperlinkUnderlineMode == UNDERLINE_ALWAYS)
@@ -283,6 +297,7 @@ public class HyperlinkHandler
* @param event
* the event which occurred
*/
+ @Override
public void handleEvent(Event event) {
IHyperlinkListener listener = getLinkListener((Control) event.widget);
listener.linkActivated((Control) event.widget);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java
index c625ada04..40ba84027 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,12 +11,34 @@
package org.eclipse.help.ui.internal;
-import org.eclipse.swt.*;
-import org.eclipse.swt.accessibility.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseTrackListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.TypedListener;
/**
*
@@ -43,13 +65,11 @@ public class HyperlinkLabel extends Canvas {
this.label = new Label(this, style);
- addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- paint(e);
- }
- });
+ addPaintListener(e -> paint(e));
addKeyListener(new KeyAdapter() {
+
+ @Override
public void keyPressed(KeyEvent e) {
if (e.character == '\r') {
// Activation
@@ -58,28 +78,28 @@ public class HyperlinkLabel extends Canvas {
}
});
- addListener(SWT.Traverse, new Listener() {
- public void handleEvent(Event e) {
- switch (e.detail) {
- // let arrows move focus
- case SWT.TRAVERSE_ARROW_NEXT :
- e.detail = SWT.TRAVERSE_TAB_NEXT;
- break;
- case SWT.TRAVERSE_ARROW_PREVIOUS :
- e.detail = SWT.TRAVERSE_TAB_PREVIOUS;
- break;
-
- case SWT.TRAVERSE_PAGE_NEXT :
- case SWT.TRAVERSE_PAGE_PREVIOUS :
- case SWT.TRAVERSE_RETURN :
- e.doit = false;
- return;
- }
- e.doit = true;
+ addListener(SWT.Traverse, e -> {
+ switch (e.detail) {
+ // let arrows move focus
+ case SWT.TRAVERSE_ARROW_NEXT:
+ e.detail = SWT.TRAVERSE_TAB_NEXT;
+ break;
+ case SWT.TRAVERSE_ARROW_PREVIOUS:
+ e.detail = SWT.TRAVERSE_TAB_PREVIOUS;
+ break;
+
+ case SWT.TRAVERSE_PAGE_NEXT:
+ case SWT.TRAVERSE_PAGE_PREVIOUS:
+ case SWT.TRAVERSE_RETURN:
+ e.doit = false;
+ return;
}
+ e.doit = true;
});
addFocusListener(new FocusListener() {
+
+ @Override
public void focusGained(FocusEvent e) {
if (!hasFocus) {
hasFocus = true;
@@ -87,6 +107,8 @@ public class HyperlinkLabel extends Canvas {
redraw();
}
}
+
+ @Override
public void focusLost(FocusEvent e) {
if (hasFocus) {
hasFocus = false;
@@ -150,6 +172,7 @@ public class HyperlinkLabel extends Canvas {
removeListener(SWT.DefaultSelection, listener);
}
+ @Override
public Point computeSize(int wHint, int hHint, boolean changed) {
int innerWidth = wHint;
if (innerWidth != SWT.DEFAULT)
@@ -161,36 +184,43 @@ public class HyperlinkLabel extends Canvas {
return new Point(textWidth, textHeight);
}
+ @Override
public void addMouseListener(MouseListener l) {
//super.addMouseListener(l);
label.addMouseListener(l);
}
+ @Override
public void addMouseTrackListener(MouseTrackListener l) {
//super.addMouseTrackListener(l);
label.addMouseTrackListener(l);
}
+ @Override
public void addPaintListener(PaintListener l) {
super.addPaintListener(l);
label.addPaintListener(l);
}
+ @Override
public void addListener(int e, Listener l) {
super.addListener(e, l);
//label.addListener(e, l);
}
+ @Override
public void setBackground(Color c) {
super.setBackground(c);
label.setBackground(c);
}
+ @Override
public void setForeground(Color c) {
super.setForeground(c);
label.setForeground(c);
}
+ @Override
public void setCursor(Cursor c) {
super.setCursor(c);
label.setCursor(c);
@@ -199,20 +229,26 @@ public class HyperlinkLabel extends Canvas {
private void initAccessibleLink() {
Accessible accessible = this.getAccessible();
accessible.addAccessibleListener(new AccessibleAdapter() {
+
+ @Override
public void getName(AccessibleEvent e) {
e.result = label.getText();
}
+ @Override
public void getHelp(AccessibleEvent e) {
e.result = label.getToolTipText();
}
});
accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
+
+ @Override
public void getRole(AccessibleControlEvent e) {
e.detail = ACC.ROLE_LINK;
}
+ @Override
public void getState(AccessibleControlEvent e) {
if (hasFocus)
e.detail = ACC.STATE_FOCUSABLE | ACC.STATE_LINKED
@@ -226,6 +262,8 @@ public class HyperlinkLabel extends Canvas {
private void initAccessibleLabel() {
Accessible accessible = label.getAccessible();
accessible.addAccessibleControlListener(new AccessibleControlAdapter() {
+
+ @Override
public void getState(AccessibleControlEvent e) {
if (hasFocus)
e.detail = ACC.STATE_READONLY | ACC.STATE_FOCUSABLE
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java
index a6f82be4c..1998ecdf1 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,16 +21,20 @@ public class SearchAction implements IWorkbenchWindowActionDelegate {
public SearchAction() {
}
- public void dispose() {
+ @Override
+ public void dispose() {
}
- public void init(IWorkbenchWindow window) {
+ @Override
+ public void init(IWorkbenchWindow window) {
}
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
PlatformUI.getWorkbench().getHelpSystem().displaySearch();
}
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java
index ae69bb263..cc35bbfd5 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,42 +22,41 @@ import org.eclipse.ui.dialogs.PreferencesUtil;
public class ShowCapabilitiesPreferenceAction implements ILiveHelpAction {
private boolean narrow;
+ @Override
public void setInitializationString(String data) {
if (data!=null && data.equals("narrow")) //$NON-NLS-1$
narrow=true;
}
+ @Override
public void run() {
final Display display = PlatformUI.getWorkbench().getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- Shell windowShell=null;
- if (!narrow) {
- Shell[] shells = display.getShells();
- for (int i=0; i<shells.length; i++) {
- Object data = shells[i].getData();
- if (data!=null && data instanceof IWorkbenchWindow) {
- windowShell=shells[i];
- break;
- }
+ display.syncExec(() -> {
+ Shell windowShell = null;
+ if (!narrow) {
+ Shell[] shells = display.getShells();
+ for (int i = 0; i < shells.length; i++) {
+ Object data = shells[i].getData();
+ if (data != null && data instanceof IWorkbenchWindow) {
+ windowShell = shells[i];
+ break;
}
}
- if (windowShell!=null) {
- windowShell.forceActive();
- if (Platform.getWS().equals(Platform.WS_WIN32)) {
- // feature in Windows. Without this code,
- // the window will only flash in the launch bar.
- windowShell.setVisible(false);
- windowShell.setMinimized(true);
- windowShell.setVisible(true);
- windowShell.setMinimized(false);
- }
+ }
+ if (windowShell != null) {
+ windowShell.forceActive();
+ if (Platform.getWS().equals(Platform.WS_WIN32)) {
+ // feature in Windows. Without this code,
+ // the window will only flash in the launch bar.
+ windowShell.setVisible(false);
+ windowShell.setMinimized(true);
+ windowShell.setVisible(true);
+ windowShell.setMinimized(false);
}
- PreferenceDialog dialog = PreferencesUtil
- .createPreferenceDialogOn(windowShell, getCapabilityPageId(),
- null, null);
- dialog.open();
}
+ PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(windowShell,
+ getCapabilityPageId(), null, null);
+ dialog.open();
});
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java
index 760c6461e..2164875bd 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,21 +24,21 @@ public class ShowInTocAction implements ILiveHelpAction {
private String path;
+ @Override
public void setInitializationString(String data) {
path = data;
}
+ @Override
public void run() {
final IHelpResource res = getHelpResource();
final ReusableHelpPart helpPart = ReusableHelpPart.getLastActiveInstance();
if (helpPart != null) {
- helpPart.getControl().getDisplay().syncExec(new Runnable() {
- public void run() {
- helpPart.showPage(IHelpUIConstants.HV_ALL_TOPICS_PAGE);
- AllTopicsPart part = (AllTopicsPart)helpPart.findPart(IHelpUIConstants.HV_TOPIC_TREE);
- if (part != null) {
- part.selectReveal(res);
- }
+ helpPart.getControl().getDisplay().syncExec(() -> {
+ helpPart.showPage(IHelpUIConstants.HV_ALL_TOPICS_PAGE);
+ AllTopicsPart part = (AllTopicsPart) helpPart.findPart(IHelpUIConstants.HV_TOPIC_TREE);
+ if (part != null) {
+ part.selectReveal(res);
}
});
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java
index 98ce70465..447b1d165 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/StyledLineWrapper.java
@@ -66,6 +66,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#addTextChangeListener(TextChangeListener)
*/
+ @Override
public void addTextChangeListener(TextChangeListener l) {
// do nothing
}
@@ -73,6 +74,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#getCharCount()
*/
+ @Override
public int getCharCount() {
if (charCount != -1)
return charCount;
@@ -85,6 +87,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#getLine(int)
*/
+ @Override
public String getLine(int i) {
if ((i >= lines.size()) || (i < 0))
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
@@ -94,6 +97,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#getLineAtOffset(int)
*/
+ @Override
public int getLineAtOffset(int offset) {
if (offset >= getCharCount())
return getLineCount() - 1;
@@ -108,6 +112,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#getLineCount()
*/
+ @Override
public int getLineCount() {
if (lines.size() == 0)
return 1;
@@ -117,6 +122,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#getLineDelimiter()
*/
+ @Override
public String getLineDelimiter() {
return null;
}
@@ -124,6 +130,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#getOffsetAtLine(int)
*/
+ @Override
public int getOffsetAtLine(int line) {
if (lines.size() == 0)
return 0;
@@ -136,6 +143,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#getTextRange(int, int)
*/
+ @Override
public String getTextRange(int start, int end) {
int l1 = getLineAtOffset(start);
int l2 = getLineAtOffset(end);
@@ -153,6 +161,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#removeTextChangeListener(TextChangeListener)
*/
+ @Override
public void removeTextChangeListener(TextChangeListener arg0) {
// do nothing
}
@@ -160,6 +169,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#replaceTextRange(int, int, String)
*/
+ @Override
public void replaceTextRange(int arg0, int arg1, String arg2) {
// do nothing
}
@@ -167,6 +177,7 @@ public class StyledLineWrapper implements StyledTextContent {
/**
* @see StyledTextContent#setText(String)
*/
+ @Override
public void setText(String text) {
if (text == null)
text = " "; //$NON-NLS-1$
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserAdapter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserAdapter.java
index bd1aa50a5..1704c8cfb 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserAdapter.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,11 +10,12 @@
*******************************************************************************/
package org.eclipse.help.ui.internal.browser;
-import org.eclipse.help.browser.*;
-import org.eclipse.help.ui.internal.*;
-import org.eclipse.help.ui.internal.util.*;
+import org.eclipse.help.browser.IBrowser;
+import org.eclipse.help.ui.internal.HelpUIPlugin;
+import org.eclipse.help.ui.internal.Messages;
+import org.eclipse.help.ui.internal.util.ErrorUtil;
import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.program.*;
+import org.eclipse.swt.program.Program;
/**
* Implmentation of IBrowser interface, using org.eclipse.swt.Program
@@ -28,15 +29,11 @@ public class SystemBrowserAdapter implements IBrowser {
public SystemBrowserAdapter() {
}
- /*
- * @see IBrowser#close()
- */
+ @Override
public void close() {
}
- /*
- * @see IBrowser#displayURL(String)
- */
+ @Override
public void displayURL(String url) {
// if (Constants.WS_WIN32.equalsIgnoreCase(Platform.getOS())) {
if (!Program.launch(url)) {
@@ -59,36 +56,26 @@ public class SystemBrowserAdapter implements IBrowser {
// }
}
- /*
- * @see IBrowser#isCloseSupported()
- */
+ @Override
public boolean isCloseSupported() {
return false;
}
- /*
- * @see IBrowser#isSetLocationSupported()
- */
+ @Override
public boolean isSetLocationSupported() {
return false;
}
- /*
- * @see IBrowser#isSetSizeSupported()
- */
+ @Override
public boolean isSetSizeSupported() {
return false;
}
- /*
- * @see IBrowser#setLocation(int, int)
- */
+ @Override
public void setLocation(int x, int y) {
}
- /*
- * @see IBrowser#setSize(int, int)
- */
+ @Override
public void setSize(int width, int height) {
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserFactory.java
index 3c0481bbc..b285bec0d 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserFactory.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/SystemBrowserFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,9 +9,10 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.help.ui.internal.browser;
-import org.eclipse.core.runtime.*;
-import org.eclipse.help.browser.*;
-import org.eclipse.osgi.service.environment.*;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.help.browser.IBrowser;
+import org.eclipse.help.browser.IBrowserFactory;
+import org.eclipse.osgi.service.environment.Constants;
public class SystemBrowserFactory implements IBrowserFactory {
/**
* Constructor.
@@ -19,15 +20,13 @@ public class SystemBrowserFactory implements IBrowserFactory {
public SystemBrowserFactory() {
super();
}
- /*
- * @see IBrowserFactory#isAvailable()
- */
+
+ @Override
public boolean isAvailable() {
return Constants.WS_WIN32.equalsIgnoreCase(Platform.getOS());
}
- /*
- * @see IBrowserFactory#createBrowser()
- */
+
+ @Override
public IBrowser createBrowser() {
return new SystemBrowserAdapter();
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java
index 7158cfa28..e4300080c 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java
@@ -30,23 +30,14 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.CloseWindowListener;
import org.eclipse.swt.browser.LocationAdapter;
import org.eclipse.swt.browser.LocationEvent;
-import org.eclipse.swt.browser.LocationListener;
-import org.eclipse.swt.browser.OpenWindowListener;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
-import org.eclipse.swt.browser.StatusTextEvent;
-import org.eclipse.swt.browser.StatusTextListener;
-import org.eclipse.swt.browser.TitleEvent;
-import org.eclipse.swt.browser.TitleListener;
import org.eclipse.swt.browser.VisibilityWindowListener;
import org.eclipse.swt.browser.WindowEvent;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
@@ -89,6 +80,8 @@ public class EmbeddedBrowser {
shell = new Shell(style);
initializeShell(shell);
shell.addControlListener(new ControlListener() {
+
+ @Override
public void controlMoved(ControlEvent e) {
if (!shell.getMaximized()) {
Point location = shell.getLocation();
@@ -96,6 +89,8 @@ public class EmbeddedBrowser {
y = location.y;
}
}
+
+ @Override
public void controlResized(ControlEvent e) {
if (!shell.getMaximized()) {
Point size = shell.getSize();
@@ -104,19 +99,17 @@ public class EmbeddedBrowser {
}
}
});
- shell.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- // save position
- IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(HelpUIPlugin.PLUGIN_ID);
- prefs.putInt(BROWSER_X, x);
- prefs.putInt(BROWSER_Y, y);
- prefs.putInt(BROWSER_WIDTH, w);
- prefs.putInt(BROWSER_HEIGTH, h);
- prefs.putBoolean(BROWSER_MAXIMIZED, (shell.getMaximized()));
- notifyCloseListners();
- if (HelpApplication.isShutdownOnClose()) {
- HelpApplication.stopHelp();
- }
+ shell.addDisposeListener(e -> {
+ // save position
+ IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(HelpUIPlugin.PLUGIN_ID);
+ prefs.putInt(BROWSER_X, x);
+ prefs.putInt(BROWSER_Y, y);
+ prefs.putInt(BROWSER_WIDTH, w);
+ prefs.putInt(BROWSER_HEIGTH, h);
+ prefs.putBoolean(BROWSER_MAXIMIZED, (shell.getMaximized()));
+ notifyCloseListners();
+ if (HelpApplication.isShutdownOnClose()) {
+ HelpApplication.stopHelp();
}
});
@@ -143,6 +136,8 @@ public class EmbeddedBrowser {
if (Platform.getPreferencesService().getBoolean(HelpUIPlugin.PLUGIN_ID, BROWSER_MAXIMIZED, false, null))
shell.setMaximized(true);
shell.addControlListener(new ControlListener() {
+
+ @Override
public void controlMoved(ControlEvent e) {
if (!shell.getMaximized()) {
Point location = shell.getLocation();
@@ -150,6 +145,8 @@ public class EmbeddedBrowser {
y = location.y;
}
}
+
+ @Override
public void controlResized(ControlEvent e) {
if (!shell.getMaximized()) {
Point size = shell.getSize();
@@ -163,7 +160,9 @@ public class EmbeddedBrowser {
shell.open();
//browser.setUrl("about:blank");
- browser.addLocationListener(new LocationListener() {
+ browser.addLocationListener(new LocationAdapter() {
+
+ @Override
public void changing(LocationEvent e) {
// hack to know when help webapp needs modal window
modalRequestTime = 0;
@@ -180,8 +179,6 @@ public class EmbeddedBrowser {
}
}
}
- public void changed(LocationEvent e) {
- }
});
}
/**
@@ -209,7 +206,9 @@ public class EmbeddedBrowser {
initialize(browser);
event.browser = browser;
- browser.addLocationListener(new LocationListener() {
+ browser.addLocationListener(new LocationAdapter() {
+
+ @Override
public void changing(LocationEvent e) {
// hack to know when help webapp needs modal window
modalRequestTime = 0;
@@ -218,8 +217,6 @@ public class EmbeddedBrowser {
modalRequestTime = System.currentTimeMillis();
}
}
- public void changed(LocationEvent e) {
- }
});
}
private static void initializeShell(Shell s) {
@@ -233,39 +230,35 @@ public class EmbeddedBrowser {
layout.verticalSpacing = 0;
layout.horizontalSpacing = 0;
s.setLayout(layout);
- s.addDisposeListener(new DisposeListener() {
-
- public void widgetDisposed(DisposeEvent e) {
- if (shellImages != null) {
- for (int i = 0; i < shellImages.length; i++) {
- shellImages[i].dispose();
- }
+ s.addDisposeListener(e -> {
+ if (shellImages != null) {
+ for (int i = 0; i < shellImages.length; i++) {
+ shellImages[i].dispose();
}
-
}
});
}
private void initialize(Browser browser) {
- browser.addOpenWindowListener(new OpenWindowListener() {
- public void open(WindowEvent event) {
- if (System.currentTimeMillis() - modalRequestTime <= 1000) {
- new EmbeddedBrowser(event, shell);
- }
- else if (event.required) {
- new EmbeddedBrowser(event, null);
- }
- else {
- displayURLExternal(event);
- }
+ browser.addOpenWindowListener(event -> {
+ if (System.currentTimeMillis() - modalRequestTime <= 1000) {
+ new EmbeddedBrowser(event, shell);
+ } else if (event.required) {
+ new EmbeddedBrowser(event, null);
+ } else {
+ displayURLExternal(event);
}
});
browser.addVisibilityWindowListener(new VisibilityWindowListener() {
+
+ @Override
public void hide(WindowEvent event) {
Browser browser = (Browser) event.widget;
Shell shell = browser.getShell();
shell.setVisible(false);
}
+
+ @Override
public void show(WindowEvent event) {
Browser browser = (Browser) event.widget;
Shell shell = browser.getShell();
@@ -278,28 +271,21 @@ public class EmbeddedBrowser {
shell.open();
}
});
- browser.addCloseWindowListener(new CloseWindowListener() {
- public void close(WindowEvent event) {
- Browser browser = (Browser) event.widget;
- Shell shell = browser.getShell();
- shell.close();
- }
+ browser.addCloseWindowListener(event -> {
+ Browser browser1 = (Browser) event.widget;
+ Shell shell = browser1.getShell();
+ shell.close();
});
- browser.addTitleListener(new TitleListener() {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.browser.TitleListener#changed(org.eclipse.swt.browser.TitleEvent)
- */
- public void changed(TitleEvent event) {
- if (event.title != null && event.title.length() > 0) {
- Browser browser = (Browser) event.widget;
- Shell shell = browser.getShell();
- shell.setText(event.title);
- }
+ browser.addTitleListener(event -> {
+ if (event.title != null && event.title.length() > 0) {
+ Browser browser1 = (Browser) event.widget;
+ Shell shell = browser1.getShell();
+ shell.setText(event.title);
}
});
- browser.addLocationListener(new LocationListener() {
+ browser.addLocationListener(new LocationAdapter() {
+
+ @Override
public void changing(LocationEvent e) {
if (!e.doit && e.location != null
&& e.location.startsWith("https://")) { //$NON-NLS-1$
@@ -310,23 +296,20 @@ public class EmbeddedBrowser {
}
}
}
-
- public void changed(LocationEvent e) {
- }
});
}
private void initializeStatusBar(Browser browser) {
- browser.addStatusTextListener(new StatusTextListener() {
- public void changed(StatusTextEvent event) {
- event.text = event.text.replaceAll("&","&&"); //$NON-NLS-1$ //$NON-NLS-2$
- if (!event.text.equals(statusText)) {
- statusText = event.text;
- statusBarText.setText(statusText);
- }
+ browser.addStatusTextListener(event -> {
+ event.text = event.text.replaceAll("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (!event.text.equals(statusText)) {
+ statusText = event.text;
+ statusBarText.setText(statusText);
}
});
browser.addProgressListener(new ProgressListener() {
+
+ @Override
public void changed(ProgressEvent event) {
if (event.total > 0) {
statusBarProgress.setMaximum(event.total);
@@ -335,6 +318,8 @@ public class EmbeddedBrowser {
statusBarProgress.setVisible(true);
}
}
+
+ @Override
public void completed(ProgressEvent event) {
statusBarSeparator.setVisible(false);
statusBarProgress.setVisible(false);
@@ -382,6 +367,8 @@ public class EmbeddedBrowser {
final Shell externalShell = new Shell(shell, SWT.NONE);
Browser externalBrowser = new Browser(externalShell, SWT.NONE);
externalBrowser.addLocationListener(new LocationAdapter() {
+
+ @Override
public void changing(final LocationEvent e) {
e.doit = false;
try {
@@ -391,11 +378,7 @@ public class EmbeddedBrowser {
String msg = "Error opening external Web browser"; //$NON-NLS-1$
HelpUIPlugin.logError(msg, t);
}
- externalShell.getDisplay().asyncExec(new Runnable() {
- public void run() {
- externalShell.dispose();
- }
- });
+ externalShell.getDisplay().asyncExec(() -> externalShell.dispose());
}
});
e.browser = externalBrowser;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
index d0667f6fc..f8617b1cc 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
setName("Help Browser UI"); //$NON-NLS-1$
}
+ @Override
public void run() {
d = new Display();
while (runEventLoop) {
@@ -80,6 +81,7 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
return Display.getDefault();
}
+ @Override
public void browserClosed() {
browser=null;
if(secondThread!=null){
@@ -87,9 +89,8 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
secondThread = null;
}
}
- /*
- * @see IBrowser#displayURL(String)
- */
+
+ @Override
public synchronized void displayURL(final String url) {
if (!HelpApplication.isShutdownOnClose()) {
close();
@@ -97,11 +98,7 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
if (getBrowserDisplay() == Display.getCurrent()) {
uiDisplayURL(url);
} else {
- getBrowserDisplay().asyncExec(new Runnable() {
- public void run() {
- uiDisplayURL(url);
- }
- });
+ getBrowserDisplay().asyncExec(() -> uiDisplayURL(url));
}
}
/**
@@ -113,18 +110,12 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
getBrowser().displayUrl(url);
}
- /*
- * @see IBrowser#close()
- */
+ @Override
public synchronized void close() {
if (getBrowserDisplay() == Display.getCurrent()) {
uiClose();
} else {
- getBrowserDisplay().syncExec(new Runnable() {
- public void run() {
- uiClose();
- }
- });
+ getBrowserDisplay().syncExec(() -> uiClose());
}
}
/*
@@ -149,36 +140,28 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
}
return browser;
}
- /*
- * @see IBrowser#isCloseSupported()
- */
+
+ @Override
public boolean isCloseSupported() {
return true;
}
- /*
- * @see IBrowser#isSetLocationSupported()
- */
+
+ @Override
public boolean isSetLocationSupported() {
return true;
}
- /*
- * @see IBrowser#isSetSizeSupported()
- */
+
+ @Override
public boolean isSetSizeSupported() {
return true;
}
- /*
- * @see IBrowser#setLocation(int, int)
- */
+
+ @Override
public synchronized void setLocation(final int x, final int y) {
if (getBrowserDisplay() == Display.getCurrent()) {
uiSetLocation(x, y);
} else {
- getBrowserDisplay().asyncExec(new Runnable() {
- public void run() {
- uiSetLocation(x, y);
- }
- });
+ getBrowserDisplay().asyncExec(() -> uiSetLocation(x, y));
}
}
/*
@@ -187,18 +170,13 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{
private void uiSetLocation(int x, int y) {
getBrowser().setLocation(x, y);
}
- /*
- * @see IBrowser#setSize(int, int)
- */
+
+ @Override
public synchronized void setSize(final int width, final int height) {
if (getBrowserDisplay() == Display.getCurrent()) {
uiSetSize(width, height);
} else {
- getBrowserDisplay().asyncExec(new Runnable() {
- public void run() {
- uiSetSize(width, height);
- }
- });
+ getBrowserDisplay().asyncExec(() -> uiSetSize(width, height));
}
}
/*
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
index 0c04f20ea..9bdd1f99e 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,15 +11,21 @@
*******************************************************************************/
package org.eclipse.help.ui.internal.browser.embedded;
-import org.eclipse.core.runtime.*;
-import org.eclipse.help.browser.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.help.browser.IBrowser;
+import org.eclipse.help.browser.IBrowserFactory;
import org.eclipse.help.internal.HelpPlugin;
-import org.eclipse.help.internal.base.*;
-import org.eclipse.help.ui.internal.*;
-import org.eclipse.osgi.service.environment.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.browser.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.help.internal.base.BaseHelpSystem;
+import org.eclipse.help.ui.internal.HelpUIEventLoop;
+import org.eclipse.help.ui.internal.HelpUIPlugin;
+import org.eclipse.osgi.service.environment.Constants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
public class EmbeddedBrowserFactory implements IBrowserFactory {
private boolean tested = false;
@@ -34,18 +40,12 @@ public class EmbeddedBrowserFactory implements IBrowserFactory {
super();
}
- /*
- * @see IBrowserFactory#isAvailable()
- */
+ @Override
public boolean isAvailable() {
if (BaseHelpSystem.getMode() == BaseHelpSystem.MODE_STANDALONE) {
try {
if (HelpUIEventLoop.isRunning()) {
- Display.getDefault().syncExec(new Runnable() {
- public void run() {
- test();
- }
- });
+ Display.getDefault().syncExec(() -> test());
}
} catch (Exception e) {
// just in case
@@ -92,9 +92,7 @@ public class EmbeddedBrowserFactory implements IBrowserFactory {
return available;
}
- /*
- * @see IBrowserFactory#createBrowser()
- */
+ @Override
public IBrowser createBrowser() {
return new EmbeddedBrowserAdapter(browserType);
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java
index c205fdd02..755389281 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,16 +25,12 @@ public class FilterResolverExtension implements Extension {
private static final String NAME_ACTIVITY = "activity"; //$NON-NLS-1$
private static final String NAME_CATEGORY = "category"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.eclipse.help.internal.dynamic.FilterResolver.Extension#isHandled(java.lang.String)
- */
+ @Override
public boolean isHandled(String name) {
return (name.equals(NAME_ACTIVITY) || name.equals(NAME_CATEGORY));
}
- /* (non-Javadoc)
- * @see org.eclipse.help.internal.dynamic.FilterResolver.Extension#isFiltered(java.lang.String, java.lang.String)
- */
+ @Override
public boolean isFiltered(String name, String value) {
if (name.equals(NAME_ACTIVITY)) {
return filterByActivity(value);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java
index 229efa1d5..847349c90 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,6 +29,7 @@ public class OpenBundleResourceHandler extends AbstractHandler {
private static final String PARAM_ID_PATH = "path"; //$NON-NLS-1$
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
String pluginId = event.getParameter(PARAM_ID_PLUGIN);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java
index 4059bc1be..1c9ac4b1e 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,6 +37,7 @@ public class ShowIndexHandler extends AbstractHandler {
return !searchFromBrowser;
}
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (isOpenInHelpView()) {
openInHelpView();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java
index eddc30fe5..322cd7e39 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java
@@ -29,7 +29,6 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.IWorkbench;
@@ -56,11 +55,7 @@ public class HelpContentPreferencePage extends PreferencePage implements
public HelpContentPreferencePage() {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
+ @Override
public void init(IWorkbench workbench) {
}
@@ -69,11 +64,7 @@ public class HelpContentPreferencePage extends PreferencePage implements
return table;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
IHelpUIConstants.PREF_PAGE_HELP_CONTENT);
@@ -96,11 +87,7 @@ public class HelpContentPreferencePage extends PreferencePage implements
return parent;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
+ @Override
protected void performDefaults() {
super.performDefaults();
@@ -121,11 +108,7 @@ public class HelpContentPreferencePage extends PreferencePage implements
changeListener.handleEvent(null);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
+ @Override
public boolean performOk() {
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID);
@@ -145,11 +128,7 @@ public class HelpContentPreferencePage extends PreferencePage implements
return super.performOk();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.dialogs.DialogPage#setButtonLayoutData(org.eclipse.swt.widgets.Button)
- */
+ @Override
protected GridData setButtonLayoutData(Button button) {
return super.setButtonLayoutData(button);
}
@@ -220,16 +199,13 @@ public class HelpContentPreferencePage extends PreferencePage implements
* Listens for any change in the UI and checks for valid input and correct
* enablement.
*/
- private Listener changeListener = new Listener() {
- public void handleEvent(Event event) {
-
- boolean isRemoteHelpEnabled = !(searchLocalHelpOnly.getSelection());
-
- // Disable/Enable table
- table.getTable().setEnabled(isRemoteHelpEnabled);
- buttons.setEnabled(isRemoteHelpEnabled);
- }
+ private Listener changeListener = event -> {
+
+ boolean isRemoteHelpEnabled = !(searchLocalHelpOnly.getSelection());
+ // Disable/Enable table
+ table.getTable().setEnabled(isRemoteHelpEnabled);
+ buttons.setEnabled(isRemoteHelpEnabled);
};
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java
index 97bc15249..4248efc9c 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java
@@ -65,6 +65,7 @@ public class HelpPreferencePage extends PreferencePage implements
* @param parent
* the parent for the preference page
*/
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
IHelpUIConstants.PREF_PAGE_HELP);
@@ -215,6 +216,7 @@ public class HelpPreferencePage extends PreferencePage implements
/**
* @see IWorkbenchPreferencePage
*/
+ @Override
public void init(IWorkbench workbench) {
}
@@ -227,6 +229,7 @@ public class HelpPreferencePage extends PreferencePage implements
* call <code>super.performDefaults</code>.
* </p>
*/
+ @Override
protected void performDefaults() {
IEclipsePreferences defaults = DefaultScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID);
if (useExternalCombo != null) {
@@ -256,6 +259,7 @@ public class HelpPreferencePage extends PreferencePage implements
/**
* @see IPreferencePage
*/
+ @Override
public boolean performOk() {
IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID);
if (useExternalCombo != null) {
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java
index f28d41f94..80acb1fc2 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java
@@ -124,6 +124,7 @@ public class IC {
this.enabled = enabled;
}
+ @Override
public String toString()
{
return name+" ("+getHref()+")"; //$NON-NLS-1$ //$NON-NLS-2$
@@ -134,6 +135,7 @@ public class IC {
* during this operation.
*
*/
+ @Override
public boolean equals(Object o)
{
if (!(o instanceof IC))
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java
index 931fbdf15..93389a1f3 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java
@@ -86,6 +86,7 @@ public class ICButtons implements SelectionListener{
return button;
}
+ @Override
public void widgetSelected(SelectionEvent e) {
if (e.getSource() instanceof Button)
{
@@ -107,6 +108,8 @@ public class ICButtons implements SelectionListener{
else if (e.getSource() instanceof Table)
updateButtonStates();
}
+
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
if (e.getSource() instanceof Table)
editIC();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java
index 1d860c711..a873e6f1a 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java
@@ -63,6 +63,7 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene
this.testConnect = testConnect;
}
+ @Override
protected Control createDialogArea(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
"org.eclipse.help.ui.prefPageHelpContent"); //$NON-NLS-1$
@@ -114,6 +115,7 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene
}
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
testButton = this.createButton(
@@ -133,6 +135,7 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene
}
+ @Override
public void initializeBounds() {
Point size = getInitialSize();
Point location = getInitialLocation(size);
@@ -140,6 +143,7 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene
size.x + 180, size.y);
}
+ @Override
public void okPressed() {
try {
String href = formalizeHref(hrefText.getText());
@@ -241,13 +245,18 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene
return ic;
}
+ @Override
public void handleEvent(Event event) {
updateValidity();
}
+
+ @Override
public void widgetSelected(SelectionEvent e) {
if (e.getSource() instanceof Button)
testConnection();
}
+
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java
index 3f2ebecdf..8fa878977 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java
@@ -139,15 +139,18 @@ public class ICTable {
{
private List<IC> content = new ArrayList<>();
+ @Override
public void dispose() {
content = null;
}
+ @Override
@SuppressWarnings("unchecked")
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
content = (List<IC>)newInput;
}
+ @Override
public IC[] getElements(Object inputElement) {
return (IC[])content.toArray(new Object[content.size()]);
}
@@ -156,10 +159,12 @@ public class ICTable {
public class ICLabelProvider extends LabelProvider implements ITableLabelProvider {
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
switch (columnIndex) {
case 0:
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java
index 6e0fcb254..2be3ca33f 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@ import org.eclipse.swt.widgets.Layout;
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);
@@ -43,6 +44,7 @@ public class TabFolderLayout extends Layout {
}
+ @Override
protected void layout (Composite composite, boolean flushCache) {
Rectangle rect= composite.getClientArea();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java
index dfb9b5329..a51572ed0 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,6 +42,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
return parent;
}
+ @Override
public boolean equals(Object arg0) {
if (arg0 instanceof CriterionName) {
CriterionName other = (CriterionName) arg0;
@@ -50,6 +51,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
return false;
}
+ @Override
public int hashCode() {
return id.hashCode();
}
@@ -80,6 +82,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
return parent;
}
+ @Override
public boolean equals(Object arg0) {
if (arg0 instanceof CriterionValue) {
CriterionValue other = (CriterionValue) arg0;
@@ -88,6 +91,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
return false;
}
+ @Override
public int hashCode() {
return id.hashCode() + parent.hashCode();
}
@@ -103,6 +107,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof String[]) {
String[] names = (String[]) parentElement;
@@ -128,6 +133,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
if (element instanceof CriterionName) {
return ((CriterionName) element).getParent();
@@ -140,6 +146,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
@@ -147,6 +154,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
@@ -154,6 +162,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
@@ -161,6 +170,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider {
* @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) {
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java
index 2cdca5e05..82c3e54c4 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,6 +27,7 @@ public class HelpCriteriaLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
return null;
}
@@ -34,6 +35,7 @@ public class HelpCriteriaLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof HelpCriteriaContentProvider.CriterionName) {
CriterionName criterionName = (HelpCriteriaContentProvider.CriterionName)element;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java
index 3f770a1a6..91a746e31 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,10 @@
*******************************************************************************/
package org.eclipse.help.ui.internal.search;
-import org.eclipse.help.internal.workingset.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.help.internal.workingset.AdaptableToc;
+import org.eclipse.help.internal.workingset.AdaptableTopic;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
public class HelpWorkingSetElementLabelProvider extends LabelProvider {
@@ -26,6 +27,7 @@ public class HelpWorkingSetElementLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
return null;
}
@@ -33,6 +35,7 @@ public class HelpWorkingSetElementLabelProvider extends LabelProvider {
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof AdaptableToc)
return ((AdaptableToc) element).getLabel();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java
index 731254075..4cc3f60a9 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,12 @@
*******************************************************************************/
package org.eclipse.help.ui.internal.search;
-import org.eclipse.core.runtime.*;
-import org.eclipse.help.internal.workingset.*;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.help.internal.workingset.AdaptableHelpResource;
+import org.eclipse.help.internal.workingset.AdaptableToc;
+import org.eclipse.help.internal.workingset.AdaptableTocsArray;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
public class HelpWorkingSetTreeContentProvider implements ITreeContentProvider {
@@ -26,6 +29,7 @@ public class HelpWorkingSetTreeContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof AdaptableTocsArray)
return ((AdaptableTocsArray) parentElement).getChildren();
@@ -38,6 +42,7 @@ public class HelpWorkingSetTreeContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
if (element instanceof AdaptableHelpResource)
return ((AdaptableHelpResource) element).getParent();
@@ -47,6 +52,7 @@ public class HelpWorkingSetTreeContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
return (element instanceof AdaptableToc || element instanceof AdaptableTocsArray);
}
@@ -54,6 +60,7 @@ public class HelpWorkingSetTreeContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
@@ -61,6 +68,7 @@ public class HelpWorkingSetTreeContentProvider implements ITreeContentProvider {
/**
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
@@ -68,6 +76,7 @@ public class HelpWorkingSetTreeContentProvider implements ITreeContentProvider {
* @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) {
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java
index fe0f1c907..125d214d2 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java
@@ -23,15 +23,12 @@ import org.eclipse.help.ui.internal.Messages;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.ITreeViewerListener;
import org.eclipse.jface.viewers.TreeExpansionEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
@@ -118,11 +115,7 @@ public class InfoCenterPage extends RootScopePage {
//firstCheck = true;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.RootScopePage#createScopeContents(org.eclipse.swt.widgets.Composite)
- */
+ @Override
protected int createScopeContents(Composite parent) {
Font font = parent.getFont();
initializeDialogUnits(parent);
@@ -140,6 +133,8 @@ public class InfoCenterPage extends RootScopePage {
gd.horizontalSpan = 2;
searchAll.setLayoutData(gd);
searchAll.addSelectionListener(new SelectionAdapter() {
+
+ @Override
public void widgetSelected(SelectionEvent e) {
if (searchAll.getSelection())
tree.getTree().setEnabled(false);
@@ -152,6 +147,8 @@ public class InfoCenterPage extends RootScopePage {
gd.horizontalSpan = 2;
searchSelected.setLayoutData(gd);
searchSelected.addSelectionListener(new SelectionAdapter() {
+
+ @Override
public void widgetSelected(SelectionEvent e) {
if (searchSelected.getSelection()) {
tree.getTree().setEnabled(true);
@@ -188,26 +185,20 @@ public class InfoCenterPage extends RootScopePage {
initializeControls();
- tree.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- handleCheckStateChange(event);
- }
- });
+ tree.addCheckStateListener(event -> handleCheckStateChange(event));
tree.addTreeListener(new ITreeViewerListener() {
+
+ @Override
public void treeCollapsed(TreeExpansionEvent event) {
}
+ @Override
public void treeExpanded(TreeExpansionEvent event) {
final Object element = event.getElement();
if (tree.getGrayed(element) == false)
BusyIndicator.showWhile(getShell().getDisplay(),
- new Runnable() {
- public void run() {
- setSubtreeChecked(element, tree
- .getChecked(element), false);
- }
- });
+ () -> setSubtreeChecked(element, tree.getChecked(element), false));
}
});
@@ -327,11 +318,7 @@ public class InfoCenterPage extends RootScopePage {
//busyLoadTocs(url);
workingSet = new RemoteWorkingSet();
workingSet.load(store);
- urlText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- tocStale=true;
- }
- });
+ urlText.addModifyListener(e -> tocStale = true);
tree.setInput(remoteTocs);
boolean selected = false;
// store.getBoolean(getKey(InfoCenterSearchScopeFactory.P_SEARCH_SELECTED));
@@ -340,16 +327,14 @@ public class InfoCenterPage extends RootScopePage {
tree.getTree().setEnabled(selected);
searchAll.setEnabled(false);
searchSelected.setEnabled(false);
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- Object[] elements = workingSet.getElements();
- tree.setCheckedElements(elements);
- for (int i = 0; i < elements.length; i++) {
- Object element = elements[i];
- if (isExpandable(element))
- setSubtreeChecked(element, true, true);
- updateParentState(element, true);
- }
+ BusyIndicator.showWhile(getShell().getDisplay(), () -> {
+ Object[] elements = workingSet.getElements();
+ tree.setCheckedElements(elements);
+ for (int i = 0; i < elements.length; i++) {
+ Object element = elements[i];
+ if (isExpandable(element))
+ setSubtreeChecked(element, true, true);
+ updateParentState(element, true);
}
});
}
@@ -359,16 +344,14 @@ public class InfoCenterPage extends RootScopePage {
//busyLoadTocs(url);
tocStale=false;
tree.setInput(remoteTocs);
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- Object[] elements = workingSet.getElements();
- tree.setCheckedElements(elements);
- for (int i = 0; i < elements.length; i++) {
- Object element = elements[i];
- if (isExpandable(element))
- setSubtreeChecked(element, true, true);
- updateParentState(element, true);
- }
+ BusyIndicator.showWhile(getShell().getDisplay(), () -> {
+ Object[] elements = workingSet.getElements();
+ tree.setCheckedElements(elements);
+ for (int i = 0; i < elements.length; i++) {
+ Object element = elements[i];
+ if (isExpandable(element))
+ setSubtreeChecked(element, true, true);
+ updateParentState(element, true);
}
});
}
@@ -442,18 +425,16 @@ public class InfoCenterPage extends RootScopePage {
}
void handleCheckStateChange(final CheckStateChangedEvent event) {
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- Object element = event.getElement();
- boolean state = event.getChecked();
- tree.setGrayed(element, false);
- if (isExpandable(element))
- setSubtreeChecked(element, state, state);
- // only check subtree if state is set to true
+ BusyIndicator.showWhile(getShell().getDisplay(), () -> {
+ Object element = event.getElement();
+ boolean state = event.getChecked();
+ tree.setGrayed(element, false);
+ if (isExpandable(element))
+ setSubtreeChecked(element, state, state);
+ // only check subtree if state is set to true
- updateParentState(element, state);
- // validateInput();
- }
+ updateParentState(element, state);
+ // validateInput();
});
}
@@ -463,11 +444,7 @@ public class InfoCenterPage extends RootScopePage {
workingSet.setElements(elements.toArray(new AdaptableHelpResource[elements.size()]));
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
+ @Override
public boolean performOk() {
IPreferenceStore store = getPreferenceStore();
if (getEngineDescriptor().isUserDefined())
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java
index 87d9f1fa7..c0a515158 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java
@@ -28,9 +28,7 @@ public class InfoCenterSearchScopeFactory implements ISearchScopeFactory {
public static final String P_TOCS = "tocs"; //$NON-NLS-1$
public static final String TOC_SEPARATOR = ";"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.eclipse.help.ui.ISearchScopeFactory#createSearchScope(org.eclipse.jface.preference.IPreferenceStore)
- */
+ @Override
public ISearchScope createSearchScope(IPreferenceStore store, String engineId,
Dictionary<String, Object> parameters) {
String url = getProperty(P_URL, store, engineId, parameters);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java
index b217b10c8..0fd09e335 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java
@@ -27,7 +27,6 @@ import org.eclipse.help.ui.internal.search.HelpCriteriaContentProvider.Criterion
import org.eclipse.help.ui.internal.search.HelpCriteriaContentProvider.CriterionValue;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.ITreeViewerListener;
@@ -66,6 +65,7 @@ public class LocalHelpPage extends RootScopePage {
private WorkingSet workingSet;
+ @Override
public void init(IEngineDescriptor ed, String scopeSetName) {
super.init(ed, scopeSetName);
if (scopeSetName != null)
@@ -80,11 +80,7 @@ public class LocalHelpPage extends RootScopePage {
//firstCheck = true;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.RootScopePage#createScopeContents(org.eclipse.swt.widgets.Composite)
- */
+ @Override
protected int createScopeContents(Composite parent) {
Font font = parent.getFont();
initializeDialogUnits(parent);
@@ -95,6 +91,8 @@ public class LocalHelpPage extends RootScopePage {
gd.horizontalSpan = 2;
searchAll.setLayoutData(gd);
searchAll.addSelectionListener(new SelectionAdapter() {
+
+ @Override
public void widgetSelected(SelectionEvent e) {
contentTree.getTree().setEnabled(false);
if (criteriaTree != null) {
@@ -109,6 +107,8 @@ public class LocalHelpPage extends RootScopePage {
gd.horizontalSpan = 2;
searchSelected.setLayoutData(gd);
searchSelected.addSelectionListener(new SelectionAdapter() {
+
+ @Override
public void widgetSelected(SelectionEvent e) {
contentTree.getTree().setEnabled(true);
if (criteriaTree != null) {
@@ -174,26 +174,22 @@ public class LocalHelpPage extends RootScopePage {
contentTree.setInput(BaseHelpSystem.getWorkingSetManager().getRoot());
- contentTree.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- handleCheckStateChange(event, contentTree, contentTreeContentProvider);
- }
- });
+ contentTree.addCheckStateListener(
+ event -> handleCheckStateChange(event, contentTree, contentTreeContentProvider));
contentTree.addTreeListener(new ITreeViewerListener() {
+
+ @Override
public void treeCollapsed(TreeExpansionEvent event) {
}
+ @Override
public void treeExpanded(TreeExpansionEvent event) {
final Object element = event.getElement();
if (contentTree.getGrayed(element) == false)
BusyIndicator.showWhile(getShell().getDisplay(),
- new Runnable() {
- public void run() {
- setSubtreeChecked(element, contentTree
- .getChecked(element), false, contentTree, contentTreeContentProvider);
- }
- });
+ () -> setSubtreeChecked(element, contentTree.getChecked(element), false,
+ contentTree, contentTreeContentProvider));
}
});
contentTree.getTree().setEnabled(workingSet != null);
@@ -227,26 +223,22 @@ public class LocalHelpPage extends RootScopePage {
criteriaTree.setInput(BaseHelpSystem.getWorkingSetManager().getCriterionIds());
- criteriaTree.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- handleCheckStateChange(event, criteriaTree, criteriaTreeContentProvider);
- }
- });
+ criteriaTree.addCheckStateListener(
+ event -> handleCheckStateChange(event, criteriaTree, criteriaTreeContentProvider));
criteriaTree.addTreeListener(new ITreeViewerListener() {
+
+ @Override
public void treeCollapsed(TreeExpansionEvent event) {
}
+ @Override
public void treeExpanded(TreeExpansionEvent event) {
final Object element = event.getElement();
if (criteriaTree.getGrayed(element) == false)
BusyIndicator.showWhile(getShell().getDisplay(),
- new Runnable() {
- public void run() {
- setSubtreeChecked(element, criteriaTree
- .getChecked(element), false, criteriaTree, criteriaTreeContentProvider);
- }
- });
+ () -> setSubtreeChecked(element, criteriaTree.getChecked(element), false,
+ criteriaTree, criteriaTreeContentProvider));
}
});
criteriaTree.getTree().setEnabled(workingSet != null);
@@ -257,12 +249,10 @@ public class LocalHelpPage extends RootScopePage {
if (workingSet == null)
return;
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- initializeContentTree();
- if (HelpPlugin.getCriteriaManager().isCriteriaEnabled()) {
- initializeCriteriaTree();
- }
+ BusyIndicator.showWhile(getShell().getDisplay(), () -> {
+ initializeContentTree();
+ if (HelpPlugin.getCriteriaManager().isCriteriaEnabled()) {
+ initializeCriteriaTree();
}
});
}
@@ -351,18 +341,16 @@ public class LocalHelpPage extends RootScopePage {
void handleCheckStateChange(final CheckStateChangedEvent event,
final CheckboxTreeViewer tree, final ITreeContentProvider contentProvider) {
- BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
- public void run() {
- Object element = event.getElement();
- boolean state = event.getChecked();
- tree.setGrayed(element, false);
- if (isExpandable(element, contentProvider))
- setSubtreeChecked(element, state, state, tree, contentProvider);
- // only check subtree if state is set to true
+ BusyIndicator.showWhile(getShell().getDisplay(), () -> {
+ Object element = event.getElement();
+ boolean state = event.getChecked();
+ tree.setGrayed(element, false);
+ if (isExpandable(element, contentProvider))
+ setSubtreeChecked(element, state, state, tree, contentProvider);
+ // only check subtree if state is set to true
- updateParentState(element, state, tree, contentProvider);
- // validateInput();
- }
+ updateParentState(element, state, tree, contentProvider);
+ // validateInput();
});
}
@@ -390,11 +378,7 @@ public class LocalHelpPage extends RootScopePage {
return workingSet;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
+ @Override
public boolean performOk() {
if (searchSelected.getSelection())
BaseHelpSystem.getWorkingSetManager()
@@ -443,6 +427,7 @@ public class LocalHelpPage extends RootScopePage {
}
}
+ @Override
protected void performDefaults() {
searchAll.setSelection(true);
searchSelected.setSelection(false);
@@ -453,6 +438,7 @@ public class LocalHelpPage extends RootScopePage {
super.performDefaults();
}
+ @Override
protected Label createDescriptionLabel(Composite parent) {
if ( getContainer() == null ) {
return null;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java
index cb504bf7e..da7acdfb2 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java
@@ -26,9 +26,7 @@ public class LocalSearchScopeFactory implements ISearchScopeFactory {
public final static String P_WORKING_SET = "workingSet"; //$NON-NLS-1$
public final static String P_CAPABILITY_FILTERING = "capabilityFiltering"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.eclipse.help.ui.ISearchScopeFactory#createSearchScope(org.eclipse.jface.preference.IPreferenceStore)
- */
+ @Override
public ISearchScope createSearchScope(IPreferenceStore store, String engineId,
Dictionary<String, Object> parameters) {
String name = store.getString(engineId+"."+P_WORKING_SET); //$NON-NLS-1$
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java
index d368e4cba..0cfda2656 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,8 +15,6 @@ import org.eclipse.help.ui.RootScopePage;
import org.eclipse.help.ui.internal.Messages;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -34,6 +32,7 @@ public class WebSearchPage extends RootScopePage {
public WebSearchPage() {
}
+ @Override
protected int createScopeContents(Composite parent) {
//Font font = parent.getFont();
initializeDialogUnits(parent);
@@ -48,11 +47,7 @@ public class WebSearchPage extends RootScopePage {
gd.heightHint = 64;
gd.widthHint = 200;
urlText.setLayoutData(gd);
- urlText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validate();
- }
- });
+ urlText.addModifyListener(e -> validate());
urlText.setEditable(getEngineDescriptor().isUserDefined());
new Label(parent, SWT.NULL);
label = new Label(parent, SWT.WRAP);
@@ -65,9 +60,7 @@ public class WebSearchPage extends RootScopePage {
return 2;
}
- /* (non-Javadoc)
- * @see org.eclipse.help.ui.RootScopePage#initializeDefaults(org.eclipse.jface.preference.IPreferenceStore)
- */
+ @Override
protected void initializeDefaults(IPreferenceStore store) {
super.initializeDefaults(store);
String template = (String) getEngineDescriptor().getParameters().get(
@@ -78,9 +71,7 @@ public class WebSearchPage extends RootScopePage {
template);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
+ @Override
protected void performDefaults() {
getPreferenceStore().setToDefault(
getStoreKey(WebSearchScopeFactory.P_URL));
@@ -100,11 +91,7 @@ public class WebSearchPage extends RootScopePage {
setValid(text.length() > 0);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
+ @Override
public boolean performOk() {
String urlTemplate = urlText.getText();
getPreferenceStore().setValue(getStoreKey(WebSearchScopeFactory.P_URL),
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java
index fdb29f904..b2929c82a 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java
@@ -23,9 +23,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
public class WebSearchScopeFactory implements ISearchScopeFactory {
public final static String P_URL = "url"; //$NON-NLS-1$
- /* (non-Javadoc)
- * @see org.eclipse.help.ui.ISearchScopeFactory#createSearchScope(org.eclipse.jface.preference.IPreferenceStore)
- */
+ @Override
public ISearchScope createSearchScope(IPreferenceStore store, String engineId,
Dictionary<String, Object> parameters) {
String urlTemplate = getProperty(store, engineId, parameters);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java
index 7266b8a80..3edae8bec 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.help.ui.internal.util;
-import org.eclipse.jface.resource.*;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
/**
* An OverlayIcon consists of a main icon and several adornments.
@@ -65,6 +67,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);
@@ -109,6 +112,7 @@ public abstract class AbstractOverlayIcon extends CompositeImageDescriptor {
}
}
+ @Override
protected Point getSize() {
return fSize;
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java
index 81b5c2b15..e2a279c78 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,18 +23,15 @@ import org.eclipse.ui.PlatformUI;
*/
public class ErrorUtil implements IErrorUtil {
+ @Override
public void displayError(String msg) {
displayErrorDialog(msg);
}
+ @Override
public void displayError(final String msg, Thread uiThread) {
try {
- Display.findDisplay(uiThread).asyncExec(new Runnable() {
-
- public void run() {
- displayErrorDialog(msg);
- }
- });
+ Display.findDisplay(uiThread).asyncExec(() -> displayErrorDialog(msg));
} catch (Exception e2) {
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java
index bb8047c15..9ba4cc6f2 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,8 @@
package org.eclipse.help.ui.internal.util;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
/**
* An OverlayIcon consists of a main icon and several adornments.
@@ -31,6 +32,7 @@ public class OverlayIcon extends AbstractOverlayIcon {
fBase = ImageDescriptor.getMissingImageDescriptor();
}
+ @Override
protected ImageData getBaseImageData() {
return fBase.getImageData();
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java
index 299de303d..d0679e459 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java
@@ -41,6 +41,8 @@ public class AllTopicsPart extends HyperlinkTreePart {
//private Action showAllAction;
class TopicsProvider implements ITreeContentProvider {
+
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement == AllTopicsPart.this)
return HelpSystem.getTocs();
@@ -51,11 +53,7 @@ public class AllTopicsPart extends HyperlinkTreePart {
return new Object[0];
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
+ @Override
public Object getParent(Object element) {
if (element instanceof IToc) {
return AllTopicsPart.this;
@@ -66,49 +64,35 @@ public class AllTopicsPart extends HyperlinkTreePart {
return null;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
+ @Override
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
- /*
- * (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) {
}
}
class TopicsLabelProvider extends LabelProvider {
+
+ @Override
public String getText(Object obj) {
if (obj instanceof IHelpResource)
return ((IHelpResource) obj).getLabel();
return super.getText(obj);
}
+ @Override
public Image getImage(Object obj) {
boolean expanded = treeViewer.getExpandedState(obj);
boolean expandable = treeViewer.isExpandable(obj);
@@ -148,6 +132,8 @@ public class AllTopicsPart extends HyperlinkTreePart {
}
class EmptyContainerFilter extends ViewerFilter {
+
+ @Override
public boolean select(Viewer viewer, Object parentElement,
Object element) {
if (element instanceof IToc) {
@@ -188,21 +174,26 @@ public class AllTopicsPart extends HyperlinkTreePart {
super(parent, toolkit, tbm);
}
+ @Override
protected void configureTreeViewer() {
initializeImages();
treeViewer.setContentProvider(new TopicsProvider());
treeViewer.setLabelProvider(new TopicsLabelProvider());
treeViewer.addTreeListener(new ITreeViewerListener() {
+
+ @Override
public void treeCollapsed(TreeExpansionEvent event) {
postUpdate(event.getElement());
}
+ @Override
public void treeExpanded(TreeExpansionEvent event) {
postUpdate(event.getElement());
}
});
}
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
super.init(parent, id, memento);
if (parent.isFilteredByRoles())
@@ -221,11 +212,13 @@ public class AllTopicsPart extends HyperlinkTreePart {
containerWithTopicImage = desc.createImage();
}
+ @Override
public void dispose() {
containerWithTopicImage.dispose();
super.dispose();
}
+ @Override
protected void doOpen(Object obj) {
if (!(obj instanceof IHelpResource))
return;
@@ -241,6 +234,7 @@ public class AllTopicsPart extends HyperlinkTreePart {
parent.showURL(res.getHref());
}
+ @Override
protected String getHref(IHelpResource res) {
return (res instanceof ITopic) ? res.getHref() : null;
}
@@ -263,10 +257,12 @@ public class AllTopicsPart extends HyperlinkTreePart {
treeViewer.getControl().setFocus();
}
+ @Override
protected boolean canAddBookmarks() {
return true;
}
+ @Override
public void toggleRoleFilter() {
if (parent.isFilteredByRoles())
treeViewer.addFilter(parent.getRoleFilter());
@@ -274,6 +270,7 @@ public class AllTopicsPart extends HyperlinkTreePart {
treeViewer.removeFilter(parent.getRoleFilter());
}
+ @Override
public void saveState(IMemento memento) {
}
} \ No newline at end of file
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java
index ac1201611..0ad25df0f 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,45 +41,56 @@ public class BookmarkHeaderPart extends AbstractFormPart implements IHelpPart {
inner.setLayoutData(data);
}
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.id = id;
}
+ @Override
public void saveState(IMemento memento) {
}
+ @Override
public Control getControl() {
return container;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public void setVisible(boolean visible) {
container.setVisible(visible);
}
+ @Override
public boolean hasFocusControl(Control control) {
return false;
}
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return false;
}
+ @Override
public IAction getGlobalAction(String id) {
return null;
}
+ @Override
public void stop() {
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java
index aac248c78..f465af0d6 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java
@@ -41,6 +41,8 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
private Action deleteAction;
class BookmarksProvider implements ITreeContentProvider {
+
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement == BookmarksPart.this)
return new Object[] { BaseHelpSystem.getBookmarkManager() };
@@ -49,52 +51,33 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
return new Object[0];
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
+ @Override
public Object getParent(Object element) {
return null;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
+ @Override
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
- /*
- * (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) {
}
}
class BookmarksLabelProvider extends LabelProvider {
+
+ @Override
public String getText(Object obj) {
if (obj instanceof BookmarkManager)
return Messages.BookmarksPart_savedTopics;
@@ -103,6 +86,7 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
return super.getText(obj);
}
+ @Override
public Image getImage(Object obj) {
if (obj instanceof BookmarkManager)
return HelpUIResources
@@ -125,16 +109,20 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
BaseHelpSystem.getBookmarkManager().addObserver(this);
}
+ @Override
public void dispose() {
BaseHelpSystem.getBookmarkManager().deleteObserver(this);
super.dispose();
}
+ @Override
protected void configureTreeViewer() {
treeViewer.setContentProvider(new BookmarksProvider());
treeViewer.setLabelProvider(new BookmarksLabelProvider());
treeViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
deleteAction = new Action("") { //$NON-NLS-1$
+
+ @Override
public void run() {
Object obj = ((IStructuredSelection)treeViewer.getSelection()).getFirstElement();
if (obj instanceof BookmarkManager.Bookmark) {
@@ -147,12 +135,14 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
deleteAction.setEnabled(false);
}
+ @Override
protected void handleSelectionChanged(IStructuredSelection sel) {
Object obj = sel.getFirstElement();
deleteAction.setEnabled(obj!=null && obj instanceof BookmarkManager.Bookmark);
super.handleSelectionChanged(sel);
}
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
boolean value = super.fillContextMenu(manager);
ISelection selection = treeViewer.getSelection();
@@ -168,12 +158,11 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
}
if (canDeleteAll) {
Action action = new Action("") { //$NON-NLS-1$
+
+ @Override
public void run() {
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
- BaseHelpSystem.getBookmarkManager().removeAllBookmarks();
- }
- });
+ BusyIndicator.showWhile(getControl().getDisplay(),
+ () -> BaseHelpSystem.getBookmarkManager().removeAllBookmarks());
}
};
action.setText(Messages.BookmarksPart_deleteAll);
@@ -190,6 +179,7 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
return obj instanceof BookmarkManager.Bookmark;
}
+ @Override
protected void doOpen(Object obj) {
if (obj instanceof BookmarkManager) {
treeViewer.setExpandedState(obj, !treeViewer.getExpandedState(obj));
@@ -200,12 +190,9 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
}
}
+ @Override
public void update(final Observable o, final Object arg) {
- treeViewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- asyncUpdate(o, arg);
- }
- });
+ treeViewer.getControl().getDisplay().asyncExec(() -> asyncUpdate(o, arg));
}
private void asyncUpdate(Observable o, Object arg) {
@@ -224,22 +211,28 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer {
break;
}
}
+
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.DELETE.getId()))
return deleteAction;
return super.getGlobalAction(id);
}
+ @Override
protected boolean canAddBookmarks() {
return false;
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
+ @Override
public void saveState(IMemento memento) {
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java
index f1690bd10..f4a81fd5c 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,12 +38,8 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.LocationEvent;
import org.eclipse.swt.browser.LocationListener;
-import org.eclipse.swt.browser.OpenWindowListener;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
-import org.eclipse.swt.browser.StatusTextEvent;
-import org.eclipse.swt.browser.StatusTextListener;
-import org.eclipse.swt.browser.WindowEvent;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -99,6 +95,8 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
final IToolBarManager tbm, IMenuManager menuManager) {
browser = new Browser(parent, SWT.NULL);
browser.addLocationListener(new LocationListener() {
+
+ @Override
public void changing(LocationEvent event) {
if (redirectLink(event.location))
event.doit = false;
@@ -112,6 +110,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public void changed(LocationEvent event) {
String url = event.location;
boolean isResult = url.indexOf("resultof")!=-1; //$NON-NLS-1$
@@ -122,6 +121,8 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
}
});
browser.addProgressListener(new ProgressListener() {
+
+ @Override
public void changed(ProgressEvent e) {
if (e.current == e.total)
return;
@@ -144,6 +145,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
lastProgress = e.current;
}
+ @Override
public void completed(ProgressEvent e) {
IStatusLineManager slm = BrowserPart.this.parent
.getStatusLineManager();
@@ -161,32 +163,25 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
BrowserPart.this.title = value != null ? value : "N/A"; //$NON-NLS-1$
}
});
- browser.addStatusTextListener(new StatusTextListener() {
- public void changed(StatusTextEvent event) {
- if (processQuery(event.text))
- return;
- IStatusLineManager statusLine = BrowserPart.this.parent
- .getStatusLineManager();
- if (statusLine != null)
- statusLine.setMessage(event.text);
- if (event.text.indexOf("://") != -1) //$NON-NLS-1$
- statusURL = event.text;
- }
+ browser.addStatusTextListener(event -> {
+ if (processQuery(event.text))
+ return;
+ IStatusLineManager statusLine = BrowserPart.this.parent.getStatusLineManager();
+ if (statusLine != null)
+ statusLine.setMessage(event.text);
+ if (event.text.indexOf("://") != -1) //$NON-NLS-1$
+ statusURL = event.text;
});
- browser.addOpenWindowListener(new OpenWindowListener() {
- public void open(WindowEvent event) {
- if (statusURL != null) {
- try {
- String relativeURL = BaseHelpSystem.unresolve(new URL(
- statusURL));
- if (BrowserPart.this.parent.isHelpResource(relativeURL)) {
- BrowserPart.this.parent
- .showExternalURL(relativeURL);
- event.required = true;
- }
- } catch (MalformedURLException e) {
- HelpUIPlugin.logError("Malformed URL: " + statusURL, e); //$NON-NLS-1$
+ browser.addOpenWindowListener(event -> {
+ if (statusURL != null) {
+ try {
+ String relativeURL = BaseHelpSystem.unresolve(new URL(statusURL));
+ if (BrowserPart.this.parent.isHelpResource(relativeURL)) {
+ BrowserPart.this.parent.showExternalURL(relativeURL);
+ event.required = true;
}
+ } catch (MalformedURLException e) {
+ HelpUIPlugin.logError("Malformed URL: " + statusURL, e); //$NON-NLS-1$
}
}
});
@@ -209,15 +204,14 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
private void contributeToToolBar(IToolBarManager tbm) {
boolean highlight = Platform.getPreferencesService().getBoolean(HelpBasePlugin.PLUGIN_ID, HIGHLIGHT_ON, true, null);
showExternalAction = new Action() {
+
+ @Override
public void run() {
- BusyIndicator.showWhile(browser.getDisplay(), new Runnable() {
- public void run() {
- try {
- parent.showExternalURL(BaseHelpSystem
- .unresolve(new URL(url)));
- } catch (MalformedURLException e) {
- HelpUIPlugin.logError("Malformed URL: " + statusURL, e); //$NON-NLS-1$
- }
+ BusyIndicator.showWhile(browser.getDisplay(), () -> {
+ try {
+ parent.showExternalURL(BaseHelpSystem.unresolve(new URL(url)));
+ } catch (MalformedURLException e) {
+ HelpUIPlugin.logError("Malformed URL: " + statusURL, e); //$NON-NLS-1$
}
});
}
@@ -227,6 +221,8 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
showExternalAction.setImageDescriptor(HelpUIResources
.getImageDescriptor(IHelpUIConstants.IMAGE_NW));
syncTocAction = new Action() {
+
+ @Override
public void run() {
doSyncToc();
}
@@ -236,6 +232,8 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
.getImageDescriptor(IHelpUIConstants.IMAGE_SYNC_TOC));
syncTocAction.setEnabled(false);
bookmarkAction = new Action() {
+
+ @Override
public void run() {
String href = LinkUtil.stripParams(BaseHelpSystem.unresolve(url));
BaseHelpSystem.getBookmarkManager().addBookmark(href, title);
@@ -246,6 +244,8 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
.getImageDescriptor(IHelpUIConstants.IMAGE_ADD_BOOKMARK));
highlightAction = new Action() {
+
+ @Override
public void run() {
IScopeContext instanceScope = InstanceScope.INSTANCE;
IEclipsePreferences prefs = instanceScope.getNode(HelpBasePlugin.PLUGIN_ID);
@@ -259,6 +259,8 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
.getImageDescriptor(IHelpUIConstants.IMAGE_HIGHLIGHT));
printAction = new Action(ActionFactory.PRINT.getId()) {
+
+ @Override
public void run() {
doPrint();
}
@@ -289,6 +291,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
private void addMenuActions(IMenuManager menuManager) {
magnifyAction = new Action() {
+ @Override
public void run() {
doMagnify(SCALE_INCREMENT);
}
@@ -302,6 +305,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
reduceAction = new Action() {
+ @Override
public void run() {
doMagnify(-SCALE_INCREMENT);
}
@@ -317,11 +321,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
menuManager.add(magnifyAction);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#init(org.eclipse.help.ui.internal.views.NewReusableHelpPart)
- */
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
@@ -332,35 +332,24 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public String getId() {
return id;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#getControl()
- */
+ @Override
public Control getControl() {
return browser;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#setVisible(boolean)
- */
+ @Override
public void setVisible(boolean visible) {
if (browser != null) {
browser.setVisible(visible);
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.forms.IFormPart#setFocus()
- */
+ @Override
public void setFocus() {
if (browser != null)
browser.setFocus();
@@ -378,6 +367,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public void stop() {
if (browser != null && !browser.isDisposed()) {
browser.stop();
@@ -450,25 +440,17 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
BaseHelpSystem.runLiveHelp(pluginId, className, arg);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
-
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#hasFocusControl(org.eclipse.swt.widgets.Control)
- */
+ @Override
public boolean hasFocusControl(Control control) {
return browser.equals(control);
}
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.PRINT.getId()))
return printAction;
@@ -499,13 +481,16 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart {
enableButtons();
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
showURL(this.url);
}
+ @Override
public void saveState(IMemento memento) {
if (url != null) {
String href = BaseHelpSystem.unresolve(url);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java
index e36390416..d99f9450e 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,6 +41,7 @@ public final class Chevron extends ToggleHyperlink {
/*
* @see SelectableControl#paint(GC)
*/
+ @Override
protected void paintHyperlink(GC gc) {
if (hover && getHoverDecorationColor() != null)
gc.setForeground(getHoverDecorationColor());
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java
index 2c7d472ce..e37a24540 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java
@@ -114,6 +114,8 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
Composite container = toolkit.createComposite(section);
section.setClient(container);
section.addExpansionListener(new ExpansionAdapter() {
+
+ @Override
public void expansionStateChanged(ExpansionEvent e) {
if (e.getState()) {
updateText(savedDescription);
@@ -141,6 +143,8 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
text.setImage(searchKey, HelpUIResources.getImage(searchKey));
text.addHyperlinkListener(new IHyperlinkListener() {
+
+ @Override
public void linkActivated(HyperlinkEvent e) {
String href = (String) e.getHref();
if (href.startsWith(MORE_HREF)) {
@@ -150,17 +154,21 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
}
}
+ @Override
public void linkEntered(HyperlinkEvent e) {
ContextHelpPart.this.parent.handleLinkEntered(e);
}
+ @Override
public void linkExited(HyperlinkEvent e) {
ContextHelpPart.this.parent.handleLinkExited(e);
}
});
text.setText(defaultText, false, false);
text.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
+
+ @Override
+ public void getName(AccessibleEvent e) {
if (e.childID == ACC.CHILDID_SELF) {
String currentName = e.result;
e.result = Messages.ReusableHelpPart_contextHelpPage_name
@@ -194,6 +202,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
return new Font(display, tfontData);
}
+ @Override
public void dispose() {
if (codeFont!=null)
codeFont.dispose();
@@ -201,35 +210,24 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
super.dispose();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#getControl()
- */
+ @Override
public Control getControl() {
return getSection();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#init(org.eclipse.help.ui.internal.views.NewReusableHelpPart)
- */
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
parent.hookFormText(text);
}
+ @Override
public String getId() {
return id;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#setVisible(boolean)
- */
+ @Override
public void setVisible(boolean visible) {
getSection().setVisible(visible);
}
@@ -702,6 +700,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
return decodedString;
}
+ @Override
public boolean setFormInput(Object input) {
if (input instanceof ContextHelpProviderInput) {
ContextHelpProviderInput chinput = (ContextHelpProviderInput) input;
@@ -712,44 +711,42 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
return false;
}
+ @Override
public void setFocus() {
if (text != null)
text.setFocus();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return parent.fillFormContextMenu(text, manager);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#hasFocusControl(org.eclipse.swt.widgets.Control)
- */
+ @Override
public boolean hasFocusControl(Control control) {
return text.equals(control);
}
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.COPY.getId()))
return parent.getCopyAction();
return null;
}
+ @Override
public void stop() {
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
+ @Override
public void saveState(IMemento memento) {
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java
index 3032bdec3..daea69229 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java
@@ -27,6 +27,7 @@ public class ContextHelpSorter extends ViewerComparator {
this.context = context;
}
+ @Override
public void sort(Viewer viewer, Object[] elements) {
for (int i = 0; i < elements.length; i++) {
IHelpResource r1 = (IHelpResource) elements[i];
@@ -38,9 +39,7 @@ public class ContextHelpSorter extends ViewerComparator {
super.sort(viewer, elements);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (!(e2 instanceof IHelpResource)) {
return -1;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java
index a173858fb..742ee940f 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java
@@ -18,8 +18,8 @@ import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.help.IContext;
import org.eclipse.help.IHelpResource;
import org.eclipse.help.internal.base.BaseHelpSystem;
@@ -42,9 +42,9 @@ import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IExpansionListener;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -71,27 +71,14 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
private JobListener jobListener;
public static final int SHORT_COUNT = 8;
- class JobListener implements IJobChangeListener {
- public void aboutToRun(IJobChangeEvent event) {
- }
-
- public void awake(IJobChangeEvent event) {
- }
+ class JobListener extends JobChangeAdapter {
+ @Override
public void done(IJobChangeEvent event) {
if (event.getJob() == runningJob) {
runningJob = null;
}
}
-
- public void running(IJobChangeEvent event) {
- }
-
- public void scheduled(IJobChangeEvent event) {
- }
-
- public void sleeping(IJobChangeEvent event) {
- }
}
/**
@@ -106,9 +93,9 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
Section section = getSection();
section.setText(Messages.SearchPart_title);
section.marginWidth = 5;
- section.addExpansionListener(new IExpansionListener() {
- public void expansionStateChanging(ExpansionEvent e) {
- }
+ section.addExpansionListener(new ExpansionAdapter() {
+
+ @Override
public void expansionStateChanged(ExpansionEvent e) {
if (e.getState()) {
refilter();
@@ -143,6 +130,8 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
searchResults.setImage(nwKey, HelpUIResources.getImage(nwKey));
searchResults.setImage(searchKey, HelpUIResources.getImage(searchKey));
searchResults.addHyperlinkListener(new IHyperlinkListener() {
+
+ @Override
public void linkActivated(HyperlinkEvent e) {
Object href = e.getHref();
if (href.equals(CANCEL_HREF)) {
@@ -156,9 +145,13 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
} else
doOpenLink(e.getHref());
}
+
+ @Override
public void linkEntered(HyperlinkEvent e) {
DynamicHelpPart.this.parent.handleLinkEntered(e);
}
+
+ @Override
public void linkExited(HyperlinkEvent e) {
DynamicHelpPart.this.parent.handleLinkExited(e);
}
@@ -168,17 +161,20 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
Job.getJobManager().addJobChangeListener(jobListener);
}
+ @Override
public void dispose() {
Job.getJobManager().removeJobChangeListener(jobListener);
stop();
super.dispose();
}
+ @Override
public void setFocus() {
if (searchResults!=null)
searchResults.setFocus();
}
+ @Override
public void stop () {
if (runningJob!=null) {
runningJob.cancel();
@@ -186,35 +182,24 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#getControl()
- */
+ @Override
public Control getControl() {
return getSection();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#init(org.eclipse.help.ui.internal.views.NewReusableHelpPart)
- */
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
parent.hookFormText(searchResults);
}
+ @Override
public String getId() {
return id;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#setVisible(boolean)
- */
+ @Override
public void setVisible(boolean visible) {
getSection().setVisible(visible);
}
@@ -240,6 +225,8 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
private void startInPlaceSearch(final String phrase,
final IContext excludeContext) {
Job job = new Job(Messages.SearchPart_dynamicJob) {
+
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
try {
@@ -266,6 +253,8 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
searchQuery.setSearchWord(phrase);
SearchResults localResults = new SearchResults(null,
DynamicHelpPart.SHORT_COUNT * 2, Platform.getNL()) {
+
+ @Override
public void addHits(List<SearchHit> hits, String highlightTerms) {
// don't highlight any terms for dynamic help part
super.addHits(hits, ""); //$NON-NLS-1$
@@ -305,11 +294,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
final SearchHit[] hits) {
if (getSection().isDisposed())
return;
- getSection().getDisplay().asyncExec(new Runnable() {
- public void run() {
- doUpdateResults(phrase, excludeContext, buffer, hits);
- }
- });
+ getSection().getDisplay().asyncExec(() -> doUpdateResults(phrase, excludeContext, buffer, hits));
}
private void doUpdateResults(String phrase, IContext excludeContext, StringBuffer buff, SearchHit[] hits) {
@@ -399,39 +384,35 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart {
parent.showURL(url);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return parent.fillFormContextMenu(searchResults, manager);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#hasFocusControl(org.eclipse.swt.widgets.Control)
- */
+ @Override
public boolean hasFocusControl(Control control) {
return searchResults.equals(control);
}
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.COPY.getId()))
return parent.getCopyAction();
return null;
}
+ @Override
public void toggleRoleFilter() {
refilter();
}
+ @Override
public void refilter() {
if (phrase!=null && phrase.length() > 0)
startInPlaceSearch(phrase, context);
}
+ @Override
public void saveState(IMemento memento) {
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java
index a2f0a95e9..f81f3093d 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java
@@ -74,6 +74,7 @@ public class EngineDescriptor implements IEngineDescriptor {
return config;
}
+ @Override
public String getLabel() {
if (label != null)
return label;
@@ -85,12 +86,14 @@ public class EngineDescriptor implements IEngineDescriptor {
return clabel;
}
+ @Override
public String getId() {
if (id != null)
return id;
return config.getAttribute(IHelpUIConstants.ATT_ID);
}
+ @Override
public String getEngineTypeId() {
if (etdesc != null)
return etdesc.getId();
@@ -110,6 +113,7 @@ public class EngineDescriptor implements IEngineDescriptor {
return etdesc.getIconImage();
}
+ @Override
public String getDescription() {
if (desc != null)
return desc;
@@ -142,6 +146,7 @@ public class EngineDescriptor implements IEngineDescriptor {
return page;
}
+ @Override
public Dictionary<String, Object> getParameters() {
if (parameters != null)
return parameters;
@@ -175,6 +180,7 @@ public class EngineDescriptor implements IEngineDescriptor {
this.id = id;
}
+ @Override
public void setLabel(String label) {
if (isUserDefined()) {
this.label = label;
@@ -183,6 +189,7 @@ public class EngineDescriptor implements IEngineDescriptor {
}
}
+ @Override
public void setDescription(String desc) {
if (isUserDefined()) {
this.desc = desc;
@@ -191,6 +198,7 @@ public class EngineDescriptor implements IEngineDescriptor {
}
}
+ @Override
public boolean isUserDefined() {
return userDefined;
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java
index 6a6f91204..d6e163120 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineResultSection.java
@@ -43,10 +43,10 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IExpansionListener;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -124,15 +124,13 @@ public class EngineResultSection {
searchResults.setColor("summary", parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); //$NON-NLS-1$
section.setClient(container);
updateSectionTitle(0);
- section.addExpansionListener(new IExpansionListener() {
+ section.addExpansionListener(new ExpansionAdapter() {
+ @Override
public void expansionStateChanging(ExpansionEvent e) {
if (needsUpdating)
asyncUpdateResults(true, false);
}
-
- public void expansionStateChanged(ExpansionEvent e) {
- }
});
return section;
}
@@ -157,6 +155,7 @@ public class EngineResultSection {
searchResults.setImage(KEY_PREFIX_GRAYED + desc.getId(), getGrayedImage(desc.getIconImage()));
searchResults.addHyperlinkListener(new IHyperlinkListener() {
+ @Override
public void linkActivated(HyperlinkEvent e) {
Object href = e.getHref();
String shref = (String) href;
@@ -170,10 +169,12 @@ public class EngineResultSection {
part.doOpenLink(e.getHref());
}
+ @Override
public void linkEntered(HyperlinkEvent e) {
part.parent.handleLinkEntered(e);
}
+ @Override
public void linkExited(HyperlinkEvent e) {
part.parent.handleLinkExited(e);
}
@@ -258,22 +259,14 @@ public class EngineResultSection {
}
private void asyncUpdateResults(boolean now, final boolean scrollToBeginning) {
- Runnable runnable = new Runnable() {
-
- public void run() {
- BusyIndicator.showWhile(section.getDisplay(), new Runnable() {
-
- public void run() {
- updateResults(true);
- if (scrollToBeginning) {
- searchResults.setFocus();
- FormToolkit.setControlVisible(section, true);
- part.updateSeparatorVisibility();
- }
- }
- });
+ Runnable runnable = () -> BusyIndicator.showWhile(section.getDisplay(), () -> {
+ updateResults(true);
+ if (scrollToBeginning) {
+ searchResults.setFocus();
+ FormToolkit.setControlVisible(section, true);
+ part.updateSeparatorVisibility();
}
- };
+ });
if (section.isDisposed())
return;
if (now)
@@ -519,6 +512,7 @@ public class EngineResultSection {
ISharedImages.IMG_TOOL_BACK));
prevLink.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
public void linkActivated(HyperlinkEvent e) {
resultOffset -= HITS_PER_PAGE;
asyncUpdateResults(false, true);
@@ -533,6 +527,7 @@ public class EngineResultSection {
nextLink.setLayoutData(gd);
nextLink.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
public void linkActivated(HyperlinkEvent e) {
resultOffset += HITS_PER_PAGE;
asyncUpdateResults(false, true);
@@ -584,12 +579,8 @@ public class EngineResultSection {
private void doBookmark(final String label, String href) {
final String fhref = href.substring(4);
- BusyIndicator.showWhile(container.getDisplay(), new Runnable() {
-
- public void run() {
- BaseHelpSystem.getBookmarkManager().addBookmark(fhref, label);
- }
- });
+ BusyIndicator.showWhile(container.getDisplay(),
+ () -> BaseHelpSystem.getBookmarkManager().addBookmark(fhref, label));
}
public void dispose() {
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java
index 86b607ea9..d00d819b7 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,13 +11,20 @@
package org.eclipse.help.ui.internal.views;
import org.eclipse.help.ui.internal.Messages;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.PlatformUI;
public class EngineTypeWizardPage extends WizardPage {
@@ -27,29 +34,40 @@ public class EngineTypeWizardPage extends WizardPage {
class EngineContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(Object inputElement) {
return engineTypes;
}
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
}
class EngineLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ @Override
public String getText(Object obj) {
EngineTypeDescriptor desc = (EngineTypeDescriptor)obj;
return desc.getLabel();
}
+
+ @Override
public Image getImage(Object obj) {
EngineTypeDescriptor desc = (EngineTypeDescriptor)obj;
return desc.getIconImage();
}
+
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return getImage(element);
}
+
+ @Override
public String getColumnText(Object element, int columnIndex) {
return getText(element);
}
@@ -62,6 +80,7 @@ public class EngineTypeWizardPage extends WizardPage {
this.engineTypes = engineTypes;
}
+ @Override
public void createControl(Composite parent) {
Font font = parent.getFont();
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
@@ -75,11 +94,10 @@ public class EngineTypeWizardPage extends WizardPage {
tableViewer = new TableViewer(container);
tableViewer.setContentProvider(new EngineContentProvider());
tableViewer.setLabelProvider(new EngineLabelProvider());
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- setPageComplete(!event.getSelection().isEmpty());
- selection = (EngineTypeDescriptor)((IStructuredSelection)event.getSelection()).getFirstElement();
- }
+ tableViewer.addSelectionChangedListener(event -> {
+ setPageComplete(!event.getSelection().isEmpty());
+ selection = (EngineTypeDescriptor) ((IStructuredSelection) event.getSelection())
+ .getFirstElement();
});
tableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
tableViewer.setInput(engineTypes);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java
index 06a0a8191..4af3f2569 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,7 +20,8 @@ public class FederatedSearchSorter extends ViewerComparator {
super(ReusableHelpPart.SHARED_COLLATOR);
}
- public int category(Object element) {
+ @Override
+ public int category(Object element) {
if (element instanceof ISearchEngineResult) {
ISearchEngineResult r = (ISearchEngineResult)element;
IHelpResource c = r.getCategory();
@@ -35,9 +36,7 @@ public class FederatedSearchSorter extends ViewerComparator {
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
int cat1 = category(e1);
int cat2 = category(e2);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java
index e5c68c690..290f18635 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,17 +70,17 @@ public class HelpTray extends DialogTray implements IPageChangedListener {
private void createActions() {
createImages();
closeAction = new ContributionItem() {
+
+ @Override
public void fill(ToolBar parent, int index) {
final ToolItem item = new ToolItem(parent, SWT.PUSH);
item.setImage(normal);
item.setHotImage(hover);
item.setToolTipText(Messages.ReusableHelpPart_closeAction_tooltip);
- item.addListener(SWT.Selection, new Listener() {
- public void handleEvent(Event event) {
- // close the tray
- TrayDialog dialog = (TrayDialog)shell.getData();
- dialog.closeTray();
- }
+ item.addListener(SWT.Selection, event -> {
+ // close the tray
+ TrayDialog dialog = (TrayDialog) shell.getData();
+ dialog.closeTray();
});
}
};
@@ -91,6 +91,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener {
*
* @param parent the parent composite that will contain the tray
*/
+ @Override
protected Control createContents(Composite parent) {
// if the dialog is too short, make it taller
ensureMinimumHeight(parent.getShell());
@@ -103,11 +104,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener {
layout.marginWidth = layout.marginHeight = 0;
layout.verticalSpacing = 0;
container.setLayout(layout);
- container.addListener(SWT.Dispose, new Listener() {
- public void handleEvent(Event event) {
- dispose();
- }
- });
+ container.addListener(SWT.Dispose, event -> dispose());
ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
tbm.createControl(container);
@@ -131,11 +128,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener {
shell = parent.getShell();
hookPageChangeListener(shell);
- helpPart.getControl().addListener(SWT.Dispose, new Listener() {
- public void handleEvent(Event event) {
- unhookPageChangeListener(shell);
- }
- });
+ helpPart.getControl().addListener(SWT.Dispose, event -> unhookPageChangeListener(shell));
return container;
}
@@ -199,6 +192,8 @@ public class HelpTray extends DialogTray implements IPageChangedListener {
* that will return the dialog height back to original.
*/
shell.addListener(SWT.Resize, new Listener() {
+
+ @Override
public void handleEvent(Event event) {
shell.removeListener(SWT.Resize, this);
Point p = shell.getSize();
@@ -274,6 +269,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener {
*
* @param event the page change event
*/
+ @Override
public void pageChanged(PageChangedEvent event) {
Object page = event.getSelectedPage();
Control c = null;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java
index 59fa80901..24870ac52 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java
@@ -61,11 +61,7 @@ public class HelpView extends ViewPart implements IPartListener2,
public HelpView() {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
- */
+ @Override
public void createPartControl(Composite parent) {
toolkit = new FormToolkit(parent.getDisplay());
toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(
@@ -88,6 +84,7 @@ public class HelpView extends ViewPart implements IPartListener2,
handlePartActivation(aref);
}
+ @Override
public void dispose() {
IWorkbenchWindow window = getSite().getPage().getWorkbenchWindow();
IPartService service = window.getPartService();
@@ -107,6 +104,7 @@ public class HelpView extends ViewPart implements IPartListener2,
super.dispose();
}
+ @Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
if (memento!=null)
this.firstPageId = memento.getString("pageId"); //$NON-NLS-1$
@@ -121,7 +119,8 @@ public class HelpView extends ViewPart implements IPartListener2,
service.addPartListener(this);
}
- public void saveState(IMemento memento) {
+ @Override
+ public void saveState(IMemento memento) {
if (reusableHelpPart!=null && memento!=null) {
String pageId = reusableHelpPart.getCurrentPageId();
if (pageId!=null)
@@ -227,11 +226,7 @@ public class HelpView extends ViewPart implements IPartListener2,
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partActivated(final IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
visible = true;
@@ -245,11 +240,7 @@ public class HelpView extends ViewPart implements IPartListener2,
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partBroughtToTop(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
visible = true;
@@ -258,29 +249,17 @@ public class HelpView extends ViewPart implements IPartListener2,
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partClosed(IWorkbenchPartReference partRef) {
handlePartDeactivation(partRef);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partDeactivated(IWorkbenchPartReference partRef) {
handlePartDeactivation(partRef);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partHidden(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
visible = false;
@@ -288,19 +267,11 @@ public class HelpView extends ViewPart implements IPartListener2,
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partInputChanged(IWorkbenchPartReference partRef) {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partOpened(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
visible = true;
@@ -309,11 +280,7 @@ public class HelpView extends ViewPart implements IPartListener2,
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
- */
+ @Override
public void partVisible(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
visible = true;
@@ -337,19 +304,11 @@ public class HelpView extends ViewPart implements IPartListener2,
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
if (!visible)
return;
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- updateActivePart();
- }
- });
+ getSite().getShell().getDisplay().asyncExec(() -> updateActivePart());
}
/*
@@ -396,6 +355,7 @@ public class HelpView extends ViewPart implements IPartListener2,
return ReusableHelpPart.getDefaultStyle();
}
+ @Override
public void setFocus() {
if (reusableHelpPart != null)
reusableHelpPart.setFocus();
@@ -421,6 +381,7 @@ public class HelpView extends ViewPart implements IPartListener2,
reusableHelpPart.showDynamicHelp(part, c);
}
+ @Override
public void pageChanged(PageChangedEvent event) {
if (!visible)
return;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java
index da353da5f..ba5fde352 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@ public class HistoryScopeSet extends ScopeSet {
setExpression(set.getExpression());
}
+ @Override
public void copyFrom(ScopeSet set) {
String expression = getExpression();
super.copyFrom(set);
@@ -42,14 +43,17 @@ public class HistoryScopeSet extends ScopeSet {
return store.getString(KEY_EXPRESSION);
}
+ @Override
public boolean isImplicit() {
return true;
}
+ @Override
protected String getExtension() {
return EXT;
}
+ @Override
protected String encodeFileName(String name) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < name.length(); i++) {
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java
index a424d89e5..a302fd916 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,22 +13,42 @@ package org.eclipse.help.ui.internal.views;
import java.util.Observable;
import java.util.Observer;
-import org.eclipse.help.*;
+import org.eclipse.help.IHelpResource;
+import org.eclipse.help.IIndexEntry;
+import org.eclipse.help.IIndexSee;
+import org.eclipse.help.IToc;
+import org.eclipse.help.ITopic;
import org.eclipse.help.base.AbstractHelpScope;
import org.eclipse.help.internal.base.scope.ScopeUtils;
import org.eclipse.help.internal.base.scope.WorkingSetScope;
import org.eclipse.help.internal.search.federated.LocalHelpScope;
import org.eclipse.help.internal.workingset.WorkingSet;
import org.eclipse.help.search.ISearchScope;
-import org.eclipse.help.ui.internal.*;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
+import org.eclipse.help.ui.internal.HelpUIResources;
+import org.eclipse.help.ui.internal.IHelpUIConstants;
+import org.eclipse.help.ui.internal.Messages;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.forms.AbstractFormPart;
@@ -40,6 +60,7 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
public class ScopeObserver implements Observer {
+ @Override
public void update(Observable o, Object arg) {
if (o instanceof ScopeSetManager) {
refilter();
@@ -55,6 +76,7 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
AbstractHelpScope scope;
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof IToc) {
return ScopeUtils.showInTree((IToc)element, scope);
@@ -116,20 +138,13 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
configureTreeViewer();
treeViewer.setInput(this);
treeViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
- treeViewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
- doOpenSelection((IStructuredSelection) event.getSelection());
- }
- });
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleSelectionChanged((IStructuredSelection) event
- .getSelection());
- }
- });
+ treeViewer.addOpenListener(event -> doOpenSelection((IStructuredSelection) event.getSelection()));
+ treeViewer.addSelectionChangedListener(
+ event -> handleSelectionChanged((IStructuredSelection) event.getSelection()));
treeViewer.getTree().addMouseListener(new MouseAdapter() {
long lastTime;
+ @Override
public void mouseUp(MouseEvent e) {
long eventTime = e.time & 0xFFFFFFFFL;
if (eventTime - lastTime <= e.display.getDoubleClickTime())
@@ -148,35 +163,32 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
}
});
- treeViewer.getTree().addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
- validateLastItem();
- if (lastItem == null)
- return;
- Rectangle bounds = lastItem.getBounds();
- boolean selected = false;
- TreeItem[] items = lastItem.getParent().getSelection();
- for (int i = 0; i < items.length; i++) {
- if (items[i].equals(lastItem)) {
- selected = true;
- break;
- }
+ treeViewer.getTree().addPaintListener(e -> {
+ validateLastItem();
+ if (lastItem == null)
+ return;
+ Rectangle bounds = lastItem.getBounds();
+ boolean selected = false;
+ TreeItem[] items = lastItem.getParent().getSelection();
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].equals(lastItem)) {
+ selected = true;
+ break;
}
- if (selected)
- e.gc.setForeground(e.display.getSystemColor(
- SWT.COLOR_LIST_SELECTION_TEXT));
- else
- e.gc.setForeground(toolkit.getHyperlinkGroup()
- .getActiveForeground());
- FontMetrics fm = e.gc.getFontMetrics();
- int height = fm.getHeight();
- int lineY = bounds.y + height;
- e.gc.drawLine(bounds.x, lineY, bounds.x + bounds.width - 1,
- lineY);
}
+ if (selected)
+ e.gc.setForeground(e.display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
+ else
+ e.gc.setForeground(toolkit.getHyperlinkGroup().getActiveForeground());
+ FontMetrics fm = e.gc.getFontMetrics();
+ int height = fm.getHeight();
+ int lineY = bounds.y + height;
+ e.gc.drawLine(bounds.x, lineY, bounds.x + bounds.width - 1, lineY);
});
treeViewer.getTree().addMouseTrackListener(new MouseTrackAdapter() {
+
+ @Override
public void mouseExit(MouseEvent e) {
validateLastItem();
if (lastItem != null) {
@@ -187,52 +199,48 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
}
});
- treeViewer.getTree().addMouseMoveListener(new MouseMoveListener() {
- public void mouseMove(MouseEvent e) {
- Point p = new Point(e.x, e.y);
- TreeItem item = treeViewer.getTree().getItem(p);
- validateLastItem();
- if (item != null) {
- if (lastItem != null) {
- if (!lastItem.equals(item)) {
- lastItem.setForeground(null);
- repaintItem(lastItem);
- updateStatus(null);
- lastItem = null;
- } else
- return;
- }
- Object obj = item.getData();
- treeViewer.getTree().setCursor(handCursor);
- IStructuredSelection ssel = (IStructuredSelection) treeViewer
- .getSelection();
- if (ssel.getFirstElement() == obj)
- item.setForeground(e.display
- .getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
- else
- item.setForeground(toolkit.getHyperlinkGroup()
- .getActiveForeground());
- lastItem = item;
- repaintItem(lastItem);
- if (obj instanceof IHelpResource)
- updateStatus((IHelpResource) obj);
- else
+ treeViewer.getTree().addMouseMoveListener(e -> {
+ Point p = new Point(e.x, e.y);
+ TreeItem item = treeViewer.getTree().getItem(p);
+ validateLastItem();
+ if (item != null) {
+ if (lastItem != null) {
+ if (!lastItem.equals(item)) {
+ lastItem.setForeground(null);
+ repaintItem(lastItem);
updateStatus(null);
- return;
- } else if (lastItem != null) {
- lastItem.setForeground(null);
- repaintItem(lastItem);
- lastItem = null;
- updateStatus(null);
+ lastItem = null;
+ } else
+ return;
}
- treeViewer.getTree().setCursor(null);
+ Object obj = item.getData();
+ treeViewer.getTree().setCursor(handCursor);
+ IStructuredSelection ssel = (IStructuredSelection) treeViewer.getSelection();
+ if (ssel.getFirstElement() == obj)
+ item.setForeground(e.display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
+ else
+ item.setForeground(toolkit.getHyperlinkGroup().getActiveForeground());
+ lastItem = item;
+ repaintItem(lastItem);
+ if (obj instanceof IHelpResource)
+ updateStatus((IHelpResource) obj);
+ else
+ updateStatus(null);
+ return;
+ } else if (lastItem != null) {
+ lastItem.setForeground(null);
+ repaintItem(lastItem);
+ lastItem = null;
+ updateStatus(null);
}
+ treeViewer.getTree().setCursor(null);
});
contributeToToolBar(tbm);
scopeObserver = new ScopeObserver();
ScopeState.getInstance().getScopeSetManager().addObserver(scopeObserver);
}
+ @Override
public void dispose() {
handCursor.dispose();
if (scopeObserver != null) {
@@ -249,12 +257,10 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
protected void contributeToToolBar(IToolBarManager tbm) {
Action collapseAllAction = new Action() {
+
+ @Override
public void run() {
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
- doCollapseAll();
- }
- });
+ BusyIndicator.showWhile(getControl().getDisplay(), () -> doCollapseAll());
}
};
collapseAllAction.setImageDescriptor(HelpUIResources
@@ -271,35 +277,24 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
treeViewer.update(expanded, null);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#getControl()
- */
+ @Override
public Control getControl() {
return treeViewer.getControl();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#init(org.eclipse.help.ui.internal.views.NewReusableHelpPart)
- */
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
refilter();
}
+ @Override
public String getId() {
return id;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#setVisible(boolean)
- */
+ @Override
public void setVisible(boolean visible) {
getControl().setVisible(visible);
if (visible)
@@ -363,18 +358,10 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
protected abstract void doOpen(Object obj);
protected void postUpdate(final Object obj) {
- treeViewer.getControl().getDisplay().asyncExec(new Runnable() {
- public void run() {
- treeViewer.update(obj, null);
- }
- });
+ treeViewer.getControl().getDisplay().asyncExec(() -> treeViewer.update(obj, null));
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return parent.fillSelectionProviderMenu(treeViewer, manager,
canAddBookmarks());
@@ -382,26 +369,25 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
protected abstract boolean canAddBookmarks();
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#hasFocus()
- */
+ @Override
public boolean hasFocusControl(Control focusControl) {
return treeViewer.getControl().equals(focusControl);
}
+ @Override
public void setFocus() {
if (treeViewer != null)
treeViewer.getTree().setFocus();
}
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.COPY.getId()))
return parent.getCopyAction();
return null;
}
+ @Override
public void stop() {
}
@@ -410,6 +396,7 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements
lastItem = null;
}
+ @Override
public void refilter() {
ScopeSetManager manager = ScopeState.getInstance().getScopeSetManager();
ScopeSet set = manager.getActiveSet();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IgnoreMissingPlaceholderHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IgnoreMissingPlaceholderHandler.java
index e243632c9..bc49e0eaa 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IgnoreMissingPlaceholderHandler.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IgnoreMissingPlaceholderHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.help.internal.base.MissingContentManager;
public class IgnoreMissingPlaceholderHandler extends AbstractHandler {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
MissingContentManager.getInstance().ignoreAllMissingPlaceholders();
return null;
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java
index 8e3e63624..bf6fd0506 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java
@@ -42,6 +42,8 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants {
private RoleFilter roleFilter;
class IndexProvider implements ITreeContentProvider {
+
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement == IndexPart.this) {
return HelpSystem.getIndex().getEntries();
@@ -52,23 +54,31 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants {
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) {
return getChildren(inputElement);
}
+ @Override
public void dispose() {}
+
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
class IndexLabelProvider extends LabelProvider {
+
+ @Override
public String getText(Object obj) {
if (obj instanceof IIndexEntry)
return ((IIndexEntry) obj).getKeyword();
@@ -81,6 +91,7 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants {
return super.getText(obj);
}
+ @Override
public Image getImage(Object obj) {
return super.getImage(obj);
}
@@ -97,6 +108,8 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants {
}
class RoleFilter extends ViewerFilter {
+
+ @Override
public boolean select(Viewer viewer, Object parentElement,
Object element) {
if (element instanceof IIndexEntry) {
@@ -146,17 +159,20 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants {
roleFilter = new RoleFilter();
}
+ @Override
protected void configureTreeViewer() {
treeViewer.setContentProvider(new IndexProvider());
treeViewer.setLabelProvider(new IndexLabelProvider());
}
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
super.init(parent, id, memento);
if (parent.isFilteredByRoles())
treeViewer.addFilter(roleFilter);
}
+ @Override
protected void doOpen(Object obj) {
if (obj instanceof IHelpResource) {
parent.showURL(((IHelpResource) obj).getHref());
@@ -179,13 +195,16 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants {
}
}
+ @Override
protected boolean canAddBookmarks() {
return true;
}
+ @Override
public void saveState(IMemento memento) {
}
+ @Override
public void toggleRoleFilter() {
if (parent.isFilteredByRoles())
treeViewer.addFilter(roleFilter);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java
index c676e7cef..1ac4d8f25 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Intel Corporation and others.
+ * Copyright (c) 2006, 2016 Intel Corporation and others.
* All rights reserved. This program and 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,8 +19,6 @@ import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
@@ -75,17 +73,20 @@ public class IndexTypeinPart extends AbstractFormPart implements IHelpPart, IHel
indexButton = toolkit.createButton(container, Messages.IndexButton, SWT.PUSH);
indexButton.setEnabled(false);
- indexText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- indexButton.setEnabled(indexText.getText().length() > 0);//!!!
- doNavigate(indexText.getText());
- }});
+ indexText.addModifyListener(e -> {
+ indexButton.setEnabled(indexText.getText().length() > 0);// !!!
+ doNavigate(indexText.getText());
+ });
indexText.addKeyListener(new KeyListener() {
+
+ @Override
public void keyReleased(KeyEvent e) {
if (e.character == '\r' && indexButton.isEnabled()) {
doOpen();
}
}
+
+ @Override
public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.ARROW_UP) {
e.doit = false;
@@ -96,6 +97,8 @@ public class IndexTypeinPart extends AbstractFormPart implements IHelpPart, IHel
}
}});
indexButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
public void widgetSelected(SelectionEvent e) {
doOpen();
}});
@@ -226,47 +229,59 @@ public class IndexTypeinPart extends AbstractFormPart implements IHelpPart, IHel
}
}
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
}
+ @Override
public void saveState(IMemento memento) {
}
+ @Override
public Control getControl() {
return container;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public void setVisible(boolean visible) {
getControl().setVisible(visible);
}
+ @Override
public boolean hasFocusControl(Control control) {
return false;
}
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return false;
}
+ @Override
public IAction getGlobalAction(String id) {
return null;
}
+ @Override
public void stop() {
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
+ @Override
public void setFocus() {
indexText.setFocus();
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java
index 1cb925394..e72881e21 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 IBM Corporation and others.
+ * Copyright (c) 2010, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,10 +37,12 @@ public class LocalScopeDialog extends TrayDialog {
this.scopeSet = set;
}
+ @Override
protected boolean isResizable() {
return true;
}
+ @Override
protected Control createDialogArea(Composite parent) {
EngineDescriptor localSearchDesc = null;
for (int i = 0; localSearchDesc == null && i < descManager.getDescriptors().length; i++) {
@@ -61,6 +63,7 @@ public class LocalScopeDialog extends TrayDialog {
return helpPageControl;
}
+ @Override
protected void okPressed() {
localHelpPage.performOk();
super.okPressed();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java
index de0cc5a16..74537dcb7 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -88,6 +88,8 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart {
statusLink.setText(linkText);
statusLink.setImage(warningImage);
statusLink.addHyperlinkListener(new HyperlinkAdapter() {
+
+ @Override
public void linkActivated(HyperlinkEvent e) {
helpPart.showURL(target);
if ( isRemote ) {
@@ -112,52 +114,64 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart {
}
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.id = id;
this.helpPart = parent;
}
+ @Override
public void saveState(IMemento memento) {
}
+ @Override
public Control getControl() {
return container;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public void setVisible(boolean visible) {
if (container != null) {
container.setVisible(visible);
}
}
+ @Override
public boolean hasFocusControl(Control control) {
return false;
}
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return false;
}
+ @Override
public IAction getGlobalAction(String id) {
return null;
}
+ @Override
public void stop() {
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
+ @Override
public void dispose() {
disposeLink();
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java
index eb9b0419c..c6b5a675a 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,11 +27,13 @@ public class NewEngineWizard extends Wizard {
this.engineTypes = engineTypes;
}
+ @Override
public void addPages() {
selectionPage = new EngineTypeWizardPage(engineTypes);
addPage(selectionPage);
}
+ @Override
public boolean performFinish() {
return true;
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java
index fe8b089d9..3cab7b791 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,6 +50,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
class RelatedLayout extends Layout implements ILayoutExtension {
+ @Override
protected Point computeSize(Composite composite, int wHint, int hHint,
boolean flushCache) {
Point topSize = contextHelpPart.getControl().computeSize(wHint,
@@ -64,6 +65,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
return size;
}
+ @Override
protected void layout(Composite composite, boolean flushCache) {
Rectangle carea = composite.getClientArea();
Point topSize = contextHelpPart.getControl().computeSize(
@@ -79,6 +81,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public int computeMinimumWidth(Composite parent, boolean changed) {
int top = computeMinimumWidth(contextHelpPart, parent, changed);
int bot = dynamicHelpPart == null ? 0 : computeMinimumWidth(dynamicHelpPart, parent, changed);
@@ -90,6 +93,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
return le.computeMinimumWidth(parent, changed);
}
+ @Override
public int computeMaximumWidth(Composite parent, boolean changed) {
return computeSize(parent, SWT.DEFAULT, SWT.DEFAULT, changed).x;
}
@@ -98,6 +102,8 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
public RelatedTopicsPart(Composite parent, FormToolkit toolkit) {
ScrolledForm form = toolkit.createScrolledForm(parent);
mform = new ManagedForm(toolkit, form) {
+
+ @Override
public void reflow(boolean changed) {
super.reflow(changed);
RelatedTopicsPart.this.parent.reflow();
@@ -110,6 +116,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
@@ -122,6 +129,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
mform.initialize();
}
+ @Override
public void dispose() {
mform.dispose();
}
@@ -135,23 +143,28 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
contextHelpPart.setDefaultText(defaultText);
}
+ @Override
public Control getControl() {
return mform.getForm();
}
+ @Override
public String getId() {
return id;
}
+ @Override
public void setVisible(boolean visible) {
mform.getForm().setVisible(visible);
}
+ @Override
public boolean hasFocusControl(Control control) {
return contextHelpPart.hasFocusControl(control)
|| (dynamicHelpPart != null && dynamicHelpPart.hasFocusControl(control));
}
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
Control focusControl = mform.getForm().getDisplay().getFocusControl();
if (contextHelpPart.hasFocusControl(focusControl) || dynamicHelpPart == null)
@@ -159,10 +172,12 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
return dynamicHelpPart.fillContextMenu(manager);
}
+ @Override
public IAction getGlobalAction(String id) {
return contextHelpPart.getGlobalAction(id);
}
+ @Override
public void stop() {
contextHelpPart.stop();
if (dynamicHelpPart != null) {
@@ -170,6 +185,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public void toggleRoleFilter() {
contextHelpPart.toggleRoleFilter();
if (dynamicHelpPart != null) {
@@ -177,12 +193,15 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public void refilter() {
contextHelpPart.refilter();
if (dynamicHelpPart != null) {
dynamicHelpPart.refilter();
}
}
+
+ @Override
public boolean setFormInput(Object input) {
return mform.setInput(input);
}
@@ -192,9 +211,11 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart {
}
}
+ @Override
public void saveState(IMemento memento) {
}
+ @Override
public void setFocus() {
if (contextHelpPart!=null)
contextHelpPart.setFocus();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java
index 8148c3f12..764f5d7e1 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java
@@ -12,13 +12,20 @@ package org.eclipse.help.ui.internal.views;
import java.util.ArrayList;
-import org.eclipse.core.runtime.*;
-import org.eclipse.help.ui.internal.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.help.ui.internal.HelpUIPlugin;
+import org.eclipse.help.ui.internal.Messages;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.SelectionStatusDialog;
public class RenameDialog extends SelectionStatusDialog {
@@ -76,6 +83,7 @@ public class RenameDialog extends SelectionStatusDialog {
this.newName = oldName;
}
+ @Override
protected Control createDialogArea(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
@@ -90,11 +98,7 @@ public class RenameDialog extends SelectionStatusDialog {
label.setText(Messages.RenameDialog_label);
text = new Text(container, SWT.SINGLE|SWT.BORDER);
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- textChanged(text.getText(), true);
- }
- });
+ text.addModifyListener(e -> textChanged(text.getText(), true));
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = 200;
text.setLayoutData(gd);
@@ -102,6 +106,7 @@ public class RenameDialog extends SelectionStatusDialog {
return container;
}
+ @Override
public int open() {
text.setText(oldName);
text.selectAll();
@@ -159,21 +164,18 @@ public class RenameDialog extends SelectionStatusDialog {
return newName;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
+ @Override
protected void okPressed() {
newName = text.getText();
super.okPressed();
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.dialogs.SelectionStatusDialog#computeResult()
- */
+ @Override
protected void computeResult() {
}
- public void setTitle(String title) {
+ @Override
+ public void setTitle(String title) {
getShell().setText(title);
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java
index 4a0f5df9d..4649ffd1a 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java
@@ -76,9 +76,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IActionBars;
@@ -190,12 +188,9 @@ public class ReusableHelpPart implements IHelpUIConstants,
super(name);
}
+ @Override
public void run() {
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
- busyRun();
- }
- });
+ BusyIndicator.showWhile(getControl().getDisplay(), () -> busyRun());
}
protected abstract void busyRun();
@@ -235,12 +230,14 @@ public class ReusableHelpPart implements IHelpUIConstants,
setTarget(null);
}
+ @Override
public void focusGained(FocusEvent e) {
FormText text = (FormText) e.widget;
text.addSelectionListener(this);
setTarget(text);
}
+ @Override
public void focusLost(FocusEvent e) {
FormText text = (FormText) e.widget;
text.removeSelectionListener(this);
@@ -256,11 +253,13 @@ public class ReusableHelpPart implements IHelpUIConstants,
setEnabled(target != null && target.canCopy());
}
+ @Override
public void run() {
if (target != null)
target.copy();
}
+ @Override
public void widgetSelected(SelectionEvent e) {
FormText text = (FormText) e.widget;
if (text == target) {
@@ -268,6 +267,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}
}
@@ -338,6 +338,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
this.iconId = iconId;
}
+ @Override
public void dispose() {
if (bars != null) {
bars.dispose();
@@ -357,42 +358,52 @@ public class ReusableHelpPart implements IHelpUIConstants,
partRecs = null;
}
+ @Override
public void setVerticalSpacing(int value) {
this.vspacing = value;
}
+ @Override
public int getVerticalSpacing() {
return vspacing;
}
+ @Override
public void setHorizontalMargin(int value) {
this.horizontalMargin = value;
}
+ @Override
public int getHorizontalMargin() {
return horizontalMargin;
}
+ @Override
public IToolBarManager getToolBarManager() {
return subToolBarManager;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public String getText() {
return text;
}
+ @Override
public String getIconId() {
return iconId;
}
+ @Override
public void addPart(String id, boolean flexible) {
addPart(id, flexible, false);
}
+ @Override
public void addPart(String id, boolean flexible, boolean grabVertical) {
partRecs.add(new PartRec(id, flexible, grabVertical));
if (flexible)
@@ -414,10 +425,12 @@ public class ReusableHelpPart implements IHelpUIConstants,
parts[p].part.refresh();
}
+ @Override
public int getNumberOfFlexibleParts() {
return nflexible;
}
+ @Override
public boolean canOpen() {
for (int i = 0; i < partRecs.size(); i++) {
PartRec rec = partRecs.get(i);
@@ -439,6 +452,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
return true;
}
+ @Override
public void stop() {
for (int i = 0; i < partRecs.size(); i++) {
PartRec rec = partRecs.get(i);
@@ -447,6 +461,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
}
+ @Override
public void saveState(IMemento memento) {
for (int i = 0; i < partRecs.size(); i++) {
PartRec rec = partRecs.get(i);
@@ -455,6 +470,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
}
+ @Override
public void toggleRoleFilter() {
for (int i = 0; i < partRecs.size(); i++) {
PartRec rec = partRecs.get(i);
@@ -463,6 +479,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
}
+ @Override
public void refilter() {
for (int i = 0; i < partRecs.size(); i++) {
PartRec rec = partRecs.get(i);
@@ -471,6 +488,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
}
+ @Override
public void setVisible(boolean visible) {
if (bars != null)
bars.clearGlobalActionHandlers();
@@ -536,6 +554,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
}
+ @Override
public IHelpPart findPart(String id) {
for (int i = 0; i < partRecs.size(); i++) {
PartRec rec = partRecs.get(i);
@@ -545,6 +564,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
return null;
}
+ @Override
public void setFocus() {
// Focus on the first part that is not the see also links or missing content link
for (int focusPart = 0; focusPart < partRecs.size(); focusPart++) {
@@ -560,14 +580,18 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
class HelpPartLayout extends Layout implements ILayoutExtension {
+
+ @Override
public int computeMaximumWidth(Composite parent, boolean changed) {
return computeSize(parent, SWT.DEFAULT, SWT.DEFAULT, changed).x;
}
+ @Override
public int computeMinimumWidth(Composite parent, boolean changed) {
return computeSize(parent, 0, SWT.DEFAULT, changed).x;
}
+ @Override
protected Point computeSize(Composite composite, int wHint, int hHint,
boolean flushCache) {
if (currentPage == null)
@@ -593,6 +617,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
return result;
}
+ @Override
protected void layout(Composite composite, boolean flushCache) {
if (currentPage == null)
return;
@@ -657,6 +682,8 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
class RoleFilter extends ViewerFilter {
+
+ @Override
public boolean select(Viewer viewer, Object parentElement,
Object element) {
IHelpResource res = (IHelpResource) element;
@@ -668,6 +695,8 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
class UAFilter extends ViewerFilter {
+
+ @Override
public boolean select(Viewer viewer, Object parentElement,
Object element) {
return !UAContentFilter.isFiltered(element, HelpEvaluationContext.getContext());
@@ -820,6 +849,8 @@ public class ReusableHelpPart implements IHelpUIConstants,
private void makeActions() {
backAction = new Action("back") { //$NON-NLS-1$
+
+ @Override
public void run() {
doBack();
}
@@ -836,6 +867,8 @@ public class ReusableHelpPart implements IHelpUIConstants,
backAction.setId("back"); //$NON-NLS-1$
nextAction = new Action("next") { //$NON-NLS-1$
+
+ @Override
public void run() {
doNext();
}
@@ -854,6 +887,8 @@ public class ReusableHelpPart implements IHelpUIConstants,
toolBarManager.add(nextAction);
openInfoCenterAction = new BusyRunAction("openInfoCenter") { //$NON-NLS-1$
+
+ @Override
protected void busyRun() {
PlatformUI.getWorkbench().getHelpSystem().displayHelp();
}
@@ -861,12 +896,16 @@ public class ReusableHelpPart implements IHelpUIConstants,
openInfoCenterAction
.setText(Messages.ReusableHelpPart_openInfoCenterAction_label);
openAction = new OpenHrefAction("open") { //$NON-NLS-1$
+
+ @Override
protected void busyRun() {
doOpen(getTarget(), getShowDocumentsInPlace());
}
};
openAction.setText(Messages.ReusableHelpPart_openAction_label);
openInHelpAction = new OpenHrefAction("") {//$NON-NLS-1$
+
+ @Override
protected void busyRun() {
doOpenInHelp(getTarget());
}
@@ -876,6 +915,8 @@ public class ReusableHelpPart implements IHelpUIConstants,
copyAction = new CopyAction();
copyAction.setText(Messages.ReusableHelpPart_copyAction_label);
bookmarkAction = new OpenHrefAction("bookmark") { //$NON-NLS-1$
+
+ @Override
protected void busyRun() {
doBookmark(getTarget());
}
@@ -890,13 +931,11 @@ public class ReusableHelpPart implements IHelpUIConstants,
uaFilter = new UAFilter();
if (HelpBasePlugin.getActivitySupport().isUserCanToggleFiltering()) {
showAllAction = new Action() {
+
+ @Override
public void run() {
BusyIndicator.showWhile(getControl().getDisplay(),
- new Runnable() {
- public void run() {
- toggleShowAll(showAllAction.isChecked());
- }
- });
+ () -> toggleShowAll(showAllAction.isChecked()));
}
};
showAllAction.setImageDescriptor(HelpUIResources
@@ -918,6 +957,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
return uaFilter;
}
+ @Override
public void activityManagerChanged(ActivityManagerEvent activityManagerEvent) {
// pages is null when the activity manager listener is added, and is set to null
// prior to the activity manager listener being removed, so very short timeframes in
@@ -970,20 +1010,12 @@ public class ReusableHelpPart implements IHelpUIConstants,
mform.getForm().setDelayedReflow(false);
toolkit.decorateFormHeading(mform.getForm().getForm());
MenuManager manager = new MenuManager();
- IMenuListener listener = new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- contextMenuAboutToShow(manager);
- }
- };
+ IMenuListener listener = manager1 -> contextMenuAboutToShow(manager1);
manager.setRemoveAllWhenShown(true);
manager.addMenuListener(listener);
Menu contextMenu = manager.createContextMenu(form.getForm());
form.getForm().setMenu(contextMenu);
- form.addListener(SWT.Activate, new Listener() {
- public void handleEvent(Event event) {
- lastActiveInstance = ReusableHelpPart.this;
- }
- });
+ form.addListener(SWT.Activate, event -> lastActiveInstance = ReusableHelpPart.this);
//contributeToDropDownMenu(mform.getForm().getForm().getMenuManager());
}
@@ -1231,11 +1263,7 @@ public class ReusableHelpPart implements IHelpUIConstants,
}
public void showURL(final String url) {
- BusyIndicator.showWhile(getControl().getDisplay(), new Runnable() {
- public void run() {
- showURL(url, getShowDocumentsInPlace());
- }
- });
+ BusyIndicator.showWhile(getControl().getDisplay(), () -> showURL(url, getShowDocumentsInPlace()));
}
public void showURL(String url, boolean replace) {
@@ -1361,13 +1389,11 @@ public class ReusableHelpPart implements IHelpUIConstants,
if (page == null)
return;
Action action = new Action(pageId, IAction.AS_CHECK_BOX) {
+
+ @Override
public void run() {
BusyIndicator.showWhile(mform.getForm().getDisplay(),
- new Runnable() {
- public void run() {
- showPage(pageId);
- }
- });
+ () -> showPage(pageId));
}
};
action.setText(page.getText());
@@ -1489,10 +1515,13 @@ public class ReusableHelpPart implements IHelpUIConstants,
final String href = topics[0].getHref();
final String label = entry.getKeyword();
return new IHelpResource() {
+
+ @Override
public String getHref() {
return href;
}
+ @Override
public String getLabel() {
return label;
}
@@ -1510,10 +1539,13 @@ public class ReusableHelpPart implements IHelpUIConstants,
final String label = text.getSelectedLinkText();
if (href != null) {
return new IHelpResource() {
+
+ @Override
public String getHref() {
return href;
}
+ @Override
public String getLabel() {
return label;
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java
index e98a5f230..a2e5699d6 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java
@@ -17,9 +17,7 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.wizard.WizardDialog;
@@ -59,6 +57,7 @@ public class ScopePreferenceDialog extends PreferenceDialog {
this.descManager = descManager;
}
+ @Override
protected Control createTreeAreaContents(Composite parent) {
GridLayout layout = new GridLayout();
layout.marginWidth = layout.marginHeight = 0;
@@ -84,18 +83,18 @@ public class ScopePreferenceDialog extends PreferenceDialog {
return container;
}
+ @Override
protected TreeViewer createTreeViewer(Composite parent) {
TreeViewer viewer = super.createTreeViewer(parent);
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection ssel = (IStructuredSelection)event.getSelection();
- Object obj = ssel.getFirstElement();
- treeSelectionChanged(obj);
- }
+ viewer.addSelectionChangedListener(event -> {
+ IStructuredSelection ssel = (IStructuredSelection) event.getSelection();
+ Object obj = ssel.getFirstElement();
+ treeSelectionChanged(obj);
});
return viewer;
}
+ @Override
protected void buttonPressed(int buttonId) {
switch (buttonId) {
case NEW_ID:
@@ -154,6 +153,8 @@ public class ScopePreferenceDialog extends PreferenceDialog {
pendingOperations = new ArrayList<>();
pendingOperations.add(new PendingOperation(action, desc));
}
+
+ @Override
protected void okPressed() {
super.okPressed();
if (pendingOperations!=null) {
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java
index 867c3da29..32c437cd4 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,14 @@
*******************************************************************************/
package org.eclipse.help.ui.internal.views;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.help.ui.internal.HelpUIPlugin;
import org.eclipse.help.ui.internal.IHelpUIConstants;
-import org.eclipse.jface.preference.*;
+import org.eclipse.jface.preference.IPreferenceNode;
+import org.eclipse.jface.preference.IPreferencePage;
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.preference.PreferenceNode;
public class ScopePreferenceManager extends PreferenceManager implements IHelpUIConstants {
private ScopeSet set;
@@ -25,7 +29,9 @@ public class ScopePreferenceManager extends PreferenceManager implements IHelpUI
super(id, label, null, null);
this.config = config;
}
- public void createPage() {
+
+ @Override
+ public void createPage() {
try {
Object obj = config.createExecutableExtension(IHelpUIConstants.ATT_CLASS);
IPreferencePage page = (IPreferencePage)obj;
@@ -47,7 +53,9 @@ public class ScopePreferenceManager extends PreferenceManager implements IHelpUI
public EngineDescriptor getDescriptor() {
return desc;
}
- public void createPage() {
+
+ @Override
+ public void createPage() {
IPreferencePage page = desc.createRootPage(set.getName());
setPage(page);
page.setTitle(desc.getLabel());
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java
index 9580b38fd..123a04f72 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart {
public class ScopeObserver implements Observer {
+ @Override
public void update(Observable o, Object arg) {
String name = ScopeState.getInstance().getScopeSetManager().getActiveSet().getName();
setScopeLink(name);
@@ -58,6 +59,8 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart {
scopeSetLink = toolkit.createFormText(container, false);
setScopeLink(name);
scopeSetLink.addHyperlinkListener(new HyperlinkAdapter() {
+
+ @Override
public void linkActivated(HyperlinkEvent e) {
doChangeScopeSet();
}
@@ -114,50 +117,62 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart {
scopeSetLink.setText(buff.toString(), true, false);
}
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.id = id;
ScopeState.getInstance().setEngineManager(parent.getEngineManager());
}
+ @Override
public void saveState(IMemento memento) {
}
+ @Override
public Control getControl() {
return container;
}
+ @Override
public String getId() {
return id;
}
+ @Override
public void setVisible(boolean visible) {
container.setVisible(visible);
}
+ @Override
public boolean hasFocusControl(Control control) {
return false;
}
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return false;
}
+ @Override
public IAction getGlobalAction(String id) {
return null;
}
+ @Override
public void stop() {
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
+ @Override
public void dispose() {
if (scopeObserver != null) {
ScopeState.getInstance().getScopeSetManager().deleteObserver(scopeObserver);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java
index 9b6eab692..2720190b3 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java
@@ -22,22 +22,18 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TrayDialog;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -56,6 +52,7 @@ public class ScopeSetDialog extends TrayDialog {
public class NonDefaultFilter extends ViewerFilter {
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof ScopeSet && ((ScopeSet)element).isDefault()) {
return false;
@@ -65,15 +62,12 @@ public class ScopeSetDialog extends TrayDialog {
}
- public class ShowAllListener implements SelectionListener {
+ public class ShowAllListener extends SelectionAdapter {
+ @Override
public void widgetSelected(SelectionEvent e) {
enableTable();
}
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
}
private ScopeSetManager manager;
@@ -114,9 +108,13 @@ public class ScopeSetDialog extends TrayDialog {
public AddOperation(ScopeSet set) {
super(set);
}
+
+ @Override
public void commit() {
manager.add(set);
}
+
+ @Override
public void cancel() {
set.dispose();
}
@@ -128,9 +126,13 @@ public class ScopeSetDialog extends TrayDialog {
super(set);
this.newName = newName;
}
+
+ @Override
public void commit() {
this.set.setName(newName);
}
+
+ @Override
public void cancel() {
}
}
@@ -151,32 +153,36 @@ public class ScopeSetDialog extends TrayDialog {
public RemoveOperation(ScopeSet set) {
super(set);
}
+
+ @Override
public void commit() {
manager.remove(set);
}
+
+ @Override
public void cancel() {
}
}
private class ScopeContentProvider implements IStructuredContentProvider {
+
+ @Override
public Object[] getElements(Object inputElement) {
return sets.toArray();
}
- /* (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 ScopeLabelProvider extends LabelProvider {
+
+ @Override
public String getText(Object obj) {
String name = findNewName((ScopeSet)obj);
if (name!=null)
@@ -191,6 +197,8 @@ public class ScopeSetDialog extends TrayDialog {
}
return null;
}
+
+ @Override
public Image getImage(Object obj) {
return HelpUIResources.getImage(IHelpUIConstants.IMAGE_SCOPE_SET);
}
@@ -222,7 +230,8 @@ public class ScopeSetDialog extends TrayDialog {
return list;
}
- protected Control createDialogArea(Composite container) {
+ @Override
+ protected Control createDialogArea(Composite container) {
Composite innerContainer = (Composite)super.createDialogArea(container);
createRadioButtons(innerContainer);
createTable(innerContainer);
@@ -230,11 +239,7 @@ public class ScopeSetDialog extends TrayDialog {
PlatformUI.getWorkbench().getHelpSystem().setHelp(innerContainer,
"org.eclipse.help.ui.searchScope"); //$NON-NLS-1$
createEditingButtons(innerContainer);
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateButtons();
- }
- });
+ viewer.addSelectionChangedListener(event -> updateButtons());
ViewerFilter[] filters = { new NonDefaultFilter() };
viewer.setFilters(filters );
return innerContainer;
@@ -257,11 +262,7 @@ public class ScopeSetDialog extends TrayDialog {
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(labelProvider);
viewer.setInput(input);
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- okPressed();
- }
- });
+ viewer.addDoubleClickListener(event -> okPressed());
if (initialSelection != null) {
viewer.setSelection(new StructuredSelection(initialSelection));
}
@@ -310,6 +311,7 @@ public class ScopeSetDialog extends TrayDialog {
return null;
}
+ @Override
protected void okPressed() {
if (operations!=null) {
for (int i=0; i<operations.size(); i++) {
@@ -342,6 +344,7 @@ public class ScopeSetDialog extends TrayDialog {
}
}
+ @Override
protected void cancelPressed() {
if (operations!=null) {
for (int i=0; i<operations.size(); i++) {
@@ -353,6 +356,7 @@ public class ScopeSetDialog extends TrayDialog {
super.cancelPressed();
}
+ @Override
protected void buttonPressed(int buttonId) {
switch (buttonId) {
case NEW_ID:
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java
index 461697f44..a2732d6af 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java
@@ -108,12 +108,8 @@ public class ScopeSetManager extends Observable {
File dir = location.toFile();
defSet = null;
if (dir.exists() && dir.isDirectory()) {
- File[] files = dir.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.endsWith(ScopeSet.EXT)
- || name.endsWith(HistoryScopeSet.EXT);
- }
- });
+ File[] files = dir.listFiles((FilenameFilter) (dir1, name) -> name.endsWith(ScopeSet.EXT)
+ || name.endsWith(HistoryScopeSet.EXT));
for (int i = 0; i < files.length; i++) {
File file = files[i];
String name = file.getName();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java
index 916346d31..4264433c2 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java
@@ -40,16 +40,12 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IMemento;
@@ -70,6 +66,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
public class SearchScopeObserver implements Observer {
+ @Override
public void update(Observable arg0, Object arg1) {
ScopeSet set = scopeSetManager.getActiveSet();
scopeSetLink.setText(set.getName());
@@ -144,12 +141,15 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
private boolean searchInProgress = false;
+ @Override
public void aboutToRun(IJobChangeEvent event) {
}
+ @Override
public void awake(IJobChangeEvent event) {
}
+ @Override
public void done(IJobChangeEvent event) {
if (event.getJob().belongsTo(FederatedSearchJob.FAMILY)) {
Job[] searchJobs = Job.getJobManager().find(FederatedSearchJob.FAMILY);
@@ -166,9 +166,11 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
}
+ @Override
public void running(IJobChangeEvent event) {
}
+ @Override
public void scheduled(IJobChangeEvent event) {
if (!searchInProgress && event.getJob().belongsTo(FederatedSearchJob.FAMILY)) {
searchInProgress = true;
@@ -176,9 +178,11 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
}
+ @Override
public void sleeping(IJobChangeEvent event) {
}
+ @Override
public void run() {
searchWordCombo.getControl().setEnabled(!searchInProgress);
if (!searchInProgress)
@@ -217,18 +221,16 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
goButton = toolkit.createButton(container, Messages.SearchPart_go, SWT.PUSH);
goButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
handleButtonPressed();
}
});
goButton.setEnabled(false);
- searchWordCombo.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- goButton.setEnabled(searchWordCombo.getText().length() > 0);
- }
- });
+ searchWordCombo.addModifyListener(e -> goButton.setEnabled(searchWordCombo.getText().length() > 0));
searchWordCombo.addKeyListener(new KeyAdapter() {
+
+ @Override
public void keyPressed(KeyEvent e) {
if (e.character == '\r') {
if (goButton.isEnabled()) {
@@ -237,24 +239,20 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
}
});
- searchWordCombo.getControl().addListener(SWT.FocusIn, new Listener() {
- public void handleEvent(Event event) {
- shellDefaultButton = null;
- Shell shell = searchWordCombo.getControl().getShell();
- Button button = shell.getDefaultButton();
- if (button != null) {
- shellDefaultButton = button;
- shell.setDefaultButton(goButton);
- }
+ searchWordCombo.getControl().addListener(SWT.FocusIn, event -> {
+ shellDefaultButton = null;
+ Shell shell = searchWordCombo.getControl().getShell();
+ Button button = shell.getDefaultButton();
+ if (button != null) {
+ shellDefaultButton = button;
+ shell.setDefaultButton(goButton);
}
});
- searchWordCombo.getControl().addListener(SWT.FocusOut, new Listener() {
- public void handleEvent(Event event) {
- if (shellDefaultButton != null) {
- Shell shell = searchWordCombo.getControl().getShell();
- shell.setDefaultButton(shellDefaultButton);
- shellDefaultButton = null;
- }
+ searchWordCombo.getControl().addListener(SWT.FocusOut, event -> {
+ if (shellDefaultButton != null) {
+ Shell shell = searchWordCombo.getControl().getShell();
+ shell.setDefaultButton(shellDefaultButton);
+ shellDefaultButton = null;
}
});
@@ -306,6 +304,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
.getImage(IHelpUIConstants.IMAGE_HELP));
searchWordText.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
public void linkActivated(HyperlinkEvent e) {
SearchPart.this.parent.showURL(HREF_SEARCH_HELP, true);
}
@@ -341,6 +340,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
advancedLink = toolkit.createHyperlink(parent, Messages.FederatedSearchPart_advanced, SWT.NULL);
advancedLink.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
public void linkActivated(HyperlinkEvent e) {
doAdvanced();
}
@@ -354,6 +354,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
scopeSetLink = toolkit.createHyperlink(section, null, SWT.WRAP);
scopeSetLink.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
public void linkActivated(HyperlinkEvent e) {
doChangeScopeSet();
}
@@ -420,6 +421,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
engineObserver = new Observer() {
+ @Override
public void update(Observable o, Object arg) {
EngineDescriptorManager.DescriptorEvent event = (EngineDescriptorManager.DescriptorEvent) arg;
int kind = event.getKind();
@@ -449,6 +451,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
master.setData(edesc);
master.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
scopeSetManager.getActiveSet().setEngineEnabled(edesc, master.getSelection());
}
@@ -583,15 +586,19 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
FederatedSearchEntry entry = new FederatedSearchEntry(ed.getId(), ed.getLabel(), scope, ed
.getEngine(), new ISearchEngineResultCollector() {
+ @Override
public void accept(ISearchEngineResult searchResult) {
results.add(ed, searchResult);
}
+ @Override
public void accept(ISearchEngineResult[] searchResults) {
results.add(ed, searchResults);
if (ed.getEngine() instanceof LocalHelp)
{
container.getDisplay().asyncExec(new Thread(){
+
+ @Override
public void run(){
if (alternateQuerySection!=null)
{
@@ -607,6 +614,8 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
Hyperlink link = toolkit.createHyperlink(
alternateQueryComposite, alts.get(b), SWT.NONE);
link.addHyperlinkListener(new HyperlinkAdapter(){
+
+ @Override
public void linkActivated(HyperlinkEvent e) {
searchWordCombo.setText(((Hyperlink)e.getSource()).getText());
@@ -620,6 +629,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
}
+ @Override
public void error(IStatus status) {
results.error(ed, status);
}
@@ -668,6 +678,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
}
+ @Override
public void dispose() {
ScopeSet activeSet = scopeSetManager.getActiveSet();
if (activeSet != null)
@@ -686,20 +697,12 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
super.dispose();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#getControl()
- */
+ @Override
public Control getControl() {
return container;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#init(org.eclipse.help.ui.internal.views.NewReusableHelpPart)
- */
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
@@ -725,6 +728,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
}
+ @Override
public void refresh() {
super.refresh();
if (searchPending) {
@@ -734,48 +738,40 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
}
+ @Override
public String getId() {
return id;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#setVisible(boolean)
- */
+ @Override
public void setVisible(boolean visible) {
getControl().setVisible(visible);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return parent.fillFormContextMenu(searchWordText, manager);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#hasFocusControl(org.eclipse.swt.widgets.Control)
- */
+ @Override
public boolean hasFocusControl(Control control) {
return control == searchWordText || control == searchWordCombo.getControl()
|| scopeSection.getClient() == control;
}
+ @Override
public void setFocus() {
searchWordCombo.getControl().setFocus();
}
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.COPY.getId()))
return parent.getCopyAction();
return null;
}
+ @Override
public void stop() {
SearchResultsPart results = (SearchResultsPart) parent.findPart(IHelpUIConstants.HV_FSEARCH_RESULT);
if (results != null) {
@@ -784,12 +780,15 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo
Job.getJobManager().cancel(FederatedSearchJob.FAMILY);
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
+ @Override
public void saveState(IMemento memento) {
ScopeSet sset = scopeSetManager.getActiveSet();
if (sset != null)
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java
index 2246f5299..dcf0cef28 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java
@@ -97,6 +97,8 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
innerForm.setLayoutData(new GridData(GridData.FILL_BOTH));
final ScrollBar scrollBar = innerForm.getVerticalBar();
scrollBar.addSelectionListener(new SelectionAdapter() {
+
+ @Override
public void widgetSelected(SelectionEvent e) {
updateSeparatorVisibility();
}
@@ -129,6 +131,8 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
boolean showCategories = Platform.getPreferencesService().getBoolean
(HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_SHOW_SEARCH_CATEGORIES, false, null);
showCategoriesAction = new Action() {
+
+ @Override
public void run() {
updateResultSections();
IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID);
@@ -147,6 +151,8 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
tbm.insertBefore("back", showCategoriesAction); //$NON-NLS-1$
showDescriptionAction = new Action() {
+
+ @Override
public void run() {
updateResultSections();
IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID);
@@ -166,20 +172,19 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
tbm.insertAfter("description", new Separator()); //$NON-NLS-1$
}
+ @Override
public void dispose() {
innerToolkit.dispose();
super.dispose();
}
private void updateResultSections() {
- BusyIndicator.showWhile(container.getDisplay(), new Runnable() {
- public void run() {
- for (int i = 0; i < results.size(); i++) {
- EngineResultSection section = results.get(i);
- section.updateResults(false);
- }
- reflow();
+ BusyIndicator.showWhile(container.getDisplay(), () -> {
+ for (int i = 0; i < results.size(); i++) {
+ EngineResultSection section = results.get(i);
+ section.updateResults(false);
}
+ reflow();
});
}
@@ -191,34 +196,23 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
return showDescriptionAction.isChecked();
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#getControl()
- */
+ @Override
public Control getControl() {
return container;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#init(org.eclipse.help.ui.internal.views.NewReusableHelpPart)
- */
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.parent = parent;
this.id = id;
}
+ @Override
public String getId() {
return id;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#setVisible(boolean)
- */
+ @Override
public void setVisible(boolean visible) {
container.setVisible(visible);
}
@@ -303,11 +297,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
Control focusControl = container.getDisplay().getFocusControl();
if (focusControl != null && focusControl instanceof FormText) {
@@ -316,11 +306,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#hasFocusControl(org.eclipse.swt.widgets.Control)
- */
+ @Override
public boolean hasFocusControl(Control control) {
for (int i = 0; i < results.size(); i++) {
EngineResultSection er = results.get(i);
@@ -357,11 +343,9 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
final EngineResultSection er = new EngineResultSection(this, ed);
Display display = parent.getForm().getToolkit().getColors()
.getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- Control c = er.createControl(innerForm.getBody(), innerToolkit);
- c.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
- }
+ display.syncExec(() -> {
+ Control c = er.createControl(innerForm.getBody(), innerToolkit);
+ c.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
});
results.add(er);
return er;
@@ -379,6 +363,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
parent.reflow();
}
+ @Override
public boolean setFormInput(Object input) {
return false;
}
@@ -387,6 +372,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
innerForm.setOrigin(0, 0);
}
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.COPY.getId()))
return parent.getCopyAction();
@@ -396,17 +382,22 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart {
FormToolkit getToolkit() {
return innerToolkit;
}
+
+ @Override
public void stop() {
}
+ @Override
public void toggleRoleFilter() {
updateResultSections();
}
+ @Override
public void refilter() {
updateResultSections();
}
+ @Override
public void saveState(IMemento memento) {
}
} \ No newline at end of file
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java
index 9f050be87..c30697211 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -93,12 +93,11 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart {
private void addLinks(final Composite container, FormToolkit toolkit) {
IHyperlinkListener listener = new HyperlinkAdapter() {
+
+ @Override
public void linkActivated(final HyperlinkEvent e) {
- container.getDisplay().asyncExec(new Runnable() {
- public void run() {
- SeeAlsoPart.this.helpPart.showPage((String) e.getHref(), true);
- }
- });
+ container.getDisplay()
+ .asyncExec(() -> SeeAlsoPart.this.helpPart.showPage((String) e.getHref(), true));
}
};
if ((helpPart.getStyle() & ReusableHelpPart.ALL_TOPICS) != 0)
@@ -143,20 +142,12 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart {
link.setLayoutData(data);
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#getControl()
- */
+ @Override
public Control getControl() {
return container;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#init(org.eclipse.help.ui.internal.views.NewReusableHelpPart)
- */
+ @Override
public void init(ReusableHelpPart parent, String id, IMemento memento) {
this.helpPart = parent;
this.id = id;
@@ -173,24 +164,19 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart {
separator.setLayoutData(seperatorData);
}
+ @Override
public String getId() {
return id;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#setVisible(boolean)
- */
+ @Override
public void setVisible(boolean visible) {
container.setVisible(visible);
if (visible)
markStale();
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.forms.AbstractFormPart#dispose()
- */
+ @Override
public void dispose() {
super.dispose();
if (bgImage != null && !bgImage.isDisposed()) {
@@ -198,46 +184,47 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart {
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#fillContextMenu(org.eclipse.jface.action.IMenuManager)
- */
+ @Override
public boolean fillContextMenu(IMenuManager manager) {
return false;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.help.ui.internal.views.IHelpPart#hasFocusControl(org.eclipse.swt.widgets.Control)
- */
+ @Override
public boolean hasFocusControl(Control control) {
return control != null && control.getParent() == linkContainer;
}
+ @Override
public IAction getGlobalAction(String id) {
if (id.equals(ActionFactory.COPY.getId()))
return helpPart.getCopyAction();
return null;
}
+
+ @Override
public void stop() {
}
+
+ @Override
public void refresh() {
if (linkContainer!=null && helpPart.getCurrentPageId()!=null)
updateLinks(helpPart.getCurrentPageId());
super.refresh();
}
+ @Override
public void toggleRoleFilter() {
}
+ @Override
public void refilter() {
}
+ @Override
public void saveState(IMemento memento) {
}
+ @Override
public void setFocus() {
if (linkContainer!=null)
linkContainer.setFocus();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java
index 797507f74..115a6cd03 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,9 +19,7 @@ public class SorterByScore extends ViewerComparator {
super(ReusableHelpPart.SHARED_COLLATOR);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
try {
float rank1 = ((SearchHit) e1).getScore();

Back to the top