diff options
author | Tom Schindl | 2015-08-17 05:16:54 +0000 |
---|---|---|
committer | Tom Schindl | 2015-08-17 05:17:08 +0000 |
commit | d2449fa35eb9490adc2affd3cb7a0f6f4e04f088 (patch) | |
tree | e4dac1c4104fc05b7cf4b5d193e7f19cd822b51f /experimental | |
parent | 1fa30090e5d3cda32200cce15b84629a17b03183 (diff) | |
download | org.eclipse.efxclipse-d2449fa35eb9490adc2affd3cb7a0f6f4e04f088.tar.gz org.eclipse.efxclipse-d2449fa35eb9490adc2affd3cb7a0f6f4e04f088.tar.xz org.eclipse.efxclipse-d2449fa35eb9490adc2affd3cb7a0f6f4e04f088.zip |
add browser sample
Diffstat (limited to 'experimental')
6 files changed, 54 insertions, 46 deletions
diff --git a/experimental/swt/org.eclipse.fx.runtime.examples.swt/.classpath b/experimental/swt/org.eclipse.fx.runtime.examples.swt/.classpath index b0b06d84c..154022be0 100644 --- a/experimental/swt/org.eclipse.fx.runtime.examples.swt/.classpath +++ b/experimental/swt/org.eclipse.fx.runtime.examples.swt/.classpath @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src-mini"/> diff --git a/experimental/swt/org.eclipse.fx.runtime.examples.swt/.settings/org.eclipse.jdt.core.prefs b/experimental/swt/org.eclipse.fx.runtime.examples.swt/.settings/org.eclipse.jdt.core.prefs index f42de363a..0c68a61dc 100644 --- a/experimental/swt/org.eclipse.fx.runtime.examples.swt/.settings/org.eclipse.jdt.core.prefs +++ b/experimental/swt/org.eclipse.fx.runtime.examples.swt/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,7 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/experimental/swt/org.eclipse.fx.runtime.examples.swt/META-INF/MANIFEST.MF b/experimental/swt/org.eclipse.fx.runtime.examples.swt/META-INF/MANIFEST.MF index 1ba427f5e..824105135 100644 --- a/experimental/swt/org.eclipse.fx.runtime.examples.swt/META-INF/MANIFEST.MF +++ b/experimental/swt/org.eclipse.fx.runtime.examples.swt/META-INF/MANIFEST.MF @@ -8,7 +8,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.fx.osgi.util;bundle-version="0.8.1", org.eclipse.equinox.event;bundle-version="1.3.0", org.eclipse.fx.runtime.swtutil;bundle-version="1.0.0" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javafx.animation;version="2.0.0", javafx.application;version="2.0.0", javafx.beans;version="2.0.0", diff --git a/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/BrowserTab.java b/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/BrowserTab.java index 4dee5fd91..b0911caf0 100644 --- a/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/BrowserTab.java +++ b/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/BrowserTab.java @@ -27,51 +27,51 @@ class BrowserTab extends Tab { /* Example widgets and groups that contain them */ Browser browser; Group browserGroup; - + /* Style widgets added to the "Style" group */ Button mozillaButton, webKitButton; - + String errorMessage, lastText, lastUrl; - + /** * Creates the Tab within a given instance of ControlExample. */ BrowserTab(ControlExample instance) { super(instance); } - + void createBackgroundModeGroup () { // Browser does not need a background mode group. } - + void createColorAndFontGroup () { // Browser does not need a color and font group. } - + /** * Creates the "Example" group. */ void createExampleGroup () { super.createExampleGroup (); - + /* Create a group for the browser */ browserGroup = new Group (exampleGroup, SWT.NONE); browserGroup.setLayout (new GridLayout ()); browserGroup.setLayoutData (new GridData (SWT.FILL, SWT.FILL, true, true)); browserGroup.setText ("Browser"); } - + /** * Creates the "Example" widgets. */ void createExampleWidgets () { - + /* Compute the widget style */ 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); @@ -114,7 +114,7 @@ class BrowserTab extends Tab { } lastText = lastUrl = null; } - + /** * Creates the "Other" group. This is typically * a child of the "Control" group. @@ -123,7 +123,7 @@ class BrowserTab extends Tab { super.createOtherGroup (); backgroundImageButton.dispose (); } - + /** * Creates the "Size" group. The "Size" group contains * controls that allow the user to change the size of @@ -131,7 +131,7 @@ class BrowserTab extends Tab { */ void createSizeGroup () { super.createSizeGroup (); - + /* Set the default state for Browser to fill horizontally & vertically. */ fillHButton.setSelection (true); fillVButton.setSelection (true); @@ -142,7 +142,7 @@ class BrowserTab extends Tab { */ void createStyleGroup () { super.createStyleGroup (); - + /* Create the extra widgets */ mozillaButton = new Button (styleGroup, SWT.CHECK); mozillaButton.setText ("SWT.MOZILLA"); @@ -161,7 +161,7 @@ class BrowserTab extends Tab { borderButton = new Button (styleGroup, SWT.CHECK); borderButton.setText ("SWT.BORDER"); } - + /** * Creates the tab folder page. * @@ -182,7 +182,7 @@ class BrowserTab extends Tab { setExampleWidgetSize (); } }); - + /* * Add a selection listener to the tabFolder to bring up a * dialog if this platform does not support the Browser. @@ -196,7 +196,7 @@ class BrowserTab extends Tab { } } }); - + return tabFolderPage; } @@ -216,12 +216,12 @@ class BrowserTab extends Tab { } } } - super.disposeExampleWidgets(); + super.disposeExampleWidgets(); } public static String getContents(InputStream in) throws IOException { BufferedReader br= new BufferedReader(new InputStreamReader(in)); - + StringBuffer sb= new StringBuffer(300); try { int read= 0; @@ -235,7 +235,7 @@ class BrowserTab extends Tab { /** * Gets the list of custom event names. - * + * * @return an array containing custom event names */ String [] getCustomEventNames () { @@ -243,7 +243,7 @@ class BrowserTab extends Tab { "OpenWindowListener", "ProgressListener", "StatusTextListener", "TitleListener", "VisibilityWindowListener"}; } - + /** * Gets the "Example" widget children. */ @@ -266,19 +266,19 @@ class BrowserTab extends Tab { String getTabText () { return "Browser"; } - + /** * Hooks the custom listener specified by eventName. */ void hookCustomListener (final String eventName) { if (browser == null) return; - if (eventName == "AuthenticationListener") { - browser.addAuthenticationListener(new AuthenticationListener () { - public void authenticate(AuthenticationEvent event) { - log (eventName, event); - } - }); - } +// if (eventName == "AuthenticationListener") { +// browser.addAuthenticationListener(new AuthenticationListener () { +// public void authenticate(AuthenticationEvent event) { +// log (eventName, event); +// } +// }); +// } if (eventName == "CloseWindowListener") { browser.addCloseWindowListener (new CloseWindowListener () { public void close(WindowEvent event) { @@ -342,7 +342,7 @@ class BrowserTab extends Tab { boolean rtlSupport() { return false; } - + /** * Sets the state of the "Example" widgets. */ diff --git a/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/ControlExample.java b/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/ControlExample.java index 5ae435bec..d47460ba9 100644 --- a/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/ControlExample.java +++ b/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/ControlExample.java @@ -62,7 +62,7 @@ public class ControlExample { /** * Creates an instance of a ControlExample embedded inside * the supplied parent Composite. - * + * * @param parent the container of the example */ public ControlExample(Composite parent) { @@ -75,8 +75,8 @@ public class ControlExample { item.setControl (tabs [i].createTabFolderPage (tabFolder)); item.setData (tabs [i]); } - -//FIXME PORTING TO FX + +//FIXME PORTING TO FX // /* Workaround: if the tab folder is wider than the screen, // * Mac platforms clip instead of somehow scrolling the tab items. // * We try to recover some width by using shorter tab names. */ @@ -121,14 +121,14 @@ public class ControlExample { // new ToolBarTab (this), // new ToolTipTab (this), new TreeTab (this), -// new BrowserTab (this), + new BrowserTab (this) }; } /** * Disposes of all resources associated with a particular * instance of the ControlExample. - */ + */ public void dispose() { /* * Destroy any shells that may have been created @@ -156,7 +156,7 @@ public class ControlExample { images = null; } } - + /** * Gets a string from the resource bundle. * We don't want to crash because of a missing String. @@ -169,7 +169,7 @@ public class ControlExample { return key; } catch (NullPointerException e) { return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$ - } + } } /** @@ -248,14 +248,14 @@ public class ControlExample { // instance.dispose(); // display.dispose(); } - + /** * Grabs input focus. */ public void setFocus() { tabFolder.setFocus(); } - + /** * Sets the size of the shell to it's "packed" size, * unless that makes it larger than the monitor it is being displayed on, @@ -266,7 +266,7 @@ public class ControlExample { //FIXME PORT TO FX Rectangle monitorArea = shell.getMonitor().getClientArea(); // shell.setSize(Math.min(size.x, monitorArea.width), Math.min(size.y, monitorArea.height)); } - - + + } diff --git a/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/browser-content.html b/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/browser-content.html new file mode 100644 index 000000000..c063fca33 --- /dev/null +++ b/experimental/swt/org.eclipse.fx.runtime.examples.swt/src/org/eclipse/swt/examples/controlexample/browser-content.html @@ -0,0 +1,8 @@ +<html> + <head> + <title>Hello SWT</title> + </head> + <body> + <h1>Hello SWT-Browser</h1> + </body> +</html>
\ No newline at end of file |