Xtext: Customize how Generator is called - xtext

I would like to change the way the Generator is called in my project. As default it is called when the model is safed, but I would need it to be called when enter is hit for example. Can anyone explane where and how to do this?
Thank you very much!

by default generator is called by the build. if you want to call it manually you need to do that yourself. you may use https://dietrich-it.de/xtext/2011/10/15/xtext-calling-the-generator-from-a-context-menu/ as a starting point

Related

How to add custom fields in ZFC-user module for zend 2 without doctrine?

I have tried using creating a different module and attaching the ZfcUser\Form\Register over init method. But it wasn't working.
I want to add few custom fields, with changing any thing in the vendor dir, as is it not a good practice. I also tried using user_entity_class ,creating a custom 'User' class, but it was creating some route issue in other modules, with zfc-user , I'm also using zfc-admin and zfc-adminuser, the error was coming in zfc-adminuser, Couldn't found the class was the error.
Thanks in advance.
Well there are some issue regarding the overriding of the module ZFC-User, But still you can overwrite it manually.
One way I have used is a bit old fashioned but working. What I have done is I have copied complete module the to module folder. Then pointing the form towards to my module where the changes are required, rest all are pointed to default.With this you can update your module. Make sure you point the user_entity_class to your module something like this:
'user_entity_class' => 'MyZfcUser\Entity\User',
you can find this in config\autoload\zfcuser.global.php

Struts2 ResultPath per package or something similar

Currently, we can define a global path that'll be used for all results, under all packages.
I have different paths for different results and hence, is it possible to have the resultPath package wise ?
Or is there something that can help me achieve this ?
Obviously, I don't want to write the complete result-location in every-result, neither I want to change at every place if the location changes.
A workaround is to use #ResultPath on a Class by Class basis;
apply it to some abstract baseActions, one per package.
All other actions will extend the one of their <package>, inheriting the ResultPath setting.

Set [Embed] attribute value dynamically

I am new to Action script.
Is there any possibility to set the source attribute value dynamically at run time?
for e.g
in the code
Embed(source="assets/images/image.pdf",mimeType="application/octet-stream");
I need to set
source="set pdf file name using a variable or reading from config xml"
Please provide some example snippets or links for reference
Thanks in advance.
Thanks
SRR
Maybe Conditional Compilation will get you some way to achieving what you want.

Grails/Compass - How can I change the compqass Connection to point to a different directory?

I use the Searchable plugin with Grails I have the need to change the directory to which Compass points to, depending upon a UI choice by the user.
Normally, this value is set in the compassConnection variable of the searchable map in grails-app/conf/Searchable.groovy, like so, and gets called at app startup time:
searchable { compassConnection = new File( "/path/to/index/file/directory" ).absolutePath
...
}
To do what I need to do, I think that I need to get a handle into the compass config variable and then call config.setConnection("/new/path/to/index/dir")
I don't know how I can get a reference to the config compass variable
Am I right in assuming that I need to call setConnection(String) only, or is(are) there any other step(s) I need to take?
Really appreciate any help that I can get,
Shailen
In Searchable.groovy file, within searchable { } closure use this:
compassConnection = new File(
"${userHome}/.grails/projects/${appName}/searchable-index/${grailsEnv}").absolutePath
Well, sorry I was not careful reading your question. I guess this class must be your starting point: http://www.compass-project.org/docs/2.2.0/api/

Autocomplete with Vim and Rails Datamapper

Is there a way that I can have auto completion in Vim after I load a model from the database?
So for example if I have a model of type Foo with an instance method of type bar and do the following
foo = Foo.first(:param=>'x')
foo.b
should show me bar as a possible auto complete value. I think that this is somewhat hard to accomplish with dynamic languages and you would probably have to be aware of the datamapper conventions.
Maybe I'm taking the wrong approach and should not be thinking using auto complete because there is an easier way to code?
I don't think it's possible to do semantic completion in VIM. However if you have written the instance name once, you could use the simple auto completion in VIM to avoid typing long names again.

Resources