use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class BackendFactory method getIdeBackendData.
private BackendData getIdeBackendData() {
final RuntimeInfo info = getIdeRuntimeInfo();
final BackendData result = new BackendData(info);
result.setNodeName(getIdeNodeName());
result.setDebug(false);
result.setConsole(SystemConfiguration.getInstance().isDeveloper());
result.setManaged(true);
result.setRestartable(true);
result.setLongName(SystemConfiguration.hasFeatureEnabled("erlide.shortname") ? false : HostnameChecker.getInstance().canUseLongNames());
result.setInternal(true);
result.setReportErrors(true);
result.setContext(CodeContext.IDE);
return result;
}
use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class ErlangLaunchDelegate method getBackendData.
private BackendData getBackendData(final ILaunchConfiguration config, final String mode, final ILaunch launch) throws CoreException {
if (config == null) {
throw new IllegalArgumentException();
}
RuntimeInfo runtimeInfo = BackendCore.getRuntimeInfoCatalog().getRuntime(config.getAttribute(ErlRuntimeAttributes.RUNTIME_NAME, ""));
if (runtimeInfo == null || !runtimeInfo.isValid()) {
runtimeInfo = BackendCore.getRuntimeInfoCatalog().getDefaultRuntime();
}
if (runtimeInfo == null) {
ErlLogger.error("Can't create backend without a runtime defined!");
return null;
}
String defaultNodeName = getDefaultNodeNameFromProjects(config, Long.toHexString(System.currentTimeMillis() & 0xFFFFFF));
final String nodeName = config.getAttribute(ErlRuntimeAttributes.NODE_NAME, defaultNodeName);
final boolean managed = ErlangLaunchDelegate.shouldManageNode(nodeName, BackendCore.getEpmdWatcher());
BackendData data = new BackendData(runtimeInfo, config, mode, managed);
data = configureBackend(data, mode, launch);
return data;
}
use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class RuntimeInfoLoader method load.
public static RuntimeInfo load(final Preferences node) {
final String path = node.get(RuntimeInfoLoader.CODE_PATH, "");
final RuntimeInfo info = new RuntimeInfo(node.name(), node.get(RuntimeInfoLoader.HOME_DIR, ""), node.get(RuntimeInfoLoader.ARGS, ""), PreferencesUtils.unpackList(path));
return info;
}
use of org.erlide.runtime.runtimeinfo.RuntimeInfo in project erlide_eclipse by erlang.
the class RuntimeInfoPreferencesSerializer method loadPrefs.
private RuntimeInfoCatalogData loadPrefs(final RuntimeInfoCatalogData data, final IEclipsePreferences root) {
String[] children;
final Collection<RuntimeInfo> runtimes = new ArrayList<>(data.runtimes);
try {
children = root.childrenNames();
for (final String name : children) {
final RuntimeInfo rt = RuntimeInfoLoader.load(root.node(name));
runtimes.add(rt);
}
} catch (final BackingStoreException e) {
ErlLogger.warn(e);
}
final String defaultRuntimeName = root.get(RuntimeInfoPreferencesSerializer.DEFAULT_KEY, data.defaultRuntimeName);
final String ideRuntimeName = root.get(RuntimeInfoPreferencesSerializer.ERLIDE_KEY, data.erlideRuntimeName);
return new RuntimeInfoCatalogData(runtimes, defaultRuntimeName, ideRuntimeName);
}
Aggregations