org.mailster.gui
Class DropDownListener

java.lang.Object
  extended by org.eclipse.swt.events.SelectionAdapter
      extended by org.mailster.gui.DropDownListener
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.internal.SWTEventListener
Direct Known Subclasses:
FilterTreeView.ImportExportDropDownMenu, MailView.AttachedFilesDropdownListener, MailView.MailViewModeDropdownListener

public abstract class DropDownListener
extends org.eclipse.swt.events.SelectionAdapter

---
Mailster (C) 2007-2009 De Oliveira Edouard

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

See  Mailster Web Site
---

DropDownListener.java - Generic handler for dropdown buttons.

Version:
$Revision: 1.3 $, $Date: 2008/12/06 13:57:17 $
Author:
Edouard De Oliveira

Field Summary
protected  org.eclipse.swt.widgets.ToolItem dropdown
           
protected  org.eclipse.swt.widgets.Menu menu
           
 
Constructor Summary
protected DropDownListener()
           
  DropDownListener(org.eclipse.swt.widgets.ToolItem dropdown)
          Constructs a DropDownListener
 
Method Summary
abstract  void buttonPushed()
          Method is called when the button was clicked.
 void clear()
          Drops all items of the current dropdown by creating a new menu.
 void setEnabled(boolean enabled)
          Sets the enabled state of the dropdown.
 void widgetSelected(org.eclipse.swt.events.SelectionEvent event)
          Called when either the button itself or the dropdown arrow is clicked
 
Methods inherited from class org.eclipse.swt.events.SelectionAdapter
widgetDefaultSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dropdown

protected org.eclipse.swt.widgets.ToolItem dropdown

menu

protected org.eclipse.swt.widgets.Menu menu
Constructor Detail

DropDownListener

protected DropDownListener()

DropDownListener

public DropDownListener(org.eclipse.swt.widgets.ToolItem dropdown)
Constructs a DropDownListener

Parameters:
dropdown - the dropdown this listener belongs to
Method Detail

clear

public final void clear()
Drops all items of the current dropdown by creating a new menu.


setEnabled

public void setEnabled(boolean enabled)
Sets the enabled state of the dropdown.


widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent event)
Called when either the button itself or the dropdown arrow is clicked

Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener
Overrides:
widgetSelected in class org.eclipse.swt.events.SelectionAdapter
Parameters:
event - the event that triggered this call

buttonPushed

public abstract void buttonPushed()
Method is called when the button was clicked.