Class UIDevices

All Implemented Interfaces:
Drawable

public class UIDevices extends Composite
Predefined UI devices list, device helpers and composite.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • UIDevices

      public UIDevices(Composite parent, int marginLeft, int marginRight, int marginTop, int marginBottom, Runnable runnable)
      Constructor.

      The composite used a GridLayout of 2 columns.

      Parameters:
      parent - The parent composite.
      marginLeft - Left margin.
      marginRight - Right margin.
      marginTop - Top margin.
      marginBottom - Bottom margin.
      runnable - Runnable called when selection changes.
  • Method Details

    • getDefaultDevices

      public static Collection<GSimpleDevice> getDefaultDevices()
      Gets the default devices.
    • getSelectedDevices

      public static Collection<GSimpleDevice> getSelectedDevices()
      Get a list of all selected devices, sorted by names.
    • createDefaultAppleDevices

      public static boolean createDefaultAppleDevices()
      Creates a default list of Apple devices if none are present.
      Returns:
      true if the default is created, false otherwise.
    • checkCreateDefaultMobileDevices

      public static boolean checkCreateDefaultMobileDevices(Shell shell)
      Shows a message box about no mobile devices, then creates a default list of all Apple devices.
      Parameters:
      shell - The shell for the message box.
      Returns:
      false for nothing done, true if the defaults were created.
    • getSortedSelectedDevices

      public static List<GSimpleDevice> getSortedSelectedDevices(boolean isMobile)
      Get a list of all selected devices, sorted by names. If the list is empty and this is a mobile device, a default list is created with the Apple devices.
      Parameters:
      isMobile - Flag for mobile devices.
    • validate

      public String validate()
      Validates the composite.
      Returns:
      null for OK, otherwise an error message.
    • saveSelection

      public boolean saveSelection()
      Saves the selection in the workspace.
      Returns:
      true for success, false for error.
    • downloadDeviceFile

      public void downloadDeviceFile() throws IOException, URISyntaxException
      Downloads a new device file.
      Throws:
      IOException
      URISyntaxException