fJRE50InfoText.setFont(composite.getFont()); fJRE50InfoText.setText(Messages.format(PreferencesMessages.ComplianceConfigurationBlock_jrecompliance_info_project, new String[] { getVersionLabel(VERSION_1_3), getVersionLabel(VERSION_1_3) })); fJRE50InfoText.setVisible(false); fJRE50InfoText.addSelectionListener(new SelectionListener() {
fJRE50InfoText.setFont(composite.getFont()); fJRE50InfoText.setText(Messages.format(PreferencesMessages.ComplianceConfigurationBlock_jrecompliance_info_project, new String[] { getVersionLabel(VERSION_1_3), getVersionLabel(VERSION_1_3) })); fJRE50InfoText.setVisible(false); fJRE50InfoText.addSelectionListener(new SelectionListener() {
private void validateJRE50Status() { if (fJRE50InfoText != null && !fJRE50InfoText.isDisposed()) { boolean isVisible= false; String compliance= getStoredValue(PREF_COMPLIANCE); // get actual value IVMInstall install= null; if (fProject != null) { // project specific settings: only test if a 50 JRE is installed try { install= JavaRuntime.getVMInstall(JavaCore.create(fProject)); } catch (CoreException e) { JavaPlugin.log(e); } } else { install= JavaRuntime.getDefaultVMInstall(); } if (install instanceof IVMInstall2) { String compilerCompliance= JavaModelUtil.getCompilerCompliance((IVMInstall2) install, compliance); if (JavaModelUtil.isVersionLessThan(compilerCompliance, compliance)) { // Discourage using compiler with version less than compliance String[] args= { getVersionLabel(compliance), getVersionLabel(compilerCompliance) }; if (fProject == null) { fJRE50InfoText.setText(Messages.format(PreferencesMessages.ComplianceConfigurationBlock_jrecompliance_info, args)); } else { fJRE50InfoText.setText(Messages.format(PreferencesMessages.ComplianceConfigurationBlock_jrecompliance_info_project, args)); } isVisible= true; } } fJRE50InfoText.setVisible(isVisible); } }
String compilerCompliance= JavaModelUtil.getCompilerCompliance((IVMInstall2) install, compliance); if (!compilerCompliance.equals(compliance)) { // Discourage using compiler with version other than compliance String[] args= { getVersionLabel(compliance), getVersionLabel(compilerCompliance) }; if (fProject == null) { fJRE50InfoText.setText(Messages.format(PreferencesMessages.ComplianceConfigurationBlock_jrecompliance_info, args));
String compilerCompliance= JavaModelUtil.getCompilerCompliance((IVMInstall2) install, compliance); if (!compilerCompliance.equals(compliance)) { // Discourage using compiler with version other than compliance String[] args= { getVersionLabel(compliance), getVersionLabel(compilerCompliance) }; if (JavaModelUtil.is9OrHigher(compilerCompliance)) { if (!JavaModelUtil.is16OrHigher(compliance) || !fComplierReleaseCheck.getSelection()) {