本文整理匯總了Java中org.eclipse.swt.widgets.List.setBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java List.setBackground方法的具體用法?Java List.setBackground怎麽用?Java List.setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.List
的用法示例。
在下文中一共展示了List.setBackground方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPopup
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
void createPopup(String[] items, int selectionIndex) {
// create shell and list
popup = new Shell (getShell(), SWT.NO_TRIM | SWT.ON_TOP);
int style = getStyle();
int listStyle = SWT.SINGLE | SWT.V_SCROLL;
if ((style & SWT.FLAT) != 0) listStyle |= SWT.FLAT;
if ((style & SWT.RIGHT_TO_LEFT) != 0) listStyle |= SWT.RIGHT_TO_LEFT;
if ((style & SWT.LEFT_TO_RIGHT) != 0) listStyle |= SWT.LEFT_TO_RIGHT;
list = new List (popup, listStyle);
if (font != null) list.setFont(font);
if (foreground != null) list.setForeground(foreground);
if (background != null) list.setBackground(background);
int [] popupEvents = {SWT.Close, SWT.Paint, SWT.Deactivate};
for (int i=0; i<popupEvents.length; i++) popup.addListener (popupEvents [i], listener);
int [] listEvents = {SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose};
for (int i=0; i<listEvents.length; i++) list.addListener (listEvents [i], listener);
if (items != null) list.setItems(items);
if (selectionIndex != -1) list.setSelection(selectionIndex);
}
示例2: workaround_383750
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
private void workaround_383750 (Composite composite) {
//
List dummy = new List(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
dummy.setBackground(composite.getBackground());
FormData fd_dummy = new FormData();
fd_dummy.top = new FormAttachment(0, 0);
fd_dummy.left = new FormAttachment(0, 1);
fd_dummy.right = new FormAttachment(0, 1);
dummy.setLayoutData(fd_dummy);
}
示例3: createPopup
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
void createPopup(String[] items, int selectionIndex) {
// create shell and list
popup = new Shell(getShell(), SWT.NO_TRIM | SWT.ON_TOP);
int style = getStyle();
int listStyle = SWT.SINGLE | SWT.V_SCROLL;
if ((style & SWT.FLAT) != 0)
listStyle |= SWT.FLAT;
if ((style & SWT.RIGHT_TO_LEFT) != 0)
listStyle |= SWT.RIGHT_TO_LEFT;
if ((style & SWT.LEFT_TO_RIGHT) != 0)
listStyle |= SWT.LEFT_TO_RIGHT;
list = new List(popup, listStyle);
if (font != null)
list.setFont(font);
if (foreground != null)
list.setForeground(foreground);
if (background != null)
list.setBackground(background);
int[] popupEvents = { SWT.Close, SWT.Paint };
for (int i = 0; i < popupEvents.length; i++)
popup.addListener(popupEvents[i], listener);
int[] listEvents = { SWT.MouseUp, SWT.Selection, SWT.Traverse,
SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.FocusOut, SWT.Dispose };
for (int i = 0; i < listEvents.length; i++)
list.addListener(listEvents[i], listener);
if (items != null)
list.setItems(items);
if (selectionIndex != -1)
list.setSelection(selectionIndex);
}
示例4: createPopup
import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
void createPopup( String[] items, int selectionIndex )
{
// create shell and list
popup = new Shell( getShell( ), SWT.NO_TRIM | SWT.ON_TOP );
int style = getStyle( );
int listStyle = SWT.SINGLE | SWT.V_SCROLL;
if ( ( style & SWT.FLAT ) != 0 )
listStyle |= SWT.FLAT;
if ( ( style & SWT.RIGHT_TO_LEFT ) != 0 )
listStyle |= SWT.RIGHT_TO_LEFT;
if ( ( style & SWT.LEFT_TO_RIGHT ) != 0 )
listStyle |= SWT.LEFT_TO_RIGHT;
list = new List( popup, listStyle );
if ( font != null )
list.setFont( font );
if ( foreground != null )
list.setForeground( foreground );
if ( background != null )
list.setBackground( background );
int[] popupEvents = {
SWT.Close, SWT.Paint, SWT.Deactivate
};
for ( int i = 0; i < popupEvents.length; i++ )
popup.addListener( popupEvents[i], listener );
int[] listEvents = {
SWT.MouseUp,
SWT.Selection,
SWT.Traverse,
SWT.KeyDown,
SWT.KeyUp,
SWT.FocusIn,
SWT.Dispose
};
for ( int i = 0; i < listEvents.length; i++ )
list.addListener( listEvents[i], listener );
if ( items != null )
list.setItems( items );
if ( selectionIndex != -1 )
list.setSelection( selectionIndex );
}