; javapopup.mnu
;
; This is the WIL menu version of WinEdit's context menu
; for Java files. These context menu commands only
; appear when you are editing an java file.
;
; Java file type options are set in the View.Options
; property sheet, in the File Types dialog.
;
;
; AutoExec Section is on top here.
;
TAB=@TAB
CR=@CRLF
EOL=@CR
Home=DirHome()
IntControl(29,@tab,0,0,0) ;Standardize on tabs as delimiters for FileItemize, etc
zxct="Help file error"
zxcm="Help file not found. See EXTENDERS directory on CD-ROM or our website at http://www.winbatch.com to obtain desired extenders."
Compile ; Compile this file with the javac compiler
wCompile()
Run Java Applet \ ^R ; Run this compiled java class in WinEdit Explorer
filename = wGetFileName()
path = FilePath(filename)
basename = FileRoot(filename)
olddir = DirGet()
javaname = strcat(path,"%basename%.class")
if (FileExist(javaname))
DirChange(path)
; see if there is already an html file in this directory
; and offer to run that
htmllist = FileItemize("*.html")
if (htmllist != "")
ifile = AskItemList("Choose an html file", htmllist, @TAB, @unsorted, @single)
if (ifile != "")
htmlname = strcat(FileRoot(ifile),".html")
else
; make an html wrapper for the class to run in
htmlname = strcat(path,"%basename%.html")
h = FileOpen(htmlname, "WRITE")
FileWrite(h, '')
FileWrite(h, '')
FileWrite(h, '')
FileWrite(h, '')
FileWrite(h, '
')
FileWrite(h, '')
FileWrite(h, ' %basename% Applet')
FileWrite(h, '')
FileWrite(h, ' ')
FileWrite(h, '')
FileWrite(h, ' %basename% Applet
')
FileWrite(h, '')
FileWrite(h, '
')
FileWrite(h, '')
FileWrite(h, '')
FileWrite(h, '')
FileWrite(h, '
')
FileWrite(h, '')
FileWrite(h, ' ')
FileWrite(h, '')
FileWrite(h, '')
FileClose(h)
endif
endif
Run("appletviewer","%htmlname%")
DirChange(olddir)
wViewOutput()
else
Message("Run Java Applet","Couldn't find %javaname%. Is it compiled?")
endif
Run Java Application (graphical) ; Run this java class in the java environment
filename = wGetFileName()
path = FilePath(filename)
basename = FileRoot(filename)
olddir = DirGet()
DirChange(path)
Run("java", "%basename%")
DirChange(olddir)
drop(filename,path,basename,olddir)
Run Java Application (console) ; Run this java class from a command window
filename = wGetFileName()
path = FilePath(filename)
basename = FileRoot(filename)
olddir = DirGet()
DirChange(path)
if (WinVersion(4) == 4)
strRun = "cmd.exe"
else
strRun = "command.com"
endif
Run("%strRun%", "/k java %basename%")
DirChange(olddir)
drop(filename,path,basename,olddir)
Run Java App (prompt for parameters) ; Run this java class in the java environment
filename = wGetFileName()
path = FilePath(filename)
basename = FileRoot(filename)
olddir = DirGet()
parameters = AskLine("Command line parameters","Enter any command line parameters", "")
DirChange(path)
Run("java", "%basename% %parameters%")
DirChange(olddir)
drop(filename,path,basename,olddir)
_Blank HTML Document ; Create a basic html template in a new document
wFileNew()
s=ClipGet()
ClipPut("") ; clear the clipboard
wCut()
wInsLine('')
wNewLine()
wInsLine('')
wNewLine()
wInsLine('')
wNewLine()
wInsLine('\^')
wNewLine()
wInsLine('')
wInsLine('')
wInsLine('')
wInsLine('')
wNewLine()
wInsLine('')
wNewLine()
wInsLine('')
wNewLine()
wNewLine()
wInsLine('')
wNewLine()
wInsLine('')
wNewLine()
wFind("\^",@FALSE,@TRUE,@FALSE,@FALSE)
wPaste()
ClipPut(s) ; restore the clipboard
_Undo ; Undoes the last editing action
wUndo()
;Redo ; Redoes the last editing action
; wRedo()
_Cut ; Cut the selection and put it on the clipboard
wCut()
Copy ; Copy the selection and put it on the clipboard
wCopy()
Paste ; Insert the clipboard contents
wPaste()
_Properties
wProperties()
_File
New \ ^N
wFileNew()
Open highlighted file \ ^F ; Open selected file
name = wEdGetWord()
length = strlen(name)
if length==0 then goto DONE
b = FileLocate(name)
if b == "" then Message("Open selected file","Cannot find %name%")
if b == "" then goto DONE
wFileOpen(b)
:DONE
drop(name,length,b)
Open \ ^O
wFileOpen()
Close \ ^{F4}
wWinClose()
Print \ ^P
wPrintDirect()
_FTP Open
wFTPOpen()
FTP Save
wFTPSave()
_How do I?... ; Learn about using scripts
Customize Menus ; Menu file reference
helpfile = strcat(DirHome(),"Windows Interface Language.hlp")
WinHelp(helpFile, "PartialKey", "Menu Files")
Write Macro Scripts ; WIL scripting language reference
helpfile = strcat(home,"Windows Interface Language.hlp")
WinHelp(helpFile, "PartialKey", "Tutorial")
Customize this menu... ; Manage WinEdit Popup menu
TheFile=strcat(DirHome(),"System\JAVAPOPUP.MNU")
WFileOpen(TheFile)
Drop(TheFile)