Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.port80.eclipse.util
Class UIUtil  view UIUtil download UIUtil.java

java.lang.Object
  extended bycom.port80.eclipse.util.UIUtil

public class UIUtil
extends java.lang.Object

Static utilities class for this package.


Field Summary
(package private) static org.eclipse.swt.graphics.Color fColorShadowDark
           
(package private) static org.eclipse.swt.graphics.Color fColorShadowLight
           
 
Constructor Summary
UIUtil()
           
 
Method Summary
static org.eclipse.swt.layout.GridData alignCell(int vspan, int hspan, int halign, int valign, boolean hgrab, boolean vgrab)
          Grid layout cell configuration.
static org.eclipse.swt.layout.GridData clone(org.eclipse.swt.layout.GridData data)
           
static org.eclipse.swt.layout.GridLayout compactGrid(int columns)
           
static org.eclipse.swt.layout.RowLayout compactRow()
           
static org.eclipse.swt.layout.RowLayout compactVerticalRow()
           
static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.graphics.Color bg, int columns, int xmargin, int ymargin, int xspacing, int yspacing, boolean equalwidth)
          Create a composite box with grid layout but no LayoutData.
static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent, int vspan, int hspan, boolean hgrab, boolean vgrab, int columns, int xmargin, int ymargin, int xspacing, int yspacing, boolean equalwidth, org.eclipse.swt.graphics.Color bg)
           
static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent, int vspan, int hspan, boolean hgrab, boolean vgrab, int columns, int xmargin, int ymargin, int xspacing, int yspacing, org.eclipse.swt.graphics.Color bg)
           
static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent, int vspan, int hspan, int columns, int xmargin, int ymargin, org.eclipse.swt.graphics.Color bg)
          Create a standard composite box, typically for enclosing other Controls.
static org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String text, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Font font)
           
static org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String text, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Font font, int vspan, int hspan, boolean hgrab, boolean vgrab)
           
static org.eclipse.swt.widgets.Combo createCombo(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Font font, java.lang.String[] items)
           
static org.eclipse.swt.widgets.Label createCTabLabel(org.eclipse.swt.custom.CTabFolder parent, java.lang.String name, java.lang.String text, org.eclipse.swt.graphics.Color bg)
          Create a CTabItem that contains a label control.
static org.eclipse.swt.widgets.Label createGridLabel(org.eclipse.swt.widgets.Composite parent, int align, java.lang.String text, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Color fg, org.eclipse.swt.graphics.Font font)
          Create a label with default GridLayoutData of fillCell(1,1,true,false).
static org.eclipse.swt.widgets.Label createGridLabel(org.eclipse.swt.widgets.Composite parent, int align, java.lang.String text, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Color fg, org.eclipse.swt.graphics.Font font, int vspan, int hspan, boolean hgrab, boolean vgrab)
           
static org.eclipse.swt.widgets.Label createGridLabel(org.eclipse.swt.widgets.Composite parent, int align, java.lang.String text, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Color fg, org.eclipse.swt.graphics.Font font, int vspan, int hspan, int halign, int valign, boolean hgrab, boolean vgrab)
           
static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.graphics.Color bg)
           
static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Color fg)
           
static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent, int align, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Color fg)
           
static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent, int align, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Color fg, int vspan, int hspan, boolean hgrab, boolean vgrab, org.eclipse.swt.graphics.Color border_color, int xmargin, int ymargin)
           
static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent, int align, java.lang.String text, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Color fg, org.eclipse.swt.graphics.Font font)
           
static org.eclipse.swt.widgets.List createList(org.eclipse.swt.widgets.Composite parent, int style, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Font font, java.lang.String[] items)
           
static void createSep(org.eclipse.swt.widgets.Composite parent, int style, int span, int size, org.eclipse.swt.graphics.Color bg)
           
static void createSep(org.eclipse.swt.widgets.Composite parent, int style, int span, int topmargin, int bottommargin, org.eclipse.swt.graphics.Color bg)
           
static org.eclipse.swt.widgets.Table createTable(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String[] headers, int[] widths, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Font font)
           
private static org.eclipse.swt.layout.GridData fillCell(int vspan, int hspan)
          Grid layout cell configuration with default h/v FILL alignment.
static org.eclipse.swt.layout.GridData fillCell(int vspan, int hspan, boolean hgrab, boolean vgrab)
          Grid layout cell configuration with default h/v FILL alignment.
static org.eclipse.swt.layout.GridData fillCell(int vspan, int hspan, int w, int h, boolean hgrab, boolean vgrab)
          Grid layout cell configuration with default h/v FILL alignment.
static org.eclipse.swt.layout.GridLayout gridLayout(int columns, int xmargin, int ymargin, int xspacing, int yspacing)
           
static org.eclipse.swt.layout.GridLayout gridLayout(int columns, int xmargin, int ymargin, int xspacing, int yspacing, boolean equalwidth)
           
static org.eclipse.swt.widgets.Label labelButton(org.eclipse.swt.widgets.Composite parent, int style, java.lang.String text, org.eclipse.swt.graphics.Color bg, org.eclipse.swt.graphics.Font font, java.lang.Runnable action)
           
static org.eclipse.swt.widgets.Text labelText(org.eclipse.swt.widgets.Composite parent, java.lang.String label, java.lang.String text, org.eclipse.swt.graphics.Color labelbg, org.eclipse.swt.graphics.Color textbg, int labelspan, int textspan, boolean hgrab)
          Create a label and a single line text control on a GridLayout row with given layout data.
static org.eclipse.swt.layout.RowLayout rowLayout(int vertical, int xmargin, int ymargin, int spacing)
           
static org.eclipse.swt.widgets.Composite scrolledComposiste(org.eclipse.swt.widgets.Composite parent, org.eclipse.swt.custom.CTabItem item)
          Create a Composite nested in a ScrolledComposite inside the given parent.
static org.eclipse.swt.widgets.TableColumn tableColumn(org.eclipse.swt.widgets.Table parent, java.lang.String header, int width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fColorShadowDark

static org.eclipse.swt.graphics.Color fColorShadowDark

fColorShadowLight

static org.eclipse.swt.graphics.Color fColorShadowLight
Constructor Detail

UIUtil

public UIUtil()
Method Detail

createCTabLabel

public static org.eclipse.swt.widgets.Label createCTabLabel(org.eclipse.swt.custom.CTabFolder parent,
                                                            java.lang.String name,
                                                            java.lang.String text,
                                                            org.eclipse.swt.graphics.Color bg)
Create a CTabItem that contains a label control.


createLabel

public static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
                                                        org.eclipse.swt.graphics.Color bg)

createLabel

public static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
                                                        org.eclipse.swt.graphics.Color bg,
                                                        org.eclipse.swt.graphics.Color fg)

createLabel

public static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
                                                        int align,
                                                        org.eclipse.swt.graphics.Color bg,
                                                        org.eclipse.swt.graphics.Color fg)

createLabel

public static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
                                                        int align,
                                                        java.lang.String text,
                                                        org.eclipse.swt.graphics.Color bg,
                                                        org.eclipse.swt.graphics.Color fg,
                                                        org.eclipse.swt.graphics.Font font)

createGridLabel

public static org.eclipse.swt.widgets.Label createGridLabel(org.eclipse.swt.widgets.Composite parent,
                                                            int align,
                                                            java.lang.String text,
                                                            org.eclipse.swt.graphics.Color bg,
                                                            org.eclipse.swt.graphics.Color fg,
                                                            org.eclipse.swt.graphics.Font font)
Create a label with default GridLayoutData of fillCell(1,1,true,false).


createGridLabel

public static org.eclipse.swt.widgets.Label createGridLabel(org.eclipse.swt.widgets.Composite parent,
                                                            int align,
                                                            java.lang.String text,
                                                            org.eclipse.swt.graphics.Color bg,
                                                            org.eclipse.swt.graphics.Color fg,
                                                            org.eclipse.swt.graphics.Font font,
                                                            int vspan,
                                                            int hspan,
                                                            boolean hgrab,
                                                            boolean vgrab)

createGridLabel

public static org.eclipse.swt.widgets.Label createGridLabel(org.eclipse.swt.widgets.Composite parent,
                                                            int align,
                                                            java.lang.String text,
                                                            org.eclipse.swt.graphics.Color bg,
                                                            org.eclipse.swt.graphics.Color fg,
                                                            org.eclipse.swt.graphics.Font font,
                                                            int vspan,
                                                            int hspan,
                                                            int halign,
                                                            int valign,
                                                            boolean hgrab,
                                                            boolean vgrab)

createLabel

public static org.eclipse.swt.widgets.Label createLabel(org.eclipse.swt.widgets.Composite parent,
                                                        int align,
                                                        org.eclipse.swt.graphics.Color bg,
                                                        org.eclipse.swt.graphics.Color fg,
                                                        int vspan,
                                                        int hspan,
                                                        boolean hgrab,
                                                        boolean vgrab,
                                                        org.eclipse.swt.graphics.Color border_color,
                                                        int xmargin,
                                                        int ymargin)

createButton

public static org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent,
                                                          int style,
                                                          java.lang.String text,
                                                          org.eclipse.swt.graphics.Color bg,
                                                          org.eclipse.swt.graphics.Font font)

createButton

public static org.eclipse.swt.widgets.Button createButton(org.eclipse.swt.widgets.Composite parent,
                                                          int style,
                                                          java.lang.String text,
                                                          org.eclipse.swt.graphics.Color bg,
                                                          org.eclipse.swt.graphics.Font font,
                                                          int vspan,
                                                          int hspan,
                                                          boolean hgrab,
                                                          boolean vgrab)

labelButton

public static org.eclipse.swt.widgets.Label labelButton(org.eclipse.swt.widgets.Composite parent,
                                                        int style,
                                                        java.lang.String text,
                                                        org.eclipse.swt.graphics.Color bg,
                                                        org.eclipse.swt.graphics.Font font,
                                                        java.lang.Runnable action)

labelText

public static org.eclipse.swt.widgets.Text labelText(org.eclipse.swt.widgets.Composite parent,
                                                     java.lang.String label,
                                                     java.lang.String text,
                                                     org.eclipse.swt.graphics.Color labelbg,
                                                     org.eclipse.swt.graphics.Color textbg,
                                                     int labelspan,
                                                     int textspan,
                                                     boolean hgrab)
Create a label and a single line text control on a GridLayout row with given layout data.


createSep

public static void createSep(org.eclipse.swt.widgets.Composite parent,
                             int style,
                             int span,
                             int size,
                             org.eclipse.swt.graphics.Color bg)

createSep

public static void createSep(org.eclipse.swt.widgets.Composite parent,
                             int style,
                             int span,
                             int topmargin,
                             int bottommargin,
                             org.eclipse.swt.graphics.Color bg)

createBox

public static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent,
                                                          int vspan,
                                                          int hspan,
                                                          int columns,
                                                          int xmargin,
                                                          int ymargin,
                                                          org.eclipse.swt.graphics.Color bg)
Create a standard composite box, typically for enclosing other Controls.


createBox

public static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent,
                                                          org.eclipse.swt.graphics.Color bg,
                                                          int columns,
                                                          int xmargin,
                                                          int ymargin,
                                                          int xspacing,
                                                          int yspacing,
                                                          boolean equalwidth)
Create a composite box with grid layout but no LayoutData.


createBox

public static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent,
                                                          int vspan,
                                                          int hspan,
                                                          boolean hgrab,
                                                          boolean vgrab,
                                                          int columns,
                                                          int xmargin,
                                                          int ymargin,
                                                          int xspacing,
                                                          int yspacing,
                                                          org.eclipse.swt.graphics.Color bg)

createBox

public static org.eclipse.swt.widgets.Composite createBox(org.eclipse.swt.widgets.Composite parent,
                                                          int vspan,
                                                          int hspan,
                                                          boolean hgrab,
                                                          boolean vgrab,
                                                          int columns,
                                                          int xmargin,
                                                          int ymargin,
                                                          int xspacing,
                                                          int yspacing,
                                                          boolean equalwidth,
                                                          org.eclipse.swt.graphics.Color bg)

tableColumn

public static org.eclipse.swt.widgets.TableColumn tableColumn(org.eclipse.swt.widgets.Table parent,
                                                              java.lang.String header,
                                                              int width)

scrolledComposiste

public static org.eclipse.swt.widgets.Composite scrolledComposiste(org.eclipse.swt.widgets.Composite parent,
                                                                   org.eclipse.swt.custom.CTabItem item)
Create a Composite nested in a ScrolledComposite inside the given parent. FIXME:
  • ScrolledComposite have predefined SHADOW_IN border.

  • createCombo

    public static org.eclipse.swt.widgets.Combo createCombo(org.eclipse.swt.widgets.Composite parent,
                                                            int style,
                                                            org.eclipse.swt.graphics.Color bg,
                                                            org.eclipse.swt.graphics.Font font,
                                                            java.lang.String[] items)

    createList

    public static org.eclipse.swt.widgets.List createList(org.eclipse.swt.widgets.Composite parent,
                                                          int style,
                                                          org.eclipse.swt.graphics.Color bg,
                                                          org.eclipse.swt.graphics.Font font,
                                                          java.lang.String[] items)

    createTable

    public static org.eclipse.swt.widgets.Table createTable(org.eclipse.swt.widgets.Composite parent,
                                                            int style,
                                                            java.lang.String[] headers,
                                                            int[] widths,
                                                            org.eclipse.swt.graphics.Color bg,
                                                            org.eclipse.swt.graphics.Font font)

    rowLayout

    public static org.eclipse.swt.layout.RowLayout rowLayout(int vertical,
                                                             int xmargin,
                                                             int ymargin,
                                                             int spacing)

    compactRow

    public static org.eclipse.swt.layout.RowLayout compactRow()

    compactVerticalRow

    public static org.eclipse.swt.layout.RowLayout compactVerticalRow()

    gridLayout

    public static org.eclipse.swt.layout.GridLayout gridLayout(int columns,
                                                               int xmargin,
                                                               int ymargin,
                                                               int xspacing,
                                                               int yspacing)

    gridLayout

    public static org.eclipse.swt.layout.GridLayout gridLayout(int columns,
                                                               int xmargin,
                                                               int ymargin,
                                                               int xspacing,
                                                               int yspacing,
                                                               boolean equalwidth)

    compactGrid

    public static org.eclipse.swt.layout.GridLayout compactGrid(int columns)

    fillCell

    private static org.eclipse.swt.layout.GridData fillCell(int vspan,
                                                            int hspan)
    Grid layout cell configuration with default h/v FILL alignment.


    fillCell

    public static org.eclipse.swt.layout.GridData fillCell(int vspan,
                                                           int hspan,
                                                           boolean hgrab,
                                                           boolean vgrab)
    Grid layout cell configuration with default h/v FILL alignment.


    fillCell

    public static org.eclipse.swt.layout.GridData fillCell(int vspan,
                                                           int hspan,
                                                           int w,
                                                           int h,
                                                           boolean hgrab,
                                                           boolean vgrab)
    Grid layout cell configuration with default h/v FILL alignment.


    alignCell

    public static org.eclipse.swt.layout.GridData alignCell(int vspan,
                                                            int hspan,
                                                            int halign,
                                                            int valign,
                                                            boolean hgrab,
                                                            boolean vgrab)
    Grid layout cell configuration.


    clone

    public static org.eclipse.swt.layout.GridData clone(org.eclipse.swt.layout.GridData data)