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

Quick Search    Search Deep

org.eclipse.swt.custom
Class PopupList  view PopupList download PopupList.java

java.lang.Object
  extended byorg.eclipse.swt.custom.PopupList

public class PopupList
extends java.lang.Object

A PopupList is a list of selectable items that appears in its own shell positioned above its parent shell. It it used for selecting items when editing a Table cell (similar to the list that appears when you open a Combo box). The list will be positioned so that does not run off the screen and the largest number of items are visible. It may appear above the current cursor location or below it depending how close you are to the edge of the screen.


Field Summary
(package private)  org.eclipse.swt.widgets.List list
           
(package private)  int minimumWidth
           
(package private)  org.eclipse.swt.widgets.Shell shell
           
 
Constructor Summary
PopupList(org.eclipse.swt.widgets.Shell parent)
          Creates a PopupList above the specified shell.
PopupList(org.eclipse.swt.widgets.Shell parent, int style)
          Creates a PopupList above the specified shell.
 
Method Summary
private static int checkStyle(int style)
           
 org.eclipse.swt.graphics.Font getFont()
          Gets the widget font.
 java.lang.String[] getItems()
          Gets the items.
 int getMinimumWidth()
          Gets the minimum width of the list.
 java.lang.String open(org.eclipse.swt.graphics.Rectangle rect)
          Launches the Popup List, waits for an item to be selected and then closes PopupList.
 void select(java.lang.String string)
          Selects an item with text that starts with specified String.
 void setFont(org.eclipse.swt.graphics.Font font)
          Sets the widget font.
 void setItems(java.lang.String[] strings)
          Sets all items.
 void setMinimumWidth(int width)
          Sets the minimum width of the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shell

org.eclipse.swt.widgets.Shell shell

list

org.eclipse.swt.widgets.List list

minimumWidth

int minimumWidth
Constructor Detail

PopupList

public PopupList(org.eclipse.swt.widgets.Shell parent)
Creates a PopupList above the specified shell.


PopupList

public PopupList(org.eclipse.swt.widgets.Shell parent,
                 int style)
Creates a PopupList above the specified shell.

Since:
3.0
Method Detail

checkStyle

private static int checkStyle(int style)

getFont

public org.eclipse.swt.graphics.Font getFont()
Gets the widget font.


getItems

public java.lang.String[] getItems()
Gets the items.

This operation will fail if the items cannot be queried from the OS.


getMinimumWidth

public int getMinimumWidth()
Gets the minimum width of the list.


open

public java.lang.String open(org.eclipse.swt.graphics.Rectangle rect)
Launches the Popup List, waits for an item to be selected and then closes PopupList.


select

public void select(java.lang.String string)
Selects an item with text that starts with specified String.

If the item is not currently selected, it is selected. If the item at an index is selected, it remains selected. If the string is not matched, it is ignored.


setFont

public void setFont(org.eclipse.swt.graphics.Font font)
Sets the widget font.

When new font is null, the font reverts to the default system font for the widget.


setItems

public void setItems(java.lang.String[] strings)
Sets all items.

The previous selection is cleared. The previous items are deleted. The new items are added. The top index is set to 0.


setMinimumWidth

public void setMinimumWidth(int width)
Sets the minimum width of the list.