本文整理匯總了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);
}
}
示例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;
}
示例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) {
}
}
}
示例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) {
}
}
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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);
//}
}
示例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());
}
示例10: removeTray
import java.awt.SystemTray; //導入方法依賴的package包/類
void removeTray() {
if (mTrayIcon != null) {
SystemTray tray = SystemTray.getSystemTray();
tray.remove(mTrayIcon);
}
}