1 11 package org.eclipse.jdt.internal.debug.ui.classpath; 12 13 import com.ibm.icu.text.MessageFormat; 14 15 import org.eclipse.jdt.internal.launching.DefaultProjectClasspathEntry; 16 import org.eclipse.jdt.launching.IRuntimeClasspathEntry; 17 import org.eclipse.jface.dialogs.MessageDialog; 18 import org.eclipse.swt.SWT; 19 import org.eclipse.swt.widgets.Button; 20 import org.eclipse.swt.widgets.Composite; 21 import org.eclipse.swt.widgets.Control; 22 import org.eclipse.swt.widgets.Shell; 23 24 29 public class DefaultClasspathEntryDialog extends MessageDialog { 30 31 private DefaultProjectClasspathEntry fEntry; 32 private Button fButton; 33 34 public DefaultClasspathEntryDialog(Shell parentShell, IRuntimeClasspathEntry entry) { 35 super(parentShell, ClasspathMessages.DefaultClasspathEntryDialog_0, null, 36 MessageFormat.format(ClasspathMessages.DefaultClasspathEntryDialog_1, new String []{entry.getJavaProject().getElementName()}), 37 MessageDialog.NONE, new String []{ClasspathMessages.DefaultClasspathEntryDialog_2, ClasspathMessages.DefaultClasspathEntryDialog_3}, 0); 38 fEntry = (DefaultProjectClasspathEntry) entry; 39 } 40 41 protected Control createCustomArea(Composite parent) { 42 fButton = new Button(parent, SWT.CHECK); 43 fButton.setText(ClasspathMessages.DefaultClasspathEntryDialog_4); 44 fButton.setSelection(fEntry.isExportedEntriesOnly()); 45 return fButton; 46 } 47 48 protected void buttonPressed(int buttonId) { 49 if (buttonId == 0) { 50 fEntry.setExportedEntriesOnly(fButton.getSelection()); 51 } 52 super.buttonPressed(buttonId); 53 } 54 55 56 57 } 58 | Popular Tags |