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.core.resources.IMarker;
13: import org.eclipse.jface.viewers.ISelectionProvider;
14: import org.eclipse.jface.viewers.IStructuredSelection;
15: import org.eclipse.ui.IWorkbenchPart;
16:
17: /**
18: * ActionProblemProperties is the action for opening the properties
19: * in the problems view.
20: *
21: */
22: public class ActionProblemProperties extends
23: MarkerSelectionProviderAction {
24:
25: private IWorkbenchPart part;
26:
27: /**
28: * Create a new instance of the receiver.
29: * @param part
30: * @param provider
31: */
32: public ActionProblemProperties(IWorkbenchPart part,
33: ISelectionProvider provider) {
34: super (provider, MarkerMessages.propertiesAction_title);
35: setEnabled(false);
36: this .part = part;
37: }
38:
39: /* (non-Javadoc)
40: * @see org.eclipse.jface.action.Action#run()
41: */
42: public void run() {
43:
44: IMarker marker = getSelectedMarker();
45: DialogMarkerProperties dialog = new DialogProblemProperties(
46: part.getSite().getShell());
47: dialog.setMarker(marker);
48: dialog.open();
49: }
50:
51: /* (non-Javadoc)
52: * @see org.eclipse.ui.actions.SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
53: */
54: public void selectionChanged(IStructuredSelection selection) {
55: setEnabled(Util.isSingleConcreteSelection(selection));
56: }
57: }
|