Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-03-24 13:43:07 +0000
committerAlexander Kurtakov2015-03-24 13:44:42 +0000
commitc960df6b62e9426b739c594dada003881c25b7cf (patch)
treea497c399d2bb8e425f736b8895915c9add8705fb /bundles/org.eclipse.swt/Eclipse SWT Browser
parent6c4a00defbeebee83c7c96074120ee83d3c45bbe (diff)
downloadeclipse.platform.swt-c960df6b62e9426b739c594dada003881c25b7cf.tar.gz
eclipse.platform.swt-c960df6b62e9426b739c594dada003881c25b7cf.tar.xz
eclipse.platform.swt-c960df6b62e9426b739c594dada003881c25b7cf.zip
Bug 455263 - Retire Eclipse SWT/wpf
Remove wpf browser/program and build support. Change-Id: I7790f5bb70665666671c6b8dc5880b46000a7a9a Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Browser')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/BrowserFactory.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/IE.java280
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/BrowserFactory.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/IE.java220
4 files changed, 0 insertions, 544 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/BrowserFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/BrowserFactory.java
deleted file mode 100644
index 6dd076ed32..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/BrowserFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.SWT;
-
-class BrowserFactory {
-
-WebBrowser createWebBrowser (int style) {
- if ((style & (SWT.MOZILLA | SWT.WEBKIT)) != 0) return null;
- return new IE ();
-}
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/IE.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/IE.java
deleted file mode 100644
index 5384ab91e3..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/forms/org/eclipse/swt/browser/IE.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.internal.wpf.*;
-import org.eclipse.swt.widgets.*;
-
-class IE extends WebBrowser {
-
- int webBrowser, host, jniRef;
-
- boolean ignoreDispose;
-
- static {
- NativeClearSessions = new Runnable() {
- public void run() {
-// OS.InternetSetOption (0, OS.INTERNET_OPTION_END_BROWSER_SESSION, 0, 0);
- }
- };
- }
-
-public void create(Composite parent, int style) {
- host = OS.gcnew_WindowsFormsHost();
- if (host == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- webBrowser = OS.gcnew_WebBrowser();
- if (webBrowser == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- OS.WindowsFormsHost_Child(host, webBrowser);
- jniRef = OS.NewGlobalRef(this);
- if (jniRef == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- OS.WebBrowser_ScriptErrorsSuppressed(webBrowser, true);
- int handler = OS.gcnew_WebBrowserNavigatingEventHandler(jniRef, "HandleNavigating");
- OS.WebBrowser_Navigating(webBrowser, handler);
- OS.GCHandle_Free(handler);
- handler = OS.gcnew_WebBrowserProgressChangedEventHandler(jniRef, "HandleProgressChanged");
- OS.WebBrowser_ProgressChanged(webBrowser, handler);
- OS.GCHandle_Free(handler);
- handler = OS.gcnew_EventHandler(jniRef, "HandleStatusTextChanged");
- OS.WebBrowser_StatusTextChanged(webBrowser, handler);
- OS.GCHandle_Free(handler);
- handler = OS.gcnew_EventHandler(jniRef, "HandleDocumentTitleChanged");
- OS.WebBrowser_DocumentTitleChanged(webBrowser, handler);
- OS.GCHandle_Free(handler);
- handler = OS.gcnew_WebBrowserDocumentCompletedEventHandler(jniRef, "HandleDocumentCompleted");
- OS.WebBrowser_DocumentCompleted(webBrowser, handler);
- OS.GCHandle_Free(handler);
-
- int parentHandle = browser.handle;
- int children = OS.Panel_Children(parentHandle);
- OS.UIElementCollection_Insert(children, 0, host);
- OS.GCHandle_Free(children);
- OS.FrameworkElement_Width(host, OS.FrameworkElement_Width(parentHandle));
- OS.FrameworkElement_Height(host, OS.FrameworkElement_Height(parentHandle));
-
- Listener listener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.Dispose: {
- if (ignoreDispose) {
- ignoreDispose = false;
- break;
- }
- ignoreDispose = true;
- browser.notifyListeners (event.type, event);
- event.type = SWT.NONE;
- OS.GCHandle_Free(host);
- OS.GCHandle_Free(webBrowser);
- OS.DeleteGlobalRef(jniRef);
- host = webBrowser = jniRef = 0;
- break;
- }
- case SWT.Resize: {
- OS.FrameworkElement_Width(host, OS.FrameworkElement_Width(browser.handle));
- OS.FrameworkElement_Height(host, OS.FrameworkElement_Height(browser.handle));
- break;
- }
- }
- }
- };
- browser.addListener(SWT.Resize, listener);
- browser.addListener(SWT.Dispose, listener);
-}
-
-public boolean back() {
- return OS.WebBrowser_GoBack(webBrowser);
-}
-
-public boolean execute(String script) {
-// int document = OS.WebBrowser_Document(frame);
-// int length = script.length ();
-// char [] buffer = new char [length + 1];
-// script.getChars (0, length, buffer, 0);
-// int str = OS.gcnew_String (buffer);
-// int result = OS.HtmlDocument_InvokeScript(document, str);
-// OS.GCHandle_Free(result);
-// OS.GCHandle_Free(str);
-// OS.GCHandle_Free(document);
- return true;
-}
-
-public boolean forward() {
- return OS.WebBrowser_GoForward(webBrowser);
-}
-
-public String getBrowserType () {
- return "ie"; //$NON-NLS-1$
-}
-
-public String getText () {
- // TODO
- return ""; //$NON-NLS-1$
-}
-
-public String getUrl() {
- int uri = OS.WebBrowser_Url(webBrowser);
- String url = getUriString (uri);
- if (uri != 0) OS.GCHandle_Free(uri);
- return url;
-}
-
-String getUriString(int uri) {
- if (uri == 0) return null;
- int str = OS.Object_ToString(uri);
- int charArray = OS.String_ToCharArray(str);
- char[] chars = new char[OS.String_Length(str)];
- OS.memcpy(chars, charArray, chars.length * 2);
- OS.GCHandle_Free(charArray);
- String url = new String(chars);
- OS.GCHandle_Free(str);
- return url;
-}
-
-void HandleDocumentCompleted(int sender, int e) {
- if (webBrowser == 0) return;
- int uri = OS.WebBrowserDocumentCompletedEventArgs_Url(e);
- String url = getUriString (uri);
- if (uri != 0) OS.GCHandle_Free(uri);
- LocationEvent newEvent = new LocationEvent(browser);
- newEvent.display = browser.getDisplay();
- newEvent.widget = browser;
- newEvent.location = url;
- newEvent.doit = true;
- for (int i = 0; i < locationListeners.length; i++) {
- locationListeners[i].changing(newEvent);
- }
- if (browser.isDisposed()) return;
- ProgressEvent progressEvent = new ProgressEvent(browser);
- progressEvent.display = browser.getDisplay();
- progressEvent.widget = browser;
- for (int i = 0; i < progressListeners.length; i++) {
- progressListeners[i].completed(progressEvent);
- }
-}
-
-void HandleDocumentTitleChanged(int sender, int e) {
- if (webBrowser == 0) return;
- int str = OS.WebBrowser_DocumentTitle(webBrowser);
- String title = "";
- if (str != 0) {
- int charArray = OS.String_ToCharArray(str);
- char[] chars = new char[OS.String_Length(str)];
- OS.memcpy(chars, charArray, chars.length * 2);
- OS.GCHandle_Free(charArray);
- OS.GCHandle_Free(str);
- title = new String(chars);
- }
- TitleEvent newEvent = new TitleEvent(browser);
- newEvent.display = browser.getDisplay();
- newEvent.widget = browser;
- newEvent.title = title;
- for (int i = 0; i < titleListeners.length; i++) {
- titleListeners[i].changed(newEvent);
- }
-}
-
-void HandleNavigating(int sender, int e) {
- if (webBrowser == 0) return;
- int uri = OS.WebBrowserNavigatingEventArgs_Url(e);
- String url = getUriString (uri);
- if (uri != 0) OS.GCHandle_Free(uri);
- LocationEvent newEvent = new LocationEvent(browser);
- newEvent.display = browser.getDisplay();
- newEvent.widget = browser;
- newEvent.location = url;
- newEvent.doit = true;
- for (int i = 0; i < locationListeners.length; i++) {
- locationListeners[i].changing(newEvent);
- }
-}
-
-void HandleProgressChanged(int sender, int e) {
- if (webBrowser == 0) return;
- long nProgress = OS.WebBrowserProgressChangedEventArgs_CurrentProgress(e);
- long nProgressMax = OS.WebBrowserProgressChangedEventArgs_MaximumProgress(e);
- if (nProgress != -1) {
- ProgressEvent newEvent = new ProgressEvent(browser);
- newEvent.display = browser.getDisplay();
- newEvent.widget = browser;
- newEvent.current = (int)nProgress;
- newEvent.total = (int)nProgressMax;
- for (int i = 0; i < progressListeners.length; i++) {
- progressListeners[i].changed(newEvent);
- }
- }
-}
-
-void HandleStatusTextChanged(int sender, int e) {
- if (webBrowser == 0) return;
- int str = OS.WebBrowser_StatusText(webBrowser);
- String text = "";
- if (str != 0) {
- int charArray = OS.String_ToCharArray(str);
- char[] chars = new char[OS.String_Length(str)];
- OS.memcpy(chars, charArray, chars.length * 2);
- OS.GCHandle_Free(charArray);
- OS.GCHandle_Free(str);
- text = new String(chars);
- }
- StatusTextEvent newEvent = new StatusTextEvent(browser);
- newEvent.display = browser.getDisplay();
- newEvent.widget = browser;
- newEvent.text = text;
- for (int i = 0; i < statusTextListeners.length; i++) {
- statusTextListeners[i].changed(newEvent);
- }
-}
-
-public boolean isBackEnabled() {
- return OS.WebBrowser_CanGoBack(webBrowser);
-}
-
-public boolean isForwardEnabled() {
- return OS.WebBrowser_CanGoForward(webBrowser);
-}
-
-public void refresh() {
- OS.WebBrowser_Refresh(webBrowser);
-}
-
-public boolean setText(String html, boolean trusted) {
- int state = OS.WebBrowser_ReadyState(webBrowser);
- if (!(state == OS.WebBrowserReadyState_Uninitialized || state == OS.WebBrowserReadyState_Complete)) {
- OS.WebBrowser_Stop(webBrowser);
- }
- int length = html.length ();
- char [] buffer = new char [length + 1];
- html.getChars (0, length, buffer, 0);
- int str = OS.gcnew_String (buffer);
- if (str == 0) SWT.error (SWT.ERROR_NO_HANDLES);
- OS.WebBrowser_DocumentText(webBrowser, str);
- OS.GCHandle_Free(str);
- return true;
-}
-
-public boolean setUrl(String url, String postData, String[] headers) {
- int state = OS.WebBrowser_ReadyState(webBrowser);
- if (!(state == OS.WebBrowserReadyState_Uninitialized || state == OS.WebBrowserReadyState_Complete)) {
- OS.WebBrowser_Stop(webBrowser);
- }
- int length = url.length ();
- char [] buffer = new char [length + 1];
- url.getChars (0, length, buffer, 0);
- int str = OS.gcnew_String (buffer);
- OS.WebBrowser_Navigate(webBrowser, str);
- OS.GCHandle_Free(str);
- return true;
-}
-
-public void stop() {
- OS.WebBrowser_Stop(webBrowser);
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/BrowserFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/BrowserFactory.java
deleted file mode 100644
index 6dd076ed32..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/BrowserFactory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.SWT;
-
-class BrowserFactory {
-
-WebBrowser createWebBrowser (int style) {
- if ((style & (SWT.MOZILLA | SWT.WEBKIT)) != 0) return null;
- return new IE ();
-}
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/IE.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/IE.java
deleted file mode 100644
index 57c1d5ec5d..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/wpf/org/eclipse/swt/browser/IE.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.internal.wpf.*;
-import org.eclipse.swt.widgets.*;
-
-class IE extends WebBrowser {
-
- int frame;
-
- boolean ignoreDispose;
-
- static {
- NativeClearSessions = new Runnable() {
- public void run() {
-// OS.InternetSetOption (0, OS.INTERNET_OPTION_END_BROWSER_SESSION, 0, 0);
- }
- };
- }
-
-public void create(Composite parent, int style) {
- frame = OS.gcnew_Frame();
- if (frame == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- OS.Frame_NavigationUIVisibility(frame, OS.NavigationUIVisibility_Hidden);
- int parentHandle = browser.handle;
- int children = OS.Panel_Children(parentHandle);
- OS.UIElementCollection_Insert(children, 0, frame);
- OS.GCHandle_Free(children);
- OS.FrameworkElement_Width(frame, OS.FrameworkElement_Width(parentHandle));
- OS.FrameworkElement_Height(frame, OS.FrameworkElement_Height(parentHandle));
-
- Listener listener = new Listener() {
- public void handleEvent(Event event) {
- switch (event.type) {
- case SWT.Dispose: {
- if (ignoreDispose) {
- ignoreDispose = false;
- break;
- }
- ignoreDispose = true;
- browser.notifyListeners (event.type, event);
- event.type = SWT.NONE;
- OS.GCHandle_Free(frame);
- frame = 0;
- break;
- }
- case SWT.Resize: {
- OS.FrameworkElement_Width(frame, OS.FrameworkElement_Width(browser.handle));
- OS.FrameworkElement_Height(frame, OS.FrameworkElement_Height(browser.handle));
- break;
- }
- }
- }
- };
- browser.addListener(SWT.Resize, listener);
- browser.addListener(SWT.Dispose, listener);
-}
-
-public boolean back() {
- if (!OS.Frame_CanGoBack(frame)) return false;
- OS.Frame_GoBack(frame);
- return true;
-}
-
-public boolean execute(String script) {
-// /* get IHTMLDocument2 */
-// int[] rgdispid = auto.getIDsOfNames(new String[]{"Document"}); //$NON-NLS-1$
-// int dispIdMember = rgdispid[0];
-// Variant pVarResult = auto.getProperty(dispIdMember);
-// if (pVarResult == null || pVarResult.getType() == COM.VT_EMPTY) return false;
-// OleAutomation document = pVarResult.getAutomation();
-// pVarResult.dispose();
-//
-// /* get IHTMLWindow2 */
-// rgdispid = document.getIDsOfNames(new String[]{"parentWindow"}); //$NON-NLS-1$
-// if (rgdispid == null) {
-// /* implies that browser's content is not a IHTMLDocument2 (eg.- acrobat reader) */
-// document.dispose();
-// return false;
-// }
-// dispIdMember = rgdispid[0];
-// pVarResult = document.getProperty(dispIdMember);
-// OleAutomation ihtmlWindow2 = pVarResult.getAutomation();
-// pVarResult.dispose();
-// document.dispose();
-//
-// rgdispid = ihtmlWindow2.getIDsOfNames(new String[] { "execScript", "code" }); //$NON-NLS-1$ //$NON-NLS-2$
-// Variant[] rgvarg = new Variant[1];
-// rgvarg[0] = new Variant(script);
-// int[] rgdispidNamedArgs = new int[1];
-// rgdispidNamedArgs[0] = rgdispid[1];
-// pVarResult = ihtmlWindow2.invoke(rgdispid[0], rgvarg, rgdispidNamedArgs);
-// rgvarg[0].dispose();
-// ihtmlWindow2.dispose();
-// if (pVarResult == null) return false;
-// pVarResult.dispose();
- return true;
-}
-
-public boolean forward() {
- if (!OS.Frame_CanGoForward(frame)) return false;
- OS.Frame_GoForward(frame);
- return true;
-}
-
-public String getBrowserType () {
- return "ie"; //$NON-NLS-1$
-}
-
-public String getUrl() {
- int uri = OS.Frame_Source(frame);
- int str = OS.Object_ToString(uri);
- int charArray = OS.String_ToCharArray(str);
- char[] chars = new char[OS.String_Length(str)];
- OS.memcpy(chars, charArray, chars.length * 2);
- OS.GCHandle_Free(charArray);
- String url = new String(chars);
- OS.GCHandle_Free(str);
- OS.GCHandle_Free(uri);
- return url;
-}
-
-public boolean isBackEnabled() {
- return OS.Frame_CanGoBack(frame);
-}
-
-public boolean isForwardEnabled() {
- return OS.Frame_CanGoForward(frame);
-}
-
-public void refresh() {
- OS.Frame_Refresh(frame);
-}
-
-public boolean setText(String html, boolean trusted) {
- return true;
-// /*
-// * If the html field is non-null then the about:blank page is already being
-// * loaded, so no Stop or Navigate is required. Just set the html that is to
-// * be shown.
-// */
-// boolean blankLoading = this.html != null;
-// this.html = html;
-// if (blankLoading) return true;
-//
-// /*
-// * Navigate to the blank page and insert the given html when
-// * receiving the next DocumentComplete notification. See the
-// * MSDN article "Loading HTML content from a Stream".
-// *
-// * Note. Stop any pending request. This is required to avoid displaying a
-// * blank page as a result of consecutive calls to setUrl and/or setText.
-// * The previous request would otherwise render the new html content and
-// * reset the html field before the browser actually navigates to the blank
-// * page as requested below.
-// *
-// * Feature in Internet Explorer. Stopping pending requests when no request
-// * is pending causes a default page 'Action cancelled' to be displayed. The
-// * workaround is to not invoke 'stop' when no request has been set since
-// * that instance was created.
-// */
-// int[] rgdispid;
-// if (navigate) {
-// /*
-// * Stopping the loading of a page causes DocumentComplete events from previous
-// * requests to be received before the DocumentComplete for this page. In such
-// * cases we must be sure to not set the html into the browser too soon, since
-// * doing so could result in its page being cleared out by a subsequent
-// * DocumentComplete. The Browser's ReadyState can be used to determine whether
-// * these extra events will be received or not.
-// */
-// rgdispid = auto.getIDsOfNames(new String[] { "ReadyState" }); //$NON-NLS-1$
-// Variant pVarResult = auto.getProperty(rgdispid[0]);
-// if (pVarResult == null) return false;
-// delaySetText = pVarResult.getInt() != READYSTATE_COMPLETE;
-// pVarResult.dispose();
-// rgdispid = auto.getIDsOfNames(new String[] { "Stop" }); //$NON-NLS-1$
-// auto.invoke(rgdispid[0]);
-// }
-// rgdispid = auto.getIDsOfNames(new String[] { "Navigate", "URL" }); //$NON-NLS-1$ //$NON-NLS-2$
-// navigate = true;
-// Variant[] rgvarg = new Variant[1];
-// rgvarg[0] = new Variant(ABOUT_BLANK);
-// int[] rgdispidNamedArgs = new int[1];
-// rgdispidNamedArgs[0] = rgdispid[1];
-// Variant pVarResult = auto.invoke(rgdispid[0], rgvarg, rgdispidNamedArgs);
-// rgvarg[0].dispose();
-// if (pVarResult == null) return false;
-// boolean result = pVarResult.getType() == OLE.VT_EMPTY;
-// pVarResult.dispose();
-// return result;
-}
-
-public boolean setUrl(String url, String postData, String[] headers) {
- if (url.indexOf(':') == -1) url = "http://" + url;
- int length = url.length ();
- char [] buffer = new char [length + 1];
- url.getChars (0, length, buffer, 0);
- int str = OS.gcnew_String (buffer);
- int uri = OS.gcnew_Uri(str, OS.UriKind_RelativeOrAbsolute);
- OS.GCHandle_Free(str);
- boolean result = OS.Frame_Navigate(frame, uri);
- OS.GCHandle_Free(uri);
- return result;
-}
-
-public void stop() {
- OS.Frame_StopLoading (frame);
-}
-}

Back to the top