KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > messageframe > FixedTableSelectionHandler


1 /*
2  * Created on Jun 13, 2003
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package org.columba.mail.gui.messageframe;
8
9 import org.columba.api.command.ICommandReference;
10 import org.columba.core.selection.SelectionHandler;
11 import org.columba.mail.command.IMailFolderCommandReference;
12 import org.columba.mail.command.MailFolderCommandReference;
13 import org.columba.mail.folder.IMailbox;
14 import org.columba.mail.gui.table.selection.TableSelectionChangedEvent;
15 import org.columba.mail.gui.table.selection.TableSelectionHandler;
16
17 /**
18  * @author frd
19  *
20  * To change the template for this generated type comment go to
21  * Window>Preferences>Java>Code Generation>Code and Comments
22  */

23 public class FixedTableSelectionHandler extends SelectionHandler {
24     IMailFolderCommandReference tableReference;
25
26     /**
27      * @param id
28      */

29     public FixedTableSelectionHandler(IMailFolderCommandReference tableReference) {
30         super(TableSelectionHandler.HANDLER_ID);
31         this.tableReference = tableReference;
32     }
33
34     /*
35      * (non-Javadoc)
36      *
37      * @see org.columba.core.gui.selection.SelectionHandler#getSelection()
38      */

39     public ICommandReference getSelection() {
40         return tableReference;
41     }
42
43     /*
44      * (non-Javadoc)
45      *
46      * @see org.columba.core.gui.selection.SelectionHandler#setSelection(org.columba.api.command.DefaultCommandReference[])
47      */

48     public void setSelection(ICommandReference selection) {
49         this.tableReference = (MailFolderCommandReference) selection;
50
51         fireSelectionChanged(new TableSelectionChangedEvent(
52                 (IMailbox) tableReference.getSourceFolder(), tableReference
53                         .getUids()));
54     }
55 }
Popular Tags