Skip to main content


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 07:28 Go to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
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 08:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using multiple providers [message #919724 is a reply to message #919683] Sat, 22 September 2012 09:02 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
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 10:33 Go to previous message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
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: Fri Apr 19 08:33:28 GMT 2024

Powered by FUDForum. Page generated in 0.24356 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top