Java Code Examples for org.eclipse.swt.events.FocusListener#focusLost()

The following examples show how to use org.eclipse.swt.events.FocusListener#focusLost() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MonthCalendar.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
public void focusLost(FocusEvent e) {
	Day day = (Day) e.widget;
	Point coordinates = day.getMonthPosition();
	e.data = new MonthCalendarSelectedDay(day.getDate(), coordinates);

	for (Iterator<FocusListener> focusListenersIter = focusListeners.iterator(); focusListenersIter.hasNext();) {
		FocusListener listener = (FocusListener) focusListenersIter.next();
		listener.focusLost(e);
	}
}
 
Example 2
Source File: CustomAbstractInformationControl.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * {@inheritDoc} This method is not intended to be overridden by subclasses.
 */
public void addFocusListener(final FocusListener listener)
{
	if (fFocusListeners.isEmpty())
	{
		fShellListener = new Listener()
		{

			public void handleEvent(Event event)
			{
				Object[] listeners = fFocusListeners.getListeners();
				for (int i = 0; i < listeners.length; i++)
				{
					FocusListener focusListener = (FocusListener) listeners[i];
					if (event.type == SWT.Activate)
					{
						focusListener.focusGained(new FocusEvent(event));
					}
					else
					{
						focusListener.focusLost(new FocusEvent(event));
					}
				}
			}
		};
		fShell.addListener(SWT.Deactivate, fShellListener);
		fShell.addListener(SWT.Activate, fShellListener);
	}
	fFocusListeners.add(listener);
}
 
Example 3
Source File: EnterXMPPAccountComposite.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
private void notifyFocusLost(FocusEvent e) {
  for (FocusListener focusListener : focusListeners) {
    focusListener.focusLost(e);
  }
}