MCPcopy Create free account
hub / github.com/BaseXdb/basex / replace

Method replace

basex-core/src/main/java/org/basex/gui/text/TextPanel.java:393–407  ·  view source on GitHub ↗

Replaces the text. @param rc replace context

(final ReplaceContext rc)

Source from the content-addressed store, hash-verified

391 * @param rc replace context
392 */
393 final void replace(final ReplaceContext rc) {
394 try {
395 final int[] select = rend.replace(rc);
396 if(rc.text != null) {
397 final boolean sel = editor.isSelected();
398 setText(rc.text);
399 editor.select(select[0], select[sel ? 1 : 0]);
400 release(Action.CHECK);
401 }
402 gui.status.setText(Text.STRINGS_REPLACED, true);
403 } catch(final Exception ex) {
404 final String msg = Util.message(ex).replaceAll(Prop.NL + ".*", "");
405 gui.status.setText(Text.REGULAR_EXPR + Text.COLS + msg, false);
406 }
407 }
408
409 /**
410 * Jumps to the current, next or previous search string.

Callers 10

quoteMethod · 0.45
filterMethod · 0.45
queryMethod · 0.45
infoMethod · 0.45
setInfoMethod · 0.45
mouseMovedMethod · 0.45
SearchBarMethod · 0.45
completeMethod · 0.45
actionMethod · 0.45
assignMethod · 0.45

Calls 5

setTextMethod · 0.95
releaseMethod · 0.95
messageMethod · 0.95
isSelectedMethod · 0.80
selectMethod · 0.45

Tested by

no test coverage detected