mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Added source for ByteEdit
This commit is contained in:
1 parent
32dacb30ff
commit
d29e5765af
352 files changed
+199016
No files matched your search
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 02/16/2012
|
||||
*
|
||||
* Copyright (C) 2013 Robert Futrell
|
||||
* robert_futrell at users.sourceforge.net
|
||||
* http://fifesoft.com/rsyntaxtextarea
|
||||
*
|
||||
* This library is distributed under a modified BSD license. See the included
|
||||
* RSyntaxTextArea.License.txt file for details.
|
||||
*/
|
||||
package org.fife.ui.rsyntaxtextarea;
|
||||
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
|
||||
|
||||
/**
|
||||
* A link generator result that selects a region of text in the text area.
|
||||
* This will typically be used by IDE-style applications, to provide support
|
||||
* for "linking" the use of a variable in a document to its declaration.
|
||||
*
|
||||
* @author Robert Futrell
|
||||
* @version 1.0
|
||||
* @see LinkGenerator
|
||||
*/
|
||||
public class SelectRegionLinkGeneratorResult implements LinkGeneratorResult {
|
||||
|
||||
private RSyntaxTextArea textArea;
|
||||
private int sourceOffset;
|
||||
private int selStart;
|
||||
private int selEnd;
|
||||
|
||||
|
||||
public SelectRegionLinkGeneratorResult(RSyntaxTextArea textArea,
|
||||
int sourceOffset, int selStart, int selEnd) {
|
||||
this.textArea = textArea;
|
||||
this.sourceOffset = sourceOffset;
|
||||
this.selStart = selStart;
|
||||
this.selEnd = selEnd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Selects the text in the text area.
|
||||
*/
|
||||
@Override
|
||||
public HyperlinkEvent execute() {
|
||||
textArea.select(selStart, selEnd);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int getSourceOffset() {
|
||||
return sourceOffset;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user