Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » FocusListener in a ViewPart
FocusListener in a ViewPart [message #432913] Mon, 20 June 2005 20:45 Go to next message
Eclipse UserFriend
Originally posted by: gilbertomsn.yahoo.com

Hi guys, I want create a focus listener in a view and I don't find a way to
add this listener.
Below following my sittuation:
1 - I have a TableView in one view, and the user can do some changes and
don't save at this moment.
2 - I have another view that shows to user some informations getted in the
first view.

So, I need show a message with a warning when the user exits without saving
(closing the application or clicking in another view).

Could you suggest possible solutions?

Thanks and best regards!
Gilberto Martins
gilbertomsn@yahoo.com
Re: FocusListener in a ViewPart [message #435656 is a reply to message #432913] Sun, 21 August 2005 21:36 Go to previous message
Sebastian is currently offline SebastianFriend
Messages: 26
Registered: July 2009
Junior Member
Gilberto Martins wrote:
> Hi guys, I want create a focus listener in a view and I don't find a way to
> add this listener.
> Below following my sittuation:
> 1 - I have a TableView in one view, and the user can do some changes and
> don't save at this moment.
> 2 - I have another view that shows to user some informations getted in the
> first view.
>
> So, I need show a message with a warning when the user exits without saving
> (closing the application or clicking in another view).
>
> Could you suggest possible solutions?
>
> Thanks and best regards!
> Gilberto Martins
> gilbertomsn@yahoo.com
>
>
Hi Gilberto,

maybe that helps:

getViewSite().getPage().addPartListener(new org.eclipse.ui.IPartListener2()
{
public void partInputChanged(IWorkbenchPartReference partRef) {}
public void partVisible(IWorkbenchPartReference partRef) {}
public void partHidden(IWorkbenchPartReference partRef) {}
public void partOpened(IWorkbenchPartReference partRef) {}
public void partDeactivated(IWorkbenchPartReference partRef)
{
// lost focus
}
public void partClosed(IWorkbenchPartReference partRef) {}
public void partBroughtToTop(IWorkbenchPartReference partRef) {}
public void partActivated(IWorkbenchPartReference partRef)
{
// gained focus
}
});

Seb
Previous Topic:Which tutorial do you suggest to be used for the newbiee in RCP?
Next Topic:Can any one explain about Sash and Sash forms?
Goto Forum:
  


Current Time: Sat Dec 07 03:30:43 GMT 2024

Powered by FUDForum. Page generated in 0.03090 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top