01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.tasklist;
11:
12: import org.eclipse.core.resources.IMarker;
13: import org.eclipse.jface.viewers.IStructuredSelection;
14: import org.eclipse.ui.PlatformUI;
15:
16: /**
17: * This action opens the properties dialog for the current task.
18: */
19: class TaskPropertiesAction extends TaskAction {
20:
21: /**
22: * Creates the action.
23: *
24: * @param tasklist the task list
25: * @param id the id
26: */
27: public TaskPropertiesAction(TaskList tasklist, String id) {
28: super (tasklist, id);
29: PlatformUI.getWorkbench().getHelpSystem().setHelp(this ,
30: ITaskListHelpContextIds.TASK_PROPERTIES_ACTION);
31: }
32:
33: /**
34: * Performs this action.
35: */
36: public void run() {
37: IStructuredSelection sel = (IStructuredSelection) getTaskList()
38: .getSelection();
39: Object o = sel.getFirstElement();
40: if (o instanceof IMarker) {
41: TaskPropertiesDialog dialog = new TaskPropertiesDialog(
42: getShell());
43: dialog.setMarker((IMarker) o);
44: dialog.open();
45: }
46: }
47: }
|