1 package com.proalpha.pds.gitutils.search;
3 import org.eclipse.jface.dialogs.IDialogSettings;
7 private static final String PHRASE =
"phrase";
8 private static final String MATCHES =
"matches";
9 private static final String CASE =
"case";
10 private static final String FINDS =
"finds";
11 private static final String REPOSITORY =
"repository";
12 private static final String FILESCOPE =
"filescope";
14 private String textPhrase =
"";
15 private String repositoryPath =
"";
16 private String branchName =
"";
17 private String fileNamePhrase =
"**/*.*";
18 private String fileType =
"ALL";
19 private int maxFinds = 100;
20 private boolean isCaseSensitive =
false;
22 public String getTextPhrase() {
26 public void setTextPhrase(String textPhrase) {
27 this.textPhrase = textPhrase;
30 public String getRepositoryPath() {
31 return repositoryPath;
34 public void setRepositoryPath(String repositoryPath) {
35 this.repositoryPath = repositoryPath;
38 public String getBranchName() {
42 public void setBranchName(String branchName) {
43 this.branchName = branchName;
46 public String getFileNamePhrase() {
47 return fileNamePhrase;
50 public void setFileNamePhrase(String fileNamePhrase) {
51 this.fileNamePhrase = fileNamePhrase;
54 public String getFileType() {
58 public void setFileType(String fileType) {
59 this.fileType = fileType;
62 public int getMaxFinds() {
66 public void setMaxFinds(
int maxFinds) {
67 this.maxFinds = maxFinds;
70 public boolean isCaseSensitive() {
71 return isCaseSensitive;
74 public void setCaseSensitive(
boolean isCaseSensitive) {
75 this.isCaseSensitive = isCaseSensitive;
83 public void save(IDialogSettings settings) {
85 IDialogSettings section = settings.getSection(
"searchSection");
87 section = settings.addNewSection(
"searchSection");
89 section.put(PHRASE, textPhrase);
90 section.put(MATCHES, fileNamePhrase);
91 section.put(CASE, !isCaseSensitive);
92 section.put(FINDS, maxFinds);
93 section.put(FILESCOPE, fileType);
94 section.put(REPOSITORY, repositoryPath);
104 IDialogSettings section = settings.getSection(
"searchSection");
106 if (section !=
null) {
107 searchSettings.setTextPhrase(section.get(PHRASE));
108 searchSettings.setFileNamePhrase(section.get(MATCHES));
109 searchSettings.setCaseSensitive(!section.getBoolean(CASE));
110 searchSettings.setMaxFinds(section.getInt(FINDS));
111 searchSettings.setFileType(section.get(FILESCOPE));
112 searchSettings.setRepositoryPath(section.get(REPOSITORY));
114 return searchSettings;
void save(IDialogSettings settings)
static GitGrepSearchSettings load(IDialogSettings settings)