|
Lines 1-16
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others. |
2 |
* Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v10.html |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
7 |
* |
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* Michael Scharf (Wind River) - initial API and implementation |
9 |
* Michael Scharf (Wind River) - initial API and implementation |
| 10 |
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified |
10 |
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified |
|
|
11 |
* Martin Oberhuber (Wind River) - [200541] Return real terminal connector if possible |
| 11 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
| 12 |
package org.eclipse.tm.internal.terminal.provisional.api; |
13 |
package org.eclipse.tm.internal.terminal.provisional.api; |
| 13 |
|
14 |
|
|
|
15 |
import java.io.InputStream; |
| 14 |
import java.io.OutputStream; |
16 |
import java.io.OutputStream; |
| 15 |
import java.util.ArrayList; |
17 |
import java.util.ArrayList; |
| 16 |
import java.util.List; |
18 |
import java.util.List; |
|
Lines 37-42
Link Here
|
| 37 |
fProxy=proxy; |
39 |
fProxy=proxy; |
| 38 |
} |
40 |
} |
| 39 |
public ITerminalConnector getConnector() { |
41 |
public ITerminalConnector getConnector() { |
|
|
42 |
if (fProxy.isInitialized()) { |
| 43 |
return fProxy.getConnector(); |
| 44 |
} |
| 40 |
return fProxy; |
45 |
return fProxy; |
| 41 |
} |
46 |
} |
| 42 |
public String getId() { |
47 |
public String getId() { |
|
Lines 55-61
Link Here
|
| 55 |
} |
60 |
} |
| 56 |
/** |
61 |
/** |
| 57 |
* A placeholder for the ITerminalConnector. It gets initialized when |
62 |
* A placeholder for the ITerminalConnector. It gets initialized when |
| 58 |
* the real connector is needed. |
63 |
* the real connector is needed. |
| 59 |
* The following methods can be called without initializing |
64 |
* The following methods can be called without initializing |
| 60 |
* the contributed class: {@link #getId()}, {@link #getName()}, |
65 |
* the contributed class: {@link #getId()}, {@link #getName()}, |
| 61 |
* {@link #getSettingsSummary()},{@link #load(ISettingsStore)}, |
66 |
* {@link #getSettingsSummary()},{@link #load(ISettingsStore)}, |
|
Lines 133-138
Link Here
|
| 133 |
public OutputStream getOutputStream() { |
138 |
public OutputStream getOutputStream() { |
| 134 |
return getConnector().getOutputStream(); |
139 |
return getConnector().getOutputStream(); |
| 135 |
} |
140 |
} |
|
|
141 |
public InputStream getInputStream() { |
| 142 |
return getConnector().getInputStream(); |
| 143 |
} |
| 136 |
public String getSettingsSummary() { |
144 |
public String getSettingsSummary() { |
| 137 |
if(fConnector!=null) |
145 |
if(fConnector!=null) |
| 138 |
return getConnector().getSettingsSummary(); |
146 |
return getConnector().getSettingsSummary(); |
|
Lines 167-173
Link Here
|
| 167 |
fConnector.setTerminalSize(newWidth, newHeight); |
175 |
fConnector.setTerminalSize(newWidth, newHeight); |
| 168 |
} |
176 |
} |
| 169 |
} |
177 |
} |
| 170 |
public void initialize() throws Exception { |
178 |
public void initialize() throws Exception { |
| 171 |
throw new IllegalStateException("Connector already initialized!"); //$NON-NLS-1$ |
179 |
throw new IllegalStateException("Connector already initialized!"); //$NON-NLS-1$ |
| 172 |
} |
180 |
} |
| 173 |
} |
181 |
} |
|
Lines 178-184
Link Here
|
| 178 |
return (ITerminalConnector)config.createExecutableExtension("class"); //$NON-NLS-1$ |
186 |
return (ITerminalConnector)config.createExecutableExtension("class"); //$NON-NLS-1$ |
| 179 |
} |
187 |
} |
| 180 |
/** |
188 |
/** |
| 181 |
* @return a new list of ITerminalConnectorInfo. |
189 |
* @return a new list of ITerminalConnectorInfo. |
| 182 |
*/ |
190 |
*/ |
| 183 |
public static ITerminalConnectorInfo[] getTerminalConnectors() { |
191 |
public static ITerminalConnectorInfo[] getTerminalConnectors() { |
| 184 |
IConfigurationElement[] config=RegistryFactory.getRegistry().getConfigurationElementsFor("org.eclipse.tm.terminal.terminalConnector"); //$NON-NLS-1$ |
192 |
IConfigurationElement[] config=RegistryFactory.getRegistry().getConfigurationElementsFor("org.eclipse.tm.terminal.terminalConnector"); //$NON-NLS-1$ |