Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-05-22 04:39:25 -0400
committerUwe Stieber2014-05-22 04:41:42 -0400
commitd354abdc5c93ebd9c84cf9ddc81d4b69c2e87f32 (patch)
treea977d7f8c508c4b4273b7b1d9666357df0e16e4d
parentd2e4c755fe29d1aaed9fee33ecfc0f80acb52132 (diff)
downloadorg.eclipse.tcf-d354abdc5c93ebd9c84cf9ddc81d4b69c2e87f32.tar.gz
org.eclipse.tcf-d354abdc5c93ebd9c84cf9ddc81d4b69c2e87f32.tar.xz
org.eclipse.tcf-d354abdc5c93ebd9c84cf9ddc81d4b69c2e87f32.zip
Target Explorer: Introduce an explizit "hidden" attribute for terminal launcher delegates
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/schema/launcherDelegates.exsd423
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/AbstractLauncherDelegate.java17
5 files changed, 244 insertions, 216 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml
index 9316b0575..2cf7615de 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml
@@ -25,7 +25,8 @@
<delegate
class="org.eclipse.tcf.te.tcf.terminals.ui.launcher.TerminalsLauncherDelegate"
id="org.eclipse.tcf.te.ui.terminals.launcher.tcf"
- label="%launcherDelegate.label">
+ label="%launcherDelegate.label"
+ hidden="true">
<enablement>
<with variable="selection">
<count value="1"/>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/schema/launcherDelegates.exsd b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/schema/launcherDelegates.exsd
index 243e1dbdc..49c11e6ee 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/schema/launcherDelegates.exsd
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/schema/launcherDelegates.exsd
@@ -1,208 +1,215 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.tcf.te.ui.terminals" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.tcf.te.ui.terminals" id="launcherDelegates" name="Terminal Launcher Delegates"/>
- </appinfo>
- <documentation>
- This extension point is used to contribute terminal launcher delegates.
-&lt;p&gt;
-Terminal launcher delegates contributes terminal settings widget to the &lt;code&gt;LaunchTerminalSettingsDialog&lt;/code&gt; required to open a remote terminal through a specific communication channel, like TCF or SSH.
- </documentation>
- </annotation>
-
- <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="delegate" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="delegate">
- <annotation>
- <documentation>
- Declares a terminal launcher delegate contribution.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="class" minOccurs="0" maxOccurs="1"/>
- <element ref="description" minOccurs="0" maxOccurs="1"/>
- <element ref="enablement" minOccurs="0" maxOccurs="1"/>
- </sequence>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- The unique id of the terminal launcher delegate contribution.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="label" type="string">
- <annotation>
- <documentation>
- The label representing the terminal launcher delegate within the UI.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- The class that implements &lt;code&gt;org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate&lt;/code&gt;.
-&lt;p&gt;
-The terminal launcher delegate implementation class must be specified either by the class attribute or the class child element!
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate:org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="description" type="string">
- <annotation>
- <documentation>
- A short description of the terminal connector type to be presented in the UI.
- </documentation>
- </annotation>
- </element>
-
- <element name="class">
- <annotation>
- <documentation>
- Used when creating an &lt;code&gt;IExecutableExtension&lt;/code&gt; with a named parameter, or more than one.
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- The class that implements &lt;code&gt;org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate&lt;/code&gt;.
-&lt;p&gt;
-The terminal launcher delegate implementation class must be specified either by the class attribute or the class child element!
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate:org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="parameter">
- <annotation>
- <documentation>
- A parameter for an &lt;code&gt;IExecutableExtension&lt;/code&gt;.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- &lt;p&gt;The parameter name.&lt;/p&gt;
- </documentation>
- </annotation>
- </attribute>
- <attribute name="value" type="string" use="required">
- <annotation>
- <documentation>
- &lt;p&gt;The parameter value.&lt;/p&gt;
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- Target Explorer 1.0.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- This is an example of the extension point usage:
-&lt;p&gt;
-&lt;pre&gt;&lt;code&gt;
- &lt;extension point=&quot;org.eclipse.tcf.te.ui.terminals.launcherDelegates&quot;&gt;
- &lt;delegate
- id=&quot;org.eclipse.tcf.te.ui.terminals.launcher.tcf&quot;
- class=&quot;org.eclipse.tcf.te.tcf.terminals.ui.internal.TerminalLauncherDelegate&quot;
- label=&quot;TCF Terminal&quot;&gt;
- &lt;enablement&gt;
- ...
- &lt;/enablement&gt;
- &lt;/delegate&gt;
- &lt;/extension&gt;
-&lt;/code&gt;&lt;/pre&gt;
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- The provider of a launcher delegate must implement &lt;samp&gt;org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate&lt;/samp&gt;.
- </documentation>
- </annotation>
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2011 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.
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tcf.te.ui.terminals" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.tcf.te.ui.terminals" id="launcherDelegates" name="Terminal Launcher Delegates"/>
+ </appinfo>
+ <documentation>
+ This extension point is used to contribute terminal launcher delegates.
+&lt;p&gt;
+Terminal launcher delegates contributes terminal settings widget to the &lt;code&gt;LaunchTerminalSettingsDialog&lt;/code&gt; required to open a remote terminal through a specific communication channel, like TCF or SSH.
+ </documentation>
+ </annotation>
+
+ <include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="delegate" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="delegate">
+ <annotation>
+ <documentation>
+ Declares a terminal launcher delegate contribution.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="class" minOccurs="0" maxOccurs="1"/>
+ <element ref="description" minOccurs="0" maxOccurs="1"/>
+ <element ref="enablement" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ The unique id of the terminal launcher delegate contribution.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+ The label representing the terminal launcher delegate within the UI.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate&lt;/code&gt;.
+&lt;p&gt;
+The terminal launcher delegate implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate:org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="hidden" type="boolean">
+ <annotation>
+ <documentation>
+ If &lt;code&gt;true&lt;/code&gt;, than the terminal launcher delegate is not visible in the UI, even if a possible &lt;code&gt;enablement&lt;/code&gt; will evaluate to &lt;code&gt;true&lt;/code&gt;.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="description" type="string">
+ <annotation>
+ <documentation>
+ A short description of the terminal connector type to be presented in the UI.
+ </documentation>
+ </annotation>
+ </element>
+
+ <element name="class">
+ <annotation>
+ <documentation>
+ Used when creating an &lt;code&gt;IExecutableExtension&lt;/code&gt; with a named parameter, or more than one.
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The class that implements &lt;code&gt;org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate&lt;/code&gt; or extends &lt;code&gt;org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate&lt;/code&gt;.
+&lt;p&gt;
+The terminal launcher delegate implementation class must be specified either by the class attribute or the class child element!
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate:org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="parameter">
+ <annotation>
+ <documentation>
+ A parameter for an &lt;code&gt;IExecutableExtension&lt;/code&gt;.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter name.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="value" type="string" use="required">
+ <annotation>
+ <documentation>
+ &lt;p&gt;The parameter value.&lt;/p&gt;
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ Target Explorer 1.0.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ This is an example of the extension point usage:
+&lt;p&gt;
+&lt;pre&gt;&lt;code&gt;
+ &lt;extension point=&quot;org.eclipse.tcf.te.ui.terminals.launcherDelegates&quot;&gt;
+ &lt;delegate
+ id=&quot;org.eclipse.tcf.te.ui.terminals.launcher.tcf&quot;
+ class=&quot;org.eclipse.tcf.te.tcf.terminals.ui.internal.TerminalLauncherDelegate&quot;
+ label=&quot;TCF Terminal&quot;&gt;
+ &lt;enablement&gt;
+ ...
+ &lt;/enablement&gt;
+ &lt;/delegate&gt;
+ &lt;/extension&gt;
+&lt;/code&gt;&lt;/pre&gt;
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ The provider of a launcher delegate must implement &lt;samp&gt;org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate&lt;/samp&gt;.
+ </documentation>
+ </annotation>
+
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ Copyright (c) 2011 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.
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java
index 25df054fa..666ad0c2b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/interfaces/ILauncherDelegate.java
@@ -22,6 +22,13 @@ import org.eclipse.tcf.te.ui.controls.BaseDialogPageControl;
public interface ILauncherDelegate extends IExecutableExtension, IAdaptable {
/**
+ * Returns if or if not the launcher delegate is hidden for the user.
+ *
+ * @return <code>True</code> if the launcher delegate is hidden, <code>false</code> otherwise.
+ */
+ public boolean isHidden();
+
+ /**
* Returns the enablement expression.
*
* @return The enablement expression or <code>null</code>.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
index b341f1676..ab67dfdca 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
@@ -389,7 +389,7 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog implements IV
ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER, LaunchTerminalSettingsDialog.this);
}
- ILauncherDelegate[] delegates = LauncherDelegateManager.getInstance().getLauncherDelegates(true);
+ ILauncherDelegate[] delegates = LauncherDelegateManager.getInstance().getLauncherDelegates(false);
if (UIPlugin.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_LAUNCH_TERMINAL_COMMAND_HANDLER)) {
UIPlugin.getTraceHandler().trace("Got launcher delegates after " + (System.currentTimeMillis() - start) + " ms.", //$NON-NLS-1$ //$NON-NLS-2$
@@ -397,13 +397,8 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog implements IV
}
for (ILauncherDelegate delegate : delegates) {
+ if (delegate.isHidden()) continue;
String label = delegate.getLabel();
- String id=delegate.getId();
- // filter out tcf terminal
- if(id.equals("org.eclipse.tcf.te.ui.terminals.launcher.tcf")){ //$NON-NLS-1$
- continue;
- }
-
if (label == null || "".equals(label.trim())) label = delegate.getId(); //$NON-NLS-1$
label2delegate.put(label, delegate);
items.add(label);
@@ -422,6 +417,7 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog implements IV
}
for (ILauncherDelegate delegate : delegates) {
+ if (delegate.isHidden()) continue;
String label = delegate.getLabel();
if (label == null || "".equals(label.trim())) label = delegate.getId(); //$NON-NLS-1$
label2delegate.put(label, delegate);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/AbstractLauncherDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/AbstractLauncherDelegate.java
index a8fac4bdf..e09627f04 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/AbstractLauncherDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/launcher/AbstractLauncherDelegate.java
@@ -22,6 +22,8 @@ import org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate;
public abstract class AbstractLauncherDelegate extends ExecutableExtension implements ILauncherDelegate {
// The converted expression
private Expression expression;
+ // The hidden attribute
+ private boolean hidden;
/* (non-Javadoc)
* @see org.eclipse.tcf.te.runtime.extensions.ExecutableExtension#doSetInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
@@ -36,6 +38,13 @@ public abstract class AbstractLauncherDelegate extends ExecutableExtension imple
if (children != null && children.length > 0) {
expression = ExpressionConverter.getDefault().perform(children[0]);
}
+
+ // Read "hidden" attribute
+ String value = config.getAttribute("hidden"); //$NON-NLS-1$
+ if (value != null && !"".equals(value.trim())) { //$NON-NLS-1$
+ hidden = Boolean.parseBoolean(value);
+ }
+
}
/* (non-Javadoc)
@@ -45,4 +54,12 @@ public abstract class AbstractLauncherDelegate extends ExecutableExtension imple
public Expression getEnablement() {
return expression;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.interfaces.ILauncherDelegate#isHidden()
+ */
+ @Override
+ public boolean isHidden() {
+ return hidden;
+ }
}

Back to the top