KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > ui > wizards > ExportBaseFromWizardPage


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

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 /**
33  * This class is a base implementation of the page to select the data to export.
34  *
35  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
36  * @version $Rev$, $Date$
37  */

38 public abstract class ExportBaseFromWizardPage extends WizardPage implements WidgetModifyListener
39 {
40
41     /** The wizard. */
42     protected ExportBaseWizard wizard;
43
44     /** The search page wrapper. */
45     protected SearchPageWrapper spw;
46
47
48     /**
49      * Creates a new instance of ExportBaseFromWizardPage.
50      *
51      * @param spw the search page wrapper
52      * @param pageName the page name
53      * @param wizard the wizard
54      */

55     public ExportBaseFromWizardPage( String JavaDoc 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     /**
68      * {@inheritDoc}
69      */

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     /**
83      * Validates this page
84      */

85     protected void validate()
86     {
87         setPageComplete( spw.isValid() );
88     }
89
90
91     /**
92      * {@inheritDoc}
93      */

94     public void widgetModified( WidgetModifyEvent event )
95     {
96         validate();
97     }
98
99
100     /**
101      * Saves the dialog settings.
102      */

103     public void saveDialogSettings()
104     {
105         spw.saveToSearch( wizard.getSearch() );
106     }
107
108 }
109
Popular Tags