public ExtendedBalloonDialog(Properties config, ICall call) { super(DisplayManager.getDefaultDisplay(), SWT.ON_TOP | SWT.CLOSE | SWT.TITLE); if (m_instance_count > 2) m_instance_count = -1; m_instance_count++; this.m_logger = LogManager.getLogManager().getLogger(IJAMConst.DEFAULT_LOGGER); IEventBroker eventBroker = this.getRuntime().getEventBroker(); eventBroker.register(this); eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED)); eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED)); eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED)); eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLMARKEDSPAM)); this.m_configuration = config; this.m_call = call; this.setAnchor(SWT.NONE); this.setText( this.getI18nManager() .getString( this.getNamespace(), (isOutgoing(call) ? "outgoing" : "call"), "label", this.getLanguage())); this.setImage( SWTImageManager.getInstance(this.getRuntime()) .get( (isOutgoing(call) ? IJAMConst.IMAGE_KEY_OUTGOING_GIF : IJAMConst.IMAGE_KEY_ACCEPTED_GIF))); }
public void close() { IEventBroker eventBroker = this.getRuntime().getEventBroker(); eventBroker.unregister(this); eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED)); eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED)); eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED)); eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLMARKEDSPAM)); m_instance_count--; m_instance_count = Math.max(m_instance_count, -1); if (!this.getShell().isDisposed()) { this.setImage(null); super.close(); } }