List of usage examples for org.eclipse.jface.preference IPreferencePageContainer IPreferencePageContainer
IPreferencePageContainer
From source file:org.polymap.core.data.ui.PipelinePropertyPage.java
License:Open Source License
protected void showPropertyPage(PipelineProcessorConfiguration config) throws CoreException { if (propertyPage != null) { propertyPage.performOk();//from w w w . java 2s . c om propertyPage.dispose(); propertyPage = null; } for (Control child : propertiesSection.getChildren()) { child.dispose(); } if (config == null) { return; } ProcessorExtension ext = ProcessorExtension.forExtensionId(config.getExtensionId()); try { if (ext == null) { Label l = new Label(propertiesSection, SWT.NONE); l.setText(Messages.get("PipelinePropertyPage_noExtension")); } else if (ext.hasPropertyPage()) { propertyPage = ext.newPropertyPage(); PipelineHolder elm = (PipelineHolder) getElement(); propertyPage.init(elm, config.getConfig()); propertyPage.createControl(propertiesSection); propertyPage.setContainer(new IPreferencePageContainer() { public void updateTitle() { setTitle(propertyPage.getTitle()); } public void updateMessage() { if (propertyPage.getErrorMessage() != null) { setMessage(propertyPage.getErrorMessage(), ERROR); } else if (propertyPage.getMessage() != null) { setMessage(propertyPage.getMessage(), INFORMATION); } else { setMessage(null); } } public void updateButtons() { setValid(propertyPage.isValid()); } public IPreferenceStore getPreferenceStore() { return null; } }); } else { Label l = new Label(propertiesSection, SWT.NONE); l.setText(Messages.get("PipelinePropertyPage_noConfig")); } propertiesSection.getParent().layout(true); propertiesSection.layout(true); } catch (Exception e) { // XXX Auto-generated catch block } }