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


Java SystemTray.remove方法代碼示例

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


在下文中一共展示了SystemTray.remove方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shutDownServer

import java.awt.SystemTray; //導入方法依賴的package包/類
@Override
public void shutDownServer() throws RemoteException, SecurityException {
    if (trayIcon != null) {
        SystemTray tray = SystemTray.getSystemTray();
        tray.remove(trayIcon);
    }
}
 
開發者ID:IARC-CSU,項目名稱:CanReg5,代碼行數:8,代碼來源:CanRegServerImpl.java

示例2: removeSystemTray

import java.awt.SystemTray; //導入方法依賴的package包/類
synchronized void removeSystemTray()
{
	if(!SystemTray.isSupported() || trayIcon == null)
	{
		return;
	}
	final SystemTray tray = SystemTray.getSystemTray();
	if(tray != null)
		tray.remove(trayIcon);
	trayIcon = null;
}
 
開發者ID:langmo,項目名稱:youscope,代碼行數:12,代碼來源:YouScopeServerImpl.java

示例3: stopNotify

import java.awt.SystemTray; //導入方法依賴的package包/類
@Override
public final void stopNotify() {
	if (SystemTray.isSupported() && started) {
		started = false;
		final SystemTray tray = SystemTray.getSystemTray();
		try {
			for (TrayIcon trayIcon : tray.getTrayIcons()) {
				tray.remove(trayIcon);
			}
			tray.add(passive);
		} catch (AWTException e) {
			
		}
	}
}
 
開發者ID:GoldenGnu,項目名稱:jwarframe,代碼行數:16,代碼來源:TrayTool.java

示例4: startNotify

import java.awt.SystemTray; //導入方法依賴的package包/類
@Override
public void startNotify(final int count, final NotifySource source, final Set<String> categories) {
	if (SystemTray.isSupported() && !started) {
		started = true;
		final SystemTray tray = SystemTray.getSystemTray();
		try {
			for (TrayIcon trayIcon : tray.getTrayIcons()) {
				tray.remove(trayIcon);
			}
			tray.add(active);
		} catch (AWTException e) {
			
		}
	}
}
 
開發者ID:GoldenGnu,項目名稱:jwarframe,代碼行數:16,代碼來源:TrayTool.java

示例5: removeFromTray

import java.awt.SystemTray; //導入方法依賴的package包/類
/**
 * Entfernt dieses WollMuxBarTrayIcon aus der SystemTray.
 * 
 * @throws UnavailableException
 *           wenn die SystemTray nicht verfügbar ist.
 * 
 * @author Daniel Benkmann (D-III-ITD-D101)
 */
public void removeFromTray() throws UnavailableException
{
  if (!SystemTray.isSupported())
  {
    throw new UnavailableException(L.m("System Tray ist nicht verfügbar!"));
  }
  SystemTray tray = SystemTray.getSystemTray();
  tray.remove(icon);
}
 
開發者ID:WollMux,項目名稱:WollMux,代碼行數:18,代碼來源:WollMuxBarTrayIcon.java

示例6: removeTrayIcon

import java.awt.SystemTray; //導入方法依賴的package包/類
public static void removeTrayIcon() {
    if (SystemTray.isSupported()) {
        SystemTray tray = SystemTray.getSystemTray();
        if (trayIcon != null) {
            tray.remove(trayIcon);
            trayIcon = null;
        }
    }
}
 
開發者ID:jindrapetrik,項目名稱:jpexs-decompiler,代碼行數:10,代碼來源:Main.java

示例7: shutdown

import java.awt.SystemTray; //導入方法依賴的package包/類
@Override
public void shutdown() {
	if (SystemTray.isSupported()) {
		SystemTray tray = SystemTray.getSystemTray();
		tray.remove(trayIcon);
	}
	ChatManager.getInstance().removeChatMessageHandler(chatMessageHandler);
}
 
開發者ID:visit,項目名稱:spark-svn-mirror,代碼行數:9,代碼來源:SysTrayPlugin.java

示例8: refreshWith

import java.awt.SystemTray; //導入方法依賴的package包/類
@Override
public void refreshWith(ClimateTrayPreferences model)
{
    if (!SystemTray.isSupported())
    {
        throw new UnsupportedOperationException("SystemTray is not supported");
    }

    SystemTray tray = SystemTray.getSystemTray();
    boolean enabled = model.isTrayIconEnabled();

    if (enabled)
    {
        MNetDevice activeDevice =
            model.getDevices().stream().filter(device -> (device.isEnabled()) && (device.isSelectedAndWorking()))
                .findFirst().orElse(null);

        if (activeDevice != null)
        {
            Image image = activeDevice.getState().createImage(ClimateTrayImageState.DEFAULT, TRAY_ICON_SIZE);
            String toolTip = activeDevice.describeStateAction();

            refreshIconWith(image, toolTip);
        }
        else
        {
            refreshIconWith(null, null);
        }
    }
    else
    {
        refreshIconWith(null, null);
    }

    boolean exists = Arrays.stream(tray.getTrayIcons()).filter(trayIcon -> trayIcon == view).count() > 0;

    if ((enabled) && (!exists))
    {
        try
        {
            tray.add(view);
        }
        catch (AWTException e)
        {
            LOG.error("TrayIcon could not be added.", e);

            model.setTrayIconEnabled(false);
            ClimateTrayService.store();
        }
    }
    else if ((!enabled) && (exists))
    {
        tray.remove(view);
    }

    //if (popupController.getView().isVisible())
    //{
    popupController.refreshWith(model);
    //}
}
 
開發者ID:thred,項目名稱:climate-tray,代碼行數:61,代碼來源:ClimateTrayIconController.java

示例9: removeIconFromTrayBar

import java.awt.SystemTray; //導入方法依賴的package包/類
/**
 * Removes the tray icon from the tray bar.
 */
private void removeIconFromTrayBar() {
	SystemTray tray = SystemTray.getSystemTray();
	tray.remove(trayView.getTrayIcon());
}
 
開發者ID:0x5542,項目名稱:LanTexter,代碼行數:8,代碼來源:ChatController.java

示例10: removeTray

import java.awt.SystemTray; //導入方法依賴的package包/類
void removeTray() {
    if (mTrayIcon != null) {
        SystemTray tray = SystemTray.getSystemTray();
        tray.remove(mTrayIcon);
    }
}
 
開發者ID:kontalk,項目名稱:desktopclient-java,代碼行數:7,代碼來源:TrayManager.java


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