org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/launchConfigurations/AppletParametersTab.java
Parent Directory
|
Revision Log
Revision 1.33 - (view) (download)
| 1 : | droberts | 1.8 | /******************************************************************************* |
| 2 : | mrennie | 1.33 | * Copyright (c) 2000, 2009 IBM Corporation and others. |
| 3 : | krbarnes | 1.17 | * All rights reserved. This program and the accompanying materials |
| 4 : | darins | 1.18 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 : | droberts | 1.8 | * which accompanies this distribution, and is available at |
| 6 : | darins | 1.18 | * http://www.eclipse.org/legal/epl-v10.html |
| 7 : | darin | 1.32 | * |
| 8 : | droberts | 1.8 | * Contributors: |
| 9 : | * IBM Corporation - initial API and implementation | ||
| 10 : | *******************************************************************************/ | ||
| 11 : | jszursze | 1.1 | package org.eclipse.jdt.debug.ui.launchConfigurations; |
| 12 : | |||
| 13 : | import java.util.HashMap; | ||
| 14 : | import java.util.Map; | ||
| 15 : | |||
| 16 : | import org.eclipse.core.runtime.CoreException; | ||
| 17 : | import org.eclipse.debug.core.ILaunchConfiguration; | ||
| 18 : | import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; | ||
| 19 : | mrennie | 1.24 | import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds; |
| 20 : | jszursze | 1.1 | import org.eclipse.jdt.internal.debug.ui.JavaDebugImages; |
| 21 : | mrennie | 1.33 | import org.eclipse.jdt.internal.debug.ui.SWTFactory; |
| 22 : | jszursze | 1.1 | import org.eclipse.jdt.internal.debug.ui.launcher.LauncherMessages; |
| 23 : | import org.eclipse.jdt.internal.debug.ui.launcher.NameValuePairDialog; | ||
| 24 : | import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; | ||
| 25 : | krbarnes | 1.23 | import org.eclipse.jface.dialogs.Dialog; |
| 26 : | jszursze | 1.1 | import org.eclipse.jface.viewers.ColumnWeightData; |
| 27 : | krbarnes | 1.23 | import org.eclipse.jface.viewers.ILabelProviderListener; |
| 28 : | import org.eclipse.jface.viewers.IStructuredContentProvider; | ||
| 29 : | import org.eclipse.jface.viewers.IStructuredSelection; | ||
| 30 : | import org.eclipse.jface.viewers.ITableLabelProvider; | ||
| 31 : | jszursze | 1.1 | import org.eclipse.jface.viewers.TableLayout; |
| 32 : | krbarnes | 1.23 | import org.eclipse.jface.viewers.TableViewer; |
| 33 : | import org.eclipse.jface.viewers.Viewer; | ||
| 34 : | darin | 1.27 | import org.eclipse.jface.viewers.ViewerComparator; |
| 35 : | jszursze | 1.1 | import org.eclipse.jface.window.Window; |
| 36 : | import org.eclipse.swt.SWT; | ||
| 37 : | import org.eclipse.swt.events.ModifyEvent; | ||
| 38 : | import org.eclipse.swt.events.ModifyListener; | ||
| 39 : | import org.eclipse.swt.events.MouseAdapter; | ||
| 40 : | import org.eclipse.swt.events.MouseEvent; | ||
| 41 : | import org.eclipse.swt.events.SelectionAdapter; | ||
| 42 : | import org.eclipse.swt.events.SelectionEvent; | ||
| 43 : | import org.eclipse.swt.graphics.Image; | ||
| 44 : | import org.eclipse.swt.layout.GridData; | ||
| 45 : | import org.eclipse.swt.widgets.Button; | ||
| 46 : | import org.eclipse.swt.widgets.Composite; | ||
| 47 : | import org.eclipse.swt.widgets.Label; | ||
| 48 : | import org.eclipse.swt.widgets.Table; | ||
| 49 : | import org.eclipse.swt.widgets.TableColumn; | ||
| 50 : | import org.eclipse.swt.widgets.Text; | ||
| 51 : | mrennie | 1.24 | import org.eclipse.ui.PlatformUI; |
| 52 : | jszursze | 1.1 | |
| 53 : | /** | ||
| 54 : | * This tab appears for java applet launch configurations and allows the user to edit | ||
| 55 : | * applet-specific attributes such as width, height, name & applet parameters. | ||
| 56 : | jszursze | 1.6 | * <p> |
| 57 : | mrennie | 1.31 | * This class may be instantiated. |
| 58 : | jszursze | 1.6 | * </p> |
| 59 : | jszursze | 1.1 | * @since 2.1 |
| 60 : | mrennie | 1.30 | * @noextend This class is not intended to be subclassed by clients. |
| 61 : | jszursze | 1.1 | */ |
| 62 : | darin | 1.22 | public class AppletParametersTab extends JavaLaunchTab { |
| 63 : | jszursze | 1.1 | |
| 64 : | private Text fWidthText; | ||
| 65 : | private Text fHeightText; | ||
| 66 : | private Text fNameText; | ||
| 67 : | private Button fParametersAddButton; | ||
| 68 : | private Button fParametersRemoveButton; | ||
| 69 : | private Button fParametersEditButton; | ||
| 70 : | jburns | 1.12 | |
| 71 : | private class AppletTabListener extends SelectionAdapter implements ModifyListener { | ||
| 72 : | |||
| 73 : | /* (non-Javadoc) | ||
| 74 : | * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent) | ||
| 75 : | */ | ||
| 76 : | public void modifyText(ModifyEvent e) { | ||
| 77 : | updateLaunchConfigurationDialog(); | ||
| 78 : | } | ||
| 79 : | |||
| 80 : | /* (non-Javadoc) | ||
| 81 : | * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent) | ||
| 82 : | */ | ||
| 83 : | public void widgetSelected(SelectionEvent e) { | ||
| 84 : | Object source= e.getSource(); | ||
| 85 : | krbarnes | 1.23 | if (source == fViewer.getTable() || source == fViewer) { |
| 86 : | jburns | 1.12 | setParametersButtonsEnableState(); |
| 87 : | } else if (source == fParametersAddButton) { | ||
| 88 : | handleParametersAddButtonSelected(); | ||
| 89 : | } else if (source == fParametersEditButton) { | ||
| 90 : | handleParametersEditButtonSelected(); | ||
| 91 : | } else if (source == fParametersRemoveButton) { | ||
| 92 : | handleParametersRemoveButtonSelected(); | ||
| 93 : | } | ||
| 94 : | } | ||
| 95 : | |||
| 96 : | } | ||
| 97 : | |||
| 98 : | private AppletTabListener fListener= new AppletTabListener(); | ||
| 99 : | jszursze | 1.1 | |
| 100 : | private static final String EMPTY_STRING = ""; //$NON-NLS-1$ | ||
| 101 : | |||
| 102 : | /** | ||
| 103 : | droberts | 1.8 | * The default value for the 'width' attribute. |
| 104 : | */ | ||
| 105 : | jszursze | 1.1 | public static final int DEFAULT_APPLET_WIDTH = 200; |
| 106 : | |||
| 107 : | /** | ||
| 108 : | * The default value for the 'height' attribute. | ||
| 109 : | */ | ||
| 110 : | public static final int DEFAULT_APPLET_HEIGHT = 200; | ||
| 111 : | krbarnes | 1.23 | |
| 112 : | /** | ||
| 113 : | * The parameters table viewer | ||
| 114 : | */ | ||
| 115 : | private TableViewer fViewer; | ||
| 116 : | jszursze | 1.1 | |
| 117 : | /** | ||
| 118 : | darin | 1.9 | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(Composite) |
| 119 : | jszursze | 1.1 | */ |
| 120 : | mrennie | 1.24 | public void createControl(Composite parent) { |
| 121 : | mrennie | 1.33 | Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL); |
| 122 : | jszursze | 1.1 | setControl(comp); |
| 123 : | mrennie | 1.24 | PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_APPLET_PARAMETERS_TAB); |
| 124 : | mrennie | 1.33 | |
| 125 : | Composite namecomp = SWTFactory.createComposite(comp, comp.getFont(), 4, 1, GridData.FILL_HORIZONTAL, 0, 0); | ||
| 126 : | |||
| 127 : | SWTFactory.createLabel(namecomp, LauncherMessages.appletlauncher_argumenttab_widthlabel_text, 1); | ||
| 128 : | |||
| 129 : | fWidthText = SWTFactory.createSingleText(namecomp, 1); | ||
| 130 : | jburns | 1.12 | fWidthText.addModifyListener(fListener); |
| 131 : | darin | 1.2 | |
| 132 : | mrennie | 1.33 | SWTFactory.createLabel(namecomp, LauncherMessages.appletlauncher_argumenttab_namelabel_text, 1); |
| 133 : | jszursze | 1.1 | |
| 134 : | mrennie | 1.33 | fNameText = SWTFactory.createSingleText(namecomp, 1); |
| 135 : | jburns | 1.12 | fNameText.addModifyListener(fListener); |
| 136 : | darin | 1.2 | |
| 137 : | mrennie | 1.33 | SWTFactory.createLabel(namecomp, LauncherMessages.appletlauncher_argumenttab_heightlabel_text, 1); |
| 138 : | jszursze | 1.1 | |
| 139 : | mrennie | 1.33 | fHeightText = SWTFactory.createSingleText(namecomp, 1); |
| 140 : | jburns | 1.12 | fHeightText.addModifyListener(fListener); |
| 141 : | jszursze | 1.1 | |
| 142 : | mrennie | 1.33 | Label blank = new Label(namecomp, SWT.NONE); |
| 143 : | darin | 1.2 | blank.setText(EMPTY_STRING); |
| 144 : | mrennie | 1.33 | Label hint = SWTFactory.createLabel(namecomp, LauncherMessages.AppletParametersTab__optional_applet_instance_name__1, 1); |
| 145 : | GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_CENTER); | ||
| 146 : | darin | 1.2 | hint.setLayoutData(gd); |
| 147 : | |||
| 148 : | mrennie | 1.33 | SWTFactory.createVerticalSpacer(comp, 1); |
| 149 : | jszursze | 1.1 | |
| 150 : | mrennie | 1.33 | Composite paramcomp = SWTFactory.createComposite(comp, comp.getFont(), 2, 1, GridData.FILL_BOTH, 0, 0); |
| 151 : | jszursze | 1.1 | |
| 152 : | mrennie | 1.33 | SWTFactory.createLabel(paramcomp, LauncherMessages.appletlauncher_argumenttab_parameterslabel_text, 2); |
| 153 : | krbarnes | 1.23 | |
| 154 : | mrennie | 1.33 | Table ptable = new Table(paramcomp, SWT.FULL_SELECTION | SWT.BORDER); |
| 155 : | fViewer = new TableViewer(ptable); | ||
| 156 : | krbarnes | 1.23 | gd = new GridData(GridData.FILL_BOTH); |
| 157 : | mrennie | 1.33 | ptable.setLayoutData(gd); |
| 158 : | TableColumn column1 = new TableColumn(ptable, SWT.NONE); | ||
| 159 : | krbarnes | 1.23 | column1.setText(LauncherMessages.appletlauncher_argumenttab_parameterscolumn_name_text); |
| 160 : | mrennie | 1.33 | TableColumn column2 = new TableColumn(ptable, SWT.NONE); |
| 161 : | krbarnes | 1.23 | column2.setText(LauncherMessages.appletlauncher_argumenttab_parameterscolumn_value_text); |
| 162 : | jszursze | 1.1 | TableLayout tableLayout = new TableLayout(); |
| 163 : | mrennie | 1.33 | ptable.setLayout(tableLayout); |
| 164 : | jszursze | 1.1 | tableLayout.addColumnData(new ColumnWeightData(100)); |
| 165 : | tableLayout.addColumnData(new ColumnWeightData(100)); | ||
| 166 : | mrennie | 1.33 | ptable.setHeaderVisible(true); |
| 167 : | ptable.setLinesVisible(true); | ||
| 168 : | ptable.addSelectionListener(fListener); | ||
| 169 : | ptable.addMouseListener(new MouseAdapter() { | ||
| 170 : | jszursze | 1.1 | public void mouseDoubleClick(MouseEvent e) { |
| 171 : | setParametersButtonsEnableState(); | ||
| 172 : | if (fParametersEditButton.isEnabled()) { | ||
| 173 : | handleParametersEditButtonSelected(); | ||
| 174 : | } | ||
| 175 : | } | ||
| 176 : | }); | ||
| 177 : | krbarnes | 1.23 | |
| 178 : | fViewer.setContentProvider(new IStructuredContentProvider() { | ||
| 179 : | public Object[] getElements(Object inputElement) { | ||
| 180 : | Map params = (Map) inputElement; | ||
| 181 : | return params.keySet().toArray(); | ||
| 182 : | } | ||
| 183 : | public void dispose() { | ||
| 184 : | } | ||
| 185 : | public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { | ||
| 186 : | } | ||
| 187 : | }); | ||
| 188 : | jszursze | 1.1 | |
| 189 : | krbarnes | 1.23 | fViewer.setLabelProvider(new ITableLabelProvider() { |
| 190 : | public Image getColumnImage(Object element, int columnIndex) { | ||
| 191 : | return null; | ||
| 192 : | } | ||
| 193 : | public String getColumnText(Object element, int columnIndex) { | ||
| 194 : | if (columnIndex == 0) { | ||
| 195 : | return element.toString(); | ||
| 196 : | } | ||
| 197 : | |||
| 198 : | String key = (String) element; | ||
| 199 : | Map params = (Map) fViewer.getInput(); | ||
| 200 : | Object object = params.get(key); | ||
| 201 : | if (object != null) | ||
| 202 : | return object.toString(); | ||
| 203 : | return null; | ||
| 204 : | } | ||
| 205 : | public void addListener(ILabelProviderListener listener) { | ||
| 206 : | } | ||
| 207 : | public void dispose() { | ||
| 208 : | } | ||
| 209 : | public boolean isLabelProperty(Object element, String property) { | ||
| 210 : | return false; | ||
| 211 : | } | ||
| 212 : | public void removeListener(ILabelProviderListener listener) { | ||
| 213 : | } | ||
| 214 : | }); | ||
| 215 : | |||
| 216 : | darin | 1.27 | fViewer.setComparator(new ViewerComparator()); |
| 217 : | krbarnes | 1.23 | |
| 218 : | mrennie | 1.33 | Composite envcomp = SWTFactory.createComposite(paramcomp, paramcomp.getFont(), 1, 1, GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL, 0, 0); |
| 219 : | jszursze | 1.1 | |
| 220 : | mrennie | 1.33 | fParametersAddButton = createPushButton(envcomp ,LauncherMessages.appletlauncher_argumenttab_parameters_button_add_text, null); |
| 221 : | jburns | 1.12 | fParametersAddButton.addSelectionListener(fListener); |
| 222 : | jszursze | 1.1 | |
| 223 : | mrennie | 1.33 | fParametersEditButton = createPushButton(envcomp, LauncherMessages.appletlauncher_argumenttab_parameters_button_edit_text, null); |
| 224 : | jburns | 1.12 | fParametersEditButton.addSelectionListener(fListener); |
| 225 : | jszursze | 1.1 | |
| 226 : | mrennie | 1.33 | fParametersRemoveButton = createPushButton(envcomp, LauncherMessages.appletlauncher_argumenttab_parameters_button_remove_text, null); |
| 227 : | jburns | 1.12 | fParametersRemoveButton.addSelectionListener(fListener); |
| 228 : | krbarnes | 1.23 | |
| 229 : | mrennie | 1.33 | setParametersButtonsEnableState(); |
| 230 : | krbarnes | 1.23 | Dialog.applyDialogFont(parent); |
| 231 : | jszursze | 1.1 | } |
| 232 : | |||
| 233 : | |||
| 234 : | /** | ||
| 235 : | darin | 1.9 | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration) |
| 236 : | jszursze | 1.1 | */ |
| 237 : | public boolean isValid(ILaunchConfiguration launchConfig) { | ||
| 238 : | setErrorMessage(null); | ||
| 239 : | try { | ||
| 240 : | jburns | 1.15 | Integer.parseInt(getWidthText()); |
| 241 : | jszursze | 1.3 | } catch(NumberFormatException nfe) { |
| 242 : | darin | 1.21 | setErrorMessage(LauncherMessages.appletlauncher_argumenttab_width_error_notaninteger); |
| 243 : | jszursze | 1.1 | return false; |
| 244 : | } | ||
| 245 : | try { | ||
| 246 : | jburns | 1.15 | Integer.parseInt(getHeightText()); |
| 247 : | jszursze | 1.3 | } catch(NumberFormatException nfe) { |
| 248 : | darin | 1.21 | setErrorMessage(LauncherMessages.appletlauncher_argumenttab_height_error_notaninteger); |
| 249 : | jszursze | 1.1 | return false; |
| 250 : | } | ||
| 251 : | return true; | ||
| 252 : | } | ||
| 253 : | |||
| 254 : | private void handleParametersAddButtonSelected() { | ||
| 255 : | NameValuePairDialog dialog = | ||
| 256 : | new NameValuePairDialog(getShell(), | ||
| 257 : | darin | 1.21 | LauncherMessages.appletlauncher_argumenttab_parameters_dialog_add_title, |
| 258 : | new String[] {LauncherMessages.appletlauncher_argumenttab_parameters_dialog_add_name_text, LauncherMessages.appletlauncher_argumenttab_parameters_dialog_add_value_text}, // | ||
| 259 : | jburns | 1.13 | new String[] {EMPTY_STRING, EMPTY_STRING}); |
| 260 : | jszursze | 1.1 | openNewParameterDialog(dialog, null); |
| 261 : | setParametersButtonsEnableState(); | ||
| 262 : | } | ||
| 263 : | |||
| 264 : | private void handleParametersEditButtonSelected() { | ||
| 265 : | krbarnes | 1.23 | IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection(); |
| 266 : | String key = (String) selection.getFirstElement(); | ||
| 267 : | Map params = (Map) fViewer.getInput(); | ||
| 268 : | String value = (String) params.get(key); | ||
| 269 : | |||
| 270 : | jszursze | 1.1 | NameValuePairDialog dialog = |
| 271 : | new NameValuePairDialog(getShell(), | ||
| 272 : | darin | 1.21 | LauncherMessages.appletlauncher_argumenttab_parameters_dialog_edit_title, |
| 273 : | new String[] {LauncherMessages.appletlauncher_argumenttab_parameters_dialog_edit_name_text, LauncherMessages.appletlauncher_argumenttab_parameters_dialog_edit_value_text}, // | ||
| 274 : | krbarnes | 1.23 | new String[] {key, value}); |
| 275 : | |||
| 276 : | openNewParameterDialog(dialog, key); | ||
| 277 : | jszursze | 1.1 | } |
| 278 : | |||
| 279 : | private void handleParametersRemoveButtonSelected() { | ||
| 280 : | krbarnes | 1.23 | IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection(); |
| 281 : | Object[] keys = selection.toArray(); | ||
| 282 : | for (int i = 0; i < keys.length; i++) { | ||
| 283 : | String key = (String) keys[i]; | ||
| 284 : | Map params = (Map) fViewer.getInput(); | ||
| 285 : | params.remove(key); | ||
| 286 : | } | ||
| 287 : | fViewer.refresh(); | ||
| 288 : | jszursze | 1.1 | setParametersButtonsEnableState(); |
| 289 : | jburns | 1.12 | updateLaunchConfigurationDialog(); |
| 290 : | jszursze | 1.1 | } |
| 291 : | |||
| 292 : | /** | ||
| 293 : | * Set the enabled state of the three environment variable-related buttons based on the | ||
| 294 : | * selection in the Table widget. | ||
| 295 : | */ | ||
| 296 : | private void setParametersButtonsEnableState() { | ||
| 297 : | krbarnes | 1.23 | IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection(); |
| 298 : | int selectCount = selection.size(); | ||
| 299 : | jszursze | 1.1 | if (selectCount < 1) { |
| 300 : | fParametersEditButton.setEnabled(false); | ||
| 301 : | fParametersRemoveButton.setEnabled(false); | ||
| 302 : | } else { | ||
| 303 : | fParametersRemoveButton.setEnabled(true); | ||
| 304 : | if (selectCount == 1) { | ||
| 305 : | fParametersEditButton.setEnabled(true); | ||
| 306 : | } else { | ||
| 307 : | fParametersEditButton.setEnabled(false); | ||
| 308 : | } | ||
| 309 : | } | ||
| 310 : | fParametersAddButton.setEnabled(true); | ||
| 311 : | } | ||
| 312 : | |||
| 313 : | /** | ||
| 314 : | * Show the specified dialog and update the parameter table based on its results. | ||
| 315 : | * | ||
| 316 : | * @param updateItem the item to update, or <code>null</code> if | ||
| 317 : | * adding a new item | ||
| 318 : | */ | ||
| 319 : | krbarnes | 1.23 | private void openNewParameterDialog(NameValuePairDialog dialog, String key) { |
| 320 : | jszursze | 1.1 | if (dialog.open() != Window.OK) { |
| 321 : | return; | ||
| 322 : | } | ||
| 323 : | String[] nameValuePair = dialog.getNameValuePair(); | ||
| 324 : | krbarnes | 1.23 | Map params = (Map) fViewer.getInput(); |
| 325 : | params.remove(key); | ||
| 326 : | params.put(nameValuePair[0], nameValuePair[1]); | ||
| 327 : | fViewer.refresh(); | ||
| 328 : | jszursze | 1.1 | updateLaunchConfigurationDialog(); |
| 329 : | } | ||
| 330 : | |||
| 331 : | /** | ||
| 332 : | darin | 1.9 | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) |
| 333 : | jszursze | 1.1 | */ |
| 334 : | public void performApply(ILaunchConfigurationWorkingCopy configuration) { | ||
| 335 : | jburns | 1.15 | try { |
| 336 : | configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_WIDTH, Integer.parseInt(getWidthText())); | ||
| 337 : | } catch (NumberFormatException e) { | ||
| 338 : | } | ||
| 339 : | try { | ||
| 340 : | configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_HEIGHT, Integer.parseInt(getHeightText())); | ||
| 341 : | } catch (NumberFormatException e) { | ||
| 342 : | } | ||
| 343 : | darins | 1.11 | configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_NAME, fNameText.getText()); |
| 344 : | krbarnes | 1.23 | configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_PARAMETERS, (Map) fViewer.getInput()); |
| 345 : | jburns | 1.15 | } |
| 346 : | krbarnes | 1.23 | |
| 347 : | jburns | 1.15 | /** |
| 348 : | * Returns the current width specified by the user | ||
| 349 : | * @return the width specified by the user | ||
| 350 : | */ | ||
| 351 : | private String getWidthText() { | ||
| 352 : | return fWidthText.getText().trim(); | ||
| 353 : | } | ||
| 354 : | |||
| 355 : | /** | ||
| 356 : | * Returns the current height specified by the user | ||
| 357 : | * @return the height specified by the user | ||
| 358 : | */ | ||
| 359 : | private String getHeightText() { | ||
| 360 : | return fHeightText.getText().trim(); | ||
| 361 : | jszursze | 1.1 | } |
| 362 : | |||
| 363 : | /** | ||
| 364 : | darin | 1.9 | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy) |
| 365 : | jszursze | 1.1 | */ |
| 366 : | public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { | ||
| 367 : | } | ||
| 368 : | |||
| 369 : | |||
| 370 : | /** | ||
| 371 : | darin | 1.9 | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration) |
| 372 : | jszursze | 1.1 | */ |
| 373 : | public void initializeFrom(ILaunchConfiguration config) { | ||
| 374 : | try { | ||
| 375 : | darin | 1.21 | fWidthText.setText(Integer.toString(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_WIDTH, DEFAULT_APPLET_WIDTH))); |
| 376 : | jszursze | 1.1 | } catch(CoreException ce) { |
| 377 : | darin | 1.21 | fWidthText.setText(Integer.toString(DEFAULT_APPLET_WIDTH)); |
| 378 : | jszursze | 1.1 | } |
| 379 : | try { | ||
| 380 : | darin | 1.21 | fHeightText.setText(Integer.toString(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_HEIGHT, DEFAULT_APPLET_HEIGHT))); |
| 381 : | jszursze | 1.1 | } catch(CoreException ce) { |
| 382 : | darin | 1.21 | fHeightText.setText(Integer.toString(DEFAULT_APPLET_HEIGHT)); |
| 383 : | jszursze | 1.1 | } |
| 384 : | try { | ||
| 385 : | darin | 1.21 | fNameText.setText(config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_NAME, LauncherMessages.appletlauncher_argumenttab_name_defaultvalue)); |
| 386 : | jszursze | 1.1 | } catch(CoreException ce) { |
| 387 : | darin | 1.21 | fNameText.setText(LauncherMessages.appletlauncher_argumenttab_name_defaultvalue); |
| 388 : | jszursze | 1.1 | } |
| 389 : | krbarnes | 1.23 | |
| 390 : | Map input = new HashMap(); | ||
| 391 : | try { | ||
| 392 : | Map params = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_PARAMETERS, (Map) null); | ||
| 393 : | if (params != null) | ||
| 394 : | input.putAll(params); | ||
| 395 : | } catch (CoreException e) { | ||
| 396 : | } | ||
| 397 : | |||
| 398 : | fViewer.setInput(input); | ||
| 399 : | jszursze | 1.1 | } |
| 400 : | |||
| 401 : | /** | ||
| 402 : | darin | 1.9 | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() |
| 403 : | jszursze | 1.1 | */ |
| 404 : | public String getName() { | ||
| 405 : | darin | 1.21 | return LauncherMessages.appletlauncher_argumenttab_name; |
| 406 : | jszursze | 1.1 | } |
| 407 : | darins | 1.7 | |
| 408 : | jszursze | 1.1 | /** |
| 409 : | darins | 1.29 | * @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId() |
| 410 : | mrennie | 1.26 | * |
| 411 : | * @since 3.3 | ||
| 412 : | mrennie | 1.25 | */ |
| 413 : | mrennie | 1.28 | public String getId() { |
| 414 : | mrennie | 1.25 | return "org.eclipse.jdt.debug.ui.appletParametersTab"; //$NON-NLS-1$ |
| 415 : | } | ||
| 416 : | |||
| 417 : | /** | ||
| 418 : | darin | 1.9 | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() |
| 419 : | jszursze | 1.1 | */ |
| 420 : | public Image getImage() { | ||
| 421 : | return JavaDebugImages.get(JavaDebugImages.IMG_VIEW_ARGUMENTS_TAB); | ||
| 422 : | } | ||
| 423 : | darin | 1.14 | |
| 424 : | /* (non-Javadoc) | ||
| 425 : | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) | ||
| 426 : | */ | ||
| 427 : | public void activated(ILaunchConfigurationWorkingCopy workingCopy) { | ||
| 428 : | // do nothing when activated | ||
| 429 : | } | ||
| 430 : | |||
| 431 : | /* (non-Javadoc) | ||
| 432 : | * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) | ||
| 433 : | */ | ||
| 434 : | public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) { | ||
| 435 : | mrennie | 1.33 | // do nothing when de-activated |
| 436 : | darin | 1.14 | } |
| 437 : | jszursze | 1.1 | } |
| 438 : |
| help@eclipse.org | ViewVC Help |
| Powered by ViewVC 1.0.3 |
