mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 02:15:31 +02:00
[240414] NPE in SystemHistoryCombo
This commit is contained in:
parent
f14890553f
commit
2f6d8afd12
2 changed files with 7 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2007 IBM Corporation and others.
|
* Copyright (c) 2002, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* {Name} (company) - description of contribution.
|
* David McKnight (IBM) - [240414] NPE in SystemHistoryCombo
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.ui.dialogs;
|
package org.eclipse.rse.internal.ui.dialogs;
|
||||||
|
@ -164,7 +164,8 @@ public class SystemWorkWithHistoryDialog extends SystemPromptDialog implements
|
||||||
mdnMI = createMenuItem(SystemResources.ACTION_HISTORY_MOVEDOWN_LABEL, SystemResources.ACTION_HISTORY_MOVEDOWN_TOOLTIP);
|
mdnMI = createMenuItem(SystemResources.ACTION_HISTORY_MOVEDOWN_LABEL, SystemResources.ACTION_HISTORY_MOVEDOWN_TOOLTIP);
|
||||||
|
|
||||||
historyList.setMenu(popupMenu);
|
historyList.setMenu(popupMenu);
|
||||||
historyList.setItems(historyInput);
|
if (historyInput != null)
|
||||||
|
historyList.setItems(historyInput);
|
||||||
|
|
||||||
clearButton.setEnabled((historyInput!=null) && (historyInput.length>0));
|
clearButton.setEnabled((historyInput!=null) && (historyInput.length>0));
|
||||||
rmvButton.setEnabled(false);
|
rmvButton.setEnabled(false);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package
|
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package
|
||||||
* David Dykstal (IBM) - [226561] Add API markup for noextend / noimplement where needed
|
* David Dykstal (IBM) - [226561] Add API markup for noextend / noimplement where needed
|
||||||
|
* David McKnight (IBM) - [240414] NPE in SystemHistoryCombo
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.widgets;
|
package org.eclipse.rse.ui.widgets;
|
||||||
|
@ -109,7 +110,7 @@ public class SystemHistoryCombo extends Composite implements ISystemCombo, Trave
|
||||||
this.maxComboEntries = maxComboEntries;
|
this.maxComboEntries = maxComboEntries;
|
||||||
createHistoryButton();
|
createHistoryButton();
|
||||||
String[] history = getHistory();
|
String[] history = getHistory();
|
||||||
if (history.length > 0)
|
if (history != null && history.length > 0)
|
||||||
setItems(history);
|
setItems(history);
|
||||||
addOurButtonSelectionListener();
|
addOurButtonSelectionListener();
|
||||||
}
|
}
|
||||||
|
@ -288,7 +289,7 @@ public class SystemHistoryCombo extends Composite implements ISystemCombo, Trave
|
||||||
{
|
{
|
||||||
this.historyKey = key;
|
this.historyKey = key;
|
||||||
String[] history = getHistory();
|
String[] history = getHistory();
|
||||||
if (history.length > 0)
|
if (history != null && history.length > 0)
|
||||||
setItems(history);
|
setItems(history);
|
||||||
else
|
else
|
||||||
historyCombo.removeAll();
|
historyCombo.removeAll();
|
||||||
|
|
Loading…
Add table
Reference in a new issue