for (int i = 0; i < EEChoices.length; i++) { if (!EEChoices[i].equals(NO_EXECUTION_ENVIRONMENT)) { if (VMUtil.getExecutionEnvironment(EEChoices[i]).isStrictlyCompatible(defaultVM)) { fEEChoice.select(i); break;
@Override protected void validatePage() { String errorMessage = validateProperties(); if (errorMessage == null && fGenerateActivator.getSelection()) { IStatus status = JavaConventions.validateJavaTypeName(fClassText.getText().trim(), PDEJavaHelper.getJavaSourceLevel(null), PDEJavaHelper.getJavaComplianceLevel(null)); if (status.getSeverity() == IStatus.ERROR) { errorMessage = status.getMessage(); } else if (status.getSeverity() == IStatus.WARNING) { setMessage(status.getMessage(), IMessageProvider.WARNING); } } if (errorMessage == null) { String eeid = fEEChoice.getText(); if (fEEChoice.isEnabled()) { IExecutionEnvironment ee = VMUtil.getExecutionEnvironment(eeid); if (ee != null && ee.getCompatibleVMs().length == 0) { setMessage(PDEUIMessages.NewProjectCreationPage_invalidEE, IMessageProvider.WARNING); } } } setErrorMessage(errorMessage); setPageComplete(errorMessage == null); }
for (int i = 0; i < EEChoices.length; i++) { if (!EEChoices[i].equals(NO_EXECUTION_ENVIRONMENT)) { if (VMUtil.getExecutionEnvironment(EEChoices[i]).isStrictlyCompatible(defaultVM)) { fEEChoice.select(i); break;
protected void saveJRESection(ILaunchConfigurationWorkingCopy config) { String javaCommand = fJavawButton.getSelection() ? null : "java"; //$NON-NLS-1$ config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JAVA_COMMAND, javaCommand); IPath jrePath = null; if (fJreButton.getSelection()) { if (fJreCombo.getSelectionIndex() != -1) { String jreName = fJreCombo.getText(); IVMInstall install = VMHelper.getVMInstall(jreName); // remove the name to make portable jrePath = JavaRuntime.newJREContainerPath(install); } } else { if (fEeCombo.getSelectionIndex() != -1) { IExecutionEnvironment environment = VMUtil.getExecutionEnvironment(parseEESelection(fEeCombo.getText())); if (environment != null) { jrePath = JavaRuntime.newJREContainerPath(environment); } } } String attr = null; if (jrePath != null) { attr = jrePath.toPortableString(); } config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, attr); }
for (int i = 0; i < EEChoices.length; i++) { if (!EEChoices[i].equals(NO_EXECUTION_ENVIRONMENT)) { if (VMUtil.getExecutionEnvironment(EEChoices[i]).isStrictlyCompatible(defaultVM)) { fEEChoice.select(i); break;
String eeid = fEEChoice.getText(); if (fEEChoice.isEnabled()) { IExecutionEnvironment ee = VMUtil.getExecutionEnvironment(eeid); if (ee != null && ee.getCompatibleVMs().length == 0) { warningMessage = PDEUIMessages.NewProjectCreationPage_invalidEE;
@Override protected boolean validatePage() { String id = IdUtil.getValidId(getProjectName()); // properties group if (!fPropertiesListener.isChanged() && fIdText != null) { fPropertiesListener.setBlocked(true); fIdText.setText(id); fNameText.setText(IdUtil.getValidName(id)); fPropertiesListener.setBlocked(false); } if (!super.validatePage()) return false; setMessage(null); String errorMessage = validateProperties(); if (errorMessage == null) { String eeid = fEEChoice.getText(); if (fEEChoice.isEnabled()) { IExecutionEnvironment ee = VMUtil.getExecutionEnvironment(eeid); if (ee != null && ee.getCompatibleVMs().length == 0) { errorMessage = PDEUIMessages.NewProjectCreationPage_invalidEE; } } } setErrorMessage(errorMessage); return errorMessage == null; }
private void updateBootstrapEnablement() { IPath jrePath = null; if (fJreButton.getSelection()) { if (fJreCombo.getSelectionIndex() != -1) { String jreName = fJreCombo.getText(); IVMInstall install = VMHelper.getVMInstall(jreName); // remove the name to make portable jrePath = JavaRuntime.newJREContainerPath(install); } } else { if (fEeCombo.getSelectionIndex() != -1) { IExecutionEnvironment environment = VMUtil .getExecutionEnvironment(parseEESelection(fEeCombo.getText())); if (environment != null) { jrePath = JavaRuntime.newJREContainerPath(environment); } } } if (jrePath != null) { IVMInstall vmInstall = JavaRuntime.getVMInstall(jrePath); if (vmInstall != null) { boolean modularJava = JavaRuntime.isModularJava(vmInstall); fBootstrap.setEnabled(!modularJava); } } }
private void createJREGroup(Composite container) { Group group = SWTFactory.createGroup(container, PDEUIMessages.EnvironmentBlock_jreTitle, 2, 1, GridData.FILL_HORIZONTAL); initializeJREValues(); SWTFactory.createWrapLabel(group, PDEUIMessages.JRESection_description, 2); fDefaultJREButton = SWTFactory.createRadioButton(group, PDEUIMessages.JRESection_defaultJRE, 2); fDefaultJREButton.addSelectionListener(widgetSelectedAdapter(e -> { updateJREWidgets(); getTargetDefinition().setJREContainer(JavaRuntime.newDefaultJREContainerPath()); })); fNamedJREButton = SWTFactory.createRadioButton(group, PDEUIMessages.JRESection_JREName); fNamedJREButton.addSelectionListener(widgetSelectedAdapter(e -> { updateJREWidgets(); getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getVMInstall(fNamedJREsCombo.getText()))); })); fNamedJREsCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, VMUtil.getVMInstallNames()); fNamedJREsCombo.addModifyListener(e -> getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getVMInstall(fNamedJREsCombo.getText())))); fExecEnvButton = SWTFactory.createRadioButton(group, PDEUIMessages.JRESection_ExecutionEnv); fExecEnvButton.addSelectionListener(widgetSelectedAdapter(e -> { updateJREWidgets(); getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getText()))); })); fExecEnvsCombo = SWTFactory.createCombo(group, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, 1, fExecEnvChoices.toArray(new String[fExecEnvChoices.size()])); fExecEnvsCombo.addModifyListener(e -> getTargetDefinition().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getText())))); }
@Override public void refresh() { fBlockChanges = true; fLastTab = fTabFolder.getSelectionIndex(); fEEButton.setSelection(getJVMLocations().includeJREWithProduct(getOS(fLastTab))); IPath jrePath = getJVMLocations().getJREContainerPath(getOS(fLastTab)); if (jrePath != null) { String eeID = JavaRuntime.getExecutionEnvironmentId(jrePath); IExecutionEnvironment env = VMUtil.getExecutionEnvironment(eeID); if (env != null) { if (!fEEsCombo.getItems().contains(env)) fEEsCombo.addItem(env); fEEsCombo.select(env); } else { IVMInstall install = JavaRuntime.getVMInstall(jrePath); if (install != null) { fEEsCombo.select(null); } } } else { fEEsCombo.select(null); } updateWidgets(); super.refresh(); fBlockChanges = false; }
updateWidgets(); if (!fBlockChanges) { getTarget().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getSelection()))); markDirty(); fExecEnvsCombo.addModifyListener(e -> { if (!fBlockChanges) { getTarget().setJREContainer(JavaRuntime.newJREContainerPath(VMUtil.getExecutionEnvironment(fExecEnvsCombo.getSelection()))); markDirty();