Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2010-04-07 23:40:39 +0000
committerChris Goldthorpe2010-04-07 23:40:39 +0000
commit978202f767d914eb0f1a004786491cf74a1f6c44 (patch)
tree74102a6cbf5e97dba643cdfa0c9a404b98adb784 /org.eclipse.help
parent06a76faf3a1d5428af50d9f39b0925c92ac4509c (diff)
downloadeclipse.platform.ua-978202f767d914eb0f1a004786491cf74a1f6c44.tar.gz
eclipse.platform.ua-978202f767d914eb0f1a004786491cf74a1f6c44.tar.xz
eclipse.platform.ua-978202f767d914eb0f1a004786491cf74a1f6c44.zip
Bug 308248 - [Webapp] <enablement> detect help content plug-ins
Diffstat (limited to 'org.eclipse.help')
-rw-r--r--org.eclipse.help/preferences.ini5
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/HelpPlugin.java1
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/UAElement.java8
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/dynamic/FilterResolver.java4
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java10
5 files changed, 21 insertions, 7 deletions
diff --git a/org.eclipse.help/preferences.ini b/org.eclipse.help/preferences.ini
index 4affb91bd..58ae0807d 100644
--- a/org.eclipse.help/preferences.ini
+++ b/org.eclipse.help/preferences.ini
@@ -10,4 +10,7 @@ baseTOCS=
enableCriteria=false
# List all the supported criteria names, separated by comma
-supportedCriteria= \ No newline at end of file
+supportedCriteria=
+
+# Apply filtering by enablement to the infocenter
+filterInfocenter=true \ No newline at end of file
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/HelpPlugin.java b/org.eclipse.help/src/org/eclipse/help/internal/HelpPlugin.java
index 58bf2d38f..9052c85a4 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/HelpPlugin.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/HelpPlugin.java
@@ -44,6 +44,7 @@ public class HelpPlugin extends Plugin {
public final static String BASE_TOCS_KEY = "baseTOCS"; //$NON-NLS-1$
public final static String IGNORED_TOCS_KEY = "ignoredTOCS"; //$NON-NLS-1$
public final static String IGNORED_INDEXES_KEY = "ignoredIndexes"; //$NON-NLS-1$
+ public final static String FILTER_INFOCENTER_KEY = "filterInfocenter"; //$NON-NLS-1$
private static HelpPlugin plugin;
private static Object tocManagerCreateLock = new Object();
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/UAElement.java b/org.eclipse.help/src/org/eclipse/help/internal/UAElement.java
index 11b8321f5..0e69cd9da 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/UAElement.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/UAElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2010 IBM Corporation and others.
* All rights reserved. This program and 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,6 +13,7 @@ package org.eclipse.help.internal;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -23,10 +24,10 @@ import org.eclipse.core.expressions.ExpressionConverter;
import org.eclipse.core.expressions.ExpressionTagNames;
import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.help.HelpSystem;
import org.eclipse.help.IUAElement;
import org.eclipse.help.internal.dynamic.FilterResolver;
import org.eclipse.help.internal.entityresolver.LocalEntityResolver;
+import org.eclipse.help.internal.util.ProductPreferences;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -241,7 +242,7 @@ public class UAElement implements IUAElement {
}
public boolean isEnabled(IEvaluationContext context) {
- if (HelpSystem.isShared()) {
+ if (!ProductPreferences.useEnablementFilters()) {
return true;
}
if (src != null) {
@@ -261,6 +262,7 @@ public class UAElement implements IUAElement {
try {
return enablementExpression.evaluate(context) == EvaluationResult.TRUE;
} catch (CoreException e) {
+ return false;
}
}
return true;
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/dynamic/FilterResolver.java b/org.eclipse.help/src/org/eclipse/help/internal/dynamic/FilterResolver.java
index 9610fde3d..66037a4a9 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/dynamic/FilterResolver.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/dynamic/FilterResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -133,7 +133,7 @@ public class FilterResolver {
if (product != null) {
return !productId.equals(product.getId());
}
- return false;
+ return true;
}
/*
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java b/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java
index 0a9798621..23cc0599c 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/util/ProductPreferences.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
* All rights reserved. This program and 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 @@ import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.help.HelpSystem;
import org.eclipse.help.internal.HelpData;
import org.eclipse.help.internal.HelpPlugin;
import org.osgi.framework.Bundle;
@@ -461,4 +462,11 @@ public class ProductPreferences {
}
return path;
}
+
+ public static boolean useEnablementFilters() {
+ if (!HelpSystem.isShared()) {
+ return true;
+ }
+ return Platform.getPreferencesService().getBoolean(HelpPlugin.PLUGIN_ID, HelpPlugin.FILTER_INFOCENTER_KEY, false, null);
+ }
}

Back to the top