01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.wizards.exports;
11:
12: import org.eclipse.jface.dialogs.IDialogSettings;
13: import org.eclipse.pde.internal.core.FeatureModelManager;
14: import org.eclipse.pde.internal.core.PDECore;
15: import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
16: import org.eclipse.pde.internal.ui.PDEUIMessages;
17: import org.eclipse.swt.SWT;
18: import org.eclipse.swt.events.SelectionAdapter;
19: import org.eclipse.swt.events.SelectionEvent;
20: import org.eclipse.swt.widgets.Button;
21: import org.eclipse.swt.widgets.Composite;
22:
23: public class FeatureOptionsTab extends ExportOptionsTab {
24:
25: private static final String S_MULTI_PLATFORM = "multiplatform"; //$NON-NLS-1$
26:
27: private Button fMultiPlatform;
28:
29: public FeatureOptionsTab(FeatureExportWizardPage page) {
30: super (page);
31: }
32:
33: protected void addCrossPlatformOption(Composite comp) {
34: FeatureModelManager manager = PDECore.getDefault()
35: .getFeatureModelManager();
36: IFeatureModel model = manager.getDeltaPackFeature();
37: if (model != null) {
38: fMultiPlatform = new Button(comp, SWT.CHECK);
39: fMultiPlatform
40: .setText(PDEUIMessages.ExportWizard_multi_platform);
41: }
42: }
43:
44: protected boolean getInitialJarButtonSelection(
45: IDialogSettings settings) {
46: return settings.getBoolean(S_JAR_FORMAT);
47: }
48:
49: protected String getJarButtonText() {
50: return PDEUIMessages.BaseExportWizardPage_fPackageJARs;
51: }
52:
53: protected void initialize(IDialogSettings settings) {
54: super .initialize(settings);
55: if (fMultiPlatform != null)
56: fMultiPlatform.setSelection(settings
57: .getBoolean(S_MULTI_PLATFORM));
58: }
59:
60: protected void saveSettings(IDialogSettings settings) {
61: super .saveSettings(settings);
62: if (fMultiPlatform != null)
63: settings.put(S_MULTI_PLATFORM, fMultiPlatform
64: .getSelection());
65: }
66:
67: protected void hookListeners() {
68: super .hookListeners();
69: if (fMultiPlatform != null) {
70: fMultiPlatform.addSelectionListener(new SelectionAdapter() {
71: public void widgetSelected(SelectionEvent e) {
72: fPage.pageChanged();
73: }
74: });
75: }
76: }
77:
78: protected boolean doMultiplePlatform() {
79: return fMultiPlatform != null && fMultiPlatform.getSelection();
80: }
81: }
|