Class CSSGridTracksDialog

java.lang.Object
org.eclipse.swt.widgets.Dialog
com.iizigo.prop.editor.dialog.CSSGridTracksDialog

public class CSSGridTracksDialog extends Dialog
The track dialog of a CSS Grid layout: edits a track list one track at a time.

The list holds the top-level tracks of the text as the parser reads them (repeat() is one entry). A selected track is edited in the field below the list; Add, Remove, Up and Down change the list. The result is the whole list in its canonical form, checked by the same parser as the runtime property (CSSGridTracks); OK is enabled only while it is valid.

Author:
Christopher Mindus
  • Constructor Details

    • CSSGridTracksDialog

      public CSSGridTracksDialog(Shell parent, String input, boolean auto)
      Creates the dialog.
      Parameters:
      parent - The parent shell.
      input - The current track list text, may be null or empty.
      auto - true for the implicit track grammar (no repeat()).
  • Method Details

    • open

      public String open()
      Opens the dialog and waits until it is closed.
      Returns:
      The canonical track list text, or null when canceled.
    • split

      public static List<String> split(String text, boolean auto) throws ParseException
      Splits a track list text into its top-level tracks.
      Parameters:
      text - The text.
      auto - The implicit track grammar flag.
      Returns:
      The canonical texts of the tracks.
      Throws:
      ParseException - When the text is not a valid list.
    • join

      public static String join(List<String> tracks, boolean auto) throws ParseException
      Joins track texts and validates the result.
      Parameters:
      tracks - The track texts.
      auto - The implicit track grammar flag.
      Returns:
      The canonical text, empty for no track.
      Throws:
      ParseException - When the joined list is not valid.