use of org.eclipse.ui.editors.text.IEncodingSupport in project dbeaver by dbeaver.
the class BinaryEditor method loadBinaryContent.
private void loadBinaryContent() {
String charset = GeneralUtils.UTF8_ENCODING;
IEditorInput editorInput = getEditorInput();
if (editorInput instanceof IEncodingSupport) {
charset = ((IEncodingSupport) editorInput).getEncoding();
}
File systemFile = null;
if (editorInput instanceof IPathEditorInput) {
systemFile = ((IPathEditorInput) editorInput).getPath().toFile();
}
if (systemFile != null) {
// open file
try {
manager.openFile(systemFile, charset);
} catch (IOException e) {
log.error("Can't open binary content", e);
}
setPartName(systemFile.getName());
}
}
Aggregations