diff options
| author | Lakshmi Shanmugam | 2017-06-22 08:01:04 +0000 |
|---|---|---|
| committer | Lakshmi Shanmugam | 2017-06-22 12:34:00 +0000 |
| commit | 6ce6e56eb49a6aa3a12ce2140a0f645922afb108 (patch) | |
| tree | 4c835ac89417673eefb74008793d2168f8875f4e | |
| parent | f5d20aa95b71b7da0b8fef298e4641a028b0d946 (diff) | |
| download | eclipse.platform.swt-6ce6e56eb49a6aa3a12ce2140a0f645922afb108.tar.gz eclipse.platform.swt-6ce6e56eb49a6aa3a12ce2140a0f645922afb108.tar.xz eclipse.platform.swt-6ce6e56eb49a6aa3a12ce2140a0f645922afb108.zip | |
Bug 518542: Remove XULRunner related code from SWT source repository
Deprecated SWT.MOZILLA & Browser.getWebBrowser. SWT.MOZILLA style will
be ignored in the code.
Change-Id: Ib69683f5526e21390f138d1f39275e2428046f93
5 files changed, 27 insertions, 34 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/BrowserFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/BrowserFactory.java index 3944cfbb5f..75e0ac1c31 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/BrowserFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/cocoa/org/eclipse/swt/browser/BrowserFactory.java @@ -10,14 +10,9 @@ *******************************************************************************/ package org.eclipse.swt.browser; -import org.eclipse.swt.SWT; - class BrowserFactory { WebBrowser createWebBrowser (int style) { - if ((style & SWT.MOZILLA) != 0) { - return new Mozilla (); - } return new WebKit (); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java index 48086529c1..0900b62bc1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java @@ -23,12 +23,12 @@ import org.eclipse.swt.widgets.*; * </p> * <dl> * <dt><b>Styles:</b></dt> - * <dd>MOZILLA, WEBKIT</dd> + * <dd>NONE, WEBKIT</dd> * <dt><b>Events:</b></dt> * <dd>CloseWindowListener, LocationListener, OpenWindowListener, ProgressListener, StatusTextListener, TitleListener, VisibilityWindowListener</dd> * </dl> * <p> - * Note: At most one of the styles MOZILLA and WEBKIT may be specified. + * Note: MOZILLA is deprecated and is no longer supported. * </p> * <p> * IMPORTANT: This class is <em>not</em> intended to be subclassed. @@ -124,18 +124,19 @@ static Composite checkParent (Composite parent) { return parent; } +@SuppressWarnings("deprecation") static int checkStyle(int style) { String platform = SWT.getPlatform (); if (DefaultType == SWT.DEFAULT) { /* - * Some Browser clients that explicitly specify the native renderer to use - * (by creating a Browser with style SWT.MOZILLA or SWT.WEBKIT) may also - * need to specify that all "default" Browser instances (those created with - * style SWT.NONE) should use this renderer as well. This may be needed in - * order to avoid incompatibilities that can arise from having multiple - * native renderers loaded within the same process. A client can do this by - * setting the "org.eclipse.swt.browser.DefaultType" java system property to - * a value like "mozilla" or "webkit". + * Some Browser clients that explicitly specify the native renderer to use (by + * creating a Browser with SWT.WEBKIT) may also need to specify that all + * "default" Browser instances (those created with style SWT.NONE) should use + * this renderer as well. This may be needed in order to avoid incompatibilities + * that can arise from having multiple native renderers loaded within the same + * process. A client can do this by setting the + * "org.eclipse.swt.browser.DefaultType" java system property to a value like + * "ie" or "webkit". Value "mozilla" is ignored now. */ /* @@ -163,10 +164,7 @@ static int checkStyle(int style) { newIndex = length; } String current = value.substring(index, newIndex).trim(); - if (current.equalsIgnoreCase ("mozilla")) { //$NON-NLS-1$ - DefaultType = SWT.MOZILLA; - break; - } else if (current.equalsIgnoreCase ("webkit")) { //$NON-NLS-1$ + if (current.equalsIgnoreCase ("webkit")) { //$NON-NLS-1$ DefaultType = SWT.WEBKIT; break; } else if (current.equalsIgnoreCase ("ie") && "win32".equals (platform)) { //$NON-NLS-1$ //$NON-NLS-2$ @@ -181,17 +179,20 @@ static int checkStyle(int style) { } } - if ((style & (SWT.MOZILLA | SWT.WEBKIT)) == 0) { - style |= DefaultType; + /* remove SWT.MOZILLA style if specified */ + if ((style & SWT.MOZILLA) != 0) { + System.err.println ("Unsupported Browser Type: SWT.MOZILLA style is deprecated.\n" //$NON-NLS-1$ + + "It'll be removed from the user specified style. Browser will be created with the modified style " + + "and if no other style bit is specified, browser with SWT.NONE style will be created"); //$NON-NLS-1$ + style &= ~SWT.MOZILLA; } - if ((style & (SWT.MOZILLA | SWT.WEBKIT)) == (SWT.MOZILLA | SWT.WEBKIT)) { - style &= ~SWT.WEBKIT; + if ((style & SWT.WEBKIT) == 0) { + style |= DefaultType; } - if ((style & SWT.MOZILLA) != 0 || (style & SWT.WEBKIT) != 0) { + if ((style & SWT.WEBKIT) != 0) { return style; } - if ("win32".equals (platform)) { //$NON-NLS-1$ /* * For IE on win32 the border is supplied by the embedded browser, so remove @@ -776,7 +777,9 @@ public String getUrl () { * @return the receiver's JavaXPCOM <code>nsIWebBrowser</code> or <code>null</code> * * @since 3.3 + * @deprecated SWT.MOZILLA is deprecated and XULRunner as a browser renderer in no longer supported. */ +@Deprecated public Object getWebBrowser () { checkWidget(); return webBrowser.getWebBrowser (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java index b66feac0fa..e61ebdd160 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/gtk/org/eclipse/swt/browser/BrowserFactory.java @@ -16,9 +16,6 @@ class BrowserFactory { WebBrowser createWebBrowser (int style) { boolean webkitInstalled = WebKit.IsInstalled (); - if ((style & SWT.MOZILLA) != 0 || (!webkitInstalled && (style & SWT.WEBKIT) == 0)) { - return new Mozilla (); - } if (!webkitInstalled) return null; return new WebKit (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java index 5f82348147..16d82f591a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/BrowserFactory.java @@ -16,12 +16,6 @@ import org.eclipse.swt.internal.win32.OS; class BrowserFactory { WebBrowser createWebBrowser (int style) { - if (OS.IsWinCE && (style & (SWT.MOZILLA | SWT.WEBKIT)) != 0) { - throw new SWTError (SWT.ERROR_NO_HANDLES, "Unsupported Browser type"); //$NON-NLS-1$ - } - if ((style & SWT.MOZILLA) != 0) { - return new Mozilla (); - } if ((style & SWT.WEBKIT) != 0) { return new WebKit (); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java index 501affc79a..c391bb7e41 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java @@ -2217,7 +2217,11 @@ public class SWT { * </ul></p> * * @since 3.3 + * @deprecated This style is deprecated and will be removed in the future. + * XULRunner as a browser renderer in no longer supported. Use + * <code>SWT.WEBKIT</code> or <code>SWT.NONE</code> instead. */ + @Deprecated public static final int MOZILLA = 1 << 15; /** |
