From: <dam...@us...> - 2009-07-10 22:52:12
|
Revision: 1729 http://azsmrc.svn.sourceforge.net/azsmrc/?rev=1729&view=rev Author: damokles Date: 2009-07-10 22:52:00 +0000 (Fri, 10 Jul 2009) Log Message: ----------- Deletion of season is now possible Modified Paths: -------------- azsmrcplugins/trunk/lbms/plugins/scanerss/main/gui/GUI_DownloadHistory.java Modified: azsmrcplugins/trunk/lbms/plugins/scanerss/main/gui/GUI_DownloadHistory.java =================================================================== --- azsmrcplugins/trunk/lbms/plugins/scanerss/main/gui/GUI_DownloadHistory.java 2009-07-10 22:22:53 UTC (rev 1728) +++ azsmrcplugins/trunk/lbms/plugins/scanerss/main/gui/GUI_DownloadHistory.java 2009-07-10 22:52:00 UTC (rev 1729) @@ -19,6 +19,8 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Monitor; import org.eclipse.swt.widgets.Shell; @@ -36,7 +38,7 @@ public GUI_DownloadHistory(Display _display, DownloadHistory dh) { this.display = _display; - List<List<Integer>> seasonList = dh.getSeasonList(); + final List<List<Integer>> seasonList = dh.getSeasonList(); boolean dataFound = false; // the main shell @@ -45,7 +47,7 @@ shell.setText("DownloadHistory"); // the parent composite - Composite parent = new Composite(shell, SWT.NONE); + final Composite parent = new Composite(shell, SWT.NONE); parent.setLayout(new GridLayout(1, false)); GridData gd = new GridData(GridData.FILL_BOTH); @@ -57,12 +59,34 @@ continue; } dataFound = true; - Group seasonGroup = new Group(parent, SWT.NONE); + final Group seasonGroup = new Group(parent, SWT.NONE); gd = new GridData(GridData.FILL_BOTH); seasonGroup.setLayoutData(gd); seasonGroup.setText("Season " + i); + final int seasonID = i; + Menu contextMenu = new Menu(seasonGroup); + MenuItem delete = new MenuItem(contextMenu, SWT.PUSH); + delete.setText("Delete Season " + 1); + delete.addSelectionListener(new SelectionAdapter() { + /* + * (non-Javadoc) + * + * @see + * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org + * .eclipse.swt.events.SelectionEvent) + */ + @Override + public void widgetSelected (SelectionEvent e) { + seasonList.set(seasonID, null); + seasonGroup.dispose(); + parent.pack(); + } + }); + + seasonGroup.setMenu(contextMenu); + seasonGroup.setLayout(new GridLayout(11, false)); Label indexLabel0 = new Label(seasonGroup, SWT.CENTER); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |