Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using multiple providers
Using multiple providers [message #919664] Sat, 22 September 2012 03:28 Go to next message
Axel Guckelsberger is currently offline Axel Guckelsberger
Messages: 210
Registered: July 2009
Senior Member
Hi all,

is it possible to split certain providers into multiple files?
Especially the validation and quickfix providers can become quite huge which
slows down working with them significantly. Thus I wondered if there are
strategies with which these can be divided into smaller amounts of code.

TIA,

Axel
Re: Using multiple providers [message #919683 is a reply to message #919664] Sat, 22 September 2012 04:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 5849
Registered: July 2009
Senior Member
Hi,

for the validator:

@ComposedChecks(validators={V1.class, V2.class})
public class MyDslJavaValidator extends AbstractMyDslJavaValidator {

}


for the Quickfix: you could use the delegate pattern
Re: Using multiple providers [message #919724 is a reply to message #919683] Sat, 22 September 2012 05:02 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel Guckelsberger
Messages: 210
Registered: July 2009
Senior Member
Hi Christian,

thanks for the fast reply.

Going to try this out asap.

Regards,

Axel



Christian Dietrich wrote:

> Hi,
>
> for the validator:
>
> @ComposedChecks(validators={V1.class, V2.class})
> public class MyDslJavaValidator extends AbstractMyDslJavaValidator {
>
> }
>
> for the Quickfix: you could use the delegate pattern
Re: Using multiple providers [message #919784 is a reply to message #919724] Sat, 22 September 2012 06:33 Go to previous message
Axel Guckelsberger is currently offline Axel Guckelsberger
Messages: 210
Registered: July 2009
Senior Member
Hi,

this approach works very well.

Example for the delegate:

@Fix(MostIssueCodes.FORM_LABEL_HAS_NO_FIELD)
public void fixFormLabelMissingField(final Issue issue,
IssueResolutionAcceptor acceptor) {
viewHelper.addFixesForFormLabelMissingField(issue, acceptor);
}

A nice side-effect of this refactoring is that reusability of certain quick
fixes gets improved, too.

Thanks again!

Axel
Previous Topic:Problem with association between XExpression and logical container
Next Topic:Quickfix All
Goto Forum:
  


Current Time: Sun Apr 20 19:45:26 EDT 2014

Powered by FUDForum. Page generated in 0.01830 seconds