Lines 15-20
Link Here
|
15 |
* David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work |
15 |
* David McKnight (IBM) - [165680] "Show in Remote Shell View" does not work |
16 |
* Yu-Fen Kuo (MontaVista) - Adapted from CommandsViewWorkbook |
16 |
* Yu-Fen Kuo (MontaVista) - Adapted from CommandsViewWorkbook |
17 |
* Anna Dushistova (MontaVista) - Adapted from CommandsViewWorkbook |
17 |
* Anna Dushistova (MontaVista) - Adapted from CommandsViewWorkbook |
|
|
18 |
* Yu-Fen Kuo (MontaVista) - [227572] RSE Terminal doesn't reset the "connected" state when the shell exits |
18 |
********************************************************************************/ |
19 |
********************************************************************************/ |
19 |
package org.eclipse.rse.internal.terminals.ui.views; |
20 |
package org.eclipse.rse.internal.terminals.ui.views; |
20 |
|
21 |
|
Lines 23-30
Link Here
|
23 |
import org.eclipse.jface.action.IMenuManager; |
24 |
import org.eclipse.jface.action.IMenuManager; |
24 |
import org.eclipse.jface.action.MenuManager; |
25 |
import org.eclipse.jface.action.MenuManager; |
25 |
import org.eclipse.jface.action.Separator; |
26 |
import org.eclipse.jface.action.Separator; |
|
|
27 |
import org.eclipse.rse.core.RSECorePlugin; |
28 |
import org.eclipse.rse.core.events.ISystemResourceChangeEvents; |
29 |
import org.eclipse.rse.core.events.SystemResourceChangeEvent; |
26 |
import org.eclipse.rse.core.model.IHost; |
30 |
import org.eclipse.rse.core.model.IHost; |
|
|
31 |
import org.eclipse.rse.core.model.ISystemRegistry; |
27 |
import org.eclipse.rse.internal.terminals.ui.TerminalServiceHelper; |
32 |
import org.eclipse.rse.internal.terminals.ui.TerminalServiceHelper; |
|
|
33 |
import org.eclipse.rse.subsystems.terminals.core.ITerminalServiceSubSystem; |
34 |
import org.eclipse.rse.subsystems.terminals.core.TerminalServiceSubSystem; |
35 |
import org.eclipse.rse.subsystems.terminals.core.elements.TerminalElement; |
28 |
import org.eclipse.rse.ui.view.ISystemViewElementAdapter; |
36 |
import org.eclipse.rse.ui.view.ISystemViewElementAdapter; |
29 |
import org.eclipse.swt.SWT; |
37 |
import org.eclipse.swt.SWT; |
30 |
import org.eclipse.swt.custom.CTabFolder; |
38 |
import org.eclipse.swt.custom.CTabFolder; |
Lines 38-43
Link Here
|
38 |
import org.eclipse.swt.layout.GridData; |
46 |
import org.eclipse.swt.layout.GridData; |
39 |
import org.eclipse.swt.widgets.Composite; |
47 |
import org.eclipse.swt.widgets.Composite; |
40 |
import org.eclipse.swt.widgets.Control; |
48 |
import org.eclipse.swt.widgets.Control; |
|
|
49 |
import org.eclipse.swt.widgets.Display; |
41 |
import org.eclipse.swt.widgets.Menu; |
50 |
import org.eclipse.swt.widgets.Menu; |
42 |
import org.eclipse.tm.internal.terminal.actions.TerminalAction; |
51 |
import org.eclipse.tm.internal.terminal.actions.TerminalAction; |
43 |
import org.eclipse.tm.internal.terminal.actions.TerminalActionClearAll; |
52 |
import org.eclipse.tm.internal.terminal.actions.TerminalActionClearAll; |
Lines 203-209
Link Here
|
203 |
; |
212 |
; |
204 |
} |
213 |
} |
205 |
item.setData(DATA_KEY_CONTROL, terminalControl); |
214 |
item.setData(DATA_KEY_CONTROL, terminalControl); |
206 |
|
|
|
207 |
} |
215 |
} |
208 |
item.setControl(c); |
216 |
item.setControl(c); |
209 |
tabFolder.setSelection(item); |
217 |
tabFolder.setSelection(item); |
Lines 361-372
Link Here
|
361 |
.getAdapter(ISystemViewElementAdapter.class); |
369 |
.getAdapter(ISystemViewElementAdapter.class); |
362 |
if (va != null) { |
370 |
if (va != null) { |
363 |
updateWithUniqueTitle(va.getName(root), titem); |
371 |
updateWithUniqueTitle(va.getName(root), titem); |
|
|
372 |
setTabImage(root, titem); |
373 |
} |
374 |
} |
375 |
private void setTabImage(IAdaptable root, CTabItem titem) { |
376 |
ISystemViewElementAdapter va = (ISystemViewElementAdapter) root |
377 |
.getAdapter(ISystemViewElementAdapter.class); |
378 |
if (va != null) { |
379 |
if (root instanceof IHost){ |
380 |
ITerminalServiceSubSystem terminalServiceSubSystem = TerminalServiceHelper.getTerminalSubSystem((IHost)root); |
381 |
TerminalElement element = terminalServiceSubSystem.getChild(titem.getText()); |
382 |
if (element != null){ |
383 |
va = (ISystemViewElementAdapter) element.getAdapter(ISystemViewElementAdapter.class); |
384 |
titem.setImage(va.getImageDescriptor(element).createImage()); |
385 |
return; |
386 |
} |
387 |
} |
388 |
|
364 |
titem.setImage(va.getImageDescriptor(root).createImage()); |
389 |
titem.setImage(va.getImageDescriptor(root).createImage()); |
365 |
} |
390 |
} |
366 |
} |
391 |
} |
|
|
392 |
public void setState(final TerminalState state) { |
393 |
if (state == TerminalState.CLOSED || state == TerminalState.CONNECTED){ |
394 |
Display.getDefault().asyncExec(new Runnable(){ |
395 |
public void run() { |
396 |
CTabItem item = tabFolder.getSelection(); |
397 |
if (item != null && !item.isDisposed()){ |
398 |
Object data = item.getData(); |
399 |
if (data instanceof IHost){ |
400 |
IHost host = (IHost)data; |
401 |
final ITerminalServiceSubSystem terminalServiceSubSystem = TerminalServiceHelper.getTerminalSubSystem(host); |
402 |
|
403 |
if (state == TerminalState.CONNECTED) |
404 |
TerminalServiceHelper.updateTerminalShellForTerminalElement(item); |
405 |
|
406 |
setTabImage(host, item); |
407 |
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); |
408 |
registry.fireEvent(new SystemResourceChangeEvent(terminalServiceSubSystem, |
409 |
ISystemResourceChangeEvents.EVENT_REFRESH, terminalServiceSubSystem)); |
410 |
} |
411 |
} |
412 |
} |
413 |
}); |
414 |
} |
367 |
|
415 |
|
368 |
public void setState(TerminalState state) { |
|
|
369 |
// terminalControl.setState(state); |
370 |
} |
416 |
} |
371 |
|
417 |
|
372 |
public void setTerminalTitle(String title) { |
418 |
public void setTerminalTitle(String title) { |
Lines 386-397
Link Here
|
386 |
|
432 |
|
387 |
public void onTerminalConnect() { |
433 |
public void onTerminalConnect() { |
388 |
// TODO Auto-generated method stub |
434 |
// TODO Auto-generated method stub |
389 |
|
435 |
|
390 |
} |
436 |
} |
391 |
|
437 |
|
392 |
public void onTerminalDisconnect() { |
438 |
public void onTerminalDisconnect() { |
393 |
// TODO Auto-generated method stub |
439 |
// TODO Auto-generated method stub |
394 |
|
440 |
|
395 |
} |
441 |
} |
396 |
|
442 |
|
397 |
public void onTerminalFontChanged() { |
443 |
public void onTerminalFontChanged() { |