diff options
author | Uwe Stieber | 2014-11-27 09:30:04 +0000 |
---|---|---|
committer | Uwe Stieber | 2014-11-27 09:30:04 +0000 |
commit | 518535909d8cd6cc842c5322ff33f703ffc8c34f (patch) | |
tree | b4ebc51a0eed48c252f910052cdd26cbf5f641ef | |
parent | 6d1ac9403b659ccf4d9d189ca285157fe838c7bf (diff) | |
download | org.eclipse.tcf-518535909d8cd6cc842c5322ff33f703ffc8c34f.tar.gz org.eclipse.tcf-518535909d8cd6cc842c5322ff33f703ffc8c34f.tar.xz org.eclipse.tcf-518535909d8cd6cc842c5322ff33f703ffc8c34f.zip |
Terminals: Allow additional custom filtering of applicable terminal
launcher delegates
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java | 18 |
1 files changed, 16 insertions, 2 deletions
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 128cf7895..71c179400 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 @@ -341,7 +341,7 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog implements IV } for (ILauncherDelegate delegate : delegates) { - if (delegate.isHidden()) continue; + if (delegate.isHidden() || isFiltered(selection, delegate)) continue; String label = delegate.getLabel(); if (label == null || "".equals(label.trim())) label = delegate.getId(); //$NON-NLS-1$ label2delegate.put(label, delegate); @@ -361,7 +361,7 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog implements IV } for (ILauncherDelegate delegate : delegates) { - if (delegate.isHidden()) continue; + if (delegate.isHidden() || isFiltered(selection, delegate)) continue; String label = delegate.getLabel(); if (label == null || "".equals(label.trim())) label = delegate.getId(); //$NON-NLS-1$ label2delegate.put(label, delegate); @@ -372,6 +372,20 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog implements IV combo.setItems(items.toArray(new String[items.size()])); } + /** + * Hook to allow additional filtering of the applicable launcher delegates. + * <p> + * <b>Note:</b> The default implementation always returns <code>false</code>. + * + * @param selection The selection or <code>null</code>. + * @param delegate The launcher delegate. Must not be <code>null</code>. + * + * @return <code>True</code> if the launcher delegate is filtered based on the given selection, <code>false</code> otherwise. + */ + protected boolean isFiltered(ISelection selection, ILauncherDelegate delegate) { + return false; + } + /* (non-Javadoc) * @see org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer#validate() */ |