1

In my eclipse plugin I want to embed another frame. This frame should always have the same size as the view. So I want to find the current size of the view. But I couldn't find any method to do it. Any hints?

This is how I embed the frame:

public void createPartControl(Composite parent) {

        final Composite composite = new Composite(parent, SWT.EMBEDDED);
        final Frame frame = SWT_AWT.new_Frame(composite);
     //   frame.setResizable(true);

        ProcessingEmbedded pap = new ProcessingEmbedded();       
        Panel panel = new Panel();

        panel.add(pap);
        frame.add(panel);

        pap.init();

    }
  • By default, parents of workbench parts (incl. views) use FillLayout, so the frame should fill the view automatically. Are you sure that your problem is the size of the frame and not the _pap_? – Martti Käärik Dec 15 '11 at 18:46
  • I'm talking about that. I have to set the size of pap, but I don't know which size. That's why I want to know the size of the view –  Dec 15 '11 at 19:03

1 Answers1

2

Your problem is about layout in AWT. I believe this should do the job:

        panel.setLayout(new BorderLayout());
        panel.add(pap, BorderLayout.CENTER);
Martti Käärik
  • 3,601
  • 18
  • 28