package myfirstrcp;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.Panel;
import javax.swing.JButton;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
public class SecondView extends ViewPart {
public static final String ID = "myfirstrcp.views.secondview";
public SecondView() {
// TODO Auto-generated constructor stub
this.setTitleImage(PlatformUI.getWorkbench().getSharedImages()
.getImage(ISharedImages.IMG_OBJ_FOLDER));
}
@Override
public void createPartControl(Composite parent) {
Display display = PlatformUI.getWorkbench().getDisplay();
Shell shell = new Shell(display);
shell.setText("SWT und AWT");
Composite comp = new Composite(shell, SWT.EMBEDDED);
Panel pan = new Panel();
pan.setLayout(new BorderLayout());
JButton btn2 = new JButton("asd");
pan.add(btn2, BorderLayout.CENTER);
Frame frame = SWT_AWT.new_Frame(comp);
frame.setLayout(new BorderLayout());
frame.add(pan, BorderLayout.CENTER);
GridLayout layout = new GridLayout();
shell.setLayout(layout);
shell.open();
}
@Override
public void setFocus() {
// TODO Auto-generated method stub
}
}