本文整理汇总了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;
}
}
示例2: addListener
import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
void addListener(PrintServiceAttributeListener listener) {
synchronized (this) {
if (listener == null || listeners == null) {
return;
}
listeners.add(listener);
}
}
示例3: removeListener
import javax.print.event.PrintServiceAttributeListener; //导入依赖的package包/类
void removeListener(PrintServiceAttributeListener listener) {
synchronized (this) {
if (listener == null || listeners == null) {
return;
}
listeners.remove(listener);
}
}
示例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);
}
}
示例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;
}
}
}
示例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);
}
}
示例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;
}
}
}
示例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);
}
}
示例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;
}
}
}