use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class RuntimePreferencePage method removeRuntimes.
public void removeRuntimes(final RuntimeInfo[] vms) {
final IStructuredSelection prev = (IStructuredSelection) getSelection();
if (runtimes.size() == 1) {
setMessage("You can't delete the last runtime definition", IMessageProvider.INFORMATION);
return;
}
for (final RuntimeInfo element : vms) {
runtimes.remove(element);
}
fRuntimeList.refresh();
final IStructuredSelection curr = (IStructuredSelection) getSelection();
if (!curr.equals(prev)) {
final List<RuntimeInfo> installs = getRuntimes();
if (curr.size() == 0 && installs.size() == 1) {
// pick a default VM automatically
setSelection(new StructuredSelection(installs.get(0)));
} else {
fireSelectionChanged();
}
}
selectSingle();
}
use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class IErlProjectTest method getRuntimeInfo.
// RuntimeInfo getRuntimeInfo();
@Test
public void getRuntimeInfo() throws Exception {
final IErlProject aProject = ErlModelTestBase.projects[0];
final RuntimeInfo info = aProject.getRuntimeInfo();
// final String expected = ResourcesPlugin.getWorkspace().getRoot()
// .getLocation().toString();
assertNotNull(info);
// The working dir might be relative to the project and can also be "."
// We need to convert it to a canonical absolute path in order to be
// able to compare it with a value.
// This is not very portable across OSs
}
use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class BackendData method asLaunchConfiguration.
public ILaunchConfiguration asLaunchConfiguration() {
final ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
final ILaunchConfigurationType type = manager.getLaunchConfigurationType(IErlangLaunchDelegateConstants.CONFIGURATION_TYPE_INTERNAL);
ILaunchConfigurationWorkingCopy workingCopy;
try {
final RuntimeInfo info = getRuntimeInfo();
final String name = getNodeName();
workingCopy = type.newInstance(null, name);
if (info.getVersion().isReleaseCompatible(new RuntimeVersion(17))) {
workingCopy.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, Charsets.UTF_8.name());
} else {
workingCopy.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, Charsets.ISO_8859_1.name());
}
workingCopy.setAttribute(DebugPlugin.ATTR_PROCESS_FACTORY_ID, "org.erlide.backend.ertsProcessFactory");
workingCopy.setAttribute(ErlRuntimeAttributes.NODE_NAME, getNodeName());
workingCopy.setAttribute(ErlRuntimeAttributes.RUNTIME_NAME, info.getName());
workingCopy.setAttribute(ErlRuntimeAttributes.COOKIE, getCookie());
// workingCopy.setAttribute(ErlLaunchAttributes.CONSOLE,
// !options.contains(BackendOptions.NO_CONSOLE));
workingCopy.setAttribute(ErlRuntimeAttributes.USE_LONG_NAME, hasLongName());
workingCopy.setAttribute(ErlRuntimeAttributes.INTERNAL, isInternal());
return workingCopy;
} catch (final CoreException e) {
ErlLogger.error(e);
return null;
}
}
use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class RuntimePreferencePage method editRuntime.
protected void editRuntime() {
final IStructuredSelection selection = (IStructuredSelection) fRuntimeList.getSelection();
final RuntimeInfo vm = (RuntimeInfo) selection.getFirstElement();
if (vm == null) {
return;
}
final AddRuntimeDialog dialog = new AddRuntimeDialog(this, getShell(), vm);
dialog.setTitle(RuntimePreferenceMessages.edit_title);
if (dialog.open() != Window.OK) {
return;
}
removeRuntimes(new RuntimeInfo[] { vm });
catalog.removeRuntime(vm.getName());
fRuntimeList.refresh();
}
use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class RuntimePreferencePage method sortByName.
/**
* Sorts by VM name.
*/
protected void sortByName() {
fRuntimeList.setComparator(new ViewerComparator() {
@Override
public int compare(final Viewer viewer, final Object e1, final Object e2) {
if (e1 instanceof RuntimeInfo && e2 instanceof RuntimeInfo) {
final RuntimeInfo left = (RuntimeInfo) e1;
final RuntimeInfo right = (RuntimeInfo) e2;
return left.getName().compareToIgnoreCase(right.getName());
}
return super.compare(viewer, e1, e2);
}
@Override
public boolean isSorterProperty(final Object element, final String property) {
return true;
}
});
fSortColumn = 1;
}
Aggregations