use of org.exbin.deltahex.capability.CodeCharactersCaseCapable in project deltahex-java by exbin.
the class CodeAreaOperationCommandHandler method copyAsCode.
@Override
public void copyAsCode() {
SelectionRange selection = ((SelectionCapable) codeArea.getWorker()).getSelection();
if (!selection.isEmpty()) {
long first = selection.getFirst();
long last = selection.getLast();
BinaryData copy = codeArea.getData().copy(first, last - first + 1);
CodeType codeType = ((CodeTypeCapable) codeArea.getWorker()).getCodeType();
CodeCharactersCase charactersCase = ((CodeCharactersCaseCapable) codeArea.getWorker()).getCodeCharactersCase();
CodeAreaUtils.CodeDataClipboardData binaryData = new CodeAreaUtils.CodeDataClipboardData(copy, binaryDataFlavor, codeType, charactersCase);
setClipboardContent(binaryData);
}
}
use of org.exbin.deltahex.capability.CodeCharactersCaseCapable in project deltahex-java by exbin.
the class DefaultCodeAreaCommandHandler method copyAsCode.
@Override
public void copyAsCode() {
SelectionRange selection = ((SelectionCapable) codeArea.getWorker()).getSelection();
if (!selection.isEmpty()) {
BinaryData data = codeArea.getData();
if (data == null) {
return;
}
long first = selection.getFirst();
long last = selection.getLast();
BinaryData copy = data.copy(first, last - first + 1);
CodeType codeType = ((CodeTypeCapable) codeArea.getWorker()).getCodeType();
CodeCharactersCase charactersCase = ((CodeCharactersCaseCapable) codeArea.getWorker()).getCodeCharactersCase();
CodeAreaUtils.CodeDataClipboardData binaryData = new CodeAreaUtils.CodeDataClipboardData(copy, binaryDataFlavor, codeType, charactersCase);
setClipboardContent(binaryData);
}
}
Aggregations