From: <in...@us...> - 2012-10-10 09:57:52
|
Revision: 22344 http://jedit.svn.sourceforge.net/jedit/?rev=22344&view=rev Author: infire Date: 2012-10-10 09:57:41 +0000 (Wed, 10 Oct 2012) Log Message: ----------- Make all plugin dependencies optional. Modified Paths: -------------- plugins/NetRexx/trunk/NetRexx.props plugins/NetRexx/trunk/build.number plugins/NetRexx/trunk/src/NetRexxDE.nrx plugins/NetRexx/trunk/src/NetRexxScript.nrx plugins/NetRexx/trunk/src/NetRexxScriptPlugin.nrx plugins/NetRexx/trunk/src/NrxParser.nrx Added Paths: ----------- plugins/NetRexx/trunk/src/NetRexxErrorList.nrx Removed Paths: ------------- plugins/NetRexx/trunk/src/NetRexxScriptErrorList.nrx Modified: plugins/NetRexx/trunk/NetRexx.props =================================================================== --- plugins/NetRexx/trunk/NetRexx.props 2012-10-10 03:22:21 UTC (rev 22343) +++ plugins/NetRexx/trunk/NetRexx.props 2012-10-10 09:57:41 UTC (rev 22344) @@ -14,8 +14,8 @@ plugin.netrexxplugin.NetRexxPlugin.depend.0=jdk 1.5 plugin.netrexxplugin.NetRexxPlugin.depend.1=jedit 04.02.99.00 plugin.netrexxplugin.NetRexxPlugin.depend.2=optional plugin errorlist.ErrorListPlugin 1.5 -plugin.netrexxplugin.NetRexxPlugin.depend.3=plugin CommonControlsPlugin 0.2 -plugin.netrexxplugin.NetRexxPlugin.depend.4=plugin sidekick.SideKickPlugin 0.1 +plugin.netrexxplugin.NetRexxPlugin.depend.3=optional plugin CommonControlsPlugin 0.2 +plugin.netrexxplugin.NetRexxPlugin.depend.4=optional plugin sidekick.SideKickPlugin 0.1 # external packages required plugin.netrexxplugin.NetRexxPlugin.jars=NetRexxC.jar Modified: plugins/NetRexx/trunk/build.number =================================================================== --- plugins/NetRexx/trunk/build.number 2012-10-10 03:22:21 UTC (rev 22343) +++ plugins/NetRexx/trunk/build.number 2012-10-10 09:57:41 UTC (rev 22344) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Oct 07 16:52:59 HST 2012 -build.number=1377 +#Tue Oct 09 23:41:36 HST 2012 +build.number=1400 Modified: plugins/NetRexx/trunk/src/NetRexxDE.nrx =================================================================== --- plugins/NetRexx/trunk/src/NetRexxDE.nrx 2012-10-10 03:22:21 UTC (rev 22343) +++ plugins/NetRexx/trunk/src/NetRexxDE.nrx 2012-10-10 09:57:41 UTC (rev 22344) @@ -25,7 +25,7 @@ import COM.ibm.netrexx.process import common.gui.pathbuilder -import errorlist +--import errorlist import org.gjt.sp.jedit import org.gjt.sp.jedit.gui import org.gjt.sp.jedit.msg @@ -56,7 +56,9 @@ PlugInStop = boolean 0 - errorsource = errorlist.DefaultErrorSource +-- errorsource = errorlist.DefaultErrorSource + errorsource=NetRexxErrorList + errorlist=Object CompilerCmd = String "" CompileErrors = boolean 1 @@ -118,16 +120,16 @@ activeConsoleTextStyle = SimpleAttributeSet projectsEnabled = boolean projectMode = boolean - singleFileModeIcon = ImageIcon(getClass().getResource("res/File16.gif")) - projectModeIcon = ImageIcon(getClass().getResource("res/Project16.gif")) - TraceIcon = ImageIcon(getClass().getResource("res/TraceConsoleON16.gif")) - NoTraceIcon = ImageIcon(getClass().getResource("res/TraceConsoleOFF16.gif")) - AlertTraceIcon = ImageIcon(getClass().getResource("res/TraceConsoleALERT16.gif")) - ErrOutputIcon = ImageIcon(getClass().getResource("res/ErrorConsoleON16.gif")) - NoErrOutputIcon = ImageIcon(getClass().getResource("res/ErrorConsoleOFF16.gif")) - AlertErrOutputIcon = ImageIcon(getClass().getResource("res/ErrorConsoleALERT16.gif")) - PlayIcon = ImageIcon(getClass().getResource("res/Play16.gif")) - StopIcon = ImageIcon(getClass().getResource("res/Stop16.gif")) + singleFileModeIcon = ImageIcon(getClass().getResource("/res/File16.gif")) + projectModeIcon = ImageIcon(getClass().getResource("/res/Project16.gif")) + TraceIcon = ImageIcon(getClass().getResource("/res/TraceConsoleON16.gif")) + NoTraceIcon = ImageIcon(getClass().getResource("/res/TraceConsoleOFF16.gif")) + AlertTraceIcon = ImageIcon(getClass().getResource("/res/TraceConsoleALERT16.gif")) + ErrOutputIcon = ImageIcon(getClass().getResource("/res/ErrorConsoleON16.gif")) + NoErrOutputIcon = ImageIcon(getClass().getResource("/res/ErrorConsoleOFF16.gif")) + AlertErrOutputIcon = ImageIcon(getClass().getResource("/res/ErrorConsoleALERT16.gif")) + PlayIcon = ImageIcon(getClass().getResource("/res/Play16.gif")) + StopIcon = ImageIcon(getClass().getResource("/res/Stop16.gif")) projectGroup = VPTGroup method NetRexxDE(v=org.gjt.sp.jedit.View, pos=String) @@ -144,37 +146,37 @@ operationModeButton.setMargin(Insets(0,0,0,0)) operationModeButton.addActionListener(this) - NavButton = JButton(ImageIcon(getClass().getResource("res/Nav16.gif"))) + NavButton = JButton(ImageIcon(getClass().getResource("/res/Nav16.gif"))) NavButton.setToolTipText("Structure Browser") NavButton.setActionCommand("Nav") NavButton.setMargin(Insets(0,0,0,0)) NavButton.addActionListener(this) - CompileButton=createButton("Compile","res/Application16.gif") + CompileButton=createButton("Compile","/res/Application16.gif") CompileButton.setToolTipText("Compile") - JavaButton = createButton("Java","res/JavaCup16.gif") + JavaButton = createButton("Java","/res/JavaCup16.gif") JavaButton.setToolTipText("Create the Java File") - OptionButton = createButton("Options","res/Preferences16.gif") + OptionButton = createButton("Options","/res/Preferences16.gif") OptionButton.setToolTipText("Set Compiler Options") - ClearButton = createButton("Clear","res/Delete16.gif") + ClearButton = createButton("Clear","/res/Delete16.gif") ClearButton.setToolTipText("Clear the NetRexx Console") - RunButton = CreateButton("Run","res/Play16.gif") + RunButton = CreateButton("Run","/res/Play16.gif") RunButton.setToolTipText("Run this program") RunButton.setIcon(PlayIcon) - TracerButton = CreateButton("ShowTrace","res/TraceConsoleOFF16.gif") + TracerButton = CreateButton("ShowTrace","/res/TraceConsoleOFF16.gif") TracerButton.setToolTipText("Show TRACE output") - ErrOutButton = CreateButton("ShowErrorOutput","res/ErrorConsoleOFF16.gif") + ErrOutButton = CreateButton("ShowErrorOutput","/res/ErrorConsoleOFF16.gif") ErrOutButton.setToolTipText("Show System.err output") - ProcessLabel1=JLabel(ImageIcon(getClass().getResource("res/ProcessStill.gif"))) + ProcessLabel1=JLabel(ImageIcon(getClass().getResource("/res/ProcessStill.gif"))) ProcessLabel1.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)) - ProcessLabel =JLabel(ImageIcon(getClass().getResource("res/ProcessDyn.gif"))) + ProcessLabel =JLabel(ImageIcon(getClass().getResource("/res/ProcessDyn.gif"))) ProcessLabel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)) ProcessLabel.setVisible(0) ProcessLabel.addComponentListener(this) @@ -200,7 +202,8 @@ --CmdToolBar.add(operationModeButton) - CmdToolBar.add(NavButton) + if jEdit.getPlugin("sidekick.SideKickPlugin") \= null then + CmdToolBar.add(NavButton) CmdToolBar.add(OptionButton) CmdToolBar.add(CompileButton) CmdToolBar.add(JavaButton) @@ -208,7 +211,11 @@ CmdToolBar.add(TracerButton) CmdToolBar.add(ErrOutButton) CmdToolBar.add(ClearButton) - CmdToolBar.add(CPButton) + jars=jEdit.getPluginJARs + loop pj over jars + if Rexx(pj.getPath).pos("CommonControls.jar")\=0 then + CmdToolBar.add(CPButton) + end CmdToolBar.add(CPField) CmdToolBar.add(RunArgsLabel) CmdToolBar.add(RunArgsField) @@ -516,6 +523,8 @@ when (ButtonClicked=="SetCP") then do + dialog=PathBuilderControl(CPField,OurView,this) +/* parent = Frame getTopLevelAncestor(); dialog=PathBuilderDialog( parent, "Build Classpath" ) pathBuilder = dialog.getPathBuilder() @@ -526,9 +535,11 @@ dialog.pack() dialog.setLocationRelativeTo( parent ) dialog.setVisible(true); +*/ if ( dialog.getResult() ) then do - newPath = pathBuilder.getPath() + newPath = dialog.getPath() +-- newPath = pathBuilder.getPath() if (newPath.length()>0 )then do CPField.setText(newPath) @@ -541,7 +552,8 @@ -- depending on which button is pressed when ProcessStatus == "" then do - errorsource.clear() +-- errorsource.clear() + if errorsource\= null then errorsource.clear getFileInfo() ButtonPushed = (JToggleButton ae.getSource()) -- get the filetype @@ -721,8 +733,10 @@ -- this object will be used to pass error messages on the Bus -- plugins like errorlist can then recieve and handle those messages - errorSource = errorlist.DefaultErrorSource(NetRexxDEPlugin.NAME) - ErrorSource.registerErrorSource(errorSource) +-- errorSource = errorlist.DefaultErrorSource(NetRexxDEPlugin.NAME) + errorlist=jEdit.getPlugin("errorlist.ErrorListPlugin") + if errorlist \=null then errorsource=NetRexxErrorList() +-- ErrorSource.registerErrorSource(errorSource) -- EditBus.addToBus(EBComponent errorSource) /** @@ -733,7 +747,8 @@ super.removeNotify() -- clear any error messages before quitting - errorsource.clear() +-- errorsource.clear() + if errorsource\= null then errorsource.clear -- exit from the compiler if it is still running if CompilerStarted then @@ -759,7 +774,8 @@ if ProcessStatus=="CompileJava" then RunProcess.destroy() -- EditBus.removeFromBus(EBComponent errorsource) - ErrorSource.unregisterErrorSource(errorsource) +-- ErrorSource.unregisterErrorSource(errorsource) + if errorsource\= null then errorsource.quit EditBus.removeFromBus(EBComponent this) -- save properties for next session @@ -1097,7 +1113,8 @@ parse ln p1 ":" p2 ":" p3 if p1 == parent.FileName then do - parent.errorsource.addError(DefaultErrorSource.ERROR,parent.FullFileName,(int p2)-1,0,0,p3) + if parent.errorsource \= null then + parent.errorsource.addError(NetRexxErrorList.ERROR,parent.FullFileName,(int p2)-1,0,0,p3) end end @@ -1168,12 +1185,14 @@ do errors='y' parse ln "[" ErrMsgDetails "] Error:" ErrMsg - AddErrMsg(DefaultErrorSource.ERROR, ErrMsgDetails, ErrMsg) + if parent.errorsource \= null then + AddErrMsg(NetRexxErrorList.ERROR, ErrMsgDetails, ErrMsg) end if ln.pos("] Warning:") > 0 then do - parse ln "[" ErrMsgDetails "] Warning:" ErrMsg - AddErrMsg(DefaultErrorSource.WARNING, ErrMsgDetails, ErrMsg) + parse ln "[" ErrMsgDetails "] Warning:" ErrMsg + if parent.errorsource \= null then + AddErrMsg(NetRexxErrorList.WARNING, ErrMsgDetails, ErrMsg) end end end @@ -1185,6 +1204,31 @@ lineIndex = int ErrMsgDetails.word(wc-2)-1 colStart = int ErrMsgDetails.word(wc-1)-1 colEnd = int colStart + ErrMsgDetails.word(wc) - if lineIndex >=0 then parent.errorsource.addError(ErrType,parent.FullFileName,lineIndex,colStart,colEnd,ErrMsg) + if lineIndex >=0 then + if parent.errorsource \= null then + parent.errorsource.addError(ErrType,parent.FullFileName,lineIndex,colStart,colEnd,ErrMsg) - +class NetRexxDE.PathBuilderControl + + dialog=PathBuilderDialog + pathBuilder = common.gui.pathbuilder.PathBuilder + TRUE=boolean 1 + + method PathBuilderControl(CPField = HistoryTextField, OurView = org.gjt.sp.jedit.View, dad=NetRexxDE) + + parent = Frame dad.getTopLevelAncestor(); + dialog=PathBuilderDialog( parent, "Build Classpath" ) + pathBuilder = dialog.getPathBuilder() + pathBuilder.setPath(String CPField.getText() ) + pathBuilder.setStartDirectory(OurView.getBuffer().getDirectory()) + pathBuilder.setFileFilter( ClasspathFilter() ) + pathBuilder.setMultiSelectionEnabled( 1 ) + dialog.pack() + dialog.setLocationRelativeTo( parent ) + dialog.setVisible(true) + + method getResult returns boolean + return dialog.getResult + + method getPath returns String + return pathBuilder.getPath Added: plugins/NetRexx/trunk/src/NetRexxErrorList.nrx =================================================================== --- plugins/NetRexx/trunk/src/NetRexxErrorList.nrx (rev 0) +++ plugins/NetRexx/trunk/src/NetRexxErrorList.nrx 2012-10-10 09:57:41 UTC (rev 22344) @@ -0,0 +1,65 @@ +/* + * NetRexxErrorList.nrx - NetRexx jEdit Scripting Plugin ErrorList interface allows optional use of ErrorList plugin + * Copyright (C) 2012 Kermit Kiser + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Version 0.1.0 (Sep 23, 2012) + + * Initial version to make errorlist plugin optional - includes some changes in class NetRexxScriptPlugin + +*/ + +import errorlist + +options strictcase + +package netrexxplugin + +Class NetRexxErrorList + + properties shared static + + WARNING=int + ERROR=int + + properties shared + + errorsource=Object + + method NetRexxErrorList + + WARNING=ErrorSource.WARNING + ERROR=ErrorSource.ERROR + + errorsource=DefaultErrorSource("NetRexx Plugin") + ErrorSource.registerErrorSource(DefaultErrorSource errorsource) + + method addError(etype=int,tfn=String,eln=int,eloc=int,elocelen=int,emsg=String) + + (DefaultErrorSource errorsource).addError(etype,tfn,eln,eloc,elocelen,emsg) + + method quit + + (DefaultErrorSource errorsource).clear() + ErrorSource.unregisterErrorSource(DefaultErrorSource errorsource) + + + method clear + + (DefaultErrorSource errorsource).clear() + + + Modified: plugins/NetRexx/trunk/src/NetRexxScript.nrx =================================================================== --- plugins/NetRexx/trunk/src/NetRexxScript.nrx 2012-10-10 03:22:21 UTC (rev 22343) +++ plugins/NetRexx/trunk/src/NetRexxScript.nrx 2012-10-10 09:57:41 UTC (rev 22344) @@ -41,7 +41,7 @@ options strictsignal -import errorlist +--import errorlist import org.gjt.sp.jedit. import javax.swing. import COM.ibm.netrexx.process.NetRexxA Deleted: plugins/NetRexx/trunk/src/NetRexxScriptErrorList.nrx =================================================================== --- plugins/NetRexx/trunk/src/NetRexxScriptErrorList.nrx 2012-10-10 03:22:21 UTC (rev 22343) +++ plugins/NetRexx/trunk/src/NetRexxScriptErrorList.nrx 2012-10-10 09:57:41 UTC (rev 22344) @@ -1,63 +0,0 @@ -/* - * NetRexxScriptErrorList.nrx - NetRexx jEdit Scripting Plugin ErrorList interface allows optional use of ErrorList plugin - * Copyright (C) 2012 Kermit Kiser - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Version 0.1.0 (Sep 23, 2012) - - * Initial version to make errorlist plugin optional - includes some changes in class NetRexxScriptPlugin - -*/ - -import errorlist - -options strictcase - -package netrexxplugin - -Class NetRexxScriptErrorList - - properties shared static - - WARNING=int - ERROR=int - - errorsource=Object - - method NetRexxScriptErrorList - - WARNING=ErrorSource.WARNING - ERROR=ErrorSource.ERROR - - errorsource=DefaultErrorSource("NetRexx Plugin") - ErrorSource.registerErrorSource(DefaultErrorSource errorsource) - - method addError(etype=int,tfn=String,eln=int,eloc=int,elocelen=int,emsg=String) - - (DefaultErrorSource errorsource).addError(etype,tfn,eln,eloc,elocelen,emsg) - - method quit - - (DefaultErrorSource errorsource).clear() - ErrorSource.unregisterErrorSource(DefaultErrorSource errorsource) - - - method clear - - (DefaultErrorSource errorsource).clear() - - - Modified: plugins/NetRexx/trunk/src/NetRexxScriptPlugin.nrx =================================================================== --- plugins/NetRexx/trunk/src/NetRexxScriptPlugin.nrx 2012-10-10 03:22:21 UTC (rev 22343) +++ plugins/NetRexx/trunk/src/NetRexxScriptPlugin.nrx 2012-10-10 09:57:41 UTC (rev 22344) @@ -17,6 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + Version 0.2.3 (Oct 09, 2012) + + * Made all plugin dependencies optional - errorlist, sidekick, and commoncontrols are helpful but not required for NetRexx support. + * Added a base doc page to link to the compiler and interpreter help docs - they are not updated yet however! + Version 0.2.2 (Oct 07, 2012) * if in prefix mode, scan programs for "class" instruction and add imports+class+prefix+main after prolog statements if not found @@ -38,7 +43,7 @@ * change all classes to package netrexxplugin - allows access to public interfaces from NetRexx scripts * change NetRexxC.jar to experimental after3.01 version with method resolution fixes - allows direct compile of TeeStream class - * Add NetRexxScriptErrorList class - allows ErrorList plugin use to be optional + * Add NetRexxErrorList class - allows ErrorList plugin use to be optional * add check of new NetRexxA.exiting api (after3.01 version) - allows us to force a new NetRexxA instance if a script executed "Exit" instruction and killed the old one * add a copy of the new ant-netrexx.jar version - allows our plugin to build even if the optional NetRexxC task was not installed with Ant * auto add all plugin jars to classpath - allows scripts to access plugins without modifying the classpath @@ -192,7 +197,7 @@ testflag= 1 -- debug flag to trace only "n" hits -- errorsource=errorlist.DefaultErrorSource - errorsource=NetRexxScriptErrorList + errorsource=NetRexxErrorList sysin = InputStream sysout= PrintStream @@ -302,7 +307,7 @@ if errpath\=null then do -- if errpath\="" then do - errorsource=NetRexxScriptErrorList() + errorsource=NetRexxErrorList() -- errorsource=errorlist.DefaultErrorSource("NetRexxScript") -- ErrorSource.registerErrorSource(errorsource) end @@ -957,8 +962,8 @@ end -- if errpath \= null then do if rep then - if etype="Warning:" then errorsource.addError(NetRexxScriptErrorList.WARNING,tfn,eln-1,eloc-1,eloc+elen-1,emsg) - else errorsource.addError(NetRexxScriptErrorList.ERROR,tfn,eln-1,eloc-1,eloc+elen-1,emsg) + if etype="Warning:" then errorsource.addError(NetRexxErrorList.WARNING,tfn,eln-1,eloc-1,eloc+elen-1,emsg) + else errorsource.addError(NetRexxErrorList.ERROR,tfn,eln-1,eloc-1,eloc+elen-1,emsg) /* if etype="Warning:" then errorsource.addError(ErrorSource.WARNING,tfn,eln-1,eloc-1,eloc+elen-1,emsg) else errorsource.addError(ErrorSource.ERROR,tfn,eln-1,eloc-1,eloc+elen-1,emsg) */ end Modified: plugins/NetRexx/trunk/src/NrxParser.nrx =================================================================== --- plugins/NetRexx/trunk/src/NrxParser.nrx 2012-10-10 03:22:21 UTC (rev 22343) +++ plugins/NetRexx/trunk/src/NrxParser.nrx 2012-10-10 09:57:41 UTC (rev 22344) @@ -91,6 +91,7 @@ EditBus.addToBus(EBComponent this) method parse(CurrentBuffer=Buffer, errorSource=DefaultErrorSource) returns SideKickParsedData +-- method parse(CurrentBuffer=Buffer, errorSource=Object) returns SideKickParsedData if reinitOnParse then do initParsingParameters() reinitOnParse = FALSE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |