本文整理汇总了Java中com.intellij.find.FindModel.SearchContext方法的典型用法代码示例。如果您正苦于以下问题:Java FindModel.SearchContext方法的具体用法?Java FindModel.SearchContext怎么用?Java FindModel.SearchContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.find.FindModel
的用法示例。
在下文中一共展示了FindModel.SearchContext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initModelBySetings
import com.intellij.find.FindModel; //导入方法依赖的package包/类
@Override
public void initModelBySetings(@NotNull FindModel model){
model.setCaseSensitive(isCaseSensitive());
model.setForward(isForward());
model.setFromCursor(isFromCursor());
model.setGlobal(isGlobal());
model.setRegularExpressions(isRegularExpressions());
model.setWholeWordsOnly(isWholeWordsOnly());
FindModel.SearchContext searchContext = isInCommentsOnly() ?
FindModel.SearchContext.IN_COMMENTS :
isInStringLiteralsOnly() ?
FindModel.SearchContext.IN_STRING_LITERALS :
isExceptComments() ?
FindModel.SearchContext.EXCEPT_COMMENTS :
isExceptStringLiterals() ?
FindModel.SearchContext.EXCEPT_STRING_LITERALS :
isExceptCommentsAndLiterals() ?
FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS :
FindModel.SearchContext.ANY;
model.setSearchContext(searchContext);
model.setWithSubdirectories(isWithSubdirectories());
model.setFileFilter(FILE_MASK);
model.setCustomScopeName(FIND_SCOPE);
}
示例2: getPresentableName
import com.intellij.find.FindModel; //导入方法依赖的package包/类
public static String getPresentableName(@NotNull FindModel.SearchContext searchContext) {
@PropertyKey(resourceBundle = "messages.FindBundle") String messageKey = null;
if (searchContext == FindModel.SearchContext.ANY) {
messageKey = "find.context.anywhere.scope.label";
} else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS) {
messageKey = "find.context.except.comments.scope.label";
} else if (searchContext == FindModel.SearchContext.EXCEPT_STRING_LITERALS) {
messageKey = "find.context.except.literals.scope.label";
} else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS) {
messageKey = "find.context.except.comments.and.literals.scope.label";
} else if (searchContext == FindModel.SearchContext.IN_COMMENTS) {
messageKey = "find.context.in.comments.scope.label";
} else if (searchContext == FindModel.SearchContext.IN_STRING_LITERALS) {
messageKey = "find.context.in.literals.scope.label";
}
return messageKey != null ? FindBundle.message(messageKey) : searchContext.toString();
}
示例3: initModelBySetings
import com.intellij.find.FindModel; //导入方法依赖的package包/类
@Override
public void initModelBySetings(@Nonnull FindModel model){
model.setCaseSensitive(isCaseSensitive());
model.setForward(isForward());
model.setFromCursor(isFromCursor());
model.setGlobal(isGlobal());
model.setRegularExpressions(isRegularExpressions());
model.setWholeWordsOnly(isWholeWordsOnly());
FindModel.SearchContext searchContext = isInCommentsOnly() ?
FindModel.SearchContext.IN_COMMENTS :
isInStringLiteralsOnly() ?
FindModel.SearchContext.IN_STRING_LITERALS :
isExceptComments() ?
FindModel.SearchContext.EXCEPT_COMMENTS :
isExceptStringLiterals() ?
FindModel.SearchContext.EXCEPT_STRING_LITERALS :
isExceptCommentsAndLiterals() ?
FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS :
FindModel.SearchContext.ANY;
model.setSearchContext(searchContext);
model.setWithSubdirectories(isWithSubdirectories());
model.setFileFilter(FILE_MASK);
model.setCustomScopeName(FIND_SCOPE);
}
示例4: EditorHeaderSetSearchContextAction
import com.intellij.find.FindModel; //导入方法依赖的package包/类
protected EditorHeaderSetSearchContextAction(@NotNull String text, @NotNull FindModel.SearchContext context) {
super(text);
myContext = context;
}
示例5: applyTo
import com.intellij.find.FindModel; //导入方法依赖的package包/类
private void applyTo(@NotNull FindModel model, boolean findAll) {
model.setCaseSensitive(myCbCaseSensitive.isSelected());
if (model.isReplaceState()) {
model.setPreserveCase(myCbPreserveCase.isSelected());
}
model.setWholeWordsOnly(myCbWholeWordsOnly.isSelected());
String selectedSearchContextInUi = (String)mySearchContext.getSelectedItem();
FindModel.SearchContext searchContext = FindModel.SearchContext.ANY;
if (FindBundle.message("find.context.in.literals.scope.label").equals(selectedSearchContextInUi)) {
searchContext = FindModel.SearchContext.IN_STRING_LITERALS;
}
else if (FindBundle.message("find.context.in.comments.scope.label").equals(selectedSearchContextInUi)) {
searchContext = FindModel.SearchContext.IN_COMMENTS;
}
else if (FindBundle.message("find.context.except.comments.scope.label").equals(selectedSearchContextInUi)) {
searchContext = FindModel.SearchContext.EXCEPT_COMMENTS;
}
else if (FindBundle.message("find.context.except.literals.scope.label").equals(selectedSearchContextInUi)) {
searchContext = FindModel.SearchContext.EXCEPT_STRING_LITERALS;
} else if (FindBundle.message("find.context.except.comments.and.literals.scope.label").equals(selectedSearchContextInUi)) {
searchContext = FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS;
}
model.setSearchContext(searchContext);
model.setRegularExpressions(myCbRegularExpressions.isSelected());
String stringToFind = getStringToFind();
model.setStringToFind(stringToFind);
if (model.isReplaceState()){
model.setPromptOnReplace(true);
model.setReplaceAll(false);
String stringToReplace = getStringToReplace();
model.setStringToReplace(StringUtil.convertLineSeparators(stringToReplace));
}
if (!model.isMultipleFiles()){
model.setForward(myRbForward.isSelected());
model.setFromCursor(myRbFromCursor.isSelected());
model.setGlobal(myRbGlobal.isSelected());
}
else{
if (myCbToOpenInNewTab != null){
model.setOpenInNewTab(myCbToOpenInNewTab.isSelected());
}
model.setProjectScope(myRbProject.isSelected());
model.setDirectoryName(null);
model.setModuleName(null);
model.setCustomScopeName(null);
model.setCustomScope(null);
model.setCustomScope(false);
if (myRbDirectory.isSelected()) {
String directory = getDirectory();
model.setDirectoryName(directory == null ? "" : directory);
model.setWithSubdirectories(myCbWithSubdirectories.isSelected());
}
else if (myRbModule.isSelected()) {
model.setModuleName((String)myModuleComboBox.getSelectedItem());
}
else if (myRbCustomScope.isSelected()) {
SearchScope selectedScope = myScopeCombo.getSelectedScope();
String customScopeName = selectedScope == null ? null : selectedScope.getDisplayName();
model.setCustomScopeName(customScopeName);
model.setCustomScope(selectedScope == null ? null : selectedScope);
model.setCustomScope(true);
}
}
model.setFindAll(findAll);
String mask = getFileTypeMask();
model.setFileFilter(mask);
}
示例6: EditorHeaderSetSearchContextAction
import com.intellij.find.FindModel; //导入方法依赖的package包/类
protected EditorHeaderSetSearchContextAction(@Nonnull String text, @Nonnull FindModel.SearchContext context) {
super(text);
myContext = context;
}