Eclipse PDS Customization Editor -> Editor Context Menu:

Posted by slacroixak on 14-Dec-2015 10:31

Hi All,

I'd like to add a custom command to the Progress Developer Studio to generate a DEBUG-LIST file for the current editor source (easy part)....  then open it in Eclipse (here comes the challenge)

I can easily add a custom menu-item in the Editor popup menu (Extensibiity  sub-menu) with this to run an ABL routine that generates a DEBUG-LIST:

Eclipse PDS -> OpenEdge -> Tools -> Customization Editor -> EditorContext Menu

But I am wondering how to ask Eclipse to open a file I just generated afterward.  

Q1: Any hint?

Besides I'd be very interested to deal with a few ABL or Java sample extensions to interact a bit more with the PDS editor.

Q2: any gold mine to share?

At last, I found out the toggle-box option "Send file name of the current selection" passes the full-path name of source file of the the current editor as a parameter right after a CHR(3) character.  I imagine it's a CHR(3) separated list and I am wondering about what it's first entry may hold.

Q3: Can someone share some information about this parameter and about the "Run persistent" option?

Kind regards

/Sébastien L

All Replies

Posted by Matt Baker on 14-Dec-2015 11:24

The doc on some of this is only sort of helpful for this screen.

documentation.progress.com/.../

documentation.progress.com/.../

documentation.progress.com/.../

Q1...will get back to you on this with more detail.  I know there is a doc here on communities with details on the API that is available

"send name of current selection".  This passes the program name as an input parameter to your program.  You need to have a string variable input parameter.  Otherwise, this assumes there are no input parameters.

Q2: Your best bet is to write a java plugin.  Its not hard, but the initial hurdle requires some setup, and a knowledge of java.  You'll get access to lots more stuff including current selection, selected views, and such.  There are a huge number of examples on the web.  I won't link to them here.  Start at the eclipse.org website.

Q3:  Run persistent...is just that.  It runs the selected .p as a persistent procedure and leaves it running.  This is normally used when you setup the run to use the project AVM instead of its own separate run configuration.  Leave the 'configuration' option blank (otherwise the run persistent option gets disabled)  so it uses the project AVM, and select 'Run persistent'.  This is how the classic Pro*Tools menu items are launched internally.  It is up to you to delete the procedure when you're program is done, or you'll end up with a memory leak.

Feel free to dig through the ABL support code shipped with PDSOE.  You'll find it in $DLC/oeide/eclipse/plugins/com.progress.pdt.project.<version>/runtime, and a few other similar places.  You'll see the code there for starting the menu entries.  It is shipped as source not r-code.

Posted by Matt Baker on 14-Dec-2015 11:35

Someone has some examples on using this here:

www.flusso.nl/.../

Posted by Matt Baker on 14-Dec-2015 11:49

You might find this useful:

pugchallenge.org/.../312_Customizing_OE_Architect_Templates.pdf

There is an include file named adecomm/oeideservice.i (and related .p) adecomm/oeideservice.p you can use in your programs that gives access to opening files from within your ABL program (think custom ProTool).

You'll find it in the adecomm.pl source code library $DLC/src/adecomm.pl (extract the .pl using prolib to a working directory).

Posted by Mike Fechner on 14-Dec-2015 11:50

As the link is for flusso, I am sure its Dutch, not German.

Posted by Mike Fechner on 14-Dec-2015 11:55

Here's our solution for what Sebastian is attempting to do:

http://confluence.consultingwerkcloud.com/wiki/display/SCL/Add+DebugListing+as+Menu+and+Toolbar+entry+in+the+OpenEdge+Architect

/**********************************************************************
 * Copyright (C) 2006-2015 by Consultingwerk Ltd. ("CW") -            *
 * www.consultingwerk.de and other contributors as listed             *
 * below.  All Rights Reserved.                                       *
 *                                                                    *
 *  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY    *
 *   KIND, either express or implied.                                 *
 *                                                                    *
 *  Contributors:                                                     *
 *                                                                    *
 **********************************************************************/
/*------------------------------------------------------------------------
    File        : debug-list.p
    Purpose     : Opens the selected file in OpenEdge Architect as a 
                  debug-listing in an Eclipse ABL Editor.

    Syntax      : Added to the OpenEdge Customization Options 
                  OpenEdge -> Tools -> Customization Editor
                  Then create a new Menu / Toolbar Entry:
                      Name:                                    Debug Listing
                      Program name:                            Consultingwerk/Studio/DebugList/debug-list.p
                      Configuration:                           <leave empty>
                      Send file name of the current selection: checked
                      Action appearance:                       Show on menu and toolbar
                      Run persistent:                          not checked

    Description :  

    Author(s)   : Mike Fechner / Consultingwerk Ltd.
    Created     : Thu Dec 29 15:20:18 CET 2011
    Notes       : see adecomm/oeideservice.p or adecomm/oeideservice.i
                  for details on the API
  ----------------------------------------------------------------------*/

/* ***************************  Definitions  ************************** */

ROUTINE-LEVEL ON ERROR UNDO, THROW.

DEFINE INPUT  PARAMETER pcFileName AS CHARACTER NO-UNDO.

{adecomm/oeideservice.i}

/* ***************************  Main Block  *************************** */

DEFINE VARIABLE cFileName AS CHARACTER          NO-UNDO .
DEFINE VARIABLE cProject  AS CHARACTER          NO-UNDO .

DEFINE VARIABLE cDebugList AS CHARACTER NO-UNDO.

ASSIGN cProject  = getProjectName () 
       cFileName = SUBSTRING (pcFileName, 2) 
       
       cDebugList = /*createLinkedFile ("":U, ".p")*/
                    SESSION:TEMP-DIRECTORY + "debuglist-":U + 
                    Consultingwerk.Util.FileHelper:ShortFileName (cFileName) .

COMPILE VALUE (cFileName)
    SAVE = FALSE 
    DEBUG-LIST VALUE (cDebugList) 
    NO-ERROR . 

openEditor  
     (?,
      cDebugList,
      "UNTITLED":U,
      ?) .

Posted by slacroixak on 15-Dec-2015 01:19

Thank you very much fro your prompt replies Matt and Mike

Mike, in my own code I did cFileName = ENTRY(2, pcParam, CHR(3))  rather than a SUBSTRING(..2) just to handle the case when IDE wants to pass something in front of that CHR(3)    (my 2 € cents)

Best regards

/Sébastien L

Posted by Arno van der Ende on 15-Dec-2015 02:12

Thanks for sharing Flusso's blog post Matt I can translate to English if someone requests :-)

Posted by slacroixak on 15-Dec-2015 02:44

met veel plezier Arno :)

Posted by Arno van der Ende on 11-Mar-2016 06:31

Hi Sébastien, the English version is also online:

www.flusso.nl/.../

This thread is closed