/** * Removes the page under the provided key from the page book. Does nothing * if page with that key does not exist. * * @param key * the page key. * @param showEmptyPage * if <code>true</code>, shows the empty page * after page removal. */ public void removePage(Object key, boolean showEmptyPage) { Control page = pages.get(key); if (page != null) { pages.remove(key); page.dispose(); if (showEmptyPage) showEmptyPage(); } } /**
/** * Removes the page under the provided key from the page book. Does nothing * if page with that key does not exist. * * @param key * the page key. * @param showEmptyPage * if <code>true</code>, shows the empty page * after page removal. */ public void removePage(Object key, boolean showEmptyPage) { Control page = pages.get(key); if (page != null) { pages.remove(key); page.dispose(); if (showEmptyPage) showEmptyPage(); } } /**
/** * Shows the page with the provided key and hides the page previously * showing. Does nothing if the page with that key does not exist. * * @param key * the page key */ public void showPage(Object key) { Control page = pages.get(key); if (page != null) { pageBook.showPage(page); if (currentPage != null && currentPage != page) { // switching pages - force layout if (page instanceof Composite) ((Composite) page).layout(false); } currentPage = page; } else { showEmptyPage(); } reflow(true); } /**
/** * Shows the page with the provided key and hides the page previously * showing. Does nothing if the page with that key does not exist. * * @param key * the page key */ public void showPage(Object key) { Control page = pages.get(key); if (page != null) { pageBook.showPage(page); if (currentPage != null && currentPage != page) { // switching pages - force layout if (page instanceof Composite) ((Composite) page).layout(false); } currentPage = page; } else { showEmptyPage(); } reflow(true); } /**
private void masterCheckChanged(boolean userChange) { boolean enabled = fTracingCheck.getSelection(); fPluginViewer.getTable().setEnabled(enabled); Control currentPage = fPageBook.getCurrentPage(); if (currentPage != null && enabled == false) { fPageBook.showEmptyPage(); } if (enabled) { fPluginViewer.setInput(getTraceableModels()); } int count = 0; if(fPluginViewer!=null) count = fPluginViewer.getTable().getItemCount(); fSelectAllButton.setEnabled(enabled && count > 0); fDeselectAllButton.setEnabled(enabled && count > 0); fRestoreDefaultButton.setEnabled(enabled && count > 0); fRestoreSelectedDefaultButton.setEnabled(!fPluginViewer.getStructuredSelection().isEmpty()); if (enabled == false) { fRestoreSelectedDefaultButton.setEnabled(false); } }
private void pluginSelected(IPluginModelBase model, boolean checked) { TracingPropertySource source = getPropertySource(model); if (source == null) { fPageBook.showEmptyPage(); } else { PageBookKey key = new PageBookKey(model, checked); if (!fPageBook.hasPage(key) || source.isChanged()) { Composite parent = fPageBook.createPage(key); source.createContents(parent, checked); source.setChanged(false); } fPageBook.showPage(key); } }