"""
Hex_Dump.py - A Jython macro for jEdit that displays the current
buffer as a Hex Dump, using the Hex Plugin.

Copyright (C) 2003 Ollie Rutherfurd <oliver@rutherfurd.net>

$Id: Hex_Dump.py 28 2003-03-25 22:40:28Z oliver $
"""

from org.gjt.sp.jedit.io import VFSManager
from org.gjt.sp.jedit import Macros

def hexdump(view):
	if not VFSManager.getVFSByName('hex'):
		Macros.error(view, "You must have Hex Plugin installed.")
	else:
		jEdit.openFile(view, 'hex:' + view.getBuffer().getPath())

if __name__ in ('__main__','main'):
	hexdump(init.view)

# :indentSize=4:lineSeparator=\n:noTabs=false:tabSize=4:

