當前位置: 首頁>>代碼示例>>Java>>正文


Java List.setFont方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.List.setFont方法的典型用法代碼示例。如果您正苦於以下問題:Java List.setFont方法的具體用法?Java List.setFont怎麽用?Java List.setFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.List的用法示例。


在下文中一共展示了List.setFont方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:22,代碼來源:CCombo.java

示例2: addMachineTab

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
private static void addMachineTab(final String name) {
    final CTabItem tabItem = new CTabItem(tabHandsetName, SWT.MULTI | SWT.V_SCROLL);
    tabItem.setImage(new Image(display, ClassLoader
        .getSystemResourceAsStream("icons/device.png")));
    tabItem.setText(name);

    listHandsets = new List(tabHandsetName, SWT.BORDER);

    tabItem.setControl(listHandsets);
    listHandsets.setFont(new Font(display, "宋體", 10, SWT.NONE));
    listHandsets.addListener(SWT.MenuDetect, new Listener() {
        public void handleEvent(Event event) {
            if (event.detail == 0) {
                //select handset
                if (listHandsets.getSelectionIndex() >= 0) {
                    device = findDevices.getDevices()[listHandsets.getSelectionIndex()];
                    //get device node from tree
                    listHandsets.setMenu(null);
                    createHandsetRightClickRecord();
                    listHandsets.setMenu(handsetMenu);

                }
            }
        }
    });
    //show it
    tabHandsetName.setSelection(tabItem);
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:29,代碼來源:AndroidRobot.java

示例3: addRemoteHandsetsList

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
private static void addRemoteHandsetsList() {
    final CTabItem cloudHandsetsTabItem = new CTabItem(tabHandsetName, SWT.V_SCROLL
                                                                       | SWT.H_SCROLL);
    cloudHandsetsTabItem.setText("雲端設備");
    cloudHandsetsTabItem.setImage(new Image(display, ".\\icons\\view.png"));

    cloudHandsetsList = new List(tabHandsetName, SWT.BORDER);
    cloudHandsetsTabItem.setControl(cloudHandsetsList);
    cloudHandsetsList.setFont(new Font(display, "宋體", 10, SWT.NONE));
    //show it
}
 
開發者ID:hoozheng,項目名稱:AndroidRobot,代碼行數:12,代碼來源:AndroidRobot.java

示例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 };
	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);
}
 
開發者ID:ghillairet,項目名稱:gef-gwt,代碼行數:33,代碼來源:CCombo.java

示例5: createList

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
private List createList(Composite parent) {
	List list = new List(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI);
	list.setFont(parent.getFont());
	list.addSelectionListener(getSelectionListener());
	return list;
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:7,代碼來源:PickListFieldEditor.java

示例6: 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 );
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:43,代碼來源:DataItemCombo.java


注:本文中的org.eclipse.swt.widgets.List.setFont方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。