Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to prompt dialog when closing editor ?
icon5.gif  How to prompt dialog when closing editor ? [message #993986] Tue, 25 December 2012 23:01 Go to next message
neal zhang is currently offline neal zhang
Messages: 11
Registered: July 2012
Junior Member
hi all,
i am developing a IDE, editor part have a console editor,which dirty is still false,but we need to add prompt dialog (have cancel and ok button) when close this editor.
i already implemented this function when close it by click (X) button and use key(ctrl+F4),i get edtior CTabFolder and add CTabFolder2Listener,implement close function,
@Override
public void close(CTabFolderEvent event) {
CTabItem ctabItem=(CTabItem)event.item;
if (IConstants.CONSOLE_TEXT.equals(ctabItem.getText())
// close console editor.will close all of connect,add this flag which
// can control to show this dialog one time.
&& ((event.data != null && event.data != Boolean.FALSE) || event.data == null)) {
KiMessageDialog dialog = new KiMessageDialog(Messages.getString("KiBasicEditor.Messages.CloseConsole"));
int isOk = dialog.open();
if (isOk == 0) {
l.close(event);
}else{
event.doit=false;
}
event.data = Boolean.FALSE;
}
else {
l.close(event);
}
}
});

but when close editor which use close menuItem(right mouse in editor head),i still find any way to do it,can you help me? thank you very much.
Re: How to prompt dialog when closing editor ? [message #994036 is a reply to message #993986] Wed, 26 December 2012 02:45 Go to previous message
neal zhang is currently offline neal zhang
Messages: 11
Registered: July 2012
Junior Member
resolved,override workbenchpage's closeEditor function
Previous Topic:Progress Service Not Working
Next Topic:How can i add an perspective from a plugin to my e4 application model?
Goto Forum:
  


Current Time: Mon Apr 21 00:52:53 EDT 2014

Powered by FUDForum. Page generated in 0.01703 seconds