mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 07:35:24 +02:00
[cleanup] Remove "implements" use of ISystemMessages
This commit is contained in:
parent
a770fcce43
commit
f3168a3023
4 changed files with 33 additions and 34 deletions
|
@ -16,7 +16,6 @@
|
|||
|
||||
package org.eclipse.rse.subsystems.files.core.subsystems;
|
||||
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.rse.services.files.IHostFile;
|
||||
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.eclipse.rse.core.subsystems.CommunicationsEvent;
|
|||
import org.eclipse.rse.core.subsystems.ICommunicationsListener;
|
||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
import org.eclipse.rse.core.subsystems.IRemoteContainer;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
||||
import org.eclipse.rse.core.subsystems.RemoteChildrenContentsType;
|
||||
import org.eclipse.rse.core.subsystems.SubSystem;
|
||||
import org.eclipse.rse.filters.ISystemFilterReference;
|
||||
|
@ -1571,7 +1570,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
|
|||
|
||||
protected void removeCachedRemoteFile(IRemoteFile file)
|
||||
{
|
||||
if (file instanceof IRemoteContainer)
|
||||
if (file != null)
|
||||
{
|
||||
Object[] children = ((IRemoteContainer)file).getContents(SystemChildrenContentsType.getInstance());
|
||||
if (children != null)
|
||||
|
@ -1680,7 +1679,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
|
|||
|
||||
public Object getTargetForFilter(ISystemFilterReference filterRef)
|
||||
{
|
||||
String firstFilterString = ((ISystemFilterReference)filterRef).getReferencedFilter().getFilterStrings()[0];
|
||||
String firstFilterString = filterRef.getReferencedFilter().getFilterStrings()[0];
|
||||
RemoteFileFilterString fs = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration(), firstFilterString);
|
||||
try
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.eclipse.rse.ui.validators.ValidatorUniqueString;
|
|||
* getFolderNameValidator methods.
|
||||
*/
|
||||
public class ValidatorFileFilterString
|
||||
extends ValidatorUniqueString implements ISystemMessages
|
||||
extends ValidatorUniqueString
|
||||
{
|
||||
//public static final boolean CASE_SENSITIVE = true;
|
||||
//public static final boolean CASE_INSENSITIVE = false;
|
||||
|
@ -55,41 +55,41 @@ public class ValidatorFileFilterString
|
|||
protected boolean isFileName, isFolderName;
|
||||
private ValidatorFileName fileNameValidator;
|
||||
private ValidatorFolderName folderNameValidator;
|
||||
private IRemoteFileSubSystemConfiguration ssFactory;
|
||||
private IRemoteFileSubSystemConfiguration ssConfiguration;
|
||||
|
||||
/**
|
||||
* Constructor accepting a Vector for the list of existing names.
|
||||
* @param ssFactory - The remote subsystem factory we are validating filter strings in
|
||||
* @param ssConfig - The remote subsystem configuration we are validating filter strings in
|
||||
* @param existingList - A vector containing list of existing filter names to compare against.
|
||||
* Note that toString() is used to get the string from each item.
|
||||
*/
|
||||
public ValidatorFileFilterString(IRemoteFileSubSystemConfiguration ssFactory, Vector existingList)
|
||||
public ValidatorFileFilterString(IRemoteFileSubSystemConfiguration ssConfig, Vector existingList)
|
||||
{
|
||||
super(existingList, ssFactory.isCaseSensitive()); // case sensitive uniqueness
|
||||
this.ssFactory = ssFactory;
|
||||
super(existingList, ssConfig.isCaseSensitive()); // case sensitive uniqueness
|
||||
this.ssConfiguration = ssConfig;
|
||||
init();
|
||||
}
|
||||
/**
|
||||
* Constructor accepting an Array for the list of existing names.
|
||||
* @param ssFactory - The remote subsystem factory we are validating filter strings in
|
||||
* @param ssConfig - The remote subsystem configuration we are validating filter strings in
|
||||
* @param existingList - An array containing list of existing strings to compare against.
|
||||
*/
|
||||
public ValidatorFileFilterString(IRemoteFileSubSystemConfiguration ssFactory, String[] existingList)
|
||||
public ValidatorFileFilterString(IRemoteFileSubSystemConfiguration ssConfig, String[] existingList)
|
||||
{
|
||||
super(existingList, ssFactory.isCaseSensitive()); // case sensitive uniqueness
|
||||
this.ssFactory = ssFactory;
|
||||
super(existingList, ssConfig.isCaseSensitive()); // case sensitive uniqueness
|
||||
this.ssConfiguration = ssConfig;
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this constructor when the name need not be unique, and you just want
|
||||
* the syntax checking.
|
||||
* @param ssFactory - The remote subsystem factory we are validating filter strings in
|
||||
* @param ssConfig - The remote subsystem configuration we are validating filter strings in
|
||||
*/
|
||||
public ValidatorFileFilterString(IRemoteFileSubSystemConfiguration ssFactory)
|
||||
public ValidatorFileFilterString(IRemoteFileSubSystemConfiguration ssConfig)
|
||||
{
|
||||
super(new String[0], ssFactory.isCaseSensitive());
|
||||
this.ssFactory = ssFactory;
|
||||
super(new String[0], ssConfig.isCaseSensitive());
|
||||
this.ssConfiguration = ssConfig;
|
||||
init();
|
||||
}
|
||||
|
||||
|
@ -97,9 +97,9 @@ public class ValidatorFileFilterString
|
|||
private void init()
|
||||
{
|
||||
//setErrorMessages(RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY),
|
||||
setErrorMessages(RSEUIPlugin.getPluginMessage(MSG_VALIDATE_NAME_EMPTY),
|
||||
RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE),
|
||||
RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID));
|
||||
setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
|
||||
RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE),
|
||||
RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID));
|
||||
isFileName = isFolderName = true;
|
||||
}
|
||||
|
||||
|
@ -158,32 +158,33 @@ public class ValidatorFileFilterString
|
|||
|
||||
/**
|
||||
* Overridable extension point to get basic file name validator
|
||||
* By default, queries it from the file subsystem factory
|
||||
* By default, queries it from the file subsystem configuration
|
||||
*/
|
||||
protected ValidatorFileName getFileNameValidator()
|
||||
{
|
||||
if (fileNameValidator == null)
|
||||
fileNameValidator = ssFactory.getFileNameValidator();;
|
||||
fileNameValidator = ssConfiguration.getFileNameValidator();
|
||||
return fileNameValidator;
|
||||
}
|
||||
/**
|
||||
* Overridable extension point to get basic folder name validator
|
||||
* By default, queries it from the file subsystem factory
|
||||
* By default, queries it from the file subsystem configuration
|
||||
*/
|
||||
protected ValidatorFolderName getFolderNameValidator()
|
||||
{
|
||||
if (folderNameValidator == null)
|
||||
folderNameValidator = ssFactory.getFolderNameValidator();;
|
||||
folderNameValidator = ssConfiguration.getFolderNameValidator();
|
||||
return folderNameValidator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if case sensitive, false it not.
|
||||
* By default, return ssFactory.isUnixStyle()
|
||||
* By default, return ssConfiguration.isUnixStyle()
|
||||
* @param ssConfig subsystem configuration
|
||||
*/
|
||||
protected boolean isCaseSensitive(IRemoteFileSubSystemConfiguration ssFactory)
|
||||
protected boolean isCaseSensitive(IRemoteFileSubSystemConfiguration ssConfig)
|
||||
{
|
||||
return ssFactory.isUnixStyle();
|
||||
return ssConfig.isUnixStyle();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.eclipse.swt.widgets.Shell;
|
|||
* getFolderNameValidator methods.
|
||||
*/
|
||||
public class ValidatorFileUniqueName
|
||||
extends ValidatorUniqueString implements ISystemMessages
|
||||
extends ValidatorUniqueString
|
||||
{
|
||||
//public static final boolean CASE_SENSITIVE = true;
|
||||
//public static final boolean CASE_INSENSITIVE = false;
|
||||
|
@ -73,10 +73,10 @@ public class ValidatorFileUniqueName
|
|||
//shell.setCursor(busyCursor);
|
||||
org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, busyCursor);
|
||||
|
||||
setErrorMessages(RSEUIPlugin.getPluginMessage(MSG_VALIDATE_NAME_EMPTY),
|
||||
RSEUIPlugin.getPluginMessage(MSG_VALIDATE_NAME_NOTUNIQUE),
|
||||
isFolder ? RSEUIPlugin.getPluginMessage(MSG_VALIDATE_FOLDERNAME_NOTVALID) :
|
||||
RSEUIPlugin.getPluginMessage(MSG_VALIDATE_FILENAME_NOTVALID)
|
||||
setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
|
||||
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE),
|
||||
isFolder ? RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FOLDERNAME_NOTVALID) :
|
||||
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILENAME_NOTVALID)
|
||||
);
|
||||
IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().listFoldersAndFiles(parentFolder);
|
||||
if (contents!=null)
|
||||
|
@ -124,7 +124,7 @@ public class ValidatorFileUniqueName
|
|||
protected ValidatorFileName getFileNameValidator()
|
||||
{
|
||||
if (fileNameValidator == null)
|
||||
fileNameValidator = parentFolder.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().getFileNameValidator();;
|
||||
fileNameValidator = parentFolder.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().getFileNameValidator();
|
||||
return fileNameValidator;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue