1 20 21 package org.apache.directory.ldapstudio; 22 23 24 import org.eclipse.jface.dialogs.Dialog; 25 import org.eclipse.jface.dialogs.TrayDialog; 26 import org.eclipse.jface.resource.ImageDescriptor; 27 import org.eclipse.jface.resource.ImageRegistry; 28 import org.eclipse.jface.resource.JFaceResources; 29 import org.eclipse.ui.PlatformUI; 30 import org.eclipse.ui.application.IWorkbenchConfigurer; 31 import org.eclipse.ui.application.IWorkbenchWindowConfigurer; 32 import org.eclipse.ui.application.WorkbenchAdvisor; 33 import org.eclipse.ui.application.WorkbenchWindowAdvisor; 34 35 36 54 public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor 55 { 56 private static final String PERSPECTIVE_ID = Application.PLUGIN_ID + ".perspective"; 59 60 70 public void initialize( IWorkbenchConfigurer configurer ) 71 { 72 configurer.setSaveAndRestore( true ); 74 75 TrayDialog.setDialogHelpAvailable( true ); 77 ImageRegistry reg = JFaceResources.getImageRegistry(); 78 ImageDescriptor helpImage = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor( 79 "IMGS_LCL_LINKTO_HELP" ); 80 reg.put( Dialog.DLG_IMG_HELP, helpImage ); 81 } 82 83 84 90 public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor( IWorkbenchWindowConfigurer configurer ) 91 { 92 return new ApplicationWorkbenchWindowAdvisor( configurer ); 93 } 94 95 96 107 public String getInitialWindowPerspectiveId() 108 { 109 return PERSPECTIVE_ID; 110 } 111 112 113 121 public boolean preShutdown() 122 { 123 return true; 124 } 125 126 } 127 | Popular Tags |