01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.views.markers.internal;
11:
12: import org.eclipse.jface.viewers.ISelectionProvider;
13: import org.eclipse.jface.viewers.IStructuredSelection;
14: import org.eclipse.ui.IWorkbenchPart;
15:
16: /**
17: * ActionTaskProperties is the action for setting a tasks properties.
18: *
19: */
20: public class ActionTaskProperties extends MarkerSelectionProviderAction {
21:
22: private IWorkbenchPart part;
23:
24: /**
25: * Create a new instance of the receiver.
26: *
27: * @param part
28: * @param provider
29: */
30: public ActionTaskProperties(IWorkbenchPart part,
31: ISelectionProvider provider) {
32: super (provider, MarkerMessages.propertiesAction_title);
33: setEnabled(false);
34: this .part = part;
35: }
36:
37: /*
38: * (non-Javadoc)
39: *
40: * @see org.eclipse.jface.action.Action#run()
41: */
42: public void run() {
43:
44: DialogMarkerProperties dialog = new DialogTaskProperties(part
45: .getSite().getShell());
46: dialog.setMarker(getSelectedMarker());
47: dialog.open();
48: }
49:
50: /*
51: * (non-Javadoc)
52: *
53: * @see org.eclipse.ui.actions.SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
54: */
55: public void selectionChanged(IStructuredSelection selection) {
56: setEnabled(Util.isSingleConcreteSelection(selection));
57: }
58: }
|