MailHandlerExtension

From OpenKM Documentation
Jump to: navigation, search

Any extension that implements MailHandlerExtension will be watching all events fired from mail tab

Method

onChange(MailEventConstant event)

Each time it'll be some new mail event the method onChange it'll be fired by OpenKM

Example

public class TabMailExample extends TabMailExtension implements MailHandlerExtension {
	VerticalPanel vPanel;
 
	public TabMailExample() {
		vPanel = new VerticalPanel();
		vPanel.add(new HTML("hello world"));
 
		initWidget(vPanel);
	}
 
	@Override
	public String getTabText() {
		return "New folder tab";
	}
 
	@Override
	public void set(GWTMail mail) {
		// TODO Auto-generated method stub
	}
 
	@Override
	public void setVisibleButtons(boolean visible) {
		// TODO Auto-generated method stub
	}
 
	@Override
	public void onChange(MailEventConstant event) {
		if (event.equals(HasMailEvent.TAB_CHANGED)) {
			Window.alert("tab changed - " + event.getType());
		}
	}
}