Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/ViewFavoriteAction.java')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/ViewFavoriteAction.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/ViewFavoriteAction.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/ViewFavoriteAction.java
new file mode 100644
index 000000000..f83e5bb4b
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/ViewFavoriteAction.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2003 - 2005 University Of British Columbia and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * University Of British Columbia - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylar.bugzilla.ui.favorites.actions;
+
+import java.util.List;
+
+import org.eclipse.mylar.bugzilla.ui.BugzillaOpenStructure;
+import org.eclipse.mylar.bugzilla.ui.FavoritesView;
+import org.eclipse.mylar.bugzilla.ui.ViewBugzillaAction;
+
+
+/**
+ * View a bug from the favorites menu
+ */
+public class ViewFavoriteAction extends AbstractFavoritesAction
+{
+
+ /** The view to get the result to launch a viewer on */
+ private FavoritesView view;
+
+ /**
+ * Constructor
+ * @param resultsView The view to launch a viewer on
+ */
+ public ViewFavoriteAction( FavoritesView resultsView )
+ {
+ setToolTipText( "View selected favorites" );
+ setText( "View selected" );
+ setIcon( "icons/openresult.gif" );
+ view = resultsView;
+ }
+
+ /**
+ * View the selected bugs in the editor window
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ @Override
+ public void run()
+ {
+ FavoritesView.checkWindow();
+ List<BugzillaOpenStructure> selectedBugs = view.getBugIdsOfSelected();
+
+ // if there are some selected bugs view the bugs in the editor window
+ if (!selectedBugs.isEmpty())
+ {
+ ViewBugzillaAction viewBugs = new ViewBugzillaAction("Display bugs in editor", selectedBugs);
+ viewBugs.schedule();
+ }
+ }
+}

Back to the top