Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e3ee65dc479303dc8084dae073a66487cb096fee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*******************************************************************************
 * Copyright (c) 2010 Intel Corporation. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Liping Ke(Intel Corp.) - initial API and implementation
 ******************************************************************************/
package org.eclipse.tm.internal.tcf.rse.terminals;

import org.eclipse.core.runtime.IProgressMonitor;

import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.terminals.AbstractTerminalService;
import org.eclipse.rse.services.terminals.ITerminalShell;
import org.eclipse.tm.internal.tcf.rse.ITCFService;
import org.eclipse.tm.internal.tcf.rse.ITCFSessionProvider;
import org.eclipse.tm.internal.tcf.rse.Messages;
import org.eclipse.tm.internal.tcf.rse.shells.TCFTerminalShell;

public class TCFTerminalService extends AbstractTerminalService implements ITCFService{
    private final ITCFSessionProvider fSessionProvider;

    /**
     * Return the TCF property set, and fill it with default values if it has
     * not been created yet. Extender may override in order to set different
     * default values.
     *
     * @return a property set holding properties understood by the TCF
     *         connector service.
     */
    public ITerminalShell launchTerminal(String ptyType, String encoding,
            String[] environment, String initialWorkingDirectory,
            String commandToRun, IProgressMonitor monitor)
            throws SystemMessageException {
        TCFTerminalShell hostShell = new TCFTerminalShell(fSessionProvider, ptyType, encoding, environment, initialWorkingDirectory, commandToRun);
        return hostShell;
    }


    public TCFTerminalService(ITCFSessionProvider sessionProvider) {
        fSessionProvider = sessionProvider;
    }

    public ITCFSessionProvider getSessionProvider() {
                return fSessionProvider;
        }
    @Override
    public String getName() {
        return Messages.TCFTerminalService_Name;
    }
    @Override
    public String getDescription() {
        return Messages.TCFTerminalService_Description;
    }
}

Back to the top