Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Kolosowski2004-03-15 23:43:55 -0500
committerKonrad Kolosowski2004-03-15 23:43:55 -0500
commit3c02aa6f0d02de0a30976e98cde7a8ada1db7815 (patch)
treee6c0ac04b2b3b784d00f079d8130465eada97afb /org.eclipse.help.base
parentfda549bee6de4ed0b19f082f85f418d629c8ecd8 (diff)
downloadeclipse.platform.ua-3c02aa6f0d02de0a30976e98cde7a8ada1db7815.tar.gz
eclipse.platform.ua-3c02aa6f0d02de0a30976e98cde7a8ada1db7815.tar.xz
eclipse.platform.ua-3c02aa6f0d02de0a30976e98cde7a8ada1db7815.zip
choice to always use external browserv20040315
Diffstat (limited to 'org.eclipse.help.base')
-rw-r--r--org.eclipse.help.base/preferences.ini12
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserManager.java40
2 files changed, 46 insertions, 6 deletions
diff --git a/org.eclipse.help.base/preferences.ini b/org.eclipse.help.base/preferences.ini
index d0e61eb42..d39fb91c0 100644
--- a/org.eclipse.help.base/preferences.ini
+++ b/org.eclipse.help.base/preferences.ini
@@ -92,4 +92,14 @@ basic.viewBackground=#FFFFFF
# space requirements as navigations and indexes will be created for each distinct preferred locale
# among browsers accessing the infocenter.
# Example: locales=en ja zh_CN zh_TW
-locales= \ No newline at end of file
+locales=
+
+######################
+# Browsers
+######################
+# Use embedded when possible, or always external
+#always_external_browser=
+# Default external browser
+#default_browser=
+# Executable path for custom browser
+#custom_browser_path= \ No newline at end of file
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserManager.java b/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserManager.java
index 5d0f2d58c..05d972064 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserManager.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/browser/BrowserManager.java
@@ -19,6 +19,7 @@ import org.eclipse.help.internal.base.*;
* Creates browser by delegating to appropriate browser adapter
*/
public class BrowserManager {
+ public static final String ALWAYS_EXTERNAL_BROWSER_KEY = "always_external_browser";
public static final String DEFAULT_BROWSER_ID_KEY = "default_browser";
private static BrowserManager instance;
private boolean initialized = false;
@@ -27,6 +28,7 @@ public class BrowserManager {
private BrowserDescriptor[] browsersDescriptors;
private BrowserDescriptor internalBrowserDesc;
private Collection browsers = new ArrayList();
+ private boolean alwaysUseExternal = false;
/**
* Private Constructor
*/
@@ -141,6 +143,10 @@ public class BrowserManager {
if (currentBrowserDesc == null) {
setCurrentBrowserID(getDefaultBrowserID());
}
+ setAlwaysUseExternal(HelpBasePlugin
+ .getDefault()
+ .getPluginPreferences()
+ .getBoolean(ALWAYS_EXTERNAL_BROWSER_KEY));
}
/**
@@ -274,11 +280,10 @@ public class BrowserManager {
if (!initialized) {
init();
}
- if (forceExternal)
- return createBrowserAdapter(forceExternal);
- else
- return new CurrentBrowser(createBrowserAdapter(forceExternal),
- getCurrentBrowserID());
+ forceExternal = forceExternal || alwaysUseExternal;
+ return createBrowserAdapter(forceExternal);
+ // TODO fix and use CurrentBrowser
+ // return new CurrentBrowser(createBrowserAdapter(forceExternal), getCurrentBrowserID());
}
/**
* Creates web browser
@@ -291,6 +296,9 @@ public class BrowserManager {
* Creates web browser
*/
private IBrowser createBrowserAdapter(boolean forceExternal) {
+ if (!initialized) {
+ init();
+ }
IBrowser browser = null;
if(! forceExternal && internalBrowserDesc != null){
browser = internalBrowserDesc.getFactory().createBrowser();
@@ -313,4 +321,26 @@ public class BrowserManager {
browser.close();
}
}
+ public boolean isEmbeddedBrowserPresent(){
+ if (!initialized) {
+ init();
+ }
+ return internalBrowserDesc != null;
+ }
+ public void setAlwaysUseExternal(boolean alwaysExternal){
+ if (!initialized) {
+ init();
+ }
+
+ alwaysUseExternal = alwaysExternal || !isEmbeddedBrowserPresent();
+ }
+ public boolean isAlwaysUseExternal(){
+ if (!initialized) {
+ init();
+ }
+ if(!isEmbeddedBrowserPresent()){
+ return true;
+ }
+ return alwaysUseExternal;
+ }
}

Back to the top