KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > classpath > DefaultClasspathEntryDialog


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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 /**
25  * Edits project default classapath.
26  *
27  * @since 3.2
28  */

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 JavaDoc[]{entry.getJavaProject().getElementName()}),
37                 MessageDialog.NONE, new String JavaDoc[]{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