本文整理汇总了Java中org.bushe.swing.event.EventSubscriber类的典型用法代码示例。如果您正苦于以下问题:Java EventSubscriber类的具体用法?Java EventSubscriber怎么用?Java EventSubscriber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventSubscriber类属于org.bushe.swing.event包,在下文中一共展示了EventSubscriber类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: subscribeStrongly
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
* {@inheritDoc}.
* <p>
* Overridden to check that the subscription corresponds to an allowed class.
*
* @param classe the observed class
* @param es the subscriber
* @return true if the subscriber was subscribed successfully, false otherwise
*/
@Override
public boolean subscribeStrongly (Class classe,
EventSubscriber es)
{
if (isAllowed(classe)) {
logger.debug(
"{}: subscription on {} by {}@{}",
this,
classe.getSimpleName(),
es,
Integer.toHexString(es.hashCode()));
return super.subscribeStrongly(classe, es);
} else {
logger.error("Event {} not available on {} service", classe, name);
return false;
}
}
示例2: unsubscribe
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
@Override
public boolean unsubscribe (Class classe,
EventSubscriber eh)
{
boolean res = super.unsubscribe(classe, eh);
logger.debug(
"{}: unsubscription on {} by {}@{} res:{}",
this,
classe.getSimpleName(),
eh,
Integer.toHexString(eh.hashCode()),
res);
return res;
}
示例3: subscribeStrongly
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
* Overridden to check that the subscription corresponds to a
* declared class.
*
* @param type the observed class
* @param es the subscriber
* @return I don't know
*/
@Override
public boolean subscribeStrongly (Class type,
EventSubscriber es)
{
if (contains(allowedEvents, type)) {
return super.subscribeStrongly(type, es);
} else {
logger.error("event class {} not available on {}", type, name);
return false;
}
}
示例4: unsubscribe
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
@Override
public boolean unsubscribe (Class cl,
EventSubscriber eh)
{
boolean res = super.unsubscribe(cl, eh);
logger.debug(
"{} unsubscribe {} subscriber:{}@{} res:{}",
this,
cl.getName(),
eh,
Integer.toHexString(eh.hashCode()),
res);
return res;
}
示例5: subscribe
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
* Subscribe to the sheet event service (for the StubEvent class).
*
* @param subscriber The subscriber to accept the events when published.
*/
public void subscribe (EventSubscriber<StubEvent> subscriber)
{
stubService.subscribeStrongly(StubEvent.class, subscriber);
}
示例6: unsubscribe
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
* Un-subscribe to the sheet event service (for the StubEvent class).
*
* @param subscriber the entity to un-subscribe
*/
public void unsubscribe (EventSubscriber<StubEvent> subscriber)
{
stubService.unsubscribe(StubEvent.class, subscriber);
}
示例7: subscribe
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
* Subscribe to the sheet event service (for the SheetEvent class).
*
* @param subscriber The subscriber to accept the events when published.
*/
public void subscribe (EventSubscriber<SheetEvent> subscriber)
{
sheetService.subscribeStrongly(SheetEvent.class, subscriber);
}
示例8: unsubscribe
import org.bushe.swing.event.EventSubscriber; //导入依赖的package包/类
/**
* Unsubscribe to the sheet event service (for the SheetEvent class).
*
* @param subscriber the entity to unsubscribe
*/
public void unsubscribe (EventSubscriber<SheetEvent> subscriber)
{
sheetService.unsubscribe(SheetEvent.class, subscriber);
}