Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-scripting-dev] Let's revive the scripting project

I'd like to propose much simple and clean solution comparing to eScript,
which can be used without any specialized tools, and having full Eclipse
<-> Script interoperability:

Sample in Groovy (similar to eScript sample):

plugin.xml:

<extension point = "org.eclipse.ui.actionSet" 
           id = "actions" 
           visible = true
           label = "eScript Sample">
   <action id = "MyAction" tooltip="Hi, eScript World"
           toolbarPath="eGroup" label="eScript Sample"
           class = "org.eclipse.scripting.ScriptedActionDelegate">
      <script language = "groovy">
           //TODO: add appropriate imports here...
           MessageDialog.openInformation(new Shell(new Display()), "Hi",
"eScript")
      </script>
   </action>
</extension>

...or alternative (with script in separate file within plugin):

<extension point = "org.eclipse.ui.actionSet" 
           id = "actions" 
           visible = true
           label = "eScript Sample">
   <action id = "MyAction" tooltip="Hi, eScript World"
           toolbarPath="eGroup" label="eScript Sample"
           class =
"org.eclipse.scripting.ScriptedActionDelegate:scripts/MessageAction.groovy">
   </action>
</extension>

And such an approach is fully compatible with Eclipse Platform

Thanks 
Andrey Platov
xored software, inc
http://www.xored.com

> It's interesting how similiar the sample "eScript" file in the
> referenced link looks to Groovy 'builder' syntax. 
> 
> eScript sample: 
>         http://www.eclipsefaq.org/chris/faq/Book%20materials/Book%
> 20samples/eScript/index.html 
> 
> Groovy builder sample: 
>         http://groovy.codehaus.org/GroovyMarkup
> 
> 
> Copyright © 2004 Patrick Mueller
> STSM, Java and other Virtual Machine Goo
> OTI Labs Raleigh, Patrick_Mueller@xxxxxxxxxx 
> 
> 
> 
> 
> "Ed Burnette"
> <Ed.Burnette@xxxxxxx> 
> Sent by:
> platform-scripting-dev-admin@xxxxxxxxxxx 
> 
> 12/09/04 05:12 PM 
>          Please respond to
>       platform-scripting-dev
> 
> 
> 
> 
>                To
> <platform-scripting-dev@xxxxxxxxxxx> 
>                cc
> 
>           Subject
> RE:
> [platform-scripting-dev] Let's revive the scripting project
> 
> 
> 
> 
> 
> 
> 
> 
> Yes, it's likely that much of the work will need to be done by people
> outside the Platform team.
> 
> You may also be interested in escript
> (http://www.eclipsefaq.org/chris/faq/Book%20materials/Book%
> 20samples/eScript/index.html). This defines a new language for
> creating plug-ins which may be simpler than plugin.xml and all that.
> 
> These are all good ideas but maybe we should try to limit the scope of
> scripting for the first version. There are some things that are so
> basic, things that people take for granted in other IDEs and editors,
> that Eclipse should be able to do them.
> 
> Here are some use cases to show what I mean:
> 
> 1. I want to do a build, export a jar file, and start running a
> program. Now say I have to do that dozens of times a day. We should
> make it really simple for a user to combine those three actions and
> bind them to a single key.
> 
> 2. I'm given a large text file and I have to do something repetitive
> on it. One time I had to join every other line together, deleting two
> characters from the beginning of the second line. I'm usually forced
> to break out Textpad and use its macro/record facility, but I should
> be able to stay in Eclipse.
> 
> 3. I have a program running and it generates some output in the
> console. Among other things, the program outputs path names. When I
> Ctrl+Click (or whatever I've defined) on one of those path names, I
> want it to analyze the text under the cursor, finding the beginning
> and the end of the path, and open an editor on that file. It sounds
> trivial but we have this capability in an internal Unix xterm-clone
> where I work and it's probably the most popular feature. Emacs users
> can write a function to do that too. (I know about console hyperlinks
> and regexps but I'm just using this as an example).
> 
> 4. I want to define something to run right before a file is saved or
> right before it's checked into (or out of) the Team repository.
> Typically I want to format the code or organize imports or do a spell
> check or a code style check or something like that. Instead of trying
> to implement every feature somebody might want, if you have scripting
> then you can implement some kind of hook so that a little bit of logic
> can get run at the critical times and that logic can be defined later
> to do whatever is necessary.
> 
> 
> > -----Original Message-----
> > From: platform-scripting-dev-admin@xxxxxxxxxxx
> > [mailto:platform-scripting-dev-admin@xxxxxxxxxxx] On Behalf
> > Of Andrey Platov
> > Sent: Thursday, December 09, 2004 2:11 PM
> > To: platform-scripting-dev@xxxxxxxxxxx
> > Subject: [platform-scripting-dev] Re: [eclipse-dev] Let's
> > revive the scripting project
> >
> > Dear Ed,
> >
> > For a lot of time we're at xored software dream to start work on
> > scripting for Eclipse Platform... Not limited with
> > macros/automation but
> > targeted to more general scripting framework.
> >
> > The idea of the freamework is the possibility to develop virtually
> any
> > Eclipse plugin as well as develop Eclipse extensions with scripting
> > language using XUL-like approach (XML for GUI declaration and
> > scripting
> > language for the logic).
> >
> > Shining eclipse runtime have no architectural barriers to
> > develop such a
> > framework and to script Eclipse extension logic directly in
> plugin.xml
> > and/or external script files. Joining everyting with the power of
> > scripting can result in easy and fast approach to script any
> > non-GUI or
> > GUI extension like Views, Actions, Eclipse Forms Editors, etc
> > and result
> > in much more productivity for Java developers and drastically
> increase
> > Eclipse popularity for non-Java developers.
> >
> > Please sorry for trivial exciting words, the question: is it
> possible
> > for external teams to participate in any fashion
> > (contribute/comment/etc)?
> >
> > Thanks and Kind Regards,
> > Andrey Platov
> > xored software, inc
> > http://www.xored.com
> >
> _______________________________________________
> platform-scripting-dev mailing list
> platform-scripting-dev@xxxxxxxxxxx 
> http://dev.eclipse.org/mailman/listinfo/platform-scripting-dev 
> 
> 



Back to the top