mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-18 22:45:23 +02:00
[341573] NPE on Show in Remote Systems view from Remote System Details view
This commit is contained in:
parent
2981614a55
commit
5e79253a7c
1 changed files with 27 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2009 IBM Corporation. All rights reserved.
|
* Copyright (c) 2010 IBM Corporation. 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
|
||||||
|
@ -11,6 +11,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David McKnight (IBM) - [160105] [usability] Universal action needed to locate a resource in the Remote Systems View
|
* David McKnight (IBM) - [160105] [usability] Universal action needed to locate a resource in the Remote Systems View
|
||||||
* David McKnight (IBM) - [218227][usability] Contribute a "Show in RSE" action to Resource Navigator and Project Explorer
|
* David McKnight (IBM) - [218227][usability] Contribute a "Show in RSE" action to Resource Navigator and Project Explorer
|
||||||
|
* David McKnight (IBM) - [341573] NPE on Show in Remote Systems view from Remote System Details view
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
package org.eclipse.rse.internal.ui.actions;
|
package org.eclipse.rse.internal.ui.actions;
|
||||||
|
|
||||||
|
@ -38,6 +39,7 @@ import org.eclipse.rse.internal.ui.view.SystemView;
|
||||||
import org.eclipse.rse.internal.ui.view.SystemViewPart;
|
import org.eclipse.rse.internal.ui.view.SystemViewPart;
|
||||||
import org.eclipse.rse.services.clientserver.messages.CommonMessages;
|
import org.eclipse.rse.services.clientserver.messages.CommonMessages;
|
||||||
import org.eclipse.rse.ui.SystemBasePlugin;
|
import org.eclipse.rse.ui.SystemBasePlugin;
|
||||||
|
import org.eclipse.rse.ui.model.ISystemPromptableObject;
|
||||||
import org.eclipse.rse.ui.view.ContextObject;
|
import org.eclipse.rse.ui.view.ContextObject;
|
||||||
import org.eclipse.rse.ui.view.ISystemTree;
|
import org.eclipse.rse.ui.view.ISystemTree;
|
||||||
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||||
|
@ -340,6 +342,7 @@ public class ShowInSystemsViewDelegate implements IViewActionDelegate {
|
||||||
ISystemViewElementAdapter adapter = getAdapter((IAdaptable)_selectedObject);
|
ISystemViewElementAdapter adapter = getAdapter((IAdaptable)_selectedObject);
|
||||||
if (adapter != null){
|
if (adapter != null){
|
||||||
ISubSystem subSystem = adapter.getSubSystem(_selectedObject);
|
ISubSystem subSystem = adapter.getSubSystem(_selectedObject);
|
||||||
|
if (subSystem != null){
|
||||||
if (subSystem.getSubSystemConfiguration().supportsFilters()){
|
if (subSystem.getSubSystemConfiguration().supportsFilters()){
|
||||||
// no match, so we will expand from filter
|
// no match, so we will expand from filter
|
||||||
// query matching filter in a job (to avoid main thread)
|
// query matching filter in a job (to avoid main thread)
|
||||||
|
@ -357,6 +360,9 @@ public class ShowInSystemsViewDelegate implements IViewActionDelegate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SystemViewPart activateSystemView(){
|
public SystemViewPart activateSystemView(){
|
||||||
|
@ -381,8 +387,14 @@ public class ShowInSystemsViewDelegate implements IViewActionDelegate {
|
||||||
}
|
}
|
||||||
IStructuredSelection sel = (IStructuredSelection)selection;
|
IStructuredSelection sel = (IStructuredSelection)selection;
|
||||||
if (sel.size() == 1){
|
if (sel.size() == 1){
|
||||||
_action.setEnabled(true);
|
|
||||||
_selectedObject = sel.getFirstElement();
|
_selectedObject = sel.getFirstElement();
|
||||||
|
if (_selectedObject instanceof ISystemPromptableObject){
|
||||||
|
_selectedObject = null; // promptables not supported here
|
||||||
|
_action.setEnabled(false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_action.setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_action.setEnabled(false);
|
_action.setEnabled(false);
|
||||||
|
|
Loading…
Add table
Reference in a new issue