1 20 21 package org.apache.directory.ldapstudio.browser.ui.wizards; 22 23 24 import org.apache.directory.ldapstudio.browser.common.widgets.BaseWidgetUtils; 25 import org.apache.directory.ldapstudio.browser.common.widgets.WidgetModifyEvent; 26 import org.apache.directory.ldapstudio.browser.common.widgets.WidgetModifyListener; 27 import org.apache.directory.ldapstudio.browser.common.widgets.search.SearchPageWrapper; 28 import org.eclipse.jface.wizard.WizardPage; 29 import org.eclipse.swt.widgets.Composite; 30 31 32 38 public abstract class ExportBaseFromWizardPage extends WizardPage implements WidgetModifyListener 39 { 40 41 42 protected ExportBaseWizard wizard; 43 44 45 protected SearchPageWrapper spw; 46 47 48 55 public ExportBaseFromWizardPage( String pageName, ExportBaseWizard wizard, SearchPageWrapper spw ) 56 { 57 super( pageName ); 58 setTitle( "Data to Export" ); 59 setDescription( "Please define search parameters for the export." ); 60 setPageComplete( true ); 61 62 this.wizard = wizard; 63 this.spw = spw; 64 } 65 66 67 70 public void createControl( Composite parent ) 71 { 72 Composite composite = BaseWidgetUtils.createColumnContainer( parent, 3, 1 ); 73 74 spw.createContents( composite ); 75 spw.loadFromSearch( wizard.getSearch() ); 76 spw.addWidgetModifyListener( this ); 77 78 setControl( composite ); 79 } 80 81 82 85 protected void validate() 86 { 87 setPageComplete( spw.isValid() ); 88 } 89 90 91 94 public void widgetModified( WidgetModifyEvent event ) 95 { 96 validate(); 97 } 98 99 100 103 public void saveDialogSettings() 104 { 105 spw.saveToSearch( wizard.getSearch() ); 106 } 107 108 } 109 | Popular Tags |