Java Code Examples for org.eclipse.ui.part.PageBook#setLayoutData()

The following examples show how to use org.eclipse.ui.part.PageBook#setLayoutData() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContentPanel.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
public ContentPanel(Composite parent, int style) {
  super(parent, style);

  GridLayout layout = new GridLayout();
  layout.marginHeight = 0;
  layout.marginWidth = 0;
  layout.horizontalSpacing = 0;
  layout.verticalSpacing = 0;
  setLayout(layout);
  GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
  setLayoutData(layoutData);

  pageBook = new PageBook(this, SWT.NONE);
  // pageBook.setLayout(new GridLayout());
  pageBook.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

  EMPTY_PANEL = new Composite(pageBook, SWT.NONE);
  EMPTY_PANEL.setLayout(new GridLayout());
}
 
Example 2
Source File: WhiteSpaceTabPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public void createContents(int numColumns, Composite parent) {

            fPageBook= new PageBook(parent, SWT.NONE);
            fPageBook.setLayoutData(createGridData(numColumns, GridData.FILL_BOTH, SWT.DEFAULT));

            fJavaElementComponent.createContents(numColumns, fPageBook);
            fSyntaxComponent.createContents(numColumns, fPageBook);

            fSwitchCombo= new Combo(parent, SWT.READ_ONLY);
    		SWTUtil.setDefaultVisibleItemCount(fSwitchCombo);
            final GridData gd= createGridData(numColumns, GridData.HORIZONTAL_ALIGN_END, SWT.DEFAULT);
            fSwitchCombo.setLayoutData(gd);
            fSwitchCombo.setItems(fItems);
        }
 
Example 3
Source File: ReferenceSearchViewPage.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void createControl(Composite parent) {
	pagebook = new PageBook(parent, SWT.NULL);
	pagebook.setLayoutData(new GridData(GridData.FILL_BOTH));
	busyLabel = new Table(pagebook, SWT.NONE);
	TableItem item = new TableItem(busyLabel, SWT.NONE);
	item.setText(Messages.ReferenceSearchViewPage_busyLabel);
	busyLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	control = new Composite(pagebook, SWT.NULL);
	control.setLayoutData(new GridData(GridData.FILL_BOTH));
	control.setSize(100, 100);
	control.setLayout(new FillLayout());
	viewer = new TreeViewer(control, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	viewer.setContentProvider(contentProvider);
	viewer.setLabelProvider(labelProvider);
	viewer.setComparator(sorter);
	createOpenAndLinkWithEditorHandler();
	IToolBarManager tbm = getSite().getActionBars().getToolBarManager();
	fillToolbar(tbm);
	tbm.update(true);
	pagebook.showPage(control);
	isBusyShowing = false;
	queryListener = createQueryListener();
	NewSearchUI.addQueryListener(queryListener);

	menu = new MenuManager("#PopUp"); //$NON-NLS-1$
	menu.setRemoveAllWhenShown(true);
	menu.setParent(getSite().getActionBars().getMenuManager());
	menu.addMenuListener(mgr -> {
		fillContextMenu(mgr);
		part.fillContextMenu(mgr);
	});

	viewer.getControl().setMenu(menu.createContextMenu(viewer.getControl()));
	viewer.getControl().addKeyListener(KeyListener.keyPressedAdapter(e -> {
		if (e.keyCode == SWT.DEL) {
			removeSelectedMatchesAction.run();
		} else if ((e.stateMask | SWT.COMMAND) != 0 && e.keyCode == 'c') {
			copyAction.run();
		}
	}));
}