diff options
| author | Tim Neumann | 2019-03-21 09:07:57 +0000 |
|---|---|---|
| committer | Andrey Loskutov | 2019-03-27 14:18:04 +0000 |
| commit | 7ec315532f01dc7fcbc1bb60b2ee29ce81abae72 (patch) | |
| tree | 347079ba246d1f1adba3e58dd7bff72ba3bdf1ef | |
| parent | 886c87b61dffaa163bdd5063112df879006e004d (diff) | |
| download | eclipse.platform.ui-7ec315532f01dc7fcbc1bb60b2ee29ce81abae72.tar.gz eclipse.platform.ui-7ec315532f01dc7fcbc1bb60b2ee29ce81abae72.tar.xz eclipse.platform.ui-7ec315532f01dc7fcbc1bb60b2ee29ce81abae72.zip | |
Bug 545615 - Show help icon only if help is really availableI20190327-1800
Add condition HelpSystem.getContext(contextId) != null to check if
marker icon should be annotated with question mark.
The check is the same as in
org.eclipse.ui.internal.help.WorkbenchHelpSystem:displayHelp(String)
So the problem view now does not show the help icon exactly when no help
would open.
Introduced a new (hidden and enabled by default) preference to control
this new help check behavior. This allows product intagrators disable
the help check if they use RemoteContextProvider and enabled RemoteHelp
via org.eclipse.help.base/remoteHelpOn=true.
To disable the new preference, product customization file should have
this line:
org.eclipse.ui.ide/helpContextAvailabilityCheck=false
Change-Id: Ic102ebeefbcb5a36d55022d3c1994dc589d83c88
Signed-off-by: Tim Neumann <Tim.Neumann@advantest.com>
3 files changed, 29 insertions, 1 deletions
diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java index 16cbd93e60d..5473570a188 100644 --- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java +++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEInternalPreferences.java @@ -165,4 +165,19 @@ public interface IDEInternalPreferences { */ String INITIAL_DEFAULT_MARKER_GROUPING = "INITIAL_DEFAULT_MARKER_GROUPING"; //$NON-NLS-1$ + /** + * Key for preference whether the problem view does check if a help context is + * really available before annotating a marker icon with the question mark + * symbol. + * + * <p> + * See bug 545615 + * </p> + * + * <p> + * The default is true. + * </p> + */ + String HELP_CONTEXT_AVAILABILITY_CHECK = "helpContextAvailabilityCheck"; //$NON-NLS-1$ + } diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEPreferenceInitializer.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEPreferenceInitializer.java index 7de79e19765..0ad90250bfd 100644 --- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEPreferenceInitializer.java +++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/IDEPreferenceInitializer.java @@ -98,6 +98,10 @@ public class IDEPreferenceInitializer extends AbstractPreferenceInitializer { // by default, don't start hidden problems view to show decoration on // it's icon. See bug 513901 node.putBoolean(IDEInternalPreferences.SHOW_PROBLEMS_VIEW_DECORATIONS_ON_STARTUP, false); + + // by default the problem view should check whether help context is really + // available. + node.putBoolean(IDEInternalPreferences.HELP_CONTEXT_AVAILABILITY_CHECK, true); } /** diff --git a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/MarkerField.java b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/MarkerField.java index a22af176f44..b11032894e1 100644 --- a/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/MarkerField.java +++ b/bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/markers/MarkerField.java @@ -18,6 +18,8 @@ import java.net.URL; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Platform; +import org.eclipse.help.HelpSystem; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.JFaceResources; @@ -32,6 +34,7 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.ide.IDE; import org.eclipse.ui.internal.WorkbenchPlugin; +import org.eclipse.ui.internal.ide.IDEInternalPreferences; import org.eclipse.ui.internal.ide.IDEInternalWorkbenchImages; import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; import org.eclipse.ui.internal.util.BundleUtility; @@ -48,6 +51,12 @@ public abstract class MarkerField { private IConfigurationElement configurationElement; private ResourceManager imageManager; + private boolean helpContextAvailabilityCheck; + + public MarkerField() { + helpContextAvailabilityCheck = Platform.getPreferencesService().getBoolean(IDEWorkbenchPlugin.IDE_WORKBENCH, + IDEInternalPreferences.HELP_CONTEXT_AVAILABILITY_CHECK, true, null); // $NON-NLS-1$ + } /** * Annotate the image with indicators for whether or not help or quick fix @@ -67,7 +76,7 @@ public abstract class MarkerField { // one if (marker != null) { String contextId = IDE.getMarkerHelpRegistry().getHelp(marker); - if (contextId != null) { + if (contextId != null && (!helpContextAvailabilityCheck || HelpSystem.getContext(contextId) != null)) { if (image == null) image = JFaceResources.getImage(Dialog.DLG_IMG_HELP); else { |
