Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326805

Summary: CTRL+C CTRL+V shortcut bug in a Mozilla browser embedded in AWT SWT
Product: [Eclipse Project] Platform Reporter: zugasti <andre_zugasti>
Component: SWTAssignee: Grant Gayed <grant_gayed>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3    
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description zugasti CLA 2010-10-01 13:09:26 EDT
Hello, We've tried this snippet coming from your site with the last XULRunner version 1.9.2.10.

This does work with IE but not with Mozilla.

Any help would be greatfully appreciated.

Thanks in advance

package ccr.technique.components.panel;

/*
 * SWT_AWT example snippet: launch SWT from AWT and keep both active
 * 
 * For a list of all SWT example snippets see
 * http://www.eclipse.org/swt/snippets/
 */

import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;

import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Snippet337 {

public static void main(String args[]) {
	final Display display = new Display();

	EventQueue.invokeLater(new Runnable() {
		public void run() {
			JFrame mainFrame = new JFrame("Main Window");
			mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			JPanel mainPanel = new JPanel();
			mainPanel.setLayout(new FlowLayout());
			JButton launchBrowserButton = new JButton("Launch Browser");
			launchBrowserButton.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					JFrame childFrame = new JFrame();
					final Canvas canvas = new Canvas();
					childFrame.setSize(850, 650);
					childFrame.getContentPane().add(canvas);
					childFrame.setVisible(true);
					display.asyncExec(new Runnable() {
						public void run() {
							Shell shell = SWT_AWT.new_Shell(display, canvas);
							shell.setSize(800, 600);
							Browser browser = new Browser(shell, SWT.MOZILLA);
							browser.setLayoutData(new GridData(GridData.FILL_BOTH));
							browser.setSize(800, 600);
							browser.setUrl("http://www.eclipse.org");
							shell.open();
						}
					});
				}
			});

			mainPanel.add(new JTextField("a JTextField"));
			mainPanel.add(launchBrowserButton);
			mainFrame.getContentPane().add(mainPanel, BorderLayout.CENTER);
			mainFrame.pack();
			mainFrame.setVisible(true);
		}
	});
	while (true) {
		if (!display.readAndDispatch()) display.sleep();
	}
}

}
Comment 1 Alexander Kurtakov CLA 2017-07-04 13:37:44 EDT
Mozills support is removed in 4.8.