mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-02 13:13:36 +02:00
[243495] [api] New: Allow file name search in Remote Search to not be case sensitive
This commit is contained in:
parent
667e97d5bb
commit
fc2870e07e
5 changed files with 119 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2008 IBM Corporation and others.
|
* Copyright (c) 2002, 2009 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [196936] Hide disabled system types
|
* Martin Oberhuber (Wind River) - [196936] Hide disabled system types
|
||||||
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
|
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
|
||||||
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
|
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
|
||||||
|
* David McKnight (IBM) - [243495] [api] New: Allow file name search in Remote Search to not be case sensitive
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.files.ui.search;
|
package org.eclipse.rse.internal.files.ui.search;
|
||||||
|
@ -117,9 +118,12 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
private Combo fileNameCombo;
|
private Combo fileNameCombo;
|
||||||
private Button fileNameBrowseButton;
|
private Button fileNameBrowseButton;
|
||||||
private Label fileNameHintLabel;
|
private Label fileNameHintLabel;
|
||||||
|
private Button fileNameCaseSensitiveButton;
|
||||||
|
private boolean initialFileNameCaseSensitive;
|
||||||
private Button fileNameRegexButton;
|
private Button fileNameRegexButton;
|
||||||
private boolean initialFileNameRegex;
|
private boolean initialFileNameRegex;
|
||||||
|
|
||||||
|
|
||||||
// file name editor
|
// file name editor
|
||||||
private FileNameEditor fileNameEditor;
|
private FileNameEditor fileNameEditor;
|
||||||
|
|
||||||
|
@ -141,6 +145,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
private static final String REMOTE_SEARCH_PAGE_NAME = "RemoteSearchPage"; //$NON-NLS-1$
|
private static final String REMOTE_SEARCH_PAGE_NAME = "RemoteSearchPage"; //$NON-NLS-1$
|
||||||
private static final String STORE_CONFIG_CASE_SENSITIVE = "caseSensitive"; //$NON-NLS-1$
|
private static final String STORE_CONFIG_CASE_SENSITIVE = "caseSensitive"; //$NON-NLS-1$
|
||||||
private static final String STORE_CONFIG_STRING_REGEX = "stringRegex"; //$NON-NLS-1$
|
private static final String STORE_CONFIG_STRING_REGEX = "stringRegex"; //$NON-NLS-1$
|
||||||
|
private static final String STORE_CONFIG_FILENAME_CASE_SENSITIVE = "fileNameCaseSensitive"; //$NON-NLS-1$
|
||||||
private static final String STORE_CONFIG_FILENAME_REGEX = "fileNameRegex"; //$NON-NLS-1$
|
private static final String STORE_CONFIG_FILENAME_REGEX = "fileNameRegex"; //$NON-NLS-1$
|
||||||
private static final String STORE_CONFIG_INCLUDE_ARCHIVES = "includeArchives"; //$NON-NLS-1$
|
private static final String STORE_CONFIG_INCLUDE_ARCHIVES = "includeArchives"; //$NON-NLS-1$
|
||||||
private static final String STORE_CONFIG_INCLUDE_SUBFOLDERS = "includeSubfolders"; //$NON-NLS-1$
|
private static final String STORE_CONFIG_INCLUDE_SUBFOLDERS = "includeSubfolders"; //$NON-NLS-1$
|
||||||
|
@ -153,6 +158,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
private static final String STORE_DATA_CASE_SENSITIVE = "caseSensitive"; //$NON-NLS-1$
|
private static final String STORE_DATA_CASE_SENSITIVE = "caseSensitive"; //$NON-NLS-1$
|
||||||
private static final String STORE_DATA_STRING_REGEX = "stringRegex"; //$NON-NLS-1$
|
private static final String STORE_DATA_STRING_REGEX = "stringRegex"; //$NON-NLS-1$
|
||||||
private static final String STORE_DATA_FILE_NAMES = "fileNames"; //$NON-NLS-1$
|
private static final String STORE_DATA_FILE_NAMES = "fileNames"; //$NON-NLS-1$
|
||||||
|
private static final String STORE_DATA_FILE_NAME_CASE_SENSITIVE = "fileNameCaseSensitive"; //$NON-NLS-1$
|
||||||
private static final String STORE_DATA_FILE_NAME_REGEX = "fileNameRegex"; //$NON-NLS-1$
|
private static final String STORE_DATA_FILE_NAME_REGEX = "fileNameRegex"; //$NON-NLS-1$
|
||||||
private static final String STORE_DATA_PROFILE_NAME = "profileName"; //$NON-NLS-1$
|
private static final String STORE_DATA_PROFILE_NAME = "profileName"; //$NON-NLS-1$
|
||||||
private static final String STORE_DATA_CONNECTION_NAME = "connectionName"; //$NON-NLS-1$
|
private static final String STORE_DATA_CONNECTION_NAME = "connectionName"; //$NON-NLS-1$
|
||||||
|
@ -160,7 +166,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
private static final String STORE_DATA_INCLUDE_ARCHIVES = "includeArchives"; //$NON-NLS-1$
|
private static final String STORE_DATA_INCLUDE_ARCHIVES = "includeArchives"; //$NON-NLS-1$
|
||||||
private static final String STORE_DATA_INCLUDE_SUBFOLDERS = "includeSubfolders"; //$NON-NLS-1$
|
private static final String STORE_DATA_INCLUDE_SUBFOLDERS = "includeSubfolders"; //$NON-NLS-1$
|
||||||
|
|
||||||
// a list to hold previous searche data
|
// a list to hold previous search data
|
||||||
private List previousSearchData = new ArrayList();
|
private List previousSearchData = new ArrayList();
|
||||||
|
|
||||||
// maximum size of data list
|
// maximum size of data list
|
||||||
|
@ -173,6 +179,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
private boolean caseSensitive;
|
private boolean caseSensitive;
|
||||||
private boolean stringRegex;
|
private boolean stringRegex;
|
||||||
private String fileNames;
|
private String fileNames;
|
||||||
|
private boolean fileNameCaseSensitive;
|
||||||
private boolean fileNameRegex;
|
private boolean fileNameRegex;
|
||||||
private String profileName;
|
private String profileName;
|
||||||
private String connectionName;
|
private String connectionName;
|
||||||
|
@ -186,6 +193,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
* @param caseSensitive <code>true</code> if case sensitive, <code>false</code> otherwise.
|
* @param caseSensitive <code>true</code> if case sensitive, <code>false</code> otherwise.
|
||||||
* @param stringRegex <code>true</code> if search string is a regular expression, <code>false</code> otherwise.
|
* @param stringRegex <code>true</code> if search string is a regular expression, <code>false</code> otherwise.
|
||||||
* @param fileNames set of file names.
|
* @param fileNames set of file names.
|
||||||
|
* @param fileNameCaseSensitive <code>true</code> if the file name is searched case sensitively, <code>false</code> otherwise.
|
||||||
* @param fileNameRegex <code>true</code> if the file name is a regular expression, <code>false</code> otherwise.
|
* @param fileNameRegex <code>true</code> if the file name is a regular expression, <code>false</code> otherwise.
|
||||||
* @param profileName the profile name.
|
* @param profileName the profile name.
|
||||||
* @param connectionName the connection name.
|
* @param connectionName the connection name.
|
||||||
|
@ -194,12 +202,13 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
* @param includeSubfolders <code>true</code> if subfolders should also be searched, <code>false</code> otherwise.
|
* @param includeSubfolders <code>true</code> if subfolders should also be searched, <code>false</code> otherwise.
|
||||||
*/
|
*/
|
||||||
private RemoteSearchData(String searchString, boolean caseSensitive, boolean stringRegex,
|
private RemoteSearchData(String searchString, boolean caseSensitive, boolean stringRegex,
|
||||||
String fileNames, boolean fileNameRegex, String profileName, String connectionName,
|
String fileNames, boolean fileNameCaseSensitive, boolean fileNameRegex, String profileName, String connectionName,
|
||||||
String folderName, boolean includeArchives, boolean includeSubfolders) {
|
String folderName, boolean includeArchives, boolean includeSubfolders) {
|
||||||
this.searchString = searchString;
|
this.searchString = searchString;
|
||||||
this.caseSensitive = caseSensitive;
|
this.caseSensitive = caseSensitive;
|
||||||
this.stringRegex = stringRegex;
|
this.stringRegex = stringRegex;
|
||||||
this.fileNames = fileNames;
|
this.fileNames = fileNames;
|
||||||
|
this.fileNameCaseSensitive = fileNameCaseSensitive;
|
||||||
this.fileNameRegex = fileNameRegex;
|
this.fileNameRegex = fileNameRegex;
|
||||||
this.profileName = profileName;
|
this.profileName = profileName;
|
||||||
this.connectionName = connectionName;
|
this.connectionName = connectionName;
|
||||||
|
@ -603,6 +612,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
data.caseSensitive = caseButton.getSelection();
|
data.caseSensitive = caseButton.getSelection();
|
||||||
data.stringRegex = stringRegexButton.getSelection();
|
data.stringRegex = stringRegexButton.getSelection();
|
||||||
data.fileNames = getFileNames();
|
data.fileNames = getFileNames();
|
||||||
|
data.fileNameCaseSensitive = fileNameCaseSensitiveButton.getSelection();
|
||||||
data.fileNameRegex = fileNameRegexButton.getSelection();
|
data.fileNameRegex = fileNameRegexButton.getSelection();
|
||||||
data.profileName = getProfileName();
|
data.profileName = getProfileName();
|
||||||
data.connectionName = getConnectionName();
|
data.connectionName = getConnectionName();
|
||||||
|
@ -617,7 +627,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
// otherwise create new data
|
// otherwise create new data
|
||||||
else {
|
else {
|
||||||
data = new RemoteSearchData(searchString, caseButton.getSelection(), stringRegexButton.getSelection(),
|
data = new RemoteSearchData(searchString, caseButton.getSelection(), stringRegexButton.getSelection(),
|
||||||
getFileNames(), fileNameRegexButton.getSelection(), getProfileName(), getConnectionName(),
|
getFileNames(), fileNameCaseSensitiveButton.getSelection(), fileNameRegexButton.getSelection(), getProfileName(), getConnectionName(),
|
||||||
getFolderName(), searchArchivesButton.getSelection(), searchSubfoldersButton.getSelection());
|
getFolderName(), searchArchivesButton.getSelection(), searchSubfoldersButton.getSelection());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,7 +728,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
// get the data corresponding to the current dialog state
|
// get the data corresponding to the current dialog state
|
||||||
RemoteSearchData data = getSearchData();
|
RemoteSearchData data = getSearchData();
|
||||||
|
|
||||||
SystemSearchString searchString = new SystemSearchString(data.searchString, data.caseSensitive, data.stringRegex, data.fileNames, data.fileNameRegex, data.includeArchives, data.includeSubfolders);
|
SystemSearchString searchString = new SystemSearchString(data.searchString, data.caseSensitive, data.stringRegex, data.fileNames, data.fileNameCaseSensitive, data.fileNameRegex, data.includeArchives, data.includeSubfolders);
|
||||||
|
|
||||||
IRemoteFileSubSystem subsys = getRemoteFileSubSystem(data.profileName, data.connectionName);
|
IRemoteFileSubSystem subsys = getRemoteFileSubSystem(data.profileName, data.connectionName);
|
||||||
|
|
||||||
|
@ -1182,6 +1192,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
|
|
||||||
// set file name regex
|
// set file name regex
|
||||||
fileNameHintLabel.setVisible(!data.fileNameRegex);
|
fileNameHintLabel.setVisible(!data.fileNameRegex);
|
||||||
|
fileNameCaseSensitiveButton.setSelection(data.fileNameCaseSensitive);
|
||||||
fileNameRegexButton.setSelection(data.fileNameRegex);
|
fileNameRegexButton.setSelection(data.fileNameRegex);
|
||||||
|
|
||||||
// set the remote folder properties
|
// set the remote folder properties
|
||||||
|
@ -1270,12 +1281,25 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
fileNameHintLabel.setLayoutData(gd);
|
fileNameHintLabel.setLayoutData(gd);
|
||||||
|
|
||||||
|
// checkbox for case sensitivity
|
||||||
|
fileNameCaseSensitiveButton = new Button(comp, SWT.CHECK);
|
||||||
|
fileNameCaseSensitiveButton.setText(FileResources.RESID_SEARCH_CASE_BUTTON_LABEL);
|
||||||
|
fileNameCaseSensitiveButton.setToolTipText(FileResources.RESID_SEARCH_CASE_BUTTON_TOOLTIP);
|
||||||
|
|
||||||
|
gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
|
||||||
|
fileNameCaseSensitiveButton.setLayoutData(gd);
|
||||||
|
fileNameCaseSensitiveButton.setSelection(initialFileNameCaseSensitive);
|
||||||
|
|
||||||
// checkbox for regex
|
// checkbox for regex
|
||||||
fileNameRegexButton = new Button(comp, SWT.CHECK);
|
fileNameRegexButton = new Button(comp, SWT.CHECK);
|
||||||
fileNameRegexButton.setText(FileResources.RESID_SEARCH_FILENAME_REGEX_LABEL);
|
fileNameRegexButton.setText(FileResources.RESID_SEARCH_FILENAME_REGEX_LABEL);
|
||||||
fileNameRegexButton.setToolTipText(FileResources.RESID_SEARCH_FILENAME_REGEX_TOOLTIP);
|
fileNameRegexButton.setToolTipText(FileResources.RESID_SEARCH_FILENAME_REGEX_TOOLTIP);
|
||||||
|
|
||||||
gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
|
//gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
|
||||||
|
|
||||||
|
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
|
||||||
|
gd.horizontalSpan = 3;
|
||||||
|
|
||||||
fileNameRegexButton.setLayoutData(gd);
|
fileNameRegexButton.setLayoutData(gd);
|
||||||
fileNameRegexButton.setSelection(initialFileNameRegex);
|
fileNameRegexButton.setSelection(initialFileNameRegex);
|
||||||
fileNameHintLabel.setVisible(!fileNameRegexButton.getSelection());
|
fileNameHintLabel.setVisible(!fileNameRegexButton.getSelection());
|
||||||
|
@ -1456,6 +1480,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
IDialogSettings s = getConfigDialogSettings();
|
IDialogSettings s = getConfigDialogSettings();
|
||||||
initialCaseSensitive = s.getBoolean(STORE_CONFIG_CASE_SENSITIVE);
|
initialCaseSensitive = s.getBoolean(STORE_CONFIG_CASE_SENSITIVE);
|
||||||
initialStringRegex = s.getBoolean(STORE_CONFIG_STRING_REGEX);
|
initialStringRegex = s.getBoolean(STORE_CONFIG_STRING_REGEX);
|
||||||
|
initialFileNameCaseSensitive = s.getBoolean(STORE_CONFIG_FILENAME_CASE_SENSITIVE);
|
||||||
initialFileNameRegex = s.getBoolean(STORE_CONFIG_FILENAME_REGEX);
|
initialFileNameRegex = s.getBoolean(STORE_CONFIG_FILENAME_REGEX);
|
||||||
initialSearchArchives = s.getBoolean(STORE_CONFIG_INCLUDE_ARCHIVES);
|
initialSearchArchives = s.getBoolean(STORE_CONFIG_INCLUDE_ARCHIVES);
|
||||||
initialSearchSubfolders = s.getBoolean(STORE_CONFIG_INCLUDE_SUBFOLDERS);
|
initialSearchSubfolders = s.getBoolean(STORE_CONFIG_INCLUDE_SUBFOLDERS);
|
||||||
|
@ -1468,6 +1493,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
IDialogSettings s = getConfigDialogSettings();
|
IDialogSettings s = getConfigDialogSettings();
|
||||||
s.put(STORE_CONFIG_CASE_SENSITIVE, caseButton.getSelection());
|
s.put(STORE_CONFIG_CASE_SENSITIVE, caseButton.getSelection());
|
||||||
s.put(STORE_CONFIG_STRING_REGEX, stringRegexButton.getSelection());
|
s.put(STORE_CONFIG_STRING_REGEX, stringRegexButton.getSelection());
|
||||||
|
s.put(STORE_CONFIG_FILENAME_CASE_SENSITIVE, fileNameCaseSensitiveButton.getSelection());
|
||||||
s.put(STORE_CONFIG_FILENAME_REGEX, fileNameRegexButton.getSelection());
|
s.put(STORE_CONFIG_FILENAME_REGEX, fileNameRegexButton.getSelection());
|
||||||
s.put(STORE_CONFIG_INCLUDE_ARCHIVES, searchArchivesButton.getSelection());
|
s.put(STORE_CONFIG_INCLUDE_ARCHIVES, searchArchivesButton.getSelection());
|
||||||
s.put(STORE_CONFIG_INCLUDE_SUBFOLDERS, searchSubfoldersButton.getSelection());
|
s.put(STORE_CONFIG_INCLUDE_SUBFOLDERS, searchSubfoldersButton.getSelection());
|
||||||
|
@ -1505,6 +1531,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
boolean stringRegex = dataSection.getBoolean(STORE_DATA_STRING_REGEX);
|
boolean stringRegex = dataSection.getBoolean(STORE_DATA_STRING_REGEX);
|
||||||
|
|
||||||
String fileNamesString = dataSection.get(STORE_DATA_FILE_NAMES);
|
String fileNamesString = dataSection.get(STORE_DATA_FILE_NAMES);
|
||||||
|
boolean fileNameCaseSensitive = dataSection.getBoolean(STORE_DATA_FILE_NAME_CASE_SENSITIVE);
|
||||||
boolean fileNameRegex = dataSection.getBoolean(STORE_DATA_FILE_NAME_REGEX);
|
boolean fileNameRegex = dataSection.getBoolean(STORE_DATA_FILE_NAME_REGEX);
|
||||||
|
|
||||||
String profileName = dataSection.get(STORE_DATA_PROFILE_NAME);
|
String profileName = dataSection.get(STORE_DATA_PROFILE_NAME);
|
||||||
|
@ -1514,7 +1541,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
boolean searchArchives = dataSection.getBoolean(STORE_DATA_INCLUDE_ARCHIVES);
|
boolean searchArchives = dataSection.getBoolean(STORE_DATA_INCLUDE_ARCHIVES);
|
||||||
boolean searchSubfolders = dataSection.getBoolean(STORE_DATA_INCLUDE_SUBFOLDERS);
|
boolean searchSubfolders = dataSection.getBoolean(STORE_DATA_INCLUDE_SUBFOLDERS);
|
||||||
|
|
||||||
RemoteSearchData data = new RemoteSearchData(searchString, caseSensitive, stringRegex, fileNamesString, fileNameRegex, profileName, connectionName, folderName, searchArchives, searchSubfolders);
|
RemoteSearchData data = new RemoteSearchData(searchString, caseSensitive, stringRegex, fileNamesString, fileNameCaseSensitive, fileNameRegex, profileName, connectionName, folderName, searchArchives, searchSubfolders);
|
||||||
previousSearchData.add(data);
|
previousSearchData.add(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1551,6 +1578,7 @@ public class SystemSearchPage extends DialogPage implements ISearchPage {
|
||||||
dataSection.put(STORE_DATA_STRING_REGEX, data.stringRegex);
|
dataSection.put(STORE_DATA_STRING_REGEX, data.stringRegex);
|
||||||
|
|
||||||
dataSection.put(STORE_DATA_FILE_NAMES, data.fileNames);
|
dataSection.put(STORE_DATA_FILE_NAMES, data.fileNames);
|
||||||
|
dataSection.put(STORE_DATA_FILE_NAME_CASE_SENSITIVE, data.fileNameCaseSensitive);
|
||||||
dataSection.put(STORE_DATA_FILE_NAME_REGEX, data.fileNameRegex);
|
dataSection.put(STORE_DATA_FILE_NAME_REGEX, data.fileNameRegex);
|
||||||
|
|
||||||
dataSection.put(STORE_DATA_PROFILE_NAME, data.profileName);
|
dataSection.put(STORE_DATA_PROFILE_NAME, data.profileName);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2008 IBM Corporation and others.
|
* Copyright (c) 2002, 2009 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
* David McKnight (IBM) - [246234] Change of file permissions changes the file owner
|
* David McKnight (IBM) - [246234] Change of file permissions changes the file owner
|
||||||
* David McKnight (IBM) - [250168] handleCommand should not blindly set the status to "done"
|
* David McKnight (IBM) - [250168] handleCommand should not blindly set the status to "done"
|
||||||
* David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder
|
* David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder
|
||||||
|
* David McKnight (IBM) - [243495] [api] New: Allow file name search in Remote Search to not be case sensitive
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.dstore.universal.miners;
|
package org.eclipse.rse.dstore.universal.miners;
|
||||||
|
@ -260,7 +261,7 @@ public class UniversalFileSystemMiner extends Miner {
|
||||||
* Method to do a search.
|
* Method to do a search.
|
||||||
*/
|
*/
|
||||||
public DataElement handleSearch(DataElement theElement, DataElement status,
|
public DataElement handleSearch(DataElement theElement, DataElement status,
|
||||||
String queryType, boolean fileNamesCaseSensitive) {
|
String queryType, boolean systemFileNamesCaseSensitive) {
|
||||||
File fileobj = null;
|
File fileobj = null;
|
||||||
|
|
||||||
DataElement subject = getCommandArgument(theElement, 0);
|
DataElement subject = getCommandArgument(theElement, 0);
|
||||||
|
@ -290,6 +291,7 @@ public class UniversalFileSystemMiner extends Miner {
|
||||||
DataElement arg1 = getCommandArgument(theElement, 1);
|
DataElement arg1 = getCommandArgument(theElement, 1);
|
||||||
DataElement arg2 = getCommandArgument(theElement, 2);
|
DataElement arg2 = getCommandArgument(theElement, 2);
|
||||||
DataElement arg3 = getCommandArgument(theElement, 3);
|
DataElement arg3 = getCommandArgument(theElement, 3);
|
||||||
|
DataElement arg4 = getCommandArgument(theElement, 4);
|
||||||
|
|
||||||
String textString = arg1.getType();
|
String textString = arg1.getType();
|
||||||
boolean isCaseSensitive = Boolean.valueOf(arg1.getName()).booleanValue();
|
boolean isCaseSensitive = Boolean.valueOf(arg1.getName()).booleanValue();
|
||||||
|
@ -305,8 +307,13 @@ public class UniversalFileSystemMiner extends Miner {
|
||||||
// boolean showHidden = Boolean.valueOf(arg3.getSource()).booleanValue();
|
// boolean showHidden = Boolean.valueOf(arg3.getSource()).booleanValue();
|
||||||
Boolean.valueOf(arg3.getSource()).booleanValue();
|
Boolean.valueOf(arg3.getSource()).booleanValue();
|
||||||
|
|
||||||
|
boolean isFileNamesCaseSensitive = true;
|
||||||
|
if (arg4 != null && arg4.getType().equals("file.name.case.sensitive")){ //$NON-NLS-1$
|
||||||
|
isFileNamesCaseSensitive = Boolean.valueOf(arg4.getName()).booleanValue();
|
||||||
|
}
|
||||||
|
|
||||||
SystemSearchString searchString = new SystemSearchString(
|
SystemSearchString searchString = new SystemSearchString(
|
||||||
textString, isCaseSensitive, isTextRegex, fileNamesString,
|
textString, isCaseSensitive, isTextRegex, fileNamesString, isFileNamesCaseSensitive,
|
||||||
isFileNamesRegex, isIncludeArchives, isIncludeSubfolders, classification);
|
isFileNamesRegex, isIncludeArchives, isIncludeSubfolders, classification);
|
||||||
|
|
||||||
UniversalSearchHandler searchThread = new UniversalSearchHandler(
|
UniversalSearchHandler searchThread = new UniversalSearchHandler(
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
* David McKnight (IBM) - [250168] update to just search file of canonical paths (not symbolic links)
|
* David McKnight (IBM) - [250168] update to just search file of canonical paths (not symbolic links)
|
||||||
* David McKnight (IBM) - [255390] memory checking
|
* David McKnight (IBM) - [255390] memory checking
|
||||||
* David McKnight (IBM) - [261644] [dstore] remote search improvements
|
* David McKnight (IBM) - [261644] [dstore] remote search improvements
|
||||||
|
* David McKnight (IBM) - [243495] [api] New: Allow file name search in Remote Search to not be case sensitive
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||||
|
@ -117,7 +118,11 @@ public class UniversalSearchHandler extends SecuredThread implements ICancellabl
|
||||||
// i.e. we do not want to look inside files
|
// i.e. we do not want to look inside files
|
||||||
_isFileSearch = _stringMatcher.isSearchStringEmpty() || _stringMatcher.isSearchStringAsterisk();
|
_isFileSearch = _stringMatcher.isSearchStringEmpty() || _stringMatcher.isSearchStringAsterisk();
|
||||||
|
|
||||||
_fileNameMatcher = new SystemSearchFileNameMatcher(_searchString.getFileNamesString(), fsCaseSensitive, _searchString.isFileNamesRegex());
|
boolean fileNamesCaseSensitive = fsCaseSensitive;
|
||||||
|
if (fileNamesCaseSensitive){ // even though it may be a case sensitive system we may want to search case-insensitive
|
||||||
|
fileNamesCaseSensitive = searchString.isFileNamesCaseSensitive();
|
||||||
|
}
|
||||||
|
_fileNameMatcher = new SystemSearchFileNameMatcher(_searchString.getFileNamesString(), fileNamesCaseSensitive, _searchString.isFileNamesRegex());
|
||||||
|
|
||||||
// classification of files to restrict the search to
|
// classification of files to restrict the search to
|
||||||
_classificationString = _searchString.getClassificationString();
|
_classificationString = _searchString.getClassificationString();
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
|
* David McKnight (IBM) - [216252] use SimpleSystemMessage instead of getMessage()
|
||||||
* David McKnight (IBM) - [255390] don't assume one update means the search is done
|
* David McKnight (IBM) - [255390] don't assume one update means the search is done
|
||||||
* David McKnight (IBM) - [261644] [dstore] remote search improvements
|
* David McKnight (IBM) - [261644] [dstore] remote search improvements
|
||||||
|
* David McKnight (IBM) - [243495] [api] New: Allow file name search in Remote Search to not be case sensitive
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.services.dstore.search;
|
package org.eclipse.rse.internal.services.dstore.search;
|
||||||
|
@ -72,6 +73,7 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
|
||||||
boolean isCaseSensitive = searchString.isCaseSensitive();
|
boolean isCaseSensitive = searchString.isCaseSensitive();
|
||||||
boolean isTextRegex = searchString.isTextStringRegex();
|
boolean isTextRegex = searchString.isTextStringRegex();
|
||||||
String fileNamesString = searchString.getFileNamesString();
|
String fileNamesString = searchString.getFileNamesString();
|
||||||
|
boolean isFileNamesCaseSensitive = searchString.isFileNamesCaseSensitive();
|
||||||
boolean isFileNamesRegex = searchString.isFileNamesRegex();
|
boolean isFileNamesRegex = searchString.isFileNamesRegex();
|
||||||
boolean includeArchives = searchString.isIncludeArchives();
|
boolean includeArchives = searchString.isIncludeArchives();
|
||||||
boolean includeSubfolders = searchString.isIncludeSubfolders();
|
boolean includeSubfolders = searchString.isIncludeSubfolders();
|
||||||
|
@ -85,7 +87,7 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
|
||||||
|
|
||||||
if (queryCmd != null)
|
if (queryCmd != null)
|
||||||
{
|
{
|
||||||
ArrayList argList = setSearchAttributes(textString, isCaseSensitive, isTextRegex, fileNamesString, isFileNamesRegex, includeArchives, includeSubfolders, classificationString, true);
|
ArrayList argList = setSearchAttributes(textString, isCaseSensitive, isTextRegex, fileNamesString, isFileNamesCaseSensitive, isFileNamesRegex, includeArchives, includeSubfolders, classificationString, true);
|
||||||
|
|
||||||
DataElement status = ds.command(queryCmd, argList, deObj);
|
DataElement status = ds.command(queryCmd, argList, deObj);
|
||||||
DStoreSearchResultConfiguration config = (DStoreSearchResultConfiguration) searchConfig;
|
DStoreSearchResultConfiguration config = (DStoreSearchResultConfiguration) searchConfig;
|
||||||
|
@ -142,6 +144,7 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
|
||||||
boolean isCaseSensitive,
|
boolean isCaseSensitive,
|
||||||
boolean isTextRegex,
|
boolean isTextRegex,
|
||||||
String fileNamesString,
|
String fileNamesString,
|
||||||
|
boolean isFileNamesCaseSensitive,
|
||||||
boolean isFileNamesRegex,
|
boolean isFileNamesRegex,
|
||||||
boolean includeArchives,
|
boolean includeArchives,
|
||||||
boolean includeSubfolders,
|
boolean includeSubfolders,
|
||||||
|
@ -157,11 +160,15 @@ public class DStoreSearchService extends AbstractDStoreService implements ISearc
|
||||||
DataElement arg2 = ds.createObject(universaltemp, fileNamesString, String.valueOf(isFileNamesRegex), classificationString);
|
DataElement arg2 = ds.createObject(universaltemp, fileNamesString, String.valueOf(isFileNamesRegex), classificationString);
|
||||||
DataElement arg3 = ds.createObject(universaltemp, String.valueOf(includeArchives), String.valueOf(includeSubfolders), String.valueOf(showHidden));
|
DataElement arg3 = ds.createObject(universaltemp, String.valueOf(includeArchives), String.valueOf(includeSubfolders), String.valueOf(showHidden));
|
||||||
|
|
||||||
|
// extra arg (for version 3.1)
|
||||||
|
DataElement arg4 = ds.createObject(universaltemp, "file.name.case.sensitive", String.valueOf(isFileNamesCaseSensitive));
|
||||||
|
|
||||||
// add the arguments to the argument list
|
// add the arguments to the argument list
|
||||||
ArrayList argList = new ArrayList();
|
ArrayList argList = new ArrayList();
|
||||||
argList.add(arg1);
|
argList.add(arg1);
|
||||||
argList.add(arg2);
|
argList.add(arg2);
|
||||||
argList.add(arg3);
|
argList.add(arg3);
|
||||||
|
argList.add(arg4);
|
||||||
|
|
||||||
return argList;
|
return argList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2003, 2006 IBM Corporation. All rights reserved.
|
* Copyright (c) 2003, 2009 IBM Corporation. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* {Name} (company) - description of contribution.
|
* David McKnight (IBM) - [243495] [api] New: Allow file name search in Remote Search to not be case sensitive
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.services.clientserver;
|
package org.eclipse.rse.services.clientserver;
|
||||||
|
@ -31,6 +31,11 @@ public class SystemSearchString {
|
||||||
protected boolean isCaseSensitive;
|
protected boolean isCaseSensitive;
|
||||||
protected boolean isTextStringRegex;
|
protected boolean isTextStringRegex;
|
||||||
protected String fileNamesString;
|
protected String fileNamesString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 3.1 for determining whether filename should be searched case-sensitive or not
|
||||||
|
*/
|
||||||
|
protected boolean isFileNamesCaseSensitive;
|
||||||
protected boolean isFileNamesRegex;
|
protected boolean isFileNamesRegex;
|
||||||
protected boolean includeArchives;
|
protected boolean includeArchives;
|
||||||
protected boolean includeSubfolders;
|
protected boolean includeSubfolders;
|
||||||
|
@ -49,7 +54,26 @@ public class SystemSearchString {
|
||||||
public SystemSearchString(String textString, boolean isCaseSensitive, boolean isTextStringRegex,
|
public SystemSearchString(String textString, boolean isCaseSensitive, boolean isTextStringRegex,
|
||||||
String fileNamesString, boolean isFileNamesRegex, boolean includeArchives,
|
String fileNamesString, boolean isFileNamesRegex, boolean includeArchives,
|
||||||
boolean includeSubfolders) {
|
boolean includeSubfolders) {
|
||||||
this(textString, isCaseSensitive, isTextStringRegex, fileNamesString, isFileNamesRegex, includeArchives,
|
this(textString, isCaseSensitive, isTextStringRegex, fileNamesString, true, isFileNamesRegex, includeArchives,
|
||||||
|
includeSubfolders);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new search string.
|
||||||
|
* @param textString the text string.
|
||||||
|
* @param isCaseSensitive <code>true</code> if the search should be case sensitive, <code>false</code> otherwise.
|
||||||
|
* @param isTextStringRegex <code>true</code> if the text string is a regular expression, <code>false</code> otherwise.
|
||||||
|
* @param fileNamesString the file names pattern.
|
||||||
|
* @param isFileNamesCaseSensitive <code>true</code> if the file name search should be case sensitive, <code>false</code> otherwise.
|
||||||
|
* @param isFileNamesRegex <code>true</code> if the file names string is a regular expression, <code>false</code> otherwise.
|
||||||
|
* @param includeArchives <code>true</code> to search inside archives, <code>false</code> otherwise.
|
||||||
|
* @param includeSubfolders <code>true</code> to search subfolders, <code>false</code> otherwise.
|
||||||
|
* @since 3.1
|
||||||
|
*/
|
||||||
|
public SystemSearchString(String textString, boolean isCaseSensitive, boolean isTextStringRegex,
|
||||||
|
String fileNamesString, boolean isFileNamesCaseSensitive, boolean isFileNamesRegex, boolean includeArchives,
|
||||||
|
boolean includeSubfolders) {
|
||||||
|
this(textString, isCaseSensitive, isTextStringRegex, fileNamesString, isFileNamesCaseSensitive, isFileNamesRegex, includeArchives,
|
||||||
includeSubfolders, ""); //$NON-NLS-1$
|
includeSubfolders, ""); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,10 +91,31 @@ public class SystemSearchString {
|
||||||
public SystemSearchString(String textString, boolean isCaseSensitive, boolean isTextStringRegex,
|
public SystemSearchString(String textString, boolean isCaseSensitive, boolean isTextStringRegex,
|
||||||
String fileNamesString, boolean isFileNamesRegex, boolean includeArchives,
|
String fileNamesString, boolean isFileNamesRegex, boolean includeArchives,
|
||||||
boolean includeSubfolders, String classificationString) {
|
boolean includeSubfolders, String classificationString) {
|
||||||
|
this(textString, isCaseSensitive, isTextStringRegex, fileNamesString, true, isFileNamesRegex,
|
||||||
|
includeArchives, includeSubfolders, classificationString);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new search string that allows search to be restricted to files with a certain classification.
|
||||||
|
* @param textString the text string.
|
||||||
|
* @param isCaseSensitive <code>true</code> if the search should be case sensitive, <code>false</code> otherwise.
|
||||||
|
* @param isTextStringRegex <code>true</code> if the text string is a regular expression, <code>false</code> otherwise.
|
||||||
|
* @param fileNamesString the file names pattern.
|
||||||
|
* @param isFileNamesCaseSensitive <code>true</code> if the file name search should be case sensitive, <code>false</code> otherwise.
|
||||||
|
* @param isFileNamesRegex <code>true</code> if the file names string is a regular expression, <code>false</code> otherwise.
|
||||||
|
* @param includeArchives <code>true</code> to search inside archives, <code>false</code> otherwise.
|
||||||
|
* @param includeSubfolders <code>true</code> to search subfolders, <code>false</code> otherwise.
|
||||||
|
* @param classificationString the classification string that file classifications should match with.
|
||||||
|
* @since 3.1
|
||||||
|
*/
|
||||||
|
public SystemSearchString(String textString, boolean isCaseSensitive, boolean isTextStringRegex,
|
||||||
|
String fileNamesString, boolean isFileNamesCaseSensitive, boolean isFileNamesRegex, boolean includeArchives,
|
||||||
|
boolean includeSubfolders, String classificationString) {
|
||||||
this.textString = textString;
|
this.textString = textString;
|
||||||
this.isCaseSensitive = isCaseSensitive;
|
this.isCaseSensitive = isCaseSensitive;
|
||||||
this.isTextStringRegex = isTextStringRegex;
|
this.isTextStringRegex = isTextStringRegex;
|
||||||
this.fileNamesString = fileNamesString;
|
this.fileNamesString = fileNamesString;
|
||||||
|
this.isFileNamesCaseSensitive = isFileNamesCaseSensitive;
|
||||||
this.isFileNamesRegex = isFileNamesRegex;
|
this.isFileNamesRegex = isFileNamesRegex;
|
||||||
this.includeArchives = includeArchives;
|
this.includeArchives = includeArchives;
|
||||||
this.includeSubfolders = includeSubfolders;
|
this.includeSubfolders = includeSubfolders;
|
||||||
|
@ -109,6 +154,15 @@ public class SystemSearchString {
|
||||||
return fileNamesString;
|
return fileNamesString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the file names search is case sensitive.
|
||||||
|
* @return <code>true</code> if the file names search is case sensitive, <code>false</code> otherwise.
|
||||||
|
* @since 3.1
|
||||||
|
*/
|
||||||
|
public boolean isFileNamesCaseSensitive() {
|
||||||
|
return isFileNamesCaseSensitive;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the file names string is a regular expression.
|
* Returns whether the file names string is a regular expression.
|
||||||
* @return <code>true</code> if the file names string is a regular expression, <code>false</code> otherwise.
|
* @return <code>true</code> if the file names string is a regular expression, <code>false</code> otherwise.
|
||||||
|
@ -147,7 +201,7 @@ public class SystemSearchString {
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return textString + " - " + isCaseSensitive + " - " + isTextStringRegex + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
return textString + " - " + isCaseSensitive + " - " + isTextStringRegex + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
fileNamesString + " - " + isFileNamesRegex + " - " + includeArchives + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
fileNamesString + " - " + isFileNamesCaseSensitive + " - " + isFileNamesRegex + " - " + includeArchives + " - " + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
includeSubfolders + " - " + classificationString; //$NON-NLS-1$
|
includeSubfolders + " - " + classificationString; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue