Search in sources :

Example 26 with RuntimeInfo

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;
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) BackendData(org.erlide.backend.api.BackendData)

Example 27 with RuntimeInfo

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;
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) BackendData(org.erlide.backend.api.BackendData)

Example 28 with RuntimeInfo

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;
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo)

Example 29 with RuntimeInfo

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);
}
Also used : RuntimeInfo(org.erlide.runtime.runtimeinfo.RuntimeInfo) ArrayList(java.util.ArrayList) BackingStoreException(org.osgi.service.prefs.BackingStoreException) RuntimeInfoCatalogData(org.erlide.runtime.runtimeinfo.RuntimeInfoCatalogData)

Aggregations

RuntimeInfo (org.erlide.runtime.runtimeinfo.RuntimeInfo)29 ArrayList (java.util.ArrayList)5 BackendData (org.erlide.backend.api.BackendData)5 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 IBackend (org.erlide.backend.api.IBackend)4 CheckboxTableViewer (org.eclipse.jface.viewers.CheckboxTableViewer)3 Composite (org.eclipse.swt.widgets.Composite)3 Label (org.eclipse.swt.widgets.Label)3 RuntimeInfoCatalogData (org.erlide.runtime.runtimeinfo.RuntimeInfoCatalogData)3 Viewer (org.eclipse.jface.viewers.Viewer)2 ViewerComparator (org.eclipse.jface.viewers.ViewerComparator)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Button (org.eclipse.swt.widgets.Button)2 Text (org.eclipse.swt.widgets.Text)2 List (java.util.List)1 IProject (org.eclipse.core.resources.IProject)1 CoreException (org.eclipse.core.runtime.CoreException)1