diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:23:09 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:24:09 +0200 |
commit | c7da892cb23d50d4d85746c9a0b6b14bf570989d (patch) | |
tree | e7136073f386d6156f51766c498c52c30c8df85f /plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/views/TerminalViewer.java | |
download | eclipse-poky-kepler-c7da892cb23d50d4d85746c9a0b6b14bf570989d.tar.gz |
initial commit for Enea Linux 4.0daisy
Migrated from the internal git server on the daisy-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/views/TerminalViewer.java')
-rw-r--r-- | plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/views/TerminalViewer.java | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/views/TerminalViewer.java b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/views/TerminalViewer.java new file mode 100644 index 0000000..65a562b --- /dev/null +++ b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/views/TerminalViewer.java | |||
@@ -0,0 +1,139 @@ | |||
1 | /******************************************************************************** | ||
2 | * Copyright (c) 2002, 2009 IBM Corporation and others. All rights reserved. | ||
3 | * This program and the accompanying materials are made available under the terms | ||
4 | * of the Eclipse Public License v1.0 which accompanies this distribution, and is | ||
5 | * available at http://www.eclipse.org/legal/epl-v10.html | ||
6 | * | ||
7 | * Initial Contributors: | ||
8 | * The following IBM employees contributed to the Remote System Explorer | ||
9 | * component that contains this file: David McKnight, Kushal Munir, | ||
10 | * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, | ||
11 | * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. | ||
12 | * | ||
13 | * Contributors: | ||
14 | * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType | ||
15 | * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core | ||
16 | * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API | ||
17 | * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui | ||
18 | * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() | ||
19 | * David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work | ||
20 | * Kevin Doyle (IBM) - [198534] Shell Menu Enablement Issue's | ||
21 | * Radoslav Gerganov(ProSyst) - [181563] Fix hardcoded Ctrl+Space for remote shell content assist | ||
22 | * Yu-Fen Kuo (MontaVista) - Adapted from SystemCommandsViewPart | ||
23 | * Anna Dushistova (MontaVista) - Adapted from SystemCommandsViewPart | ||
24 | * Yu-Fen Kuo (MontaVista) - [227572] RSE Terminal doesn't reset the "connected" state when the shell exits | ||
25 | * Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl | ||
26 | * Anna Dushistova (MontaVista) - [238257] Request a help text when no tab is open in "Remote Shell", "Remote Monitor" and "Terminals" views | ||
27 | * Anna Dushistova (MontaVista) - [235097] [rseterminal] Cannot activate RSE Terminals View with the keyboard | ||
28 | * Anna Dushistova (MontaVista) - [267609] [rseterminal] The first "Launch Terminal" command creates no terminal tab | ||
29 | *********************************************************************************/ | ||
30 | package org.yocto.sdk.remotetools.views; | ||
31 | |||
32 | import org.yocto.sdk.remotetools.Messages; | ||
33 | |||
34 | import org.eclipse.jface.action.IMenuManager; | ||
35 | import org.eclipse.jface.viewers.ISelection; | ||
36 | import org.eclipse.jface.viewers.ISelectionChangedListener; | ||
37 | import org.eclipse.jface.viewers.SelectionChangedEvent; | ||
38 | import org.eclipse.swt.SWT; | ||
39 | import org.eclipse.swt.events.SelectionEvent; | ||
40 | import org.eclipse.swt.events.SelectionListener; | ||
41 | import org.eclipse.swt.widgets.Composite; | ||
42 | import org.eclipse.swt.widgets.Label; | ||
43 | import org.eclipse.ui.ISelectionListener; | ||
44 | import org.eclipse.ui.ISelectionService; | ||
45 | import org.eclipse.ui.IWorkbenchPart; | ||
46 | import org.eclipse.ui.part.PageBook; | ||
47 | import org.eclipse.ui.part.ViewPart; | ||
48 | |||
49 | public class TerminalViewer extends ViewPart implements ISelectionListener, | ||
50 | SelectionListener, ISelectionChangedListener/*, | ||
51 | ISystemResourceChangeListener,*/{ | ||
52 | |||
53 | private TerminalViewTab tabFolder; | ||
54 | |||
55 | private PageBook pagebook; | ||
56 | |||
57 | private Label noTabShownLabel; | ||
58 | |||
59 | public static String VIEW_ID = "org.eclipse.rse.terminals.ui.view.TerminalView"; //$NON-NLS-1$ | ||
60 | |||
61 | public void createPartControl(Composite parent) { | ||
62 | pagebook = new PageBook(parent, SWT.NONE); | ||
63 | |||
64 | tabFolder = new TerminalViewTab(pagebook, this); | ||
65 | tabFolder.getFolder().addSelectionListener(this); | ||
66 | |||
67 | // Page 2: Nothing selected | ||
68 | noTabShownLabel = new Label(pagebook, SWT.TOP + SWT.LEFT + SWT.WRAP); | ||
69 | noTabShownLabel.setText(Messages.TerminalViewer_text); | ||
70 | showEmptyPage(); | ||
71 | |||
72 | |||
73 | ISelectionService selectionService = getSite().getWorkbenchWindow() | ||
74 | .getSelectionService(); | ||
75 | selectionService.addSelectionListener(this); | ||
76 | /* | ||
77 | ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); | ||
78 | |||
79 | registry.addSystemResourceChangeListener(this); | ||
80 | */ | ||
81 | } | ||
82 | |||
83 | public void setFocus() { | ||
84 | tabFolder.setFocus(); | ||
85 | } | ||
86 | |||
87 | public void selectionChanged(IWorkbenchPart part, ISelection selection) { | ||
88 | // TODO Auto-generated method stub | ||
89 | |||
90 | } | ||
91 | |||
92 | public void widgetDefaultSelected(SelectionEvent e) { | ||
93 | // TODO Auto-generated method stub | ||
94 | |||
95 | } | ||
96 | |||
97 | public void widgetSelected(SelectionEvent e) { | ||
98 | // TODO Auto-generated method stub | ||
99 | |||
100 | } | ||
101 | |||
102 | public void selectionChanged(SelectionChangedEvent event) { | ||
103 | // TODO Auto-generated method stub | ||
104 | |||
105 | } | ||
106 | /* | ||
107 | public void systemResourceChanged(ISystemResourceChangeEvent event) { | ||
108 | if (event.getType() == ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_REMOVED) { | ||
109 | Object source = event.getSource(); | ||
110 | if (source instanceof TerminalElement) { | ||
111 | tabFolder.disposePageFor(((TerminalElement) source).getName()); | ||
112 | } | ||
113 | }else if(event.getType() == ISystemResourceChangeEvents.EVENT_REFRESH){ | ||
114 | if(tabFolder.getItemCount() == 0) | ||
115 | showEmptyPage(); | ||
116 | else | ||
117 | showTabsPage(); | ||
118 | } | ||
119 | } | ||
120 | */ | ||
121 | |||
122 | public void menuAboutToShow(IMenuManager manager) { | ||
123 | // TODO Auto-generated method stub | ||
124 | |||
125 | } | ||
126 | |||
127 | public TerminalViewTab getTabFolder() { | ||
128 | return tabFolder; | ||
129 | } | ||
130 | |||
131 | private void showEmptyPage() { | ||
132 | pagebook.showPage(noTabShownLabel); | ||
133 | } | ||
134 | |||
135 | private void showTabsPage(){ | ||
136 | pagebook.showPage(tabFolder); | ||
137 | } | ||
138 | |||
139 | } \ No newline at end of file | ||