001: /*******************************************************************************
002: * Copyright (c) 2000, 2005 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.internal.ui.macbundler;
011:
012: import java.util.Enumeration;
013:
014: import org.eclipse.swt.SWT;
015: import org.eclipse.swt.events.*;
016: import org.eclipse.swt.events.SelectionAdapter;
017: import org.eclipse.swt.layout.GridData;
018: import org.eclipse.swt.widgets.*;
019: import org.eclipse.swt.widgets.Composite;
020:
021: import org.eclipse.jface.util.PropertyChangeEvent;
022:
023: public class BundleWizardPage3 extends BundleWizardBasePage {
024:
025: Text fIdentifier;
026: Text fSignature;
027: Text fVMOptions;
028: Table fProperties;
029:
030: protected BundleWizardPage3(BundleDescription bd) {
031: super ("page3", bd); //$NON-NLS-1$
032: }
033:
034: public void createContents(Composite c) {
035:
036: Composite c1 = createComposite(c, 4);
037:
038: createLabel(
039: c1,
040: Util.getString("page3.identifier.label"), GridData.VERTICAL_ALIGN_CENTER); //$NON-NLS-1$
041: fIdentifier = createText(c1, IDENTIFIER, 1);
042:
043: createLabel(
044: c1,
045: Util.getString("page3.signature.label"), GridData.VERTICAL_ALIGN_CENTER); //$NON-NLS-1$
046: fSignature = createText(c1, SIGNATURE, 1);
047:
048: createLabel(
049: c,
050: Util.getString("page3.vmOptions.label"), GridData.VERTICAL_ALIGN_CENTER); //$NON-NLS-1$
051: fVMOptions = createText(c, VMOPTIONS, 2);
052:
053: Group g = createGroup(c, Util
054: .getString("page3.propertiesGroup.label"), 1); //$NON-NLS-1$
055: fProperties = new Table(g, SWT.H_SCROLL | SWT.V_SCROLL
056: | SWT.MULTI);
057: fProperties.setHeaderVisible(true);
058: fProperties.setLinesVisible(true);
059: fProperties.addSelectionListener(new SelectionAdapter() {
060: public void widgetSelected(SelectionEvent e) {
061: //
062: }
063: });
064: setHeightHint(fProperties, 60);
065:
066: TableColumn col0 = new TableColumn(fProperties, SWT.NONE);
067: col0.setText(Util.getString("page3.keys.column.label")); //$NON-NLS-1$
068: col0.setWidth(150);
069:
070: TableColumn col1 = new TableColumn(fProperties, SWT.NONE);
071: col1.setText(Util.getString("page3.values.column.label")); //$NON-NLS-1$
072: col1.setWidth(150);
073: }
074:
075: public void propertyChange(PropertyChangeEvent event) {
076: if (fProperties == null)
077: return;
078: fIdentifier.setText(fBundleDescription.get(IDENTIFIER, "")); //$NON-NLS-1$
079: fSignature.setText(fBundleDescription.get(SIGNATURE, "")); //$NON-NLS-1$
080: fVMOptions.setText(fBundleDescription.get(VMOPTIONS, "")); //$NON-NLS-1$
081:
082: fProperties.removeAll();
083: if (fBundleDescription.fProperties2 != null
084: && fBundleDescription.fProperties2.size() > 0) {
085: Enumeration iter = fBundleDescription.fProperties2.keys();
086: for (int i = 0; iter.hasMoreElements(); i++) {
087: String key = (String) iter.nextElement();
088: String value = (String) fBundleDescription.fProperties2
089: .get(key);
090: TableItem ti = new TableItem(fProperties, SWT.NONE);
091: ti.setText(0, key);
092: ti.setText(1, value);
093: }
094: }
095: }
096:
097: public boolean isPageComplete() {
098: return true;
099: }
100: }
|