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


Java PrintServiceAttributeListener类代码示例

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


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

示例1: removeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
public void removeListener(PrintService service,
        PrintServiceAttributeListener listener) {
    if (service == null || listener == null) {
        return;
    }
    
    if (services.contains(service)) {
        ArrayList serviceListeners = (ArrayList)listeners.get(service);
        serviceListeners.remove(listener);
        if (serviceListeners.size() == 0) {
            listeners.remove(service);
            attributes.remove(service);
            services.remove(service);
        }
    }

    if (services.size() == 0) {
        running = false;
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:EventNotifier.java

示例2: addListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
void addListener(PrintServiceAttributeListener listener) {
    synchronized (this) {
        if (listener == null || listeners == null) {
            return;
        }
        listeners.add(listener);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ServiceNotifier.java

示例3: removeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
void removeListener(PrintServiceAttributeListener listener) {
     synchronized (this) {
        if (listener == null || listeners == null) {
            return;
        }
        listeners.remove(listener);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ServiceNotifier.java

示例4: addPrintServiceAttributeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
public void addPrintServiceAttributeListener(PrintServiceAttributeListener
                                             listener) {
    synchronized (this) {
        if (listener == null) {
            return;
        }
        if (notifier == null) {
            notifier = new ServiceNotifier(this);
        }
        notifier.addListener(listener);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:Win32PrintService.java

示例5: removePrintServiceAttributeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
public void removePrintServiceAttributeListener(
                                  PrintServiceAttributeListener listener) {
    synchronized (this) {
        if (listener == null || notifier == null ) {
            return;
        }
        notifier.removeListener(listener);
        if (notifier.isEmpty()) {
            notifier.stopNotifier();
            notifier = null;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:Win32PrintService.java

示例6: addPrintServiceAttributeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
public void addPrintServiceAttributeListener(
                             PrintServiceAttributeListener listener) {
    synchronized (this) {
        if (listener == null) {
            return;
        }
        if (notifier == null) {
            notifier = new ServiceNotifier(this);
        }
        notifier.addListener(listener);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:UnixPrintService.java

示例7: removePrintServiceAttributeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
public void removePrintServiceAttributeListener(
                              PrintServiceAttributeListener listener) {
    synchronized (this) {
        if (listener == null || notifier == null ) {
            return;
        }
        notifier.removeListener(listener);
        if (notifier.isEmpty()) {
            notifier.stopNotifier();
            notifier = null;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:UnixPrintService.java

示例8: addPrintServiceAttributeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
@Override
public void addPrintServiceAttributeListener(PrintServiceAttributeListener listener){
    synchronized (this) {
        if (listener == null) {
            return;
        }
        if (notifier == null) {
            notifier = new ServiceNotifier(this);
        }
        notifier.addListener(listener);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:Win32PrintService.java

示例9: removePrintServiceAttributeListener

import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
@Override
public void removePrintServiceAttributeListener(PrintServiceAttributeListener listener){
    synchronized (this) {
        if (listener == null || notifier == null ) {
            return;
        }
        notifier.removeListener(listener);
        if (notifier.isEmpty()) {
            notifier.stopNotifier();
            notifier = null;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:Win32PrintService.java


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