1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-09 09:15:38 +02:00

[196582] fix ClassCastException when doing copy/paste

This commit is contained in:
Xuan Chen 2007-08-09 03:46:28 +00:00
parent 97ab7c9494
commit 6ff91851ea
4 changed files with 27 additions and 14 deletions

View file

@ -13,12 +13,13 @@
* Contributors:
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Kevin Doyle (IBM) - [188637] Handle the caught exception in DeleteJob.run when file fails to be deleted
* Kevin Doyle (IBM) - [196582] ClassCastException when doing copy/paste with Remote Search view open
********************************************************************************/
package org.eclipse.rse.internal.ui.actions;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@ -110,8 +111,8 @@ public class SystemCommonDeleteAction
public IStatus run(IProgressMonitor monitor)
{
boolean ok = true;
List localDeletedObjects = new ArrayList();
List remoteDeletedObjects = new ArrayList();
List localDeletedObjects = new Vector();
List remoteDeletedObjects = new Vector();
// local delete is pretty straight-forward
for (int l = 0; l < _localResources.size() && ok; l++)
@ -190,7 +191,7 @@ public class SystemCommonDeleteAction
setProcessAllSelections(true);
setContextMenuGroup(ISystemContextMenuConstants.GROUP_REORGANIZE);
setHelp(RSEUIPlugin.HELPPREFIX+"actn0021"); //$NON-NLS-1$
_setList = new ArrayList();
_setList = new Vector();
}
/**
@ -280,7 +281,7 @@ public class SystemCommonDeleteAction
if (selection instanceof IStructuredSelection)
{
// keep track of the current set
List localSet = new ArrayList();
List localSet = new Vector();
// divide up all objects to delete
IStructuredSelection ssel = (IStructuredSelection)selection;

View file

@ -1428,8 +1428,8 @@ public class SystemTableTreeView
}
/**
* Returns the implementation of ISystemRemoteElement for the given
* object. Returns null if this object does not adaptable to this.
* Returns the implementation of ISystemRemoteElementAdapter for the given
* object. Returns null if this object is not adaptable to this.
*/
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
{
@ -1445,7 +1445,10 @@ public class SystemTableTreeView
/**
* Returns the implementation of IRemoteObjectIdentifier for the given
* object. Returns null if this object does not adaptable to this.
* object. Returns null if this object is not adaptable to this.
*
* @deprecated should use getViewAdapter(Object) as IRemoteObjectIdentifier
* is not defined in the adapter factories
*/
protected IRemoteObjectIdentifier getRemoteObjectIdentifier(Object o)
{

View file

@ -38,6 +38,7 @@
* Tobias Schwarz (Wind River) - [197484] Provide ContextObject for queries on all levels
* David McKnight (IBM) - [196662] Avoid main thread query to check exists when remote refreshing
* Kevin Doyle (IBM) - [198576] Renaming a folder directly under a Filter doesn't update children
* Kevin Doyle (IBM) - [196582] Depreciated getRemoteObjectIdentifier
********************************************************************************/
package org.eclipse.rse.internal.ui.view;
@ -1349,14 +1350,21 @@ public class SystemView extends SafeTreeViewer
}
}
/**
* Returns the implementation of IRemoteObjectIdentifier for the given
* object. Returns null if this object is not adaptable to this.
*
* @deprecated should use getViewAdapter(Object) as IRemoteObjectIdentifier
* is not defined in the adapter factories
*/
protected IRemoteObjectIdentifier getRemoteObjectIdentifier(Object o)
{
return (IRemoteObjectIdentifier)((IAdaptable)o).getAdapter(IRemoteObjectIdentifier.class);
}
/**
* Returns the implementation of IRemoteObjectIdentifier for the given
* object. Returns null if this object does not adaptable to this.
* Returns the implementation of ISystemRemoteElementAdapter for the given
* object. Returns null if this object is not adaptable to this.
*/
protected ISystemRemoteElementAdapter getRemoteAdapter(Object o)
{

View file

@ -16,6 +16,7 @@
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Kevin Doyle (IBM) - [177587] Made MonitorViewPart a SelectionProvider
* Kevin Doyle (IBM) - [160378] Subset action should be disabled when there are no tabs in Monitor
* Kevin Doyle (IBM) - [196582] ClassCastException when doing copy/paste
********************************************************************************/
package org.eclipse.rse.internal.ui.view.monitor;
@ -926,11 +927,11 @@ class SubSetAction extends BrowseAction
int eventType = event.getEventType();
Object remoteResource = event.getResource();
Vector remoteResourceNames = null;
if (remoteResource instanceof Vector)
java.util.List remoteResourceNames = null;
if (remoteResource instanceof java.util.List)
{
remoteResourceNames = (Vector) remoteResource;
remoteResource = remoteResourceNames.elementAt(0);
remoteResourceNames = (java.util.List) remoteResource;
remoteResource = remoteResourceNames.get(0);
}
Object child = event.getResource();