/** Update the title bar of the contributor has a label provider. */ protected void refreshTitleBar() { if (hasTitleBar) { final TabbedPropertyTitle title = tabbedPropertyComposite.getTitle(); if (currentTab == null) { /** * No tabs are shown so hide the title bar, otherwise you see "No properties available" and * a title bar for the selection. */ title.setTitle(null, null); } else { final String text = registry.getLabelProvider().getText(currentSelection); final Image image = registry.getLabelProvider().getImage(currentSelection); title.setTitle(text, image); } } }
/** * Helper method for creating property tab composites. * * @return the property tab composite. */ private Composite createTabComposite() { final Composite result = widgetFactory.createComposite(tabbedPropertyComposite.getTabComposite(), SWT.NO_FOCUS); result.setVisible(false); result.setLayout(new FillLayout()); final FormData data = new FormData(); if (hasTitleBar) { data.top = new FormAttachment(tabbedPropertyComposite.getTitle(), 0); } else { data.top = new FormAttachment(0, 0); } data.bottom = new FormAttachment(100, 0); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(100, 0); result.setLayoutData(data); return result; }