1 11 package org.eclipse.pde.ui.launcher; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.debug.core.ILaunchConfiguration; 15 import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; 16 import org.eclipse.jface.dialogs.Dialog; 17 import org.eclipse.pde.internal.ui.IHelpContextIds; 18 import org.eclipse.pde.internal.ui.PDEPluginImages; 19 import org.eclipse.pde.internal.ui.PDEUIMessages; 20 import org.eclipse.pde.internal.ui.launcher.ConfigurationAreaBlock; 21 import org.eclipse.pde.internal.ui.launcher.JREBlock; 22 import org.eclipse.swt.SWT; 23 import org.eclipse.swt.graphics.Image; 24 import org.eclipse.swt.layout.GridData; 25 import org.eclipse.swt.layout.GridLayout; 26 import org.eclipse.swt.widgets.Composite; 27 import org.eclipse.ui.PlatformUI; 28 29 37 public class OSGiSettingsTab extends AbstractLauncherTab { 38 39 private JREBlock fJREBlock; 40 private ConfigurationAreaBlock fConfigurationBlock; 41 private Image fImage; 42 private boolean fInitializing = false; 43 44 48 public OSGiSettingsTab() { 49 fImage = PDEPluginImages.DESC_SETTINGS_OBJ.createImage(); 50 fJREBlock = new JREBlock(this); 51 fConfigurationBlock = new ConfigurationAreaBlock(this); 52 } 53 54 58 public void createControl(Composite parent) { 59 Composite container = new Composite(parent, SWT.NONE); 60 container.setLayout(new GridLayout()); 61 container.setLayoutData(new GridData(GridData.FILL_BOTH)); 62 63 fJREBlock.createControl(container); 64 fConfigurationBlock.createControl(container); 65 66 Dialog.applyDialogFont(container); 67 setControl(container); 68 PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IHelpContextIds.LAUNCHER_CONFIGURATION); 69 } 70 71 74 public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { 75 fJREBlock.setDefaults(configuration); 76 fConfigurationBlock.setDefaults(configuration, false); 77 } 78 79 82 public void initializeFrom(ILaunchConfiguration configuration) { 83 try { 84 fInitializing = true; 85 fJREBlock.initializeFrom(configuration); 86 fConfigurationBlock.initializeFrom(configuration); 87 fInitializing = false; 88 } catch (CoreException e) { 89 } 90 } 91 92 95 public void performApply(ILaunchConfigurationWorkingCopy configuration) { 96 fJREBlock.performApply(configuration); 97 fConfigurationBlock.performApply(configuration); 98 } 99 100 104 public String getName() { 105 return PDEUIMessages.EquinoxSettingsTab_name; 106 } 107 108 112 public Image getImage() { 113 return fImage; 114 } 115 116 120 public void dispose() { 121 if (fImage != null) 122 fImage.dispose(); 123 } 124 125 129 public void validateTab() { 130 } 131 132 136 public void updateLaunchConfigurationDialog() { 137 if (!fInitializing) 138 super.updateLaunchConfigurationDialog(); 139 } 140 } 141 | Popular Tags |