1 11 12 13 package org.eclipse.ui.texteditor; 14 15 16 import java.util.ResourceBundle ; 17 18 import org.eclipse.core.resources.IMarker; 19 import org.eclipse.core.resources.IResource; 20 21 import org.eclipse.jface.action.IAction; 22 import org.eclipse.jface.text.source.IVerticalRulerInfo; 23 24 import org.eclipse.ui.views.tasklist.TaskPropertiesDialog; 25 26 27 28 33 public class TaskRulerAction extends AbstractRulerActionDelegate { 34 35 38 static class TaskMarkerRulerAction extends MarkerRulerAction { 39 40 52 public TaskMarkerRulerAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo ruler) { 53 super(bundle, prefix, editor, ruler, IMarker.TASK, false); 54 } 55 56 59 protected void addMarker() { 60 IResource resource= getResource(); 61 if (resource == null) 62 return; 63 64 TaskPropertiesDialog dialog = new TaskPropertiesDialog(getTextEditor().getSite().getShell()); 65 dialog.setResource(resource); 66 dialog.setInitialAttributes(getInitialAttributes()); 67 dialog.open(); 68 } 69 } 70 71 74 protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) { 75 return new TaskMarkerRulerAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ManageTasks.", editor, rulerInfo); } 77 } 78 | Popular Tags |