/** * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration) */ public boolean isValid(ILaunchConfiguration launchConfig) { setErrorMessage(null); try { Integer.parseInt(getWidthText()); } catch(NumberFormatException nfe) { setErrorMessage(LauncherMessages.appletlauncher_argumenttab_width_error_notaninteger); return false; } try { Integer.parseInt(getHeightText()); } catch(NumberFormatException nfe) { setErrorMessage(LauncherMessages.appletlauncher_argumenttab_height_error_notaninteger); return false; } return true; }
private void handleParametersAddButtonSelected() { NameValuePairDialog dialog = new NameValuePairDialog(getShell(), LauncherMessages.appletlauncher_argumenttab_parameters_dialog_add_title, new String[] {LauncherMessages.appletlauncher_argumenttab_parameters_dialog_add_name_text, LauncherMessages.appletlauncher_argumenttab_parameters_dialog_add_value_text}, // new String[] {EMPTY_STRING, EMPTY_STRING}); openNewParameterDialog(dialog, null); setParametersButtonsEnableState(); }
setControl(comp); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_APPLET_PARAMETERS_TAB); GridLayout topLayout = new GridLayout(); comp.setLayout(topLayout); hint.setLayoutData(gd); createVerticalSpacer(comp); envButtonComp.setLayoutData(gd); fParametersAddButton = createPushButton(envButtonComp ,LauncherMessages.appletlauncher_argumenttab_parameters_button_add_text, null); fParametersAddButton.addSelectionListener(fListener); fParametersEditButton = createPushButton(envButtonComp, LauncherMessages.appletlauncher_argumenttab_parameters_button_edit_text, null); fParametersEditButton.addSelectionListener(fListener); fParametersRemoveButton = createPushButton(envButtonComp, LauncherMessages.appletlauncher_argumenttab_parameters_button_remove_text, null); fParametersRemoveButton.addSelectionListener(fListener);
private void handleParametersEditButtonSelected() { IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection(); String key = (String) selection.getFirstElement(); Map params = (Map) fViewer.getInput(); String value = (String) params.get(key); NameValuePairDialog dialog = new NameValuePairDialog(getShell(), LauncherMessages.appletlauncher_argumenttab_parameters_dialog_edit_title, new String[] {LauncherMessages.appletlauncher_argumenttab_parameters_dialog_edit_name_text, LauncherMessages.appletlauncher_argumenttab_parameters_dialog_edit_value_text}, // new String[] {key, value}); openNewParameterDialog(dialog, key); }
/** * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) */ public void performApply(ILaunchConfigurationWorkingCopy configuration) { try { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_WIDTH, Integer.parseInt(getWidthText())); } catch (NumberFormatException e) { } try { configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_HEIGHT, Integer.parseInt(getHeightText())); } catch (NumberFormatException e) { } configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_NAME, fNameText.getText()); configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_PARAMETERS, (Map) fViewer.getInput()); }
public void createTabs(ILaunchConfigurationDialog dialog, String mode) { ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { new AppletMainTab(), new AppletParametersTab(), new AppletArgumentsTab(), new JavaJRETab(), new JavaClasspathTab(), new SourceLookupTab(), new CommonTab() }; setTabs(tabs); }