KickJava   Java API By Example, From Geeks To Geeks.

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


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.core.resources.IMarker;
15 import org.eclipse.jface.viewers.ISelectionProvider;
16 import org.eclipse.jface.viewers.IStructuredSelection;
17 import org.eclipse.ui.IWorkbenchPart;
18
19 /**
20  * ActionProblemProperties is the action for opening the properties
21  * in the problems view.
22  *
23  */

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

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

43     public void run() {
44  
45         IMarker marker = getSelectedMarker();
46         DialogMarkerProperties dialog = new DialogProblemProperties(part
47                 .getSite().getShell());
48         dialog.setMarker(marker);
49         dialog.open();
50     }
51
52     /* (non-Javadoc)
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 }
59
Popular Tags