java类org.eclipse.swt.widgets.Tray的实例源码

ApplicationMain.java 文件源码 项目:logbook 阅读 30 收藏 0 点赞 0 评论 0
/**
 * 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();
            }
        }
    }
}
SystemTray.java 文件源码 项目:dazzl 阅读 34 收藏 0 点赞 0 评论 0
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);
    }
}
TrayIcon.java 文件源码 项目:DroidNavi 阅读 34 收藏 0 点赞 0 评论 0
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);
}
ApplicationMain.java 文件源码 项目:logbookpn 阅读 29 收藏 0 点赞 0 评论 0
/**
 * 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();
            }
        }
    }
}
ApplicationMain.java 文件源码 项目:logbook-EN 阅读 33 收藏 0 点赞 0 评论 0
/**
 * 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();
            }
        }
    }
}
ApplicationMain.java 文件源码 项目:logbook 阅读 28 收藏 0 点赞 0 评论 0
/**
 * トレイアイコンを追加します
 *
 * @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;
}
ApplicationMain.java 文件源码 项目:logbookpn 阅读 30 收藏 0 点赞 0 评论 0
/**
 * トレイアイコンを追加します
 * 
 * @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;
}
ApplicationMain.java 文件源码 项目:logbook-EN 阅读 41 收藏 0 点赞 0 评论 0
/**
 * トレイアイコンを追加します
 * 
 * @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;
}
ServerUI.java 文件源码 项目:nju-eas-server 阅读 31 收藏 0 点赞 0 评论 0
/**
 * 窗口是可见状态时,则隐藏窗口,同时把系统栏中图标删除 窗口是隐藏状态时,则显示窗口,并且在系统栏中显示图标
 * 
 * @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();
    }
}
Overview.java 文件源码 项目:srimporter 阅读 30 收藏 0 点赞 0 评论 0
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;

}
TraySWT.java 文件源码 项目:BiglyBT 阅读 35 收藏 0 点赞 0 评论 0
public Tray getSWT() {
    return tray;
}
TrayIcon.java 文件源码 项目:RouterLogger 阅读 32 收藏 0 点赞 0 评论 0
public Tray getTray() {
    return tray;
}


问题


面经


文章

微信
公众号

扫码关注公众号