1 11 package org.eclipse.debug.internal.ui.sourcelookup.browsers; 12 import org.eclipse.debug.internal.ui.IDebugHelpContextIds; 13 import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages; 14 import org.eclipse.jface.viewers.ILabelProvider; 15 import org.eclipse.jface.viewers.IStructuredContentProvider; 16 import org.eclipse.swt.SWT; 17 import org.eclipse.swt.events.SelectionAdapter; 18 import org.eclipse.swt.events.SelectionEvent; 19 import org.eclipse.swt.graphics.Font; 20 import org.eclipse.swt.widgets.Button; 21 import org.eclipse.swt.widgets.Composite; 22 import org.eclipse.swt.widgets.Control; 23 import org.eclipse.swt.widgets.Shell; 24 import org.eclipse.ui.PlatformUI; 25 import org.eclipse.ui.dialogs.ListSelectionDialog; 26 27 32 public class ProjectSourceContainerDialog extends ListSelectionDialog { 33 34 private boolean fAddRequiredProjects = false; 35 36 public ProjectSourceContainerDialog( 37 Shell parentShell, 38 Object input, 39 IStructuredContentProvider contentProvider, 40 ILabelProvider labelProvider, 41 String message) { 42 super(parentShell, input, contentProvider, labelProvider, message); 43 } 44 45 46 49 protected Control createDialogArea(Composite parent) { 50 Font font = parent.getFont(); 51 52 Composite composite = (Composite)super.createDialogArea(parent); 53 54 final Button addRequired = new Button(composite, SWT.CHECK); 55 addRequired.setText(SourceLookupUIMessages.projectSelection_requiredLabel); 56 addRequired.addSelectionListener(new SelectionAdapter() { 57 public void widgetSelected(SelectionEvent e) { 58 fAddRequiredProjects = addRequired.getSelection(); 59 } 60 }); 61 addRequired.setSelection(fAddRequiredProjects); 62 addRequired.setFont(font); 63 64 applyDialogFont(composite); 65 PlatformUI.getWorkbench().getHelpSystem().setHelp(getShell(), IDebugHelpContextIds.ADD_PROJECT_CONTAINER_DIALOG); 66 return composite; 67 } 68 69 70 75 public boolean isAddRequiredProjects() { 76 return fAddRequiredProjects; 77 } 78 } 79 | Popular Tags |