Class WelcomeContent

java.lang.Object
com.amalgamasimulation.desktop.appelements.parts.WelcomeContent

public final class WelcomeContent extends Object
Content of the welcome page that AbstractWelcomePart passes to createContent. The methods add elements from top to bottom in the order of the calls: an image, sections, lines of text, links and lists of files. Each method returns this WelcomeContent, so the calls can be chained.
Author:
Ionov Ivan
  • Method Details

    • image

      public WelcomeContent image(org.eclipse.swt.graphics.Image image)
      Adds an image at the left edge. The next element starts below the image, after a gap.
    • section

      public WelcomeContent section()
      Starts a section without an icon. A section is a group of lines with a gap before it when it follows another section.
    • section

      public WelcomeContent section(org.eclipse.swt.graphics.Image icon)
      Starts a section. If the icon is not null, the page draws it to the left of the first line of the section.
    • text

      public WelcomeContent text(String text)
      Adds a line of text to the current section.
    • link

      public WelcomeContent link(String text, Runnable action)
      Adds a line with a link to the current section. If the user clicks the link, the page runs the action.
    • files

      public WelcomeContent files(List<String> paths, Consumer<String> open)
      Adds one link for each path. If a path is longer than 60 characters, an ellipsis replaces its middle. If the user clicks a link, open receives the full path.
    • fileSection

      public WelcomeContent fileSection(org.eclipse.swt.graphics.Image icon, String title, List<String> paths, Consumer<String> open)
      Adds a section with the icon, a line with the title and links to the files, as files does. If the list of paths is empty, adds nothing.