diff options
author | Grant Gayed <ggayed> | 2011-01-25 20:19:49 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2011-01-25 20:19:49 +0000 |
commit | e35d6aee41c222c15df583c9ed33006b5e2bb456 (patch) | |
tree | f73ac30eda8a3513dbae7ebc5916ebc5ae2abd28 | |
parent | 27379046853b02a253f59ff9ee95a94909da3203 (diff) | |
download | eclipse.platform.swt-e35d6aee41c222c15df583c9ed33006b5e2bb456.tar.gz eclipse.platform.swt-e35d6aee41c222c15df583c9ed33006b5e2bb456.tar.xz eclipse.platform.swt-e35d6aee41c222c15df583c9ed33006b5e2bb456.zip |
add SWT.WEBKIT style
3 files changed, 22 insertions, 4 deletions
diff --git a/examples/org.eclipse.swt.examples/src/examples_control.properties b/examples/org.eclipse.swt.examples/src/examples_control.properties index 58ae03e51b..bebd27b75b 100644 --- a/examples/org.eclipse.swt.examples/src/examples_control.properties +++ b/examples/org.eclipse.swt.examples/src/examples_control.properties @@ -259,3 +259,4 @@ No_Icon = No Icon Show_In_Tray = Show In Tray BrowserNotFound = Browser not found: {0} MozillaNotFound = Cannot use SWT.MOZILLA style: {0}\nSee http://www.eclipse.org/swt/faq.php#howusemozilla for more information. +WebKitNotFound = Cannot use SWT.WEBKIT style: {0}\nSee http://www.eclipse.org/swt/faq.php#howusewebkit for more information. diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java index 529f266bb7..6044bc535b 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java @@ -29,7 +29,7 @@ class BrowserTab extends Tab { Group browserGroup; /* Style widgets added to the "Style" group */ - Button mozillaButton; + Button mozillaButton, webKitButton; String errorMessage, lastText, lastUrl; @@ -70,19 +70,21 @@ class BrowserTab extends Tab { int style = getDefaultStyle(); if (borderButton.getSelection ()) style |= SWT.BORDER; if (mozillaButton.getSelection ()) style |= SWT.MOZILLA; + if (webKitButton.getSelection ()) style |= SWT.WEBKIT; /* Create the example widgets */ try { browser = new Browser (browserGroup, style); - } catch (SWTError e) { //XPCOM error + } catch (SWTError e) { // Probably missing browser try { - browser = new Browser (browserGroup, style &~ SWT.MOZILLA); + browser = new Browser (browserGroup, style & ~(SWT.MOZILLA | SWT.WEBKIT)); } catch (SWTError e2) { // Unsupported platform errorMessage = e.getMessage(); return; } MessageBox dialog = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK); - dialog.setMessage(ControlExample.getResourceString("MozillaNotFound", new String [] {e.getMessage()})); + String resourceString = (style & SWT.MOZILLA) != 0 ? "MozillaNotFound" : "WebKitNotFound"; + dialog.setMessage(ControlExample.getResourceString(resourceString, new String [] {e.getMessage()})); dialog.open(); } @@ -144,6 +146,18 @@ class BrowserTab extends Tab { /* Create the extra widgets */ mozillaButton = new Button (styleGroup, SWT.CHECK); mozillaButton.setText ("SWT.MOZILLA"); + mozillaButton.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + webKitButton.setSelection(false); + } + }); + webKitButton = new Button (styleGroup, SWT.CHECK); + webKitButton.setText ("SWT.WEBKIT"); + webKitButton.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + mozillaButton.setSelection(false); + } + }); borderButton = new Button (styleGroup, SWT.CHECK); borderButton.setText ("SWT.BORDER"); } @@ -327,6 +341,7 @@ class BrowserTab extends Tab { void setExampleWidgetState () { super.setExampleWidgetState (); mozillaButton.setSelection (browser == null ? false : (browser.getStyle () & SWT.MOZILLA) != 0); + webKitButton.setSelection (browser == null ? false : (browser.getStyle () & SWT.WEBKIT) != 0); borderButton.setSelection (browser == null ? false : (browser.getStyle () & SWT.BORDER) != 0); } } diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/browser-content.html b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/browser-content.html index 248b93ee1c..bc167e6624 100644 --- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/browser-content.html +++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/browser-content.html @@ -10,6 +10,8 @@ <a href="http://www.eclipse.org/swt/faq.php#whatisbrowser">http://www.eclipse.org/swt/faq.php#whatisbrowser</a></li> <li>For a list of the platforms that Browser supports, see: <a href="http://www.eclipse.org/swt/faq.php#browserplatforms">http://www.eclipse.org/swt/faq.php#browserplatforms</a></li> +<li>For more information on the SWT.WEBKIT Browser style, see: +<a href="http://www.eclipse.org/swt/faq.php#howusewebkit">http://www.eclipse.org/swt/faq.php#howusewebkit</a></li> <li>For more information on the SWT.MOZILLA Browser style, see: <a href="http://www.eclipse.org/swt/faq.php#howusemozilla">http://www.eclipse.org/swt/faq.php#howusemozilla</a></li> <li>For more examples that use a Browser widget, see BrowserExample, BrowserDemo, and WebBrowser: |