Call Button's ClickHandler From Method

Hi Geeks

I have created

cancel = new ButtonItem("cancel", "Close");
cancel.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				//do something
				window.destroy();
			}
		});

I want to call ‘cancel’ button’s click handler in a method.
Is it possible ?

Extract the contents of the onClick handler into a separate method, and call that instead.