| Refactor OCL statement, PrettyPrinter ignores code formatting [message #1384860] |
Mon, 02 June 2014 11:16  |
Eclipse User |
|
|
|
I want to re-factor OCL statement and i have done it using PrettyPrinter but the problem with prettyPrinter is that it ignores all code formatting (spaces, indentation, line breaks etc).
Then i am trying to use EssentialOCL to refactor OCL statement so code formatting should remain as it is.
What can be best solution for re-factoring OCL statement.
Cheers
|
|
|
|
|
| Re: Refactor OCL statement, PrettyPrinter ignores code formatting [message #1385151 is a reply to message #1385149] |
Wed, 04 June 2014 11:41  |
Eclipse User |
|
|
|
Hi
Try reading my earlier email.
The obvious answer to your solution is not to create the wrong Ecore in
the first place.
Regards
Ed Willink
On 04/06/2014 16:28, ModelGeek Mising name wrote:
> I have attached a plugin project. Please run the project as eclipse application and console will show following :
> ----------with classic OCL------------------------------
>
> --mycomment
> if 1=1 then
> 2*(tNew + 1)
> else
> 0
> endif
>
> ---------------------------------------------------------
> ----------with Pivot OCL and Pretty Printer--------------
>
> if 1 = 1 then 2 * (newT + 1) else 0 endif
>
> ---------------------------------------------------------
> I am creating very simple ecore model at run time. It contains one class("TestClass") having two attributes ("t1", "t2"). Same Ecore model is also available in oclinecore format in "model" folder just to make sure you can easily understand the model.
>
> I want to change the rename "t2" to "tNew" but before doing that i want to refactor OCL statement of "t1" to make sure it use "tNew" instead of "t2".
> Please check ClassicOCL.java. It is very easy to do it in classic OCL. All the code formatting in OCL statement remains intact and i did not have to save Ecore model in File format, it remains in memory and it is very nice.
>
> I want to do the same in Pivot OCL and i have used PrettyPrinter for this purpose.
> Please check PivotAndPrettyPrinter.java. I have successfully refactored but the code formatting in OCL statement is gone. How to make sure all code formatting remain intact while refactoring? I am open to use other solutions to achieve this.
>
> I hope i have explained the problem well.
>
> Cheers,
|
|
|
Powered by
FUDForum. Page generated in 0.04010 seconds