KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > wizards > buildpaths > NativeLibrariesDialog


1 /*******************************************************************************
2  * Copyright (c) 2000, 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
12 package org.eclipse.jdt.internal.ui.wizards.buildpaths;
13
14 import org.eclipse.core.runtime.IStatus;
15
16 import org.eclipse.swt.SWT;
17 import org.eclipse.swt.layout.GridData;
18 import org.eclipse.swt.widgets.Composite;
19 import org.eclipse.swt.widgets.Control;
20 import org.eclipse.swt.widgets.Shell;
21
22 import org.eclipse.jface.dialogs.StatusDialog;
23
24 import org.eclipse.jdt.core.IClasspathEntry;
25
26 import org.eclipse.jdt.internal.ui.preferences.NativeLibrariesConfigurationBlock;
27 import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener;
28 import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
29
30 /**
31  *
32  */

33 public class NativeLibrariesDialog extends StatusDialog {
34
35     private final NativeLibrariesConfigurationBlock fConfigurationBlock;
36     
37     public NativeLibrariesDialog(Shell parent, String JavaDoc nativeLibPath, IClasspathEntry parentEntry) {
38         super(parent);
39         setTitle(NewWizardMessages.NativeLibrariesDialog_title);
40         
41         setShellStyle(getShellStyle() | SWT.RESIZE);
42         
43         IStatusChangeListener listener= new IStatusChangeListener() {
44             public void statusChanged(IStatus status) {
45                 updateStatus(status);
46             }
47         };
48         
49         fConfigurationBlock= new NativeLibrariesConfigurationBlock(listener, parent, nativeLibPath, parentEntry);
50         setHelpAvailable(false);
51     }
52     
53     /* (non-Javadoc)
54      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
55      */

56     protected Control createDialogArea(Composite parent) {
57         Composite composite= (Composite) super.createDialogArea(parent);
58         Control inner= fConfigurationBlock.createContents(composite);
59         inner.setLayoutData(new GridData(GridData.FILL_BOTH));
60         applyDialogFont(composite);
61         return composite;
62     }
63
64     public String JavaDoc getNativeLibraryPath() {
65         return fConfigurationBlock.getNativeLibraryPath();
66     }
67
68 }
69
Popular Tags