Class UIDevices

java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.iizigo.panel.UIDevices
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class UIDevices extends org.eclipse.swt.widgets.Composite
Predefined UI devices list, device helpers and composite.
Author:
Christopher Mindus
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The device URL.

    Fields inherited from class org.eclipse.swt.widgets.Control

    handle
  • Constructor Summary

    Constructors
    Constructor
    Description
    UIDevices(org.eclipse.swt.widgets.Composite parent, int marginLeft, int marginRight, int marginTop, int marginBottom, Runnable runnable)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    checkCreateDefaultMobileDevices(org.eclipse.swt.widgets.Shell shell)
    Shows a message box about no mobile devices, then creates a default list of all Apple devices.
    static boolean
    Creates a default list of Apple devices if none are present.
    void
    Downloads a new device file.
    Gets the default devices.
    Get a list of all selected devices, sorted by names.
    getSortedSelectedDevices(boolean isMobile)
    Get a list of all selected devices, sorted by names.
    boolean
    Saves the selection in the workspace.
    Validates the composite.

    Methods inherited from class org.eclipse.swt.widgets.Composite

    changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toString

    Methods inherited from class org.eclipse.swt.widgets.Scrollable

    computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar

    Methods inherited from class org.eclipse.swt.widgets.Control

    addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update

    Methods inherited from class org.eclipse.swt.widgets.Widget

    addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.swt.graphics.Drawable

    isAutoScalable
  • Field Details

  • Constructor Details

    • UIDevices

      public UIDevices(org.eclipse.swt.widgets.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(org.eclipse.swt.widgets.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
      Downloads a new device file.
      Throws:
      IOException