KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > markers > internal > ActionTaskProperties


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.views.markers.internal;
13
14 import org.eclipse.jface.viewers.ISelectionProvider;
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.ui.IWorkbenchPart;
17
18 /**
19  * ActionTaskProperties is the action for setting a tasks properties.
20  *
21  */

22 public class ActionTaskProperties extends MarkerSelectionProviderAction {
23
24     private IWorkbenchPart part;
25
26     /**
27      * Create a new instance of the receiver.
28      *
29      * @param part
30      * @param provider
31      */

32     public ActionTaskProperties(IWorkbenchPart part, ISelectionProvider provider) {
33         super(provider, MarkerMessages.propertiesAction_title);
34         setEnabled(false);
35         this.part = part;
36     }
37
38     /*
39      * (non-Javadoc)
40      *
41      * @see org.eclipse.jface.action.Action#run()
42      */

43     public void run() {
44
45         DialogMarkerProperties dialog = new DialogTaskProperties(part.getSite()
46                 .getShell());
47         dialog.setMarker(getSelectedMarker());
48         dialog.open();
49     }
50
51     /*
52      * (non-Javadoc)
53      *
54      * @see org.eclipse.ui.actions.SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
55      */

56     public void selectionChanged(IStructuredSelection selection) {
57         setEnabled(Util.isSingleConcreteSelection(selection));
58     }
59 }
60
Popular Tags