KickJava   Java API By Example, From Geeks To Geeks.

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


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.dialogs.preferences.TextFormatsPreferencePage;
25 import org.apache.directory.ldapstudio.browser.common.widgets.BaseWidgetUtils;
26 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
27 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
28 import org.eclipse.swt.events.SelectionAdapter;
29 import org.eclipse.swt.events.SelectionEvent;
30 import org.eclipse.swt.widgets.Composite;
31 import org.eclipse.swt.widgets.Link;
32 import org.eclipse.ui.dialogs.PreferencesUtil;
33
34
35 /**
36  * This class implements the page to select the target Excel file.
37  *
38  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
39  * @version $Rev$, $Date$
40  */

41 public class ExportExcelToWizardPage extends ExportBaseToPage
42 {
43
44     /** The extensions used by Excel files */
45     private static final String JavaDoc[] EXTENSIONS = new String JavaDoc[]
46         { "*.xls", "*.*" };
47
48
49     /**
50      * Creates a new instance of ExportExcelToWizardPage.
51      *
52      * @param pageName the page name
53      * @param wizard the wizard
54      */

55     public ExportExcelToWizardPage( String JavaDoc pageName, ExportBaseWizard wizard )
56     {
57         super( pageName, wizard );
58         setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_EXPORT_XLS_WIZARD ) );
59     }
60
61
62     /**
63      * {@inheritDoc}
64      */

65     public void createControl( Composite parent )
66     {
67         final Composite composite = BaseWidgetUtils.createColumnContainer( parent, 3, 1 );
68         super.createControl( composite );
69
70         BaseWidgetUtils.createSpacer( composite, 3 );
71
72         BaseWidgetUtils.createSpacer( composite, 1 );
73         String JavaDoc text = "See <a>Text Formats</a> for Excel file format preferences.";
74         Link link = BaseWidgetUtils.createLink( composite, text, 2 );
75         link.addSelectionListener( new SelectionAdapter()
76         {
77             public void widgetSelected( SelectionEvent e )
78             {
79                 PreferencesUtil.createPreferenceDialogOn( getShell(), TextFormatsPreferencePage.class.getName(), null,
80                     TextFormatsPreferencePage.XLS_TAB ).open();
81             }
82         } );
83
84         BaseWidgetUtils.createSpacer( composite, 3 );
85         BaseWidgetUtils.createSpacer( composite, 1 );
86         BaseWidgetUtils.createWrappedLabel( composite,
87             "Warning: Excel export is memory intensive! Maximum number of exportable entries is limited to 65000!", 2 );
88     }
89
90
91     /**
92      * {@inheritDoc}
93      */

94     protected String JavaDoc[] getExtensions()
95     {
96         return EXTENSIONS;
97     }
98
99
100     /**
101      * {@inheritDoc}
102      */

103     protected String JavaDoc getFileType()
104     {
105         return "Excel";
106     }
107
108 }
109
Popular Tags