1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 20:45:22 +02:00

[267609] Fixed problem with array out of bounds exception occuring when terminal view is not active at launching new terminal.

This commit is contained in:
Anna Dushistova 2009-04-22 21:47:32 +00:00
parent a51cdab773
commit 20e13bcd58
2 changed files with 8 additions and 2 deletions

View file

@ -20,6 +20,7 @@
* Michael Scharf (Wind River) - [236203] [rseterminal] Potentially UI blocking code in TerminalViewTab.createTabItem * Michael Scharf (Wind River) - [236203] [rseterminal] Potentially UI blocking code in TerminalViewTab.createTabItem
* Anna Dushistova (MontaVista) - [244437] [rseterminal] Possible race condition when multiple Terminals are launched after each other * Anna Dushistova (MontaVista) - [244437] [rseterminal] Possible race condition when multiple Terminals are launched after each other
* Martin Oberhuber (Wind River) - [247700] Terminal uses ugly fonts in JEE package * Martin Oberhuber (Wind River) - [247700] Terminal uses ugly fonts in JEE package
* Anna Dushistova (MontaVista) - [267609] [rseterminal] The first "Launch Terminal" command creates no terminal tab
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.terminals.ui.views; package org.eclipse.rse.internal.terminals.ui.views;
@ -151,6 +152,10 @@ public class TerminalViewTab extends Composite {
} }
public int getItemCount(){
return tabFolder.getItemCount();
}
public CTabItem getSelectedTab() { public CTabItem getSelectedTab() {
if (tabFolder.getItemCount() > 0) { if (tabFolder.getItemCount() > 0) {
int index = tabFolder.getSelectionIndex(); int index = tabFolder.getSelectionIndex();

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved. * Copyright (c) 2002, 2009 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * 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 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -25,6 +25,7 @@
* Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl * Anna Dushistova (MontaVista) - [228577] [rseterminal] Clean up RSE Terminal impl
* Anna Dushistova (MontaVista) - [238257] Request a help text when no tab is open in "Remote Shell", "Remote Monitor" and "Terminals" views * Anna Dushistova (MontaVista) - [238257] Request a help text when no tab is open in "Remote Shell", "Remote Monitor" and "Terminals" views
* Anna Dushistova (MontaVista) - [235097] [rseterminal] Cannot activate RSE Terminals View with the keyboard * Anna Dushistova (MontaVista) - [235097] [rseterminal] Cannot activate RSE Terminals View with the keyboard
* Anna Dushistova (MontaVista) - [267609] [rseterminal] The first "Launch Terminal" command creates no terminal tab
*********************************************************************************/ *********************************************************************************/
package org.eclipse.rse.internal.terminals.ui.views; package org.eclipse.rse.internal.terminals.ui.views;
@ -125,7 +126,7 @@ public class TerminalViewer extends ViewPart implements ISelectionListener,
tabFolder.disposePageFor(((TerminalElement) source).getName()); tabFolder.disposePageFor(((TerminalElement) source).getName());
} }
}else if(event.getType() == ISystemResourceChangeEvents.EVENT_REFRESH){ }else if(event.getType() == ISystemResourceChangeEvents.EVENT_REFRESH){
if(tabFolder.getSelectedTab()==null) if(tabFolder.getItemCount() == 0)
showEmptyPage(); showEmptyPage();
else else
showTabsPage(); showTabsPage();