/** * Create a Form for holding pages without navigation. * * @param pageBook */ public void createPartControl(ScrolledPageBook mainPageBook, SharedStyleManager sharedStyleManager) { // Cash the shared style manager. We need to pass it around to category // forms. So, do not null it! // this.sharedStyleManager = sharedStyleManager; // creating page in Main page book. pageForm = toolkit.createForm(mainPageBook.getContainer()); mainPageBook.registerPage(getId(), pageForm); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; pageForm.getBody().setLayout(layout); // Util.highlight(pageForm.getBody(), SWT.COLOR_RED); // Get form body. Form body is one column grid layout. Add page book // and navigation UI to it. categoryPageBook = toolkit.createPageBook(pageForm.getBody(), SWT.H_SCROLL | SWT.V_SCROLL); categoryPageBook.setLayoutData(new GridData(GridData.FILL_BOTH)); // pageForm.setText(rootPageStyleManager.getPageSubTitle()); }
/** * Create the form for the root page. Number of columns there is equal to * the number of links. * * @param pageBook */ public void createPartControl(ScrolledPageBook mainPageBook, SharedStyleManager shardStyleManager) { // first, create the root page style manager from shared style manager. rootPageStyleManager = new PageStyleManager(rootPage, shardStyleManager .getProperties()); // Set title of Main form from root page title. parentForm.setText(rootPage.getTitle()); // Composite for full root page. It has custom layout, and two // children: the content composite and the description label. Composite rootPageComposite = new PageComposite(mainPageBook .getContainer(), SWT.NULL); toolkit.adapt(rootPageComposite); mainPageBook.registerPage(rootPage.getId(), rootPageComposite); rootPageComposite.setLayout(new RootPageLayout()); // Util.highlight(pageComposite, SWT.COLOR_DARK_CYAN); // create the contents composite in the center of the root page. createRootPageContent(rootPageComposite); // create description label for links description. descriptionLabel = createHoverLabel(rootPageComposite); // Clear memory. No need for style manager any more. rootPageStyleManager = null; }