1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-29 20:05:35 +02:00

[fix] Bug 282996 - [terminal][api] Add "hidden" attribute to terminal connector extension point

This commit is contained in:
Uwe Stieber 2009-07-09 11:00:22 +00:00
parent d2cc958a3c
commit 6cb797eede
21 changed files with 104 additions and 63 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation --> <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point -->
<feature <feature
id="org.eclipse.tm.terminal" id="org.eclipse.tm.terminal"
label="%featureName" label="%featureName"
version="3.0.0.qualifier" version="3.1.0.qualifier"
provider-name="%providerName"> provider-name="%providerName">
<description> <description>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation --> <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point -->
<feature <feature
id="org.eclipse.tm.terminal.sdk" id="org.eclipse.tm.terminal.sdk"
label="%featureName" label="%featureName"
version="3.0.0.qualifier" version="3.1.0.qualifier"
provider-name="%providerName" provider-name="%providerName"
image="eclipse_update_120.jpg"> image="eclipse_update_120.jpg">

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation --> <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2006, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point -->
<feature <feature
id="org.eclipse.tm.terminal.serial" id="org.eclipse.tm.terminal.serial"
label="%featureName" label="%featureName"
version="2.0.100.qualifier" version="2.1.0.qualifier"
provider-name="%providerName"> provider-name="%providerName">
<description> <description>
@ -25,7 +25,7 @@
<requires> <requires>
<import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.tm.terminal" version="3.0.0" match="equivalent"/> <import plugin="org.eclipse.tm.terminal" version="3.1.0" match="equivalent"/>
</requires> </requires>
<plugin <plugin

View file

@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.serial;singleton:=true Bundle-SymbolicName: org.eclipse.tm.terminal.serial;singleton:=true
Bundle-Version: 2.0.100.qualifier Bundle-Version: 2.1.0.qualifier
Bundle-Localization: plugin Bundle-Localization: plugin
Import-Package: gnu.io;resolution:=optional Import-Package: gnu.io;resolution:=optional
Require-Bundle: org.eclipse.ui, Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime, org.eclipse.core.runtime,
org.eclipse.tm.terminal;bundle-version="[3.0.0,3.1.0)" org.eclipse.tm.terminal;bundle-version="[3.1.0,3.2.0)"
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true Eclipse-LazyStart: true
Eclipse-BuddyPolicy: ext Eclipse-BuddyPolicy: ext

View file

@ -7,12 +7,12 @@
Contributors: Contributors:
IBM Corporation - initial API and implementation IBM Corporation - initial API and implementation
--> Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point -->
<feature <feature
id="org.eclipse.tm.terminal.ssh" id="org.eclipse.tm.terminal.ssh"
label="%featureName" label="%featureName"
version="2.0.100.qualifier" version="2.1.0.qualifier"
provider-name="%providerName"> provider-name="%providerName">
<description> <description>
@ -35,7 +35,7 @@
<requires> <requires>
<import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.tm.terminal" version="3.0.0" match="equivalent"/> <import plugin="org.eclipse.tm.terminal" version="3.1.0" match="equivalent"/>
<import plugin="org.eclipse.jsch.core" version="1.0.0" match="compatible"/> <import plugin="org.eclipse.jsch.core" version="1.0.0" match="compatible"/>
<import plugin="com.jcraft.jsch" version="0.1.31" match="compatible"/> <import plugin="com.jcraft.jsch" version="0.1.31" match="compatible"/>
</requires> </requires>

View file

@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.ssh;singleton:=true Bundle-SymbolicName: org.eclipse.tm.terminal.ssh;singleton:=true
Bundle-Version: 2.0.100.qualifier Bundle-Version: 2.1.0.qualifier
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui, Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime, org.eclipse.core.runtime,
org.eclipse.tm.terminal;bundle-version="[3.0.0,3.1.0)", org.eclipse.tm.terminal;bundle-version="[3.1.0,3.2.0)",
com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)", com.jcraft.jsch;bundle-version="[0.1.31,1.0.0)",
org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)" org.eclipse.jsch.core;bundle-version="[1.0.0,2.0.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.4 Bundle-RequiredExecutionEnvironment: J2SE-1.4

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2007, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation --> <feature <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2007, 2009 Wind River Systems, Inc. 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: Wind River - initial API and implementation Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point --> <feature
id="org.eclipse.tm.terminal.telnet" id="org.eclipse.tm.terminal.telnet"
label="%featureName" label="%featureName"
version="2.0.100.qualifier" version="2.1.0.qualifier"
provider-name="%providerName"> provider-name="%providerName">
<description> <description>
@ -24,7 +24,7 @@
<requires> <requires>
<import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.tm.terminal" version="3.0.0" match="equivalent"/> <import plugin="org.eclipse.tm.terminal" version="3.1.0" match="equivalent"/>
</requires> </requires>
<plugin <plugin

View file

@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.telnet;singleton:=true Bundle-SymbolicName: org.eclipse.tm.terminal.telnet;singleton:=true
Bundle-Version: 2.0.100.qualifier Bundle-Version: 2.1.0.qualifier
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui, Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime, org.eclipse.core.runtime,
org.eclipse.tm.terminal;bundle-version="[3.0.0,3.1.0)" org.eclipse.tm.terminal;bundle-version="[3.1.0,3.2.0)"
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1, Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
J2SE-1.4 J2SE-1.4
Export-Package: org.eclipse.tm.internal.terminal.telnet;x-internal:=true Export-Package: org.eclipse.tm.internal.terminal.telnet;x-internal:=true

View file

@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.test;singleton:=true Bundle-SymbolicName: org.eclipse.tm.terminal.test;singleton:=true
Bundle-Version: 2.0.100.qualifier Bundle-Version: 2.1.0.qualifier
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin
Require-Bundle: org.junit, Require-Bundle: org.junit,
org.eclipse.tm.terminal;bundle-version="[3.0.0,3.1.0)", org.eclipse.tm.terminal;bundle-version="[3.1.0,3.2.0)",
org.eclipse.core.runtime, org.eclipse.core.runtime,
org.eclipse.ui org.eclipse.ui
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1, Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,

View file

@ -10,12 +10,14 @@
# Contributors: # Contributors:
# Michael Scharf (Wind River) - initial API and implementation # Michael Scharf (Wind River) - initial API and implementation
# Martin Oberhuber (Wind River) - fixed copyright headers and beautified # Martin Oberhuber (Wind River) - fixed copyright headers and beautified
# Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
--> -->
<plugin> <plugin>
<extension <extension
point="org.eclipse.tm.terminal.terminalConnectors"> point="org.eclipse.tm.terminal.terminalConnectors">
<connector name="Speed Test" <connector
id="org.eclipse.tm.internal.terminal.speedtest.SpeedTestConnector" class="org.eclipse.tm.internal.terminal.speedtest.SpeedTestConnector"
class="org.eclipse.tm.internal.terminal.speedtest.SpeedTestConnector"/> id="org.eclipse.tm.internal.terminal.speedtest.SpeedTestConnector"
name="Speed Test"/>
</extension> </extension>
</plugin> </plugin>

View file

@ -9,6 +9,7 @@
* Michael Scharf (Wind River) - initial API and implementation * Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl
* Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use
* Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.connector; package org.eclipse.tm.internal.terminal.connector;
@ -137,7 +138,7 @@ public class TerminalConnectorFactoryTest extends TestCase {
public TerminalConnectorImpl makeConnector() throws Exception { public TerminalConnectorImpl makeConnector() throws Exception {
return mock; return mock;
} }
},"xID","xName"); },"xID","xName", false);
return c; return c;
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2008 Wind River Systems, Inc. and others. * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - initial API and implementation * Martin Oberhuber (Wind River) - initial API and implementation
* Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.connector; package org.eclipse.tm.internal.terminal.connector;
@ -26,12 +27,14 @@ public class TerminalConnectorPluginTest extends TestCase {
public void testIsInitialized() { public void testIsInitialized() {
if (!Platform.isRunning()) if (!Platform.isRunning())
return; return;
TerminalConnector c = new TerminalConnector(new SimpleFactory(new ConnectorMock()), "xID", "xName"); TerminalConnector c = new TerminalConnector(new SimpleFactory(new ConnectorMock()), "xID", "xName", false);
assertFalse(c.isInitialized()); assertFalse(c.isInitialized());
c.getId(); c.getId();
assertFalse(c.isInitialized()); assertFalse(c.isInitialized());
c.getName(); c.getName();
assertFalse(c.isInitialized()); assertFalse(c.isInitialized());
c.isHidden();
assertFalse(c.isInitialized());
c.getSettingsSummary(); c.getSettingsSummary();
assertFalse(c.isInitialized()); assertFalse(c.isInitialized());
c.setTerminalSize(10, 10); c.setTerminalSize(10, 10);
@ -48,7 +51,7 @@ public class TerminalConnectorPluginTest extends TestCase {
if (!Platform.isRunning()) if (!Platform.isRunning())
return; return;
ConnectorMock mock = new ConnectorMock(); ConnectorMock mock = new ConnectorMock();
TerminalConnector c = new TerminalConnector(new SimpleFactory(mock), "xID", "xName"); TerminalConnector c = new TerminalConnector(new SimpleFactory(mock), "xID", "xName", false);
assertNull(c.getAdapter(ConnectorMock.class)); assertNull(c.getAdapter(ConnectorMock.class));
// the load is called after the connect... // the load is called after the connect...
c.connect(new TerminalControlMock()); c.connect(new TerminalControlMock());

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others. * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,6 +9,7 @@
* Michael Scharf (Wind River) - initial API and implementation * Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl
* Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use * Martin Oberhuber (Wind River) - [204796] Terminal should allow setting the encoding to use
* Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.connector; package org.eclipse.tm.internal.terminal.connector;
@ -139,27 +140,27 @@ public class TerminalConnectorTest extends TestCase {
} }
} }
public void testGetInitializationErrorMessage() { public void testGetInitializationErrorMessage() {
TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false);
c.connect(new TerminalControlMock()); c.connect(new TerminalControlMock());
assertNull(c.getInitializationErrorMessage()); assertNull(c.getInitializationErrorMessage());
c=new TerminalConnector(new SimpleFactory(new ConnectorMock(){ c=new TerminalConnector(new SimpleFactory(new ConnectorMock(){
public void initialize() throws Exception { public void initialize() throws Exception {
throw new Exception("FAILED"); throw new Exception("FAILED");
}}),"xID","xName"); }}),"xID","xName", false);
c.connect(new TerminalControlMock()); c.connect(new TerminalControlMock());
assertEquals("FAILED",c.getInitializationErrorMessage()); assertEquals("FAILED",c.getInitializationErrorMessage());
} }
public void testGetIdAndName() { public void testGetIdAndName() {
TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false);
assertEquals("xID", c.getId()); assertEquals("xID", c.getId());
assertEquals("xName", c.getName()); assertEquals("xName", c.getName());
} }
public void testConnect() { public void testConnect() {
TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false);
assertFalse(c.isInitialized()); assertFalse(c.isInitialized());
c.connect(new TerminalControlMock()); c.connect(new TerminalControlMock());
assertTrue(c.isInitialized()); assertTrue(c.isInitialized());
@ -168,7 +169,7 @@ public class TerminalConnectorTest extends TestCase {
public void testDisconnect() { public void testDisconnect() {
ConnectorMock mock=new ConnectorMock(); ConnectorMock mock=new ConnectorMock();
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
TerminalControlMock control=new TerminalControlMock(); TerminalControlMock control=new TerminalControlMock();
c.connect(control); c.connect(control);
c.disconnect(); c.disconnect();
@ -177,14 +178,14 @@ public class TerminalConnectorTest extends TestCase {
public void testGetTerminalToRemoteStream() { public void testGetTerminalToRemoteStream() {
ConnectorMock mock=new ConnectorMock(); ConnectorMock mock=new ConnectorMock();
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
TerminalControlMock control=new TerminalControlMock(); TerminalControlMock control=new TerminalControlMock();
c.connect(control); c.connect(control);
assertSame(mock.fControl,control); assertSame(mock.fControl,control);
} }
public void testGetSettingsSummary() { public void testGetSettingsSummary() {
TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(new ConnectorMock()),"xID","xName", false);
assertEquals("Not Initialized", c.getSettingsSummary()); assertEquals("Not Initialized", c.getSettingsSummary());
c.connect(new TerminalControlMock()); c.connect(new TerminalControlMock());
assertEquals("Summary", c.getSettingsSummary()); assertEquals("Summary", c.getSettingsSummary());
@ -192,7 +193,7 @@ public class TerminalConnectorTest extends TestCase {
public void testIsLocalEcho() { public void testIsLocalEcho() {
ConnectorMock mock=new ConnectorMock(); ConnectorMock mock=new ConnectorMock();
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
assertFalse(c.isLocalEcho()); assertFalse(c.isLocalEcho());
mock.fEcho=true; mock.fEcho=true;
assertTrue(c.isLocalEcho()); assertTrue(c.isLocalEcho());
@ -200,7 +201,7 @@ public class TerminalConnectorTest extends TestCase {
public void testLoad() { public void testLoad() {
ConnectorMock mock=new ConnectorMock(); ConnectorMock mock=new ConnectorMock();
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
ISettingsStore s=new SettingsMock(); ISettingsStore s=new SettingsMock();
c.load(s); c.load(s);
// the load is called after the connect... // the load is called after the connect...
@ -211,7 +212,7 @@ public class TerminalConnectorTest extends TestCase {
public void testSave() { public void testSave() {
ConnectorMock mock=new ConnectorMock(); ConnectorMock mock=new ConnectorMock();
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
ISettingsStore s=new SettingsMock(); ISettingsStore s=new SettingsMock();
c.save(s); c.save(s);
assertNull(mock.fSaveStore); assertNull(mock.fSaveStore);
@ -222,13 +223,13 @@ public class TerminalConnectorTest extends TestCase {
public void testMakeSettingsPage() { public void testMakeSettingsPage() {
ConnectorMock mock=new ConnectorMock(); ConnectorMock mock=new ConnectorMock();
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
assertNotNull(c.makeSettingsPage()); assertNotNull(c.makeSettingsPage());
} }
public void testSetTerminalSize() { public void testSetTerminalSize() {
ConnectorMock mock=new ConnectorMock(); ConnectorMock mock=new ConnectorMock();
TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName"); TerminalConnector c=new TerminalConnector(new SimpleFactory(mock),"xID","xName", false);
c.setTerminalSize(100, 200); c.setTerminalSize(100, 200);
} }

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <!-- <?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006, 2009 Wind River Systems, Inc. and others. Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0 are made available under the terms of the Eclipse Public License v1.0
@ -7,12 +8,12 @@
Contributors: Contributors:
Wind River - initial API and implementation Wind River - initial API and implementation
Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
--> -->
<feature <feature
id="org.eclipse.tm.terminal.view" id="org.eclipse.tm.terminal.view"
label="%featureName" label="%featureName"
version="2.0.100.qualifier" version="2.1.0.qualifier"
provider-name="%providerName"> provider-name="%providerName">
<description> <description>
@ -35,7 +36,7 @@
<requires> <requires>
<import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.tm.terminal" version="3.0.0" match="equivalent"/> <import plugin="org.eclipse.tm.terminal" version="3.1.0" match="equivalent"/>
</requires> </requires>
<plugin <plugin

View file

@ -2,12 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal.view;singleton:=true Bundle-SymbolicName: org.eclipse.tm.terminal.view;singleton:=true
Bundle-Version: 2.0.100.qualifier Bundle-Version: 2.1.0.qualifier
Bundle-Activator: org.eclipse.tm.internal.terminal.view.TerminalViewPlugin Bundle-Activator: org.eclipse.tm.internal.terminal.view.TerminalViewPlugin
Bundle-Localization: plugin Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui, Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime, org.eclipse.core.runtime,
org.eclipse.tm.terminal;bundle-version="[3.0.0,3.1.0)" org.eclipse.tm.terminal;bundle-version="[3.1.0,3.2.0)"
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true Eclipse-LazyStart: true
Bundle-RequiredExecutionEnvironment: J2SE-1.4 Bundle-RequiredExecutionEnvironment: J2SE-1.4

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2003, 2008 Wind River Systems, Inc. and others. * Copyright (c) 2003, 2009 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -18,6 +18,7 @@
* Michael Scharf (Wind River) - [196454] Initial connection settings dialog should not be blank * Michael Scharf (Wind River) - [196454] Initial connection settings dialog should not be blank
* Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button * Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button
* Martin Oberhuber (Wind River) - [206917] Add validation for Terminal Settings * Martin Oberhuber (Wind River) - [206917] Add validation for Terminal Settings
* Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.view; package org.eclipse.tm.internal.terminal.view;
@ -87,7 +88,7 @@ class TerminalSettingsDlg extends Dialog {
List list=new ArrayList(Arrays.asList(connectors)); List list=new ArrayList(Arrays.asList(connectors));
for (Iterator iterator = list.iterator(); iterator.hasNext();) { for (Iterator iterator = list.iterator(); iterator.hasNext();) {
ITerminalConnector info = (ITerminalConnector) iterator.next(); ITerminalConnector info = (ITerminalConnector) iterator.next();
if(info.isInitialized() && info.getInitializationErrorMessage()!=null) if(info.isInitialized() && info.getInitializationErrorMessage()!=null || info.isHidden())
iterator.remove(); iterator.remove();
} }
connectors=(ITerminalConnector[]) list.toArray(new ITerminalConnector[list.size()]); connectors=(ITerminalConnector[]) list.toArray(new ITerminalConnector[list.size()]);

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %pluginName Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
Bundle-Version: 3.0.0.qualifier Bundle-Version: 3.1.0.qualifier
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
Bundle-Vendor: %providerName Bundle-Vendor: %providerName
Bundle-Localization: plugin Bundle-Localization: plugin

View file

@ -2,15 +2,20 @@
<!-- Schema file written by PDE --> <!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.tm.terminal" xmlns="http://www.w3.org/2001/XMLSchema"> <schema targetNamespace="org.eclipse.tm.terminal" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation> <annotation>
<appinfo> <appInfo>
<meta.schema plugin="org.eclipse.tm.terminal" id="terminalConnectors" name="Terminal Connectors"/> <meta.schema plugin="org.eclipse.tm.terminal" id="terminalConnectors" name="Terminal Connectors"/>
</appinfo> </appInfo>
<documentation> <documentation>
</documentation> </documentation>
</annotation> </annotation>
<element name="extension"> <element name="extension">
<annotation>
<appInfo>
<meta.element />
</appInfo>
</annotation>
<complexType> <complexType>
<sequence minOccurs="1" maxOccurs="unbounded"> <sequence minOccurs="1" maxOccurs="unbounded">
<element ref="connector"/> <element ref="connector"/>
@ -34,9 +39,9 @@
<documentation> <documentation>
</documentation> </documentation>
<appinfo> <appInfo>
<meta.attribute translatable="true"/> <meta.attribute translatable="true"/>
</appinfo> </appInfo>
</annotation> </annotation>
</attribute> </attribute>
</complexType> </complexType>
@ -49,9 +54,9 @@
<documentation> <documentation>
A class extending TerminalConnectorImpl A class extending TerminalConnectorImpl
</documentation> </documentation>
<appinfo> <appInfo>
<meta.attribute kind="java" basedOn="org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl:"/> <meta.attribute kind="java" basedOn="org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnectorImpl:"/>
</appinfo> </appInfo>
</annotation> </annotation>
</attribute> </attribute>
<attribute name="id" type="string" use="required"> <attribute name="id" type="string" use="required">
@ -66,9 +71,16 @@
<documentation> <documentation>
The name of the connection (used in the UI) The name of the connection (used in the UI)
</documentation> </documentation>
<appinfo> <appInfo>
<meta.attribute translatable="true"/> <meta.attribute translatable="true"/>
</appinfo> </appInfo>
</annotation>
</attribute>
<attribute name="hidden" type="boolean">
<annotation>
<documentation>
When set to &quot;true&quot;, the terminal connector will not be visible to the user in connector selections.
</documentation>
</annotation> </annotation>
</attribute> </attribute>
</complexType> </complexType>
@ -79,9 +91,9 @@
<annotation> <annotation>
<appinfo> <appInfo>
<meta.section type="copyright"/> <meta.section type="copyright"/>
</appinfo> </appInfo>
<documentation> <documentation>
Copyright (c) 2006, 2008 Wind River Systems, Inc. and others. Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
@ -92,6 +104,7 @@ http://www.eclipse.org/legal/epl-v10.html
Contributors: Contributors:
Michael Scharf (Wind River) - initial API and implementation Michael Scharf (Wind River) - initial API and implementation
Martin Oberhuber (Wind River) - fixed copyright headers and beautified Martin Oberhuber (Wind River) - fixed copyright headers and beautified
Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
</documentation> </documentation>
</annotation> </annotation>

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others. * Copyright (c) 2007, 2009 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -9,6 +9,7 @@
* Michael Scharf (Wind River) - initial API and implementation * Michael Scharf (Wind River) - initial API and implementation
* Michael Scharf (Wind River) - [200541] Extract from TerminalConnectorExtension.TerminalConnectorProxy * Michael Scharf (Wind River) - [200541] Extract from TerminalConnectorExtension.TerminalConnectorProxy
* Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl * Martin Oberhuber (Wind River) - [225853][api] Provide more default functionality in TerminalConnectorImpl
* Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.connector; package org.eclipse.tm.internal.terminal.connector;
@ -75,6 +76,10 @@ public class TerminalConnector implements ITerminalConnector {
* The unique id the connector * The unique id the connector
*/ */
private final String fId; private final String fId;
/**
* Flag to mark the connector as hidden.
*/
private final boolean fHidden;
/** /**
* The connector * The connector
*/ */
@ -98,10 +103,11 @@ public class TerminalConnector implements ITerminalConnector {
* this ID. * this ID.
* @param name translatable name to display the connector in the UI. * @param name translatable name to display the connector in the UI.
*/ */
public TerminalConnector(TerminalConnector.Factory terminalConnectorFactory, String id, String name) { public TerminalConnector(TerminalConnector.Factory terminalConnectorFactory, String id, String name, boolean hidden) {
fTerminalConnectorFactory = terminalConnectorFactory; fTerminalConnectorFactory = terminalConnectorFactory;
fId = id; fId = id;
fName = name; fName = name;
fHidden = hidden;
} }
public String getInitializationErrorMessage() { public String getInitializationErrorMessage() {
getConnectorImpl(); getConnectorImpl();
@ -115,6 +121,9 @@ public class TerminalConnector implements ITerminalConnector {
public String getName() { public String getName() {
return fName; return fName;
} }
public boolean isHidden() {
return fHidden;
}
private TerminalConnectorImpl getConnectorImpl() { private TerminalConnectorImpl getConnectorImpl() {
if(!isInitialized()) { if(!isInitialized()) {
try { try {

View file

@ -9,6 +9,7 @@
* Michael Scharf (Wind River) - initial API and implementation * Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
* Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend * Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend
* Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.provisional.api; package org.eclipse.tm.internal.terminal.provisional.api;
@ -60,6 +61,12 @@ public interface ITerminalConnector extends IAdaptable {
*/ */
String getName(); String getName();
/**
* @return <code>True</code> if the connector is not visible in user selections.
* @since org.eclipse.tm.terminal 3.1
*/
boolean isHidden();
/** /**
* @return true if the {@link TerminalConnectorImpl} has been initialized. * @return true if the {@link TerminalConnectorImpl} has been initialized.
* If there was an initialization error, {@link #getInitializationErrorMessage()} * If there was an initialization error, {@link #getInitializationErrorMessage()}

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Michael Scharf (Wind River) - initial API and implementation * Michael Scharf (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified * Martin Oberhuber (Wind River) - fixed copyright headers and beautified
* Uwe Stieber (Wind River) - [282996] [terminal][api] Add "hidden" attribute to terminal connector extension point
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.provisional.api; package org.eclipse.tm.internal.terminal.provisional.api;
@ -44,11 +45,13 @@ public class TerminalConnectorExtension {
if(name==null || name.length()==0) { if(name==null || name.length()==0) {
name=id; name=id;
} }
String hidden = config.getAttribute("hidden"); //$NON-NLS-1$
boolean isHidden = hidden != null ? Boolean.parseBoolean(hidden) : false;
TerminalConnector.Factory factory=new TerminalConnector.Factory(){ TerminalConnector.Factory factory=new TerminalConnector.Factory(){
public TerminalConnectorImpl makeConnector() throws Exception { public TerminalConnectorImpl makeConnector() throws Exception {
return (TerminalConnectorImpl)config.createExecutableExtension("class"); //$NON-NLS-1$ return (TerminalConnectorImpl)config.createExecutableExtension("class"); //$NON-NLS-1$
}}; }};
return new TerminalConnector(factory,id,name); return new TerminalConnector(factory,id,name, isHidden);
} }
/** /**