1 11 package org.eclipse.pde.internal.ui.wizards.exports; 12 13 import org.eclipse.jface.dialogs.IDialogSettings; 14 import org.eclipse.pde.internal.core.FeatureModelManager; 15 import org.eclipse.pde.internal.core.PDECore; 16 import org.eclipse.pde.internal.core.ifeature.IFeatureModel; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 import org.eclipse.swt.SWT; 19 import org.eclipse.swt.events.SelectionAdapter; 20 import org.eclipse.swt.events.SelectionEvent; 21 import org.eclipse.swt.widgets.Button; 22 import org.eclipse.swt.widgets.Composite; 23 24 public class FeatureOptionsTab extends ExportOptionsTab { 25 26 private static final String S_MULTI_PLATFORM = "multiplatform"; 28 private Button fMultiPlatform; 29 30 public FeatureOptionsTab(FeatureExportWizardPage page) { 31 super(page); 32 } 33 34 protected void addCrossPlatformOption(Composite comp) { 35 FeatureModelManager manager = PDECore.getDefault().getFeatureModelManager(); 36 IFeatureModel model = manager.findFeatureModel("org.eclipse.platform.launchers"); if (model != null) { 38 fMultiPlatform = new Button(comp, SWT.CHECK); 39 fMultiPlatform.setText(PDEUIMessages.ExportWizard_multi_platform); 40 } 41 } 42 43 protected boolean getInitialJarButtonSelection(IDialogSettings settings){ 44 return settings.getBoolean(S_JAR_FORMAT); 45 } 46 47 protected String getJarButtonText() { 48 return PDEUIMessages.BaseExportWizardPage_fPackageJARs; 49 } 50 51 protected void initialize(IDialogSettings settings) { 52 super.initialize(settings); 53 if (fMultiPlatform != null) 54 fMultiPlatform.setSelection(settings.getBoolean(S_MULTI_PLATFORM)); 55 } 56 57 protected void saveSettings(IDialogSettings settings) { 58 super.saveSettings(settings); 59 if (fMultiPlatform != null) 60 settings.put(S_MULTI_PLATFORM, fMultiPlatform.getSelection()); 61 } 62 63 protected void hookListeners() { 64 super.hookListeners(); 65 if (fMultiPlatform != null) { 66 fMultiPlatform.addSelectionListener(new SelectionAdapter() { 67 public void widgetSelected(SelectionEvent e) { 68 fPage.pageChanged(); 69 } 70 }); 71 } 72 } 73 74 protected boolean doMultiplePlatform() { 75 return fMultiPlatform != null && fMultiPlatform.getSelection(); 76 } 77 } 78 | Popular Tags |