Class 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 java.lang.String DEVICE_URL
      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, java.lang.Runnable runnable)
      Constructor.
    • 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 org.eclipse.swt.graphics.Drawable

        isAutoScalable
    • 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)
        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 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.
        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 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.
        Parameters:
        isMobile - Flag for mobile devices.
      • validate

        public java.lang.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 java.io.IOException
        Downloads a new device file.
        Throws:
        java.io.IOException