mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-10 10:35:23 +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;
|
package org.eclipse.rse.subsystems.files.core.subsystems;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
|
||||||
import org.eclipse.rse.services.files.IHostFile;
|
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.ICommunicationsListener;
|
||||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||||
import org.eclipse.rse.core.subsystems.IRemoteContainer;
|
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.RemoteChildrenContentsType;
|
||||||
import org.eclipse.rse.core.subsystems.SubSystem;
|
import org.eclipse.rse.core.subsystems.SubSystem;
|
||||||
import org.eclipse.rse.filters.ISystemFilterReference;
|
import org.eclipse.rse.filters.ISystemFilterReference;
|
||||||
|
@ -1571,7 +1570,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
|
||||||
|
|
||||||
protected void removeCachedRemoteFile(IRemoteFile file)
|
protected void removeCachedRemoteFile(IRemoteFile file)
|
||||||
{
|
{
|
||||||
if (file instanceof IRemoteContainer)
|
if (file != null)
|
||||||
{
|
{
|
||||||
Object[] children = ((IRemoteContainer)file).getContents(SystemChildrenContentsType.getInstance());
|
Object[] children = ((IRemoteContainer)file).getContents(SystemChildrenContentsType.getInstance());
|
||||||
if (children != null)
|
if (children != null)
|
||||||
|
@ -1680,7 +1679,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi
|
||||||
|
|
||||||
public Object getTargetForFilter(ISystemFilterReference filterRef)
|
public Object getTargetForFilter(ISystemFilterReference filterRef)
|
||||||
{
|
{
|
||||||
String firstFilterString = ((ISystemFilterReference)filterRef).getReferencedFilter().getFilterStrings()[0];
|
String firstFilterString = filterRef.getReferencedFilter().getFilterStrings()[0];
|
||||||
RemoteFileFilterString fs = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration(), firstFilterString);
|
RemoteFileFilterString fs = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration(), firstFilterString);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,7 @@ import org.eclipse.rse.ui.validators.ValidatorUniqueString;
|
||||||
* getFolderNameValidator methods.
|
* getFolderNameValidator methods.
|
||||||
*/
|
*/
|
||||||
public class ValidatorFileFilterString
|
public class ValidatorFileFilterString
|
||||||
extends ValidatorUniqueString implements ISystemMessages
|
extends ValidatorUniqueString
|
||||||
{
|
{
|
||||||
//public static final boolean CASE_SENSITIVE = true;
|
//public static final boolean CASE_SENSITIVE = true;
|
||||||
//public static final boolean CASE_INSENSITIVE = false;
|
//public static final boolean CASE_INSENSITIVE = false;
|
||||||
|
@ -55,41 +55,41 @@ public class ValidatorFileFilterString
|
||||||
protected boolean isFileName, isFolderName;
|
protected boolean isFileName, isFolderName;
|
||||||
private ValidatorFileName fileNameValidator;
|
private ValidatorFileName fileNameValidator;
|
||||||
private ValidatorFolderName folderNameValidator;
|
private ValidatorFolderName folderNameValidator;
|
||||||
private IRemoteFileSubSystemConfiguration ssFactory;
|
private IRemoteFileSubSystemConfiguration ssConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor accepting a Vector for the list of existing names.
|
* 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.
|
* @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.
|
* 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
|
super(existingList, ssConfig.isCaseSensitive()); // case sensitive uniqueness
|
||||||
this.ssFactory = ssFactory;
|
this.ssConfiguration = ssConfig;
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Constructor accepting an Array for the list of existing names.
|
* 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.
|
* @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
|
super(existingList, ssConfig.isCaseSensitive()); // case sensitive uniqueness
|
||||||
this.ssFactory = ssFactory;
|
this.ssConfiguration = ssConfig;
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use this constructor when the name need not be unique, and you just want
|
* Use this constructor when the name need not be unique, and you just want
|
||||||
* the syntax checking.
|
* 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());
|
super(new String[0], ssConfig.isCaseSensitive());
|
||||||
this.ssFactory = ssFactory;
|
this.ssConfiguration = ssConfig;
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,9 +97,9 @@ public class ValidatorFileFilterString
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
//setErrorMessages(RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY),
|
//setErrorMessages(RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_EMPTY),
|
||||||
setErrorMessages(RSEUIPlugin.getPluginMessage(MSG_VALIDATE_NAME_EMPTY),
|
setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
|
||||||
RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE),
|
RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTUNIQUE),
|
||||||
RSEUIPlugin.getPluginMessage(FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID));
|
RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_VALIDATE_FILEFILTERSTRING_NOTVALID));
|
||||||
isFileName = isFolderName = true;
|
isFileName = isFolderName = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,32 +158,33 @@ public class ValidatorFileFilterString
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overridable extension point to get basic file name validator
|
* 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()
|
protected ValidatorFileName getFileNameValidator()
|
||||||
{
|
{
|
||||||
if (fileNameValidator == null)
|
if (fileNameValidator == null)
|
||||||
fileNameValidator = ssFactory.getFileNameValidator();;
|
fileNameValidator = ssConfiguration.getFileNameValidator();
|
||||||
return fileNameValidator;
|
return fileNameValidator;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Overridable extension point to get basic folder name validator
|
* 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()
|
protected ValidatorFolderName getFolderNameValidator()
|
||||||
{
|
{
|
||||||
if (folderNameValidator == null)
|
if (folderNameValidator == null)
|
||||||
folderNameValidator = ssFactory.getFolderNameValidator();;
|
folderNameValidator = ssConfiguration.getFolderNameValidator();
|
||||||
return folderNameValidator;
|
return folderNameValidator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if case sensitive, false it not.
|
* 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.
|
* getFolderNameValidator methods.
|
||||||
*/
|
*/
|
||||||
public class ValidatorFileUniqueName
|
public class ValidatorFileUniqueName
|
||||||
extends ValidatorUniqueString implements ISystemMessages
|
extends ValidatorUniqueString
|
||||||
{
|
{
|
||||||
//public static final boolean CASE_SENSITIVE = true;
|
//public static final boolean CASE_SENSITIVE = true;
|
||||||
//public static final boolean CASE_INSENSITIVE = false;
|
//public static final boolean CASE_INSENSITIVE = false;
|
||||||
|
@ -73,10 +73,10 @@ public class ValidatorFileUniqueName
|
||||||
//shell.setCursor(busyCursor);
|
//shell.setCursor(busyCursor);
|
||||||
org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, busyCursor);
|
org.eclipse.rse.ui.dialogs.SystemPromptDialog.setDisplayCursor(shell, busyCursor);
|
||||||
|
|
||||||
setErrorMessages(RSEUIPlugin.getPluginMessage(MSG_VALIDATE_NAME_EMPTY),
|
setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_EMPTY),
|
||||||
RSEUIPlugin.getPluginMessage(MSG_VALIDATE_NAME_NOTUNIQUE),
|
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_NAME_NOTUNIQUE),
|
||||||
isFolder ? RSEUIPlugin.getPluginMessage(MSG_VALIDATE_FOLDERNAME_NOTVALID) :
|
isFolder ? RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FOLDERNAME_NOTVALID) :
|
||||||
RSEUIPlugin.getPluginMessage(MSG_VALIDATE_FILENAME_NOTVALID)
|
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILENAME_NOTVALID)
|
||||||
);
|
);
|
||||||
IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().listFoldersAndFiles(parentFolder);
|
IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().listFoldersAndFiles(parentFolder);
|
||||||
if (contents!=null)
|
if (contents!=null)
|
||||||
|
@ -124,7 +124,7 @@ public class ValidatorFileUniqueName
|
||||||
protected ValidatorFileName getFileNameValidator()
|
protected ValidatorFileName getFileNameValidator()
|
||||||
{
|
{
|
||||||
if (fileNameValidator == null)
|
if (fileNameValidator == null)
|
||||||
fileNameValidator = parentFolder.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().getFileNameValidator();;
|
fileNameValidator = parentFolder.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().getFileNameValidator();
|
||||||
return fileNameValidator;
|
return fileNameValidator;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue