1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 15:45:25 +02:00

[187711] filter encompass apis taken out

This commit is contained in:
David McKnight 2008-01-03 19:36:35 +00:00
parent 30555b1db5
commit 886b5721b3
4 changed files with 6 additions and 91 deletions

View file

@ -16,7 +16,7 @@
* Martin Oberhuber (Wind River) - [187218] Fix error reporting for connect()
* David McKnight (IBM) - [207095] Implicit connect needs to run in the same job as caller
* David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect()
* David McKnight (IBM) - [187711] new doesFilterEncompass apis
* David McKnight (IBM) - [187711] new doesFilterEncompass apis - now unneeded
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -272,23 +272,8 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
*/
public boolean doesFilterStringMatch(String filterString, String remoteObjectAbsoluteName, boolean caseSensitive);
/**
* Return true if the remote remote object would be a descendent of the result of this filter
* @param filter
* @param remoteObjectAbsoluteName
* @return
*/
public boolean doesFilterEncompass(ISystemFilter filter, String remoteObjectAbsoluteName);
/**
* Return true if the remote remote object would be a descendent of the result of this filter
* @param filterString
* @param remoteObjectAbsoluteName
* @param caseSensitive
* @return
*/
public boolean doesFilterStringEncompass(String filterString, String remoteObjectAbsoluteName, boolean caseSensitive);
// -------------------------
// Filter Pool References...
// -------------------------

View file

@ -23,7 +23,7 @@
* David McKnight (IBM) - [207178] changing list APIs for file service and subsystems
* David McKnight (IBM) - [210109] store constants in IFileService rather than IFileServiceConstants
* David McKnight (IBM) - [211472] [api][breaking] IRemoteObjectResolver.getObjectWithAbsoluteName() needs a progress monitor
* David McKnight (IBM) - [187711] doestFilterEncompass api
* David McKnight (IBM) - [187711] doestFilterEncompass api - now unneeded so taken out
*******************************************************************************/
package org.eclipse.rse.subsystems.files.core.subsystems;
@ -406,51 +406,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
return affected;
}
/**
* Return true if the remote remote object would be a descendent of the result of this filter
* @param filterString
* @param remoteObjectAbsoluteName
* @param caseSensitive
* @return
*/
public boolean doesFilterStringEncompass(String filterString, String remoteObjectAbsoluteName, boolean caseSensitive)
{
RemoteFileFilterString rffs = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration(), filterString);
// ok, this is a tweak: if the absolute name has " -folder" at the end, that means it is a folder...
if (remoteObjectAbsoluteName.endsWith(" -folder")) //$NON-NLS-1$
{
if (!rffs.getShowSubDirs())
return false;
remoteObjectAbsoluteName = remoteObjectAbsoluteName.substring(0, remoteObjectAbsoluteName.indexOf(" -folder")); //$NON-NLS-1$
}
// problem 1: we don't know if the given remote object name represents a file or folder. We have to assume a file,
// since we don't support filtering by folder names.
if (!rffs.getShowFiles())
return false;
// step 1: verify the path of the remote object matches the path of the filter string
String container = rffs.getPath();
if (container == null)
return false;
if (container.equals(".")) //$NON-NLS-1$
{
try
{
container = getRemoteFileObject(container, new NullProgressMonitor()).getAbsolutePath();
}
catch (Exception e)
{
}
}
if (container.indexOf(remoteObjectAbsoluteName) > -1){
return true;
}
return false;
}
// -------------------------------
// SubSystem METHODS ...

View file

@ -5723,10 +5723,6 @@ public class SystemView extends SafeTreeViewer
else if (ss.doesFilterListContentsOf(ref.getReferencedFilter(),remoteObjectName)){
expandTo(data, remoteObject);
}
else if (ss.doesFilterEncompass(ref.getReferencedFilter(), remoteObjectName))
{
expandTo(data, remoteObject);
}
}
else if (data instanceof ISystemFilterPoolReference)
{

View file

@ -28,7 +28,7 @@
* David McKnight (IBM) - [186363] get rid of obsolete calls to SubSystem.connect()
* David McKnight (IBM) - [211472] [api][breaking] IRemoteObjectResolver.getObjectWithAbsoluteName() needs a progress monitor
* David McKnight (IBM) - [212403] [apidoc][breaking] Fixing docs of SubSystem#getConnectorService() and making internalConnect() private
* David McKnight (IBM) - [187711] default implementation of doesFilterEncompass()
* David McKnight (IBM) - [187711] default implementation of doesFilterEncompass() - now taken unneeded
********************************************************************************/
package org.eclipse.rse.core.subsystems;
@ -744,29 +744,7 @@ public abstract class SubSystem extends RSEModelObject
{
return true;
}
public boolean doesFilterStringEncompass(String filter, String remoteObjectAbsoluteName, boolean caseSensitive)
{
return true;
}
public boolean doesFilterEncompass(ISystemFilter filter, String remoteObjectAbsoluteName)
{
boolean would = false;
String[] strings = filter.getFilterStrings();
if (strings != null){
for (int idx=0; !would && (idx<strings.length); idx++)
{
if (strings[idx].equals("*")) //$NON-NLS-1$
would = true;
else if (strings[idx].equals("./*")) //$NON-NLS-1$
would = true;
else
would = doesFilterStringEncompass(strings[idx], remoteObjectAbsoluteName, filter.areStringsCaseSensitive());
}
}
return would;
}
// -------------------------------------