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:
parent
3c482638be
commit
53e33dcc46
6 changed files with 16 additions and 16 deletions
|
@ -38,7 +38,7 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
|
|||
if ("canDisconnect".equals(property) && receiver instanceof ITerminalsView) { //$NON-NLS-1$
|
||||
CTabItem tabItem = null;
|
||||
|
||||
TabFolderManager manager = ((ITerminalsView)receiver).getAdapter(TabFolderManager.class);
|
||||
TabFolderManager manager = (TabFolderManager) ((ITerminalsView)receiver).getAdapter(TabFolderManager.class);
|
||||
if (manager != null) {
|
||||
tabItem = manager.getActiveTabItem();
|
||||
}
|
||||
|
|
|
@ -440,7 +440,7 @@ public class ConsoleManager {
|
|||
ITerminalsView view = (ITerminalsView)part;
|
||||
|
||||
// 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;
|
||||
|
||||
// Lookup an existing console first
|
||||
|
@ -506,7 +506,7 @@ public class ConsoleManager {
|
|||
if (view == null) return null;
|
||||
|
||||
// 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;
|
||||
|
||||
return manager.findTabItem(title, connector, data);
|
||||
|
@ -532,7 +532,7 @@ public class ConsoleManager {
|
|||
IViewReference ref = refs[i];
|
||||
IViewPart part = ref != null ? ref.getView(false) : null;
|
||||
if (part instanceof ITerminalsView) {
|
||||
CTabFolder tabFolder = part.getAdapter(CTabFolder.class);
|
||||
CTabFolder tabFolder = (CTabFolder) part.getAdapter(CTabFolder.class);
|
||||
if (tabFolder == null) continue;
|
||||
CTabItem[] candidates = tabFolder.getItems();
|
||||
for (CTabItem candidate : candidates) {
|
||||
|
@ -575,7 +575,7 @@ public class ConsoleManager {
|
|||
IViewPart part = ref.getView(true);
|
||||
if (part instanceof ITerminalsView) {
|
||||
// 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) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
|
|||
* @return The tab folder or <code>null</code>.
|
||||
*/
|
||||
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
|
||||
TabFolderMenuHandler menuHandler = getParentView().getAdapter(TabFolderMenuHandler.class);
|
||||
TabFolderMenuHandler menuHandler = (TabFolderMenuHandler) getParentView().getAdapter(TabFolderMenuHandler.class);
|
||||
if (menuHandler != null) {
|
||||
Menu menu = (Menu)menuHandler.getAdapter(Menu.class);
|
||||
if (menu != null) {
|
||||
|
@ -408,7 +408,7 @@ public class TabFolderManager extends PlatformObject implements ISelectionProvid
|
|||
}
|
||||
|
||||
// Set the context menu
|
||||
TabFolderMenuHandler menuHandler = getParentView().getAdapter(TabFolderMenuHandler.class);
|
||||
TabFolderMenuHandler menuHandler = (TabFolderMenuHandler) getParentView().getAdapter(TabFolderMenuHandler.class);
|
||||
if (menuHandler != null) {
|
||||
Menu menu = (Menu)menuHandler.getAdapter(Menu.class);
|
||||
if (menu != null) {
|
||||
|
|
|
@ -131,7 +131,7 @@ public class TabFolderMenuHandler extends PlatformObject {
|
|||
* @return The tab folder or <code>null</code>.
|
||||
*/
|
||||
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
|
||||
boolean needsTranslation = false;
|
||||
|
||||
TabFolderManager manager = getParentView().getAdapter(TabFolderManager.class);
|
||||
TabFolderManager manager = (TabFolderManager) getParentView().getAdapter(TabFolderManager.class);
|
||||
if (manager != null) {
|
||||
// If we have the active tab item, we can get the active terminal control
|
||||
CTabItem activeTabItem = manager.getActiveTabItem();
|
||||
|
@ -293,7 +293,7 @@ public class TabFolderMenuHandler extends PlatformObject {
|
|||
});
|
||||
|
||||
// Create and add the select encoding action
|
||||
add (new SelectEncodingAction(getParentView().getAdapter(TabFolderManager.class)) {
|
||||
add (new SelectEncodingAction((TabFolderManager) getParentView().getAdapter(TabFolderManager.class)) {
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.tm.internal.terminal.control.actions.AbstractTerminalAction#getTarget()
|
||||
*/
|
||||
|
@ -313,7 +313,7 @@ public class TabFolderMenuHandler extends PlatformObject {
|
|||
ITerminalViewControl terminal = null;
|
||||
|
||||
// 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 we have the active tab item, we can get the active terminal control
|
||||
CTabItem activeTabItem = manager.getActiveTabItem();
|
||||
|
|
|
@ -102,7 +102,7 @@ public class TabFolderToolbarHandler extends PlatformObject {
|
|||
* @return The tab folder or <code>null</code>.
|
||||
*/
|
||||
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;
|
||||
|
||||
// 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 we have the active tab item, we can get the active terminal control
|
||||
CTabItem activeTabItem = manager.getActiveTabItem();
|
||||
|
|
|
@ -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 (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$
|
||||
if (command != null && command.isDefined() && command.isEnabled()) {
|
||||
try {
|
||||
ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(command, null);
|
||||
Assert.isNotNull(pCmd);
|
||||
IHandlerService handlerSvc = PlatformUI.getWorkbench().getService(IHandlerService.class);
|
||||
IHandlerService handlerSvc = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
|
||||
Assert.isNotNull(handlerSvc);
|
||||
IEvaluationContext ctx = handlerSvc.getCurrentState();
|
||||
ctx = new EvaluationContext(ctx, selection);
|
||||
|
|
Loading…
Add table
Reference in a new issue