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

前端 未结 3 406
囚心锁ツ
囚心锁ツ 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:

    <templates>
        <template autoinsert="true" context="java" deleted="false" description="Dummy text" enabled="true" name="Lorem Ipsum">
            Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
        </template>
    </templates>
    

    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.)

0 讨论(0)
  • 2021-01-06 21:52

    They can help.

    tools:text="@tools:sample/cities"
    tools:text="@tools:sample/backgrounds/scenic"
    tools:text= "@tools:sample/avatars"
    tools:text="@tools:sample/full_names"
    tools:text=”@tools:sample/lorem"
    tools:text=”@tools:sample/lorem/random"
    

    for other

    0 讨论(0)
  • 2021-01-06 22:10

    In Android Studio, you can preview lorem ipsum TextViews with:

    tools:text="@tools:sample/lorem/random"
    

    You can also use this for Names, Cities, Zip codes, Avatars, and more.

    see https://developer.android.com/studio/write/tool-attributes.html#toolssample_resources

    0 讨论(0)
  • 提交回复
    热议问题