1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 18:56:02 +02:00

Bug 392092 - Extend ITerminalView API to allow programmatically opening a UI-less connector

This commit is contained in:
Kris De Volder 2012-11-06 11:49:21 +01:00 committed by Uwe Stieber
parent ef36e367bc
commit e9a193a3a9
2 changed files with 48 additions and 18 deletions

View file

@ -10,19 +10,33 @@
* Martin Oberhuber (Wind River) - [227537] moved actions from terminal.view to terminal plugin * Martin Oberhuber (Wind River) - [227537] moved actions from terminal.view to terminal plugin
* Michael Scharf (Wind River) - [172483] switch between connections * Michael Scharf (Wind River) - [172483] switch between connections
* 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
* Kris De Volder (VMWare) - [392092] Extend ITerminalView API to allow programmatically opening a UI-less connector
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.view; package org.eclipse.tm.internal.terminal.view;
import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector;
public interface ITerminalView { public interface ITerminalView {
/** /**
* Create a new terminal connection within the view. * Create a new terminal connection within the view.
*/ */
void onTerminalNewTerminal(); void onTerminalNewTerminal();
/**
* Programmatically create a new terminal connection within the view. This method
* does the same thing as onTerminalNewTerminal, but instead of popping up a settings
* dialog to allow the user fill in connection details, a connector is provided as
* a parameter. The connector should have all of its details pre-configured so it can
* be opened without requiring user input.
*/
void newTerminal(ITerminalConnector c);
/** /**
* Create a new Terminal view. * Create a new Terminal view.
*/ */
void onTerminalNewView(); void onTerminalNewView();
void onTerminalConnect(); void onTerminalConnect();
void onTerminalDisconnect(); void onTerminalDisconnect();
void onTerminalSettings(); void onTerminalSettings();

View file

@ -27,6 +27,7 @@
* Martin Oberhuber (Wind River) - [205486] Enable ScrollLock * Martin Oberhuber (Wind River) - [205486] Enable ScrollLock
* Ahmet Alptekin (Tubitak) - [244405] Add a UI Control for setting the Terminal's encoding * Ahmet Alptekin (Tubitak) - [244405] Add a UI Control for setting the Terminal's encoding
* Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget * Martin Oberhuber (Wind River) - [378691][api] push Preferences into the Widget
* Kris De Volder (VMWare) - [392092] Extend ITerminalView API to allow programmatically opening a UI-less connector
*******************************************************************************/ *******************************************************************************/
package org.eclipse.tm.internal.terminal.view; package org.eclipse.tm.internal.terminal.view;
@ -46,7 +47,6 @@ import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MenuEvent; import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.events.MenuListener; import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
@ -219,6 +219,7 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
uniqueTitle=title+" "+i++; //$NON-NLS-1$ uniqueTitle=title+" "+i++; //$NON-NLS-1$
} }
} }
/** /**
* Display a new Terminal view. This method is called when the user clicks the New * Display a new Terminal view. This method is called when the user clicks the New
* Terminal button in any Terminal view's toolbar. * Terminal button in any Terminal view's toolbar.
@ -231,6 +232,21 @@ public class TerminalView extends ViewPart implements ITerminalView, ITerminalVi
} }
} }
/**
* Programmatically create a new terminal connection within the view. This method
* does the same thing as onTerminalNewTerminal, but instead of popping up a settings
* dialog to allow the user fill in connection details, a connector is provided as
* a parameter. The connector should have all of its details pre-configured so it can
* be opened without requiring user input.
*/
public void newTerminal(ITerminalConnector c) {
this.setupControls();
if(c!=null) {
this.setConnector(c);
this.onTerminalConnect();
}
}
public void onTerminalNewView() { public void onTerminalNewView() {
try { try {
// The second argument to showView() is a unique String identifying the // The second argument to showView() is a unique String identifying the