当前位置: 首页>>代码示例>>Java>>正文


Java Tray类代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Tray的典型用法代码示例。如果您正苦于以下问题:Java Tray类的具体用法?Java Tray怎么用?Java Tray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Tray类属于org.eclipse.swt.widgets包,在下文中一共展示了Tray类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: open

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
/**
 * Open the window.
 */
public void open() {
    try {
        Display display = Display.getDefault();
        this.createContents();
        this.shell.open();
        this.shell.layout();
        while (!this.shell.isDisposed()) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
    } finally {
        Tray tray = Display.getDefault().getSystemTray();
        if (tray != null) {
            for (TrayItem item : tray.getItems()) {
                item.dispose();
            }
        }
    }
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:24,代码来源:ApplicationMain.java

示例2: addTrayItem

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
private void addTrayItem() {
    Display display;
    Tray tray;
    Shell shell;

    display = Main.getDisplay();
    tray = display.getSystemTray();
    shell = Main.getShell();

    if (tray != null) {
        trayItem = new TrayItem(tray, SWT.NONE);
        trayItem.setToolTipText("Dazzl");  //$NON-NLS-1$
        trayItem.setImage(admIcon); //$NON-NLS-1$
        trayItem.addListener(SWT.MenuDetect, new Listener() {
            public void handleEvent(Event event) {
                if (menu != null) {
                    menu.setVisible(true);
                }
            }
        });
    } else {
        CommonDialogs.showError(Messages
                .getString("SystemTray.error.no_system_tray"), null);
    }
}
 
开发者ID:rhamnett,项目名称:dazzl,代码行数:26,代码来源:SystemTray.java

示例3: TrayIcon

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
public TrayIcon(Display display, MainWindow window) {
	if(display == null) { throw new NullPointerException("Display cannot be null."); }
	if(window == null) { throw new NullPointerException("Main window cannot be null."); }
	
	m_mainDisplay = display;
	m_mainWindow = window;
	
	// Create tray item
	Tray tray = display.getSystemTray();
	
	m_item = new TrayItem(tray, SWT.NONE);
	m_item.setText("Droid Navi");
	
	// Set Image
	m_logo = AppLogo.getLogo(AppLogo.LogoType.TRAY_ICON, display);
	m_item.setImage(m_logo);
	
	init(m_item);
}
 
开发者ID:Kenishi,项目名称:DroidNavi,代码行数:20,代码来源:TrayIcon.java

示例4: addTrayItem

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
/**
 * トレイアイコンを追加します
 *
 * @param display
 * @return
 */
private TrayItem addTrayItem(final Display display) {
    // トレイアイコンを追加します
    Tray tray = display.getSystemTray();
    TrayItem item = new TrayItem(tray, SWT.NONE);
    Image image = display.getSystemImage(SWT.ICON_INFORMATION);
    item.setImage(image);
    item.setToolTipText(AppConstants.NAME + AppConstants.VERSION);
    item.addListener(SWT.Selection, new TraySelectionListener(this.shell));
    item.addMenuDetectListener(new TrayItemMenuListener(this.getShell()));
    return item;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:18,代码来源:ApplicationMain.java

示例5: addTrayItem

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
/**
 * トレイアイコンを追加します
 * 
 * @param display
 * @return
 */
private TrayItem addTrayItem(final Display display) {
    // トレイアイコンを追加します
    Tray tray = display.getSystemTray();
    TrayItem item = new TrayItem(tray, SWT.NONE);
    Image image = display.getSystemImage(SWT.ICON_INFORMATION);
    item.setImage(image);
    item.setToolTipText(AppConstants.NAME + AppConstants.VERSION);
    item.addListener(SWT.Selection, new TraySelectionListener(this.shell));
    item.addMenuDetectListener(new TrayItemMenuListener(this.getShell()));
    return item;
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:18,代码来源:ApplicationMain.java

示例6: addTrayItem

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
/**
 * トレイアイコンを追加します
 * 
 * @param display
 * @return
 */
private TrayItem addTrayItem(final Display display) {
    // トレイアイコンを追加します
    Tray tray = display.getSystemTray();
    TrayItem item = new TrayItem(tray, SWT.NONE);
    Image image = display.getSystemImage(SWT.ICON_INFORMATION);
    item.setImage(image);
    item.setToolTipText(AppConstants.NAME + " " + AppConstants.VERSION);
    item.addListener(SWT.Selection, new TraySelectionListener(this.shell));
    item.addMenuDetectListener(new TrayItemMenuListener(this.getShell()));
    return item;
}
 
开发者ID:silfumus,项目名称:logbook-EN,代码行数:18,代码来源:ApplicationMain.java

示例7: toggleDisplay

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
/**
 * 窗口是可见状态时,则隐藏窗口,同时把系统栏中图标删除 窗口是隐藏状态时,则显示窗口,并且在系统栏中显示图标
 * 
 * @param shell
 *            窗口
 * @param tray
 *            系统栏图标控件
 */
private void toggleDisplay(Shell shell, Tray tray) {
	try {
		shell.setVisible(!shell.isVisible());
		if (shell.getVisible()) {
			shell.setMinimized(false);
			shell.setActive();
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:NJU-HouseWang,项目名称:nju-eas-server,代码行数:20,代码来源:ServerUI.java

示例8: initTaskItem

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
private TrayItem initTaskItem(Shell shell) {
	final Tray tray = shell.getDisplay().getSystemTray();
	TrayItem trayItem = new TrayItem(tray, SWT.NONE);
	trayImage = AbstractUIPlugin.imageDescriptorFromPlugin(
			"com.dmagik.sheetrackimporter", "/icons/alt_window_16.gif")
			.createImage();
	trayItem.setImage(trayImage);
	trayItem.setToolTipText("Double-click to maximize SheetRack Importer");
	return trayItem;

}
 
开发者ID:imadk,项目名称:srimporter,代码行数:12,代码来源:Overview.java

示例9: getSWT

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
public Tray getSWT() {
	return tray;
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:4,代码来源:TraySWT.java

示例10: getTray

import org.eclipse.swt.widgets.Tray; //导入依赖的package包/类
public Tray getTray() {
	return tray;
}
 
开发者ID:Albertus82,项目名称:RouterLogger,代码行数:4,代码来源:TrayIcon.java


注:本文中的org.eclipse.swt.widgets.Tray类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。