Is there any way to generate “Lorem ipsum” in eclipse?

前端 未结 3 405
囚心锁ツ
囚心锁ツ 2021-01-06 21:39

I\'m into finding a way to generate Lorem ipsum in eclipse when creating views just for dummy texts. for example in Visual studio you can do it simply by typing

3条回答
  •  时光说笑
    2021-01-06 21:47

    I haven't encountered an Eclipse functionality to actually generate dummy text, but I do highly recommend this workaround (truth be told, I don't think you need different dummy text each time).

    Create an Eclipe template. It's an xml file that looks like this:

    
        
    
    

    Go to Java -> Editor -> Templates and import the above file.

    Now, when you write code and type lore (which represents the name attribute value of the template tag above), and hit CTRL+SPACE, then it will automatically insert the lorem ipsum text.

    More Tips:

  • Add apostrophes to the ipsum text, so that it automatically generates a Java String
  • Add + signs to the ispum text, so that it breaks down the long string when inserted
  • Set the autoinsert attribute to false. Then you can see the ipsum description in the proposal
  • Set the name of the template to something like aaa_LoremIpsum. Then, in Eclipse, type aaa and press CTRL+SPACE. That way you can add many templates beginning with aaa, and select in Eclipse whichever you like.

    I myself have templates for separating methods in a class. (e.g. aaa_1.StaticFields, aaa_2.InstanceFields, aaa_3.Constructors etc.)

提交回复
热议问题