本文整理汇总了Java中org.eclipse.jdt.launching.IVMInstall.equals方法的典型用法代码示例。如果您正苦于以下问题:Java IVMInstall.equals方法的具体用法?Java IVMInstall.equals怎么用?Java IVMInstall.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.launching.IVMInstall
的用法示例。
在下文中一共展示了IVMInstall.equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCompatibleVMs
import org.eclipse.jdt.launching.IVMInstall; //导入方法依赖的package包/类
public static void setCompatibleVMs(String id) {
// update all environments compatible to use the test JRE
IExecutionEnvironmentsManager manager = JavaRuntime.getExecutionEnvironmentsManager();
IExecutionEnvironment[] environments = manager.getExecutionEnvironments();
for (IExecutionEnvironment environment : environments) {
IVMInstall[] compatibleVMs = environment.getCompatibleVMs();
for (IVMInstall compatibleVM : compatibleVMs) {
if (id.equals(compatibleVM.getVMInstallType().getId()) && compatibleVM.getVMInstallType().findVMInstall(compatibleVM.getId()) != null && !compatibleVM.equals(environment.getDefaultVM())
// Fugly way to ensure the lowest VM version is set:
&& (environment.getDefaultVM() == null || compatibleVM.getId().compareTo(environment.getDefaultVM().getId()) < 0)) {
environment.setDefaultVM(compatibleVM);
}
}
}
}
示例2: testDefaultVM
import org.eclipse.jdt.launching.IVMInstall; //导入方法依赖的package包/类
@Test
public void testDefaultVM() throws CoreException {
String oldJavaHome = prefManager.getPreferences().getJavaHome();
IVMInstall oldVm = JavaRuntime.getDefaultVMInstall();
assertNotNull(oldVm);
try {
IVMInstall vm = null;
IVMInstallType type = JavaRuntime.getVMInstallType(TestVMType.VMTYPE_ID);
IVMInstall[] installs = type.getVMInstalls();
for (IVMInstall install : installs) {
if (!install.equals(oldVm)) {
vm = install;
break;
}
}
assertNotNull(vm);
assertNotEquals(vm, oldVm);
String javaHome = new File(TestVMType.getFakeJDKsLocation(), "9").getAbsolutePath();
prefManager.getPreferences().setJavaHome(javaHome);
boolean changed = server.configureVM();
IVMInstall defaultVM = JavaRuntime.getDefaultVMInstall();
assertTrue("A VM hasn't been changed", changed);
assertEquals(vm, defaultVM);
assertNotEquals(oldVm, defaultVM);
} finally {
prefManager.getPreferences().setJavaHome(oldJavaHome);
TestVMType.setTestJREAsDefault();
}
}
示例3: setTestJREAsDefault
import org.eclipse.jdt.launching.IVMInstall; //导入方法依赖的package包/类
public static void setTestJREAsDefault() throws CoreException {
IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(VMTYPE_ID);
IVMInstall testVMInstall = vmInstallType.findVMInstall("1.8");
if (!testVMInstall.equals(JavaRuntime.getDefaultVMInstall())) {
// set the 1.8 test JRE as the new default JRE
JavaRuntime.setDefaultVMInstall(testVMInstall, new NullProgressMonitor());
}
JDTUtils.setCompatibleVMs(VMTYPE_ID);
}
示例4: getAdditionalProposalInfo
import org.eclipse.jdt.launching.IVMInstall; //导入方法依赖的package包/类
@Override
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
StringBuffer message= new StringBuffer();
if (fChangeOnWorkspace) {
message.append(Messages.format(CorrectionMessages.ReorgCorrectionsSubProcessor_required_compliance_changeworkspace_description, fRequiredVersion));
} else {
message.append(Messages.format(CorrectionMessages.ReorgCorrectionsSubProcessor_required_compliance_changeproject_description, fRequiredVersion));
}
try {
IVMInstall install= JavaRuntime.getVMInstall(fProject); // can be null
if (fChangeOnWorkspace) {
IVMInstall vmInstall= findRequiredOrGreaterVMInstall();
if (vmInstall != null) {
IVMInstall defaultVM= JavaRuntime.getDefaultVMInstall(); // can be null
if (defaultVM != null && !defaultVM.equals(install)) {
message.append(CorrectionMessages.ReorgCorrectionsSubProcessor_50_compliance_changeProjectJREToDefault_description);
}
if (defaultVM == null || !isRequiredOrGreaterVMInstall(defaultVM)) {
message.append(Messages.format(CorrectionMessages.ReorgCorrectionsSubProcessor_50_compliance_changeWorkspaceJRE_description, vmInstall.getName()));
}
}
} else {
IExecutionEnvironment bestEE= findBestMatchingEE();
if (bestEE != null) {
if (install == null || !isEEOnClasspath(bestEE)) {
message.append(Messages.format(CorrectionMessages.ReorgCorrectionsSubProcessor_50_compliance_changeProjectJRE_description, bestEE.getId()));
}
}
}
} catch (CoreException e) {
// ignore
}
return message.toString();
}
示例5: init
import org.eclipse.jdt.launching.IVMInstall; //导入方法依赖的package包/类
protected void init()
{
Trace.trace(Trace.CONFIG, "JettyRuntimeComposite: init(): start");
if (_name == null || _jettyRuntimeWC == null)
{
Trace.trace(Trace.CONFIG, "JettyRuntimeComposite: init(): name or jetty runtime working copy is null");
return;
}
if (_runtimeWC.getName() != null)
{
_name.setText(_runtimeWC.getName());
}
else
{
_name.setText("");
}
if (_runtimeWC.getLocation() != null)
{
_installDir.setText(_runtimeWC.getLocation().toOSString());
}
else
{
_installDir.setText("");
}
Trace.trace(Trace.CONFIG, "JettyRuntimeComposite: init(): choosing initial jre");
if (_jettyRuntimeWC.isUsingDefaultJRE())
{
_combo.select(0);
}
else
{
boolean found = false;
int size = _installedJREs.size();
for (int i = 0; i < size; i++)
{
IVMInstall vmInstall = (IVMInstall)_installedJREs.get(i);
if (vmInstall.equals(_jettyRuntimeWC.getVMInstall()))
{
_combo.select(i + 1);
found = true;
}
}
if (!found)
{
_combo.select(0);
}
}
Trace.trace(Trace.CONFIG, "JettyRuntimeComposite: init(): end");
}