1 11 package org.eclipse.jdt.internal.ui.wizards.buildpaths; 12 13 import java.net.URL ; 14 15 import org.eclipse.core.runtime.IStatus; 16 17 import org.eclipse.swt.SWT; 18 import org.eclipse.swt.layout.GridData; 19 import org.eclipse.swt.widgets.Composite; 20 import org.eclipse.swt.widgets.Control; 21 import org.eclipse.swt.widgets.Shell; 22 23 import org.eclipse.jface.dialogs.StatusDialog; 24 25 import org.eclipse.ui.PlatformUI; 26 27 import org.eclipse.jdt.internal.corext.util.Messages; 28 29 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 30 import org.eclipse.jdt.internal.ui.preferences.JavadocConfigurationBlock; 31 import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; 32 import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; 33 34 37 public class JavadocLocationDialog extends StatusDialog { 38 39 private JavadocConfigurationBlock fJavadocConfigurationBlock; 40 41 49 public JavadocLocationDialog(Shell parent, String libraryName, URL initialURL) { 50 super(parent); 51 setShellStyle(getShellStyle() | SWT.RESIZE); 52 53 IStatusChangeListener listener= new IStatusChangeListener() { 54 public void statusChanged(IStatus status) { 55 updateStatus(status); 56 } 57 }; 58 59 setTitle(Messages.format(NewWizardMessages.LibrariesWorkbookPage_JavadocPropertyDialog_title, libraryName)); 60 fJavadocConfigurationBlock= new JavadocConfigurationBlock(parent, listener, initialURL, false); 61 } 62 63 66 protected Control createDialogArea(Composite parent) { 67 Composite composite= (Composite) super.createDialogArea(parent); 68 Control inner= fJavadocConfigurationBlock.createContents(composite); 69 inner.setLayoutData(new GridData(GridData.FILL_BOTH)); 70 applyDialogFont(composite); 71 return composite; 72 } 73 74 79 public URL getResult() { 80 return fJavadocConfigurationBlock.getJavadocLocation(); 81 } 82 83 86 protected void configureShell(Shell newShell) { 87 super.configureShell(newShell); 88 PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.JAVADOC_PROPERTY_DIALOG); 89 } 90 } 91 | Popular Tags |