KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > macbundler > BundleWizardPage3


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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.ui.macbundler;
12
13 import java.util.Enumeration JavaDoc;
14
15 import org.eclipse.swt.SWT;
16 import org.eclipse.swt.events.*;
17 import org.eclipse.swt.events.SelectionAdapter;
18 import org.eclipse.swt.layout.GridData;
19 import org.eclipse.swt.widgets.*;
20 import org.eclipse.swt.widgets.Composite;
21
22 import org.eclipse.jface.util.PropertyChangeEvent;
23
24
25 public class BundleWizardPage3 extends BundleWizardBasePage {
26
27     Text fIdentifier;
28     Text fSignature;
29     Text fVMOptions;
30     Table fProperties;
31
32     protected BundleWizardPage3(BundleDescription bd) {
33         super("page3", bd); //$NON-NLS-1$
34
}
35
36     public void createContents(Composite c) {
37
38         Composite c1= createComposite(c, 4);
39             
40             createLabel(c1, Util.getString("page3.identifier.label"), GridData.VERTICAL_ALIGN_CENTER); //$NON-NLS-1$
41
fIdentifier= createText(c1, IDENTIFIER, 1);
42         
43             createLabel(c1, Util.getString("page3.signature.label"), GridData.VERTICAL_ALIGN_CENTER); //$NON-NLS-1$
44
fSignature= createText(c1, SIGNATURE, 1);
45
46         createLabel(c, Util.getString("page3.vmOptions.label"), GridData.VERTICAL_ALIGN_CENTER); //$NON-NLS-1$
47
fVMOptions= createText(c, VMOPTIONS, 2);
48         
49         Group g= createGroup(c, Util.getString("page3.propertiesGroup.label"), 1); //$NON-NLS-1$
50
fProperties= new Table(g, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
51         fProperties.setHeaderVisible(true);
52         fProperties.setLinesVisible(true);
53         fProperties.addSelectionListener(new SelectionAdapter() {
54             public void widgetSelected(SelectionEvent e) {
55                 //
56
}
57         });
58         setHeightHint(fProperties, 60);
59         
60         TableColumn col0= new TableColumn(fProperties, SWT.NONE);
61         col0.setText(Util.getString("page3.keys.column.label")); //$NON-NLS-1$
62
col0.setWidth(150);
63         
64         TableColumn col1= new TableColumn(fProperties, SWT.NONE);
65         col1.setText(Util.getString("page3.values.column.label")); //$NON-NLS-1$
66
col1.setWidth(150);
67     }
68
69     public void propertyChange(PropertyChangeEvent event) {
70         if (fProperties == null)
71             return;
72         fIdentifier.setText(fBundleDescription.get(IDENTIFIER, "")); //$NON-NLS-1$
73
fSignature.setText(fBundleDescription.get(SIGNATURE, "")); //$NON-NLS-1$
74
fVMOptions.setText(fBundleDescription.get(VMOPTIONS, "")); //$NON-NLS-1$
75

76         fProperties.removeAll();
77         if (fBundleDescription.fProperties2 != null && fBundleDescription.fProperties2.size() > 0) {
78             Enumeration JavaDoc iter= fBundleDescription.fProperties2.keys();
79             for (int i= 0; iter.hasMoreElements(); i++) {
80                 String JavaDoc key= (String JavaDoc) iter.nextElement();
81                 String JavaDoc value= (String JavaDoc) fBundleDescription.fProperties2.get(key);
82                 TableItem ti= new TableItem(fProperties, SWT.NONE);
83                 ti.setText(0, key);
84                 ti.setText(1, value);
85             }
86         }
87     }
88     
89     public boolean isPageComplete() {
90         return true;
91     }
92 }
93
Popular Tags