当前位置: 首页>>代码示例>>Java>>正文


Java SearchContext.setSearchForward方法代码示例

本文整理汇总了Java中org.fife.ui.rtextarea.SearchContext.setSearchForward方法的典型用法代码示例。如果您正苦于以下问题:Java SearchContext.setSearchForward方法的具体用法?Java SearchContext.setSearchForward怎么用?Java SearchContext.setSearchForward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.fife.ui.rtextarea.SearchContext的用法示例。


在下文中一共展示了SearchContext.setSearchForward方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: replace

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public final boolean replace(String toFind, String toReplace,
		boolean matchCase, boolean wholeWorld, boolean isRegex,
		boolean searchBack) {
	if (toFind.length() == 0) {
		return false;
	}
	SearchContext context = new SearchContext();
	context.setSearchFor(toFind);
	context.setReplaceWith(toReplace);
	context.setMatchCase(matchCase);
	context.setRegularExpression(isRegex);
	context.setWholeWord(wholeWorld);
	context.setSearchForward(!searchBack);

	return SearchEngine.replace(textarea, context);
}
 
开发者ID:roscisz,项目名称:KernelHive,代码行数:18,代码来源:SourceCodeEditor.java

示例2: replaceAll

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public final int replaceAll(String toFind, String toReplace,
		boolean matchCase, boolean wholeWorld, boolean isRegex,
		boolean searchBack) {
	if (toFind.length() == 0) {
		return -1;
	}
	SearchContext context = new SearchContext();
	context.setSearchFor(toFind);
	context.setReplaceWith(toReplace);
	context.setMatchCase(matchCase);
	context.setRegularExpression(isRegex);
	context.setWholeWord(wholeWorld);
	context.setSearchForward(!searchBack);

	return SearchEngine.replaceAll(textarea, context);
}
 
开发者ID:roscisz,项目名称:KernelHive,代码行数:18,代码来源:SourceCodeEditor.java

示例3: actionPerformed

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
    if (textField.getText().length() == 0)
        return;

    RSyntaxTextArea pane = mainWindow.getModel().getCurrentTextArea();
    if (pane == null)
        return;

    SearchContext context = new SearchContext();
    context.setSearchFor(textField.getText());
    context.setMatchCase(mcase.isSelected());
    context.setRegularExpression(regex.isSelected());
    context.setSearchForward(!reverse.isSelected());
    context.setWholeWord(wholew.isSelected());

    if (!SearchEngine.find(pane, context).wasFound()) {
        pane.setSelectionStart(0);
        pane.setSelectionEnd(0);
    }
}
 
开发者ID:hsswx7,项目名称:CS4500GroupProject,代码行数:22,代码来源:FindBox.java

示例4: actionPerformed

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
	if (textField.getText().length() == 0)
		return;

	RSyntaxTextArea pane = mainWindow.getModel().getCurrentTextArea();
	if (pane == null)
		return;

	SearchContext context = new SearchContext();
	context.setSearchFor(textField.getText());
	context.setMatchCase(mcase.isSelected());
	context.setRegularExpression(regex.isSelected());
	context.setSearchForward(!reverse.isSelected());
	context.setWholeWord(wholew.isSelected());

	if (!SearchEngine.find(pane, context).wasFound()) {
		if (wrap.isSelected()) {
			pane.setSelectionStart(0);
			pane.setSelectionEnd(0);
		} else {
			mainWindow.getLabel().setText("Search Complete");
		}
	}
}
 
开发者ID:KevinPriv,项目名称:Luyten4Forge,代码行数:26,代码来源:FindBox.java

示例5: actionPerformed

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public void actionPerformed(final ActionEvent event) {
    if (event.getSource() == prevButton || event.getSource() == nextButton) {
        final String command = event.getActionCommand();
        final boolean forward = "FindNext".equals(command);
        // Create an object defining our search parameters.
        final SearchContext context = new SearchContext();
        final String text = searchField.getText();
        if (text.length() == 0)
            return;
        context.setSearchFor(text);
        context.setMatchCase(matchCaseCB.isSelected());
        context.setRegularExpression(regexCB.isSelected());
        context.setSearchForward(forward);
        context.setWholeWord(false);

        final boolean found = SearchEngine.find(btext, context).wasFound();
        if (!found) {
            JOptionPane.showMessageDialog(null, "Text not found");
        }
    }
}
 
开发者ID:uwx,项目名称:OpenNFMM,代码行数:23,代码来源:TextEditor.java

示例6: actionPerformed

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {

	// "FindNext" => search forward, "FindPrev" => search backward
	String command = e.getActionCommand();
	boolean forward = "FindNext".equals(command);

	// Create an object defining our search parameters.
	SearchContext context = new SearchContext();
	String text = searchField.getText();
	if (text.length() == 0) {
		return;
	}
	context.setSearchFor(text);
	context.setMatchCase(matchCaseCB.isSelected());
	context.setRegularExpression(regexCB.isSelected());
	context.setSearchForward(forward);
	context.setWholeWord(false);

	boolean found = SearchEngine.find(textArea, context);
	if (!found) {
		JOptionPane.showMessageDialog(this, "Text not found");
	}

}
 
开发者ID:glaudiston,项目名称:project-bianca,代码行数:26,代码来源:FindAndReplaceDialog.java

示例7: find

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
/**
 * Finds the specified string in the code editor.
 * @param str The string to find.
 * @param matchCase If the search is case-sensitive.
 * @param forward Whether to search forwards or backwards.
 */
protected void find(String str, boolean matchCase, boolean forward) {
	if(!str.isEmpty()) {
		clearFind();

		SearchContext context = new SearchContext();
		context.setSearchFor(str);
		context.setMatchCase(matchCase);
		context.setRegularExpression(false);
		context.setSearchForward(forward);
		context.setWholeWord(false);

		SearchEngine.find(txtCode, context);
		txtCode.markAll(str, matchCase, false, false);
	}
}
 
开发者ID:brunonova,项目名称:drmips,代码行数:22,代码来源:FrmSimulator.java

示例8: replace

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
/**
 * Replaces the next occurrence of the given string by another string.
 * @param str The string to find.
 * @param by The string to replace with.
 * @param matchCase If the search is case-sensitive.
 * @param forward Whether to search forwards or backwards.
 */
protected void replace(String str, String by, boolean matchCase, boolean forward) {
	if(!str.isEmpty()) {
		clearFind();

		SearchContext context = new SearchContext();
		context.setSearchFor(str);
		context.setReplaceWith(by);
		context.setMatchCase(matchCase);
		context.setRegularExpression(false);
		context.setSearchForward(forward);
		context.setWholeWord(false);

		SearchEngine.replace(txtCode, context);
		txtCode.markAll(str, matchCase, false, false);
	}
}
 
开发者ID:brunonova,项目名称:drmips,代码行数:24,代码来源:FrmSimulator.java

示例9: replaceAll

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
/**
 * Replaces all occurrence of the given string by another string.
 * @param str The string to find.
 * @param by The string to replace with.
 * @param matchCase If the search is case-sensitive.
 * @param forward Whether to search forwards or backwards.
 */
protected void replaceAll(String str, String by, boolean matchCase, boolean forward) {
	if(!str.isEmpty()) {
		clearFind();

		SearchContext context = new SearchContext();
		context.setSearchFor(str);
		context.setReplaceWith(by);
		context.setMatchCase(matchCase);
		context.setRegularExpression(false);
		context.setSearchForward(forward);
		context.setWholeWord(false);

		SearchEngine.replaceAll(txtCode, context);
	}
}
 
开发者ID:brunonova,项目名称:drmips,代码行数:23,代码来源:FrmSimulator.java

示例10: performSearch

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
private void performSearch(boolean forward) {
    //SearchContext context = new SearchContext();
    String text = searchField.getText();
    if (text.length() == 0)
        return;
    boolean caseSensitive = matchCaseCB.isSelected();
    boolean regExpr = regexCB.isSelected();
    boolean forwardSearch = forward;
    boolean wholeWord = false;

    SearchContext context = new SearchContext();
    if (text.length() == 0)
        return;
    context.setSearchFor(text);
    context.setMatchCase(matchCaseCB.isSelected());
    context.setRegularExpression(regexCB.isSelected());
    context.setSearchForward(forward);
    context.setWholeWord(false);

    boolean found = SearchEngine.find(jep, context);

    if (!found)
        JOptionPane.showMessageDialog(this.currentFrame, "Text not found");
}
 
开发者ID:scalalab,项目名称:scalalab,代码行数:25,代码来源:rsyntaxEditor.java

示例11: actionPerformed

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e)
{
	if(e.getSource() == bSearch)
	{
		if (fSearch.getText().length() == 0) return;

		SearchContext context = new SearchContext();
		context.setSearchFor(fSearch.getText());
		context.setMatchCase(cbCaseSensitive.isSelected());
		context.setRegularExpression(cbRegEx.isSelected());
		context.setSearchForward(!cbSearchBackward.isSelected());
		context.setWholeWord(cbWholeWord.isSelected());

		if (!SearchEngine.find(textArea, context).wasFound())
			JOptionPane.showMessageDialog(frame, "Texto no encontrado");
	}
	if(e.getSource() == bCancel)
		this.dispose();
}
 
开发者ID:pedromateo,项目名称:tug_qt_unit_testing_fw,代码行数:20,代码来源:DialogSearch.java

示例12: actionPerformed

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {

  // "FindNext" => search forward, "FindPrev" => search backward
  String command = e.getActionCommand();
  boolean forward = "FindNext".equals(command);

  // Create an object defining our search parameters.
  SearchContext context = new SearchContext();
  String text = searchField.getText();
  if (text.length() == 0) {
    return;
  }
  context.setSearchFor(text);
  context.setMatchCase(matchCaseCB.isSelected());
  context.setRegularExpression(regexCB.isSelected());
  context.setSearchForward(forward);
  context.setWholeWord(false);

  boolean found = SearchEngine.find(textArea, context);
  if (!found) {
    JOptionPane.showMessageDialog(this, "Text not found");
  }

}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:26,代码来源:FindAndReplaceDemo.java

示例13: find

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
@Override
public final boolean find(String toFind, boolean matchCase,
		boolean wholeWorld, boolean isRegex, boolean searchBack) {
	if (toFind.length() == 0) {
		return false;
	}
	SearchContext context = new SearchContext();
	context.setSearchFor(toFind);
	context.setMatchCase(matchCase);
	context.setRegularExpression(isRegex);
	context.setWholeWord(wholeWorld);
	context.setSearchForward(!searchBack);

	return SearchEngine.find(textarea, context);
}
 
开发者ID:roscisz,项目名称:KernelHive,代码行数:16,代码来源:SourceCodeEditor.java

示例14: searchText

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
public void searchText(String operation, boolean regex, boolean matchCase,
		boolean wholeWord, boolean markAll, boolean forSearch) {
	int chosenIndex = tabPane.getSelectedIndex();
	if (chosenIndex < 0) {
		JOptionPane.showMessageDialog(null, "No files opened to search on");
		return;
	}
	RTextScrollPane htmlScroll = (RTextScrollPane) tabPane
			.getComponentAt(chosenIndex);
	RSyntaxTextArea searchtextArea = (RSyntaxTextArea) htmlScroll
			.getViewport().getView();
	SearchContext context = new SearchContext();
	String text = searchField.getText();
	if (text.length() == 0) {
		return;
	}
	context.setSearchFor(text);
	context.setMatchCase(matchCase);
	context.setRegularExpression(regex);
	context.setSearchForward(forSearch);
	context.setWholeWord(wholeWord);
	context.setMarkAll(markAll);
	boolean found = false;
	if (operation.equals("replace")) {
		context.setReplaceWith(repWithField.getText());
		found = SearchEngine.replace(searchtextArea, context).wasFound();
	} else if (operation.equals("replaceAll")) {
		context.setReplaceWith(repWithField.getText());
		found = SearchEngine.replaceAll(searchtextArea, context).wasFound();
	} else {
		found = SearchEngine.find(searchtextArea, context).wasFound();
	}
	if (!found) {
		JOptionPane.showMessageDialog(null, "Text not found");
	}
}
 
开发者ID:csanuragjain,项目名称:APKRepatcher,代码行数:37,代码来源:APKRepatcher.java

示例15: actionPerformed

import org.fife.ui.rtextarea.SearchContext; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e)
{
	if(e.getSource() == bCancel)
		this.dispose();

	if (fSearch.getText().length() == 0) return;

	SearchContext context = new SearchContext();
	context.setSearchFor(fSearch.getText());
	context.setMatchCase(cbCaseSensitive.isSelected());
	context.setRegularExpression(cbRegEx.isSelected());
	context.setSearchForward(!cbSearchBackward.isSelected());
	context.setWholeWord(cbWholeWord.isSelected());

	if(e.getSource() == bSearch)
	{
		if (!SearchEngine.find(textArea, context).wasFound())
			JOptionPane.showMessageDialog(frame, "Texto no encontrado");
		return;
	}
	
	if(fReplace.getText().length() == 0) return;

	context.setReplaceWith(fReplace.getText());

	if(e.getSource() == bReplace)
	{
		SearchEngine.replace(textArea, context);
		return;
	}
	if(e.getSource() == bReplaceAll)
	{
		SearchEngine.replaceAll(textArea, context).wasFound();
		return;
	}
}
 
开发者ID:pedromateo,项目名称:tug_qt_unit_testing_fw,代码行数:37,代码来源:DialogReplace.java


注:本文中的org.fife.ui.rtextarea.SearchContext.setSearchForward方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。