mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
[170916][api][efs] Remove checking for the SHOWHIDDEN preference in the host file to remote file adapters and instead pass it in as a flag to the adapters. EFS can then make use of it to convert all files.
This commit is contained in:
parent
895374834f
commit
5fbcefaad7
6 changed files with 23 additions and 26 deletions
|
@ -30,6 +30,7 @@ import org.eclipse.rse.core.model.IHost;
|
|||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
|
||||
import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType;
|
||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||
import org.eclipse.rse.services.clientserver.PathUtility;
|
||||
import org.eclipse.rse.services.clientserver.SystemEncodingUtil;
|
||||
import org.eclipse.rse.services.clientserver.SystemSearchString;
|
||||
|
@ -335,7 +336,8 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
|
|||
|
||||
IHostFile[] results = getFilesAndFolders(monitor, parentPath, fileNameFilter);
|
||||
|
||||
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results, showHidden);
|
||||
if (parent != null)
|
||||
parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
|
||||
return farr;
|
||||
|
@ -373,7 +375,10 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
|
|||
{
|
||||
|
||||
}
|
||||
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
|
||||
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results, showHidden);
|
||||
|
||||
if (parent != null)
|
||||
parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
|
||||
return farr;
|
||||
|
@ -409,7 +414,9 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
|
|||
catch (SystemMessageException e)
|
||||
{
|
||||
}
|
||||
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results);
|
||||
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results, showHidden);
|
||||
if (parent != null)
|
||||
parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr);
|
||||
return farr;
|
||||
|
@ -426,7 +433,9 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
|
|||
{
|
||||
|
||||
}
|
||||
IRemoteFile[] results = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, null, roots);
|
||||
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
IRemoteFile[] results = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, null, roots, showHidden);
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,6 @@ import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSyst
|
|||
|
||||
public interface IHostFileToRemoteFileAdapter
|
||||
{
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes);
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes, boolean includeHidden);
|
||||
public IRemoteFile convertToRemoteFile(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile node);
|
||||
}
|
|
@ -23,7 +23,6 @@ import java.util.List;
|
|||
import org.eclipse.dstore.core.model.DataElement;
|
||||
import org.eclipse.rse.connectorservice.dstore.DStoreConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.SubSystem;
|
||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||
import org.eclipse.rse.services.dstore.files.DStoreHostFile;
|
||||
import org.eclipse.rse.services.dstore.files.DStoreVirtualHostFile;
|
||||
import org.eclipse.rse.services.files.IHostFile;
|
||||
|
@ -31,7 +30,6 @@ import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSyst
|
|||
import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAdapter;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext;
|
||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
public class DStoreFileAdapter implements IHostFileToRemoteFileAdapter
|
||||
|
@ -49,16 +47,15 @@ public class DStoreFileAdapter implements IHostFileToRemoteFileAdapter
|
|||
}
|
||||
|
||||
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes)
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes, boolean includeHidden)
|
||||
{
|
||||
registerFilePropertyChangeListener(ss);
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
|
||||
List results = new ArrayList();
|
||||
for (int i = 0; i < nodes.length; i++)
|
||||
{
|
||||
DStoreHostFile node = (DStoreHostFile)nodes[i];
|
||||
if (showHidden || !node.isHidden())
|
||||
if (includeHidden || !node.isHidden())
|
||||
{
|
||||
IRemoteFile lfile = null;
|
||||
|
||||
|
|
|
@ -21,27 +21,23 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.rse.internal.services.files.ftp.FTPHostFile;
|
||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||
import org.eclipse.rse.services.files.IHostFile;
|
||||
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAdapter;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext;
|
||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||
|
||||
|
||||
public class FTPFileAdapter implements IHostFileToRemoteFileAdapter
|
||||
{
|
||||
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes)
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes, boolean includeHidden)
|
||||
{
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
|
||||
List results = new ArrayList();
|
||||
for (int i = 0; i < nodes.length; i++)
|
||||
{
|
||||
FTPHostFile node = (FTPHostFile)nodes[i];
|
||||
if (showHidden || !node.isHidden())
|
||||
if (includeHidden || !node.isHidden())
|
||||
{
|
||||
IRemoteFile ftpFile = new FTPRemoteFile(ss, context, parent, node);
|
||||
results.add(ftpFile);
|
||||
|
|
|
@ -21,13 +21,11 @@ import java.util.List;
|
|||
|
||||
import org.eclipse.rse.internal.services.local.files.LocalHostFile;
|
||||
import org.eclipse.rse.internal.services.local.files.LocalVirtualHostFile;
|
||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||
import org.eclipse.rse.services.files.IHostFile;
|
||||
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAdapter;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext;
|
||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||
|
||||
|
||||
public class LocalFileAdapter implements IHostFileToRemoteFileAdapter
|
||||
|
@ -35,16 +33,16 @@ public class LocalFileAdapter implements IHostFileToRemoteFileAdapter
|
|||
|
||||
|
||||
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes)
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes, boolean includeHidden)
|
||||
{
|
||||
if (nodes == null) return null;
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
|
||||
List results = new ArrayList();
|
||||
for (int i = 0; i < nodes.length; i++)
|
||||
{
|
||||
IHostFile child = nodes[i];
|
||||
if (showHidden || !child.isHidden())
|
||||
|
||||
if (includeHidden || !child.isHidden())
|
||||
{
|
||||
IRemoteFile lfile;
|
||||
if (child instanceof LocalVirtualHostFile)
|
||||
|
|
|
@ -21,24 +21,21 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.rse.internal.services.ssh.files.SftpHostFile;
|
||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||
import org.eclipse.rse.services.files.IHostFile;
|
||||
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IHostFileToRemoteFileAdapter;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileContext;
|
||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||
|
||||
public class SftpFileAdapter implements IHostFileToRemoteFileAdapter {
|
||||
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes) {
|
||||
boolean showHidden = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.SHOWHIDDEN);
|
||||
public IRemoteFile[] convertToRemoteFiles(FileServiceSubSystem ss, IRemoteFileContext context, IRemoteFile parent, IHostFile[] nodes, boolean includeHidden) {
|
||||
|
||||
List results = new ArrayList();
|
||||
if (nodes!=null) {
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
SftpHostFile node = (SftpHostFile)nodes[i];
|
||||
if (showHidden || !node.isHidden()) {
|
||||
if (includeHidden || !node.isHidden()) {
|
||||
IRemoteFile remoteFile = new SftpRemoteFile(ss, context, parent, node);
|
||||
results.add(remoteFile);
|
||||
ss.cacheRemoteFile(remoteFile);
|
||||
|
|
Loading…
Add table
Reference in a new issue