Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. public void createPartControl(Composite parent) {
  2. // make a grid layout with two columns: one for a table, the other for a composite containing buttons
  3. GridLayout layout = new GridLayout(2, true);
  4. parent.setLayout(layout);
  5.  
  6. // create the composite containing the table. we make a composite to use TableColumnLayout
  7. Composite comp = createHeaderTable(parent);
  8. comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
  9.  
  10. // create a composite for rows of buttons
  11. comp = new Composite(parent, SWT.NONE);
  12. layout = new GridLayout(1, true);
  13. comp.setLayout(layout);
  14. Button b = new Button(comp, SWT.PUSH);
  15. b.setText("create");
  16. b.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
  17. b = new Button(comp, SWT.PUSH);
  18. b.setText("remove");
  19. b.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
  20. b = new Button(comp, SWT.PUSH);
  21. b.setText("move up");
  22. b.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
  23. b = new Button(comp, SWT.PUSH);
  24. b.setText("move down");
  25. b.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
  26. comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
  27. comp.pack();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement