KickJava   Java API By Example, From Geeks To Geeks.

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


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.actions.SelectionUtils;
25 import org.apache.directory.ldapstudio.browser.core.model.ISearch;
26 import org.eclipse.jface.viewers.IStructuredSelection;
27 import org.eclipse.jface.wizard.Wizard;
28 import org.eclipse.ui.IExportWizard;
29 import org.eclipse.ui.IWorkbench;
30 import org.eclipse.ui.PlatformUI;
31
32
33 /**
34  * This class is a base implementation of the export wizard.
35  *
36  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
37  * @version $Rev$, $Date$
38  */

39 public abstract class ExportBaseWizard extends Wizard implements IExportWizard
40 {
41
42     /** The export filename. */
43     protected String JavaDoc exportFilename = "";
44
45     /** The search. */
46     protected ISearch search;
47
48
49     /**
50      * Creates a new instance of ExportBaseWizard.
51      *
52      * @param title the title
53      */

54     public ExportBaseWizard( String JavaDoc title )
55     {
56         super();
57         setWindowTitle( title );
58         init( null, ( IStructuredSelection ) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService()
59             .getSelection() );
60     }
61
62
63     /**
64      * {@inheritDoc}
65      */

66     public void init( IWorkbench workbench, IStructuredSelection selection )
67     {
68         search = SelectionUtils.getExampleSearch( selection );
69         search.setName( null );
70         exportFilename = "";
71     }
72
73
74     /**
75      * Sets the export filename.
76      *
77      * @param exportFilename the export filename
78      */

79     public void setExportFilename( String JavaDoc exportFilename )
80     {
81         this.exportFilename = exportFilename;
82     }
83
84
85     /**
86      * Gets the export filename.
87      *
88      * @return the export filename
89      */

90     public String JavaDoc getExportFilename()
91     {
92         return exportFilename;
93     }
94
95
96     /**
97      * Gets the search.
98      *
99      * @return the search
100      */

101     public ISearch getSearch()
102     {
103         return search;
104     }
105
106
107     /**
108      * Sets the search.
109      *
110      * @param search the search
111      */

112     public void setSearch( ISearch search )
113     {
114         this.search = search;
115     }
116
117 }
118
Popular Tags