1 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 41 public class ExportLdifToWizardPage extends ExportBaseToPage 42 { 43 44 45 private static final String [] EXTENSIONS = new String [] 46 { "*.ldif", "*.*" }; 47 48 49 55 public ExportLdifToWizardPage( String pageName, ExportBaseWizard wizard ) 56 { 57 super( pageName, wizard ); 58 setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor( 59 BrowserUIConstants.IMG_EXPORT_LDIF_WIZARD ) ); 60 } 61 62 63 66 public void createControl( Composite parent ) 67 { 68 final Composite composite = BaseWidgetUtils.createColumnContainer( parent, 3, 1 ); 69 super.createControl( composite ); 70 71 BaseWidgetUtils.createSpacer( composite, 3 ); 72 73 BaseWidgetUtils.createSpacer( composite, 1 ); 74 String text = "See <a>Text Formats</a> for LDIF file format preferences."; 75 Link link = BaseWidgetUtils.createLink( composite, text, 2 ); 76 link.addSelectionListener( new SelectionAdapter() 77 { 78 public void widgetSelected( SelectionEvent e ) 79 { 80 PreferencesUtil.createPreferenceDialogOn( getShell(), TextFormatsPreferencePage.class.getName(), null, 81 TextFormatsPreferencePage.LDIF_TAB ).open(); 82 } 83 } ); 84 } 85 86 87 90 protected String [] getExtensions() 91 { 92 return EXTENSIONS; 93 } 94 95 96 99 protected String getFileType() 100 { 101 return "LDIF"; 102 } 103 104 } 105 | Popular Tags |