1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 06:32:10 +02:00

Fixed missing explicit casts

This commit is contained in:
Uwe Stieber 2015-05-07 09:24:10 +02:00
parent 3c482638be
commit 53e33dcc46
6 changed files with 16 additions and 16 deletions

View file

@ -38,7 +38,7 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
if ("canDisconnect".equals(property) && receiver instanceof ITerminalsView) { //$NON-NLS-1$ if ("canDisconnect".equals(property) && receiver instanceof ITerminalsView) { //$NON-NLS-1$
CTabItem tabItem = null; CTabItem tabItem = null;
TabFolderManager manager = ((ITerminalsView)receiver).getAdapter(TabFolderManager.class); TabFolderManager manager = (TabFolderManager) ((ITerminalsView)receiver).getAdapter(TabFolderManager.class);
if (manager != null) { if (manager != null) {
tabItem = manager.getActiveTabItem(); tabItem = manager.getActiveTabItem();
} }

View file

@ -440,7 +440,7 @@ public class ConsoleManager {
ITerminalsView view = (ITerminalsView)part; ITerminalsView view = (ITerminalsView)part;
// Get the tab folder manager associated with the view // Get the tab folder manager associated with the view
TabFolderManager manager = view.getAdapter(TabFolderManager.class); TabFolderManager manager = (TabFolderManager) view.getAdapter(TabFolderManager.class);
if (manager == null) return null; if (manager == null) return null;
// Lookup an existing console first // Lookup an existing console first
@ -506,7 +506,7 @@ public class ConsoleManager {
if (view == null) return null; if (view == null) return null;
// Get the tab folder manager associated with the view // Get the tab folder manager associated with the view
TabFolderManager manager = view.getAdapter(TabFolderManager.class); TabFolderManager manager = (TabFolderManager) view.getAdapter(TabFolderManager.class);
if (manager == null) return null; if (manager == null) return null;
return manager.findTabItem(title, connector, data); return manager.findTabItem(title, connector, data);
@ -532,7 +532,7 @@ public class ConsoleManager {
IViewReference ref = refs[i]; IViewReference ref = refs[i];
IViewPart part = ref != null ? ref.getView(false) : null; IViewPart part = ref != null ? ref.getView(false) : null;
if (part instanceof ITerminalsView) { if (part instanceof ITerminalsView) {
CTabFolder tabFolder = part.getAdapter(CTabFolder.class); CTabFolder tabFolder = (CTabFolder) part.getAdapter(CTabFolder.class);
if (tabFolder == null) continue; if (tabFolder == null) continue;
CTabItem[] candidates = tabFolder.getItems(); CTabItem[] candidates = tabFolder.getItems();
for (CTabItem candidate : candidates) { for (CTabItem candidate : candidates) {
@ -575,7 +575,7 @@ public class ConsoleManager {
IViewPart part = ref.getView(true); IViewPart part = ref.getView(true);
if (part instanceof ITerminalsView) { if (part instanceof ITerminalsView) {
// Get the tab folder manager associated with the view // Get the tab folder manager associated with the view
TabFolderManager manager = part.getAdapter(TabFolderManager.class); TabFolderManager manager = (TabFolderManager) part.getAdapter(TabFolderManager.class);
if (manager == null) { if (manager == null) {
continue; continue;
} }

View file

@ -201,7 +201,7 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
* @return The tab folder or <code>null</code>. * @return The tab folder or <code>null</code>.
*/ */
protected final CTabFolder getTabFolder() { protected final CTabFolder getTabFolder() {
return getParentView().getAdapter(CTabFolder.class); return (CTabFolder) getParentView().getAdapter(CTabFolder.class);
} }
/** /**
@ -296,7 +296,7 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
} }
// Set the context menu // Set the context menu
TabFolderMenuHandler menuHandler = getParentView().getAdapter(TabFolderMenuHandler.class); TabFolderMenuHandler menuHandler = (TabFolderMenuHandler) getParentView().getAdapter(TabFolderMenuHandler.class);
if (menuHandler != null) { if (menuHandler != null) {
Menu menu = (Menu)menuHandler.getAdapter(Menu.class); Menu menu = (Menu)menuHandler.getAdapter(Menu.class);
if (menu != null) { if (menu != null) {
@ -408,7 +408,7 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
} }
// Set the context menu // Set the context menu
TabFolderMenuHandler menuHandler = getParentView().getAdapter(TabFolderMenuHandler.class); TabFolderMenuHandler menuHandler = (TabFolderMenuHandler) getParentView().getAdapter(TabFolderMenuHandler.class);
if (menuHandler != null) { if (menuHandler != null) {
Menu menu = (Menu)menuHandler.getAdapter(Menu.class); Menu menu = (Menu)menuHandler.getAdapter(Menu.class);
if (menu != null) { if (menu != null) {

View file

@ -131,7 +131,7 @@ public class TabFolderMenuHandler extends PlatformObject {
* @return The tab folder or <code>null</code>. * @return The tab folder or <code>null</code>.
*/ */
protected final CTabFolder getTabFolder() { protected final CTabFolder getTabFolder() {
return getParentView().getAdapter(CTabFolder.class); return (CTabFolder) getParentView().getAdapter(CTabFolder.class);
} }
/** /**
@ -221,7 +221,7 @@ public class TabFolderMenuHandler extends PlatformObject {
// Determine if pasting to the active tab require backslash translation // Determine if pasting to the active tab require backslash translation
boolean needsTranslation = false; boolean needsTranslation = false;
TabFolderManager manager = getParentView().getAdapter(TabFolderManager.class); TabFolderManager manager = (TabFolderManager) getParentView().getAdapter(TabFolderManager.class);
if (manager != null) { if (manager != null) {
// If we have the active tab item, we can get the active terminal control // If we have the active tab item, we can get the active terminal control
CTabItem activeTabItem = manager.getActiveTabItem(); CTabItem activeTabItem = manager.getActiveTabItem();
@ -293,7 +293,7 @@ public class TabFolderMenuHandler extends PlatformObject {
}); });
// Create and add the select encoding action // Create and add the select encoding action
add (new SelectEncodingAction(getParentView().getAdapter(TabFolderManager.class)) { add (new SelectEncodingAction((TabFolderManager) getParentView().getAdapter(TabFolderManager.class)) {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.tm.internal.terminal.control.actions.AbstractTerminalAction#getTarget() * @see org.eclipse.tm.internal.terminal.control.actions.AbstractTerminalAction#getTarget()
*/ */
@ -313,7 +313,7 @@ public class TabFolderMenuHandler extends PlatformObject {
ITerminalViewControl terminal = null; ITerminalViewControl terminal = null;
// Get the active tab item from the tab folder manager // Get the active tab item from the tab folder manager
TabFolderManager manager = getParentView().getAdapter(TabFolderManager.class); TabFolderManager manager = (TabFolderManager) getParentView().getAdapter(TabFolderManager.class);
if (manager != null) { if (manager != null) {
// If we have the active tab item, we can get the active terminal control // If we have the active tab item, we can get the active terminal control
CTabItem activeTabItem = manager.getActiveTabItem(); CTabItem activeTabItem = manager.getActiveTabItem();

View file

@ -102,7 +102,7 @@ public class TabFolderToolbarHandler extends PlatformObject {
* @return The tab folder or <code>null</code>. * @return The tab folder or <code>null</code>.
*/ */
protected final CTabFolder getTabFolder() { protected final CTabFolder getTabFolder() {
return getParentView().getAdapter(CTabFolder.class); return (CTabFolder) getParentView().getAdapter(CTabFolder.class);
} }
/** /**
@ -114,7 +114,7 @@ public class TabFolderToolbarHandler extends PlatformObject {
ITerminalViewControl terminal = null; ITerminalViewControl terminal = null;
// Get the active tab item from the tab folder manager // Get the active tab item from the tab folder manager
TabFolderManager manager = getParentView().getAdapter(TabFolderManager.class); TabFolderManager manager = (TabFolderManager) getParentView().getAdapter(TabFolderManager.class);
if (manager != null) { if (manager != null) {
// If we have the active tab item, we can get the active terminal control // If we have the active tab item, we can get the active terminal control
CTabItem activeTabItem = manager.getActiveTabItem(); CTabItem activeTabItem = manager.getActiveTabItem();

View file

@ -695,13 +695,13 @@ public class TerminalsView extends ViewPart implements ITerminalsView, IShowInTa
// If the selection is valid, fire the command to open the local terminal // If the selection is valid, fire the command to open the local terminal
if (isValid) { if (isValid) {
ICommandService service = PlatformUI.getWorkbench().getService(ICommandService.class); ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
Command command = service != null ? service.getCommand("org.eclipse.tm.terminal.connector.local.command.launch") : null; //$NON-NLS-1$ Command command = service != null ? service.getCommand("org.eclipse.tm.terminal.connector.local.command.launch") : null; //$NON-NLS-1$
if (command != null && command.isDefined() && command.isEnabled()) { if (command != null && command.isDefined() && command.isEnabled()) {
try { try {
ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(command, null); ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(command, null);
Assert.isNotNull(pCmd); Assert.isNotNull(pCmd);
IHandlerService handlerSvc = PlatformUI.getWorkbench().getService(IHandlerService.class); IHandlerService handlerSvc = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
Assert.isNotNull(handlerSvc); Assert.isNotNull(handlerSvc);
IEvaluationContext ctx = handlerSvc.getCurrentState(); IEvaluationContext ctx = handlerSvc.getCurrentState();
ctx = new EvaluationContext(ctx, selection); ctx = new EvaluationContext(ctx, selection);