1 11 package org.eclipse.jdt.internal.ui.wizards.buildpaths; 12 13 import org.eclipse.core.runtime.IStatus; 14 15 import org.eclipse.swt.SWT; 16 import org.eclipse.swt.layout.GridData; 17 import org.eclipse.swt.widgets.Composite; 18 import org.eclipse.swt.widgets.Control; 19 import org.eclipse.swt.widgets.Shell; 20 21 import org.eclipse.jface.dialogs.StatusDialog; 22 23 import org.eclipse.ui.PlatformUI; 24 25 import org.eclipse.jdt.core.IClasspathEntry; 26 27 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 28 import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; 29 import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; 30 31 36 public class SourceAttachmentDialog extends StatusDialog { 37 38 private SourceAttachmentBlock fSourceAttachmentBlock; 39 40 47 public SourceAttachmentDialog(Shell parent, IClasspathEntry entry) { 48 super(parent); 49 setShellStyle(getShellStyle() | SWT.RESIZE); 50 51 IStatusChangeListener listener= new IStatusChangeListener() { 52 public void statusChanged(IStatus status) { 53 updateStatus(status); 54 } 55 }; 56 fSourceAttachmentBlock= new SourceAttachmentBlock(listener, entry); 57 58 setTitle(NewWizardMessages.SourceAttachmentDialog_title); 59 } 60 61 64 protected void configureShell(Shell newShell) { 65 super.configureShell(newShell); 66 PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.SOURCE_ATTACHMENT_DIALOG); 67 } 68 69 72 protected Control createDialogArea(Composite parent) { 73 Composite composite= (Composite) super.createDialogArea(parent); 74 75 Control inner= createSourceAttachmentControls(composite); 76 inner.setLayoutData(new GridData(GridData.FILL_BOTH)); 77 applyDialogFont(composite); 78 return composite; 79 } 80 81 84 protected Control createSourceAttachmentControls(Composite composite) { 85 return fSourceAttachmentBlock.createControl(composite); 86 } 87 88 91 public IClasspathEntry getResult() { 92 return fSourceAttachmentBlock.getNewEntry(); 93 } 94 } 95 | Popular Tags |