mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 07:55:24 +02:00
[253037] ClassCastException in SystemDynamicUserActionMenu, SystemDynamicCompileMenu
This commit is contained in:
parent
70365fef23
commit
dbb50116d7
2 changed files with 8 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
||||||
* Xuan Chen (IBM) - [222470] initial contribution.
|
* Xuan Chen (IBM) - [222470] initial contribution.
|
||||||
* Kevin Doyle (IBM) - [239805] User Action/Compile menu's shouldn't be tied to IRemoteFile
|
* Kevin Doyle (IBM) - [239805] User Action/Compile menu's shouldn't be tied to IRemoteFile
|
||||||
* Kevin Doyle (IBM) - [239700] Compile Commands are available on items it shouldn't
|
* Kevin Doyle (IBM) - [239700] Compile Commands are available on items it shouldn't
|
||||||
|
* Kevin Doyle (IBM) - [253037] ClassCastException in SystemDynamicUserActionMenu, SystemDynamicCompileMenu
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
package org.eclipse.rse.internal.useractions.api.ui.compile;
|
package org.eclipse.rse.internal.useractions.api.ui.compile;
|
||||||
|
|
||||||
|
@ -56,7 +57,9 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem
|
||||||
ISystemProfile[] activeProfiles = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfiles();
|
ISystemProfile[] activeProfiles = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfiles();
|
||||||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||||
ISelection selection = window.getSelectionService().getSelection();
|
ISelection selection = window.getSelectionService().getSelection();
|
||||||
Object firstSelection = ((IStructuredSelection) selection).getFirstElement();
|
Object firstSelection = null;
|
||||||
|
if (selection instanceof IStructuredSelection)
|
||||||
|
firstSelection = ((IStructuredSelection) selection).getFirstElement();
|
||||||
if (firstSelection == null)
|
if (firstSelection == null)
|
||||||
{
|
{
|
||||||
return new IContributionItem[0];
|
return new IContributionItem[0];
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Xuan Chen (IBM) - [222470] initial contribution.
|
* Xuan Chen (IBM) - [222470] initial contribution.
|
||||||
* Kevin Doyle (IBM) - [239700] Compile Commands are available on items it shouldn't -- Modified SystemDynamicCompileMenu
|
* Kevin Doyle (IBM) - [239700] Compile Commands are available on items it shouldn't -- Modified SystemDynamicCompileMenu
|
||||||
|
* Kevin Doyle (IBM) - [253037] ClassCastException in SystemDynamicUserActionMenu, SystemDynamicCompileMenu
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
package org.eclipse.rse.internal.useractions.api.ui.compile;
|
package org.eclipse.rse.internal.useractions.api.ui.compile;
|
||||||
|
|
||||||
|
@ -55,7 +56,9 @@ public class SystemDynamicCompilePromptMenu extends CompoundContributionItem
|
||||||
ISystemProfile[] activeProfiles = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfiles();
|
ISystemProfile[] activeProfiles = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfiles();
|
||||||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||||
ISelection selection = window.getSelectionService().getSelection();
|
ISelection selection = window.getSelectionService().getSelection();
|
||||||
Object firstSelection = ((IStructuredSelection) selection).getFirstElement();
|
Object firstSelection = null;
|
||||||
|
if (selection instanceof IStructuredSelection)
|
||||||
|
firstSelection = ((IStructuredSelection) selection).getFirstElement();
|
||||||
if (firstSelection == null)
|
if (firstSelection == null)
|
||||||
{
|
{
|
||||||
return new IContributionItem[0];
|
return new IContributionItem[0];
|
||||||
|
|
Loading…
Add table
Reference in a new issue