本文整理了Java中javax.swing.text.JTextComponent.replaceSelection()
方法的一些代码示例,展示了JTextComponent.replaceSelection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.replaceSelection()
方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:replaceSelection
暂无
代码示例来源:origin: skylot/jadx
@Override
public void actionPerformed(ActionEvent ae) {
textComponent.replaceSelection("");
}
};
代码示例来源:origin: RipMeApp/ripme
@Override
public void actionPerformed(ActionEvent ae) {
textComponent.setText("");
textComponent.replaceSelection(savedString);
lastActionSelected = Actions.UNDO;
}
};
代码示例来源:origin: stackoverflow.com
public void actionPerformed(ActionEvent ae) {
textComponent.setText("");
textComponent.replaceSelection(savedString);
代码示例来源:origin: bobbylight/RSyntaxTextArea
sbuff.append('\n');
c.replaceSelection(sbuff != null ? sbuff.toString() : "");
代码示例来源:origin: stackoverflow.com
display.replaceSelection( source.getActionCommand() );
代码示例来源:origin: freeplane/freeplane
@Override
public void actionPerformed(ActionEvent e) {
JTextComponent c = (JTextComponent) e.getSource();
c.replaceSelection("\n");
}
}
代码示例来源:origin: jcbvm/i18n-editor
@Override
public void actionPerformed(ActionEvent e) {
JTextComponent component = getFocusedComponent();
component.replaceSelection("");
}
}
代码示例来源:origin: de.sciss/jsyntaxpane
private void jLstItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLstItemsMouseClicked
if(evt.getClickCount() == 2) {
String selected = jLstItems.getSelectedValue().toString();
target.replaceSelection(selected);
setVisible(false);
}
}//GEN-LAST:event_jLstItemsMouseClicked
代码示例来源:origin: de.sciss/syntaxpane
private void jLstItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLstItemsMouseClicked
if(evt.getClickCount() == 2) {
String selected = jLstItems.getSelectedValue().toString();
target.replaceSelection(selected);
setVisible(false);
}
}//GEN-LAST:event_jLstItemsMouseClicked
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer
public Transferable copyText(boolean cut) {
String text = inlineTextEditor.getSelectedText();
Transferable transferable = new StringSelection(text);
if (cut) {
inlineTextEditor.replaceSelection("");
}
return transferable;
}
代码示例来源:origin: stackoverflow.com
public class AddDigitAction extends TextAction
{
public void actionPerformed(ActionEvent e)
{
JButton button = (JButton)e.getSource();
String digit = button.getActionCommand();
JTextComponent target = getTextComponent(e);
target.replaceSelection(digit);
}
代码示例来源:origin: de.sciss/syntaxpane
private void jLstItemsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLstItemsMouseClicked
if (evt.getClickCount() == 2) {
String selected = getSelection();
target.replaceSelection(selected);
setVisible(false);
}
}//GEN-LAST:event_jLstItemsMouseClicked
代码示例来源:origin: de.sciss/jsyntaxpane
/**
* Replace single occurrence of match with the replacement.
* @param target
* @param replacement
*/
public void doReplace(JTextComponent target, String replacement) {
if (target.getSelectedText() != null) {
target.replaceSelection(replacement == null ? "" : replacement);
doFindNext(target);
}
}
代码示例来源:origin: org.gosu-lang.gosu/gosu-lab
/**
* @return offset of replaced word
*/
public static int replaceWordAtCaret( JTextComponent editor, String strText )
{
selectWordAtCaret( editor );
int selectionStart = editor.getSelectionStart();
editor.replaceSelection( strText == null ? "" : strText );
return selectionStart;
}
代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz
public void actionPerformed(ActionEvent arg0) {
final String toDecode = area.getSelectedText();
if(toDecode != null ){
final String decoded = EncoderHashCore.decode(toDecode, EncoderHashCore.CODES[index]);
area.replaceSelection(decoded);
}
}
});
代码示例来源:origin: org.gosu-lang.gosu/gosu-editor
/**
* @return offset of replaced word
*/
public static int replaceWordAtCaret( JTextComponent editor, String strText )
{
selectWordAtCaret( editor );
int selectionStart = editor.getSelectionStart();
editor.replaceSelection( strText == null ? "" : strText );
return selectionStart;
}
代码示例来源:origin: de.sciss/syntaxpane
/**
* Replaces single occurrence of match with the replacement.
*/
public void doReplace(JTextComponent target, String replacement) {
if (target.getSelectedText() != null) {
target.replaceSelection(replacement == null ? "" : replacement);
doFindNext(target,true);
}
}
代码示例来源:origin: net.java.abeille/abeille
public void actionPerformed(ActionEvent evt, JTextComponent target) {
if (target != null) {
if (!target.isEditable() || !target.isEnabled()) {
target.getToolkit().beep();
return;
}
target.replaceSelection(null);
}
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib
public void actionPerformed(ActionEvent evt, JTextComponent target) {
if (target != null) {
if (!target.isEditable() || !target.isEnabled()) {
target.getToolkit().beep();
return;
}
target.replaceSelection(text);
}
}
}
代码示例来源:origin: net.java.abeille/abeille
public void actionPerformed(ActionEvent evt, JTextComponent target) {
if (target != null) {
if (!target.isEditable() || !target.isEnabled()) {
target.getToolkit().beep();
return;
}
target.replaceSelection(text);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!