Class UIDevices

  • All Implemented Interfaces:

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

      Modifier and Type Field Description
      static java.lang.String DEVICE_URL
      The device URL.
      • Fields inherited from class org.eclipse.swt.widgets.Control

    • Constructor Summary

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

      All Methods Static Methods Instance Methods Concrete Methods 
      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 createDefaultAppleDevices()
      Creates a default list of Apple devices if none are present.
      void downloadDeviceFile()
      Downloads a new device file.
      static java.util.Collection<GSimpleDevice> getDefaultDevices()
      Gets the default devices.
      static java.util.Collection<GSimpleDevice> getSelectedDevices()
      Get a list of all selected devices, sorted by names.
      static java.util.List<GSimpleDevice> getSortedSelectedDevices​(boolean isMobile)
      Get a list of all selected devices, sorted by names.
      boolean saveSelection()
      Saves the selection in the workspace.
      java.lang.String validate()
      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
      • 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, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface

    • Field Detail

      • DEVICE_URL

        public static final java.lang.String DEVICE_URL
        The device URL.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UIDevices

        public UIDevices​(org.eclipse.swt.widgets.Composite parent,
                         int marginLeft,
                         int marginRight,
                         int marginTop,
                         int marginBottom,
                         java.lang.Runnable runnable)

        The composite used a GridLayout of 2 columns.

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

      • getDefaultDevices

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

        public static java.util.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.
        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.
        shell - The shell for the message box.
        false for nothing done, true if the defaults were created.
      • getSortedSelectedDevices

        public static java.util.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.
        isMobile - Flag for mobile devices.
      • validate

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

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

        public void downloadDeviceFile()
        Downloads a new device file.