|
Lines 78-83
Link Here
|
| 78 |
import org.eclipse.mylyn.internal.tasks.ui.actions.AttachScreenshotAction; |
78 |
import org.eclipse.mylyn.internal.tasks.ui.actions.AttachScreenshotAction; |
| 79 |
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyAttachmentToClipboardJob; |
79 |
import org.eclipse.mylyn.internal.tasks.ui.actions.CopyAttachmentToClipboardJob; |
| 80 |
import org.eclipse.mylyn.internal.tasks.ui.actions.DownloadAttachmentJob; |
80 |
import org.eclipse.mylyn.internal.tasks.ui.actions.DownloadAttachmentJob; |
|
|
81 |
import org.eclipse.mylyn.internal.tasks.ui.actions.NewBugFromCommentAction; |
| 81 |
import org.eclipse.mylyn.internal.tasks.ui.actions.SynchronizeEditorAction; |
82 |
import org.eclipse.mylyn.internal.tasks.ui.actions.SynchronizeEditorAction; |
| 82 |
import org.eclipse.mylyn.internal.tasks.ui.actions.ToggleTaskActivationAction; |
83 |
import org.eclipse.mylyn.internal.tasks.ui.actions.ToggleTaskActivationAction; |
| 83 |
import org.eclipse.mylyn.internal.tasks.ui.editors.AttachmentTableLabelProvider; |
84 |
import org.eclipse.mylyn.internal.tasks.ui.editors.AttachmentTableLabelProvider; |
|
Lines 126-131
Link Here
|
| 126 |
import org.eclipse.swt.dnd.FileTransfer; |
127 |
import org.eclipse.swt.dnd.FileTransfer; |
| 127 |
import org.eclipse.swt.dnd.TextTransfer; |
128 |
import org.eclipse.swt.dnd.TextTransfer; |
| 128 |
import org.eclipse.swt.dnd.Transfer; |
129 |
import org.eclipse.swt.dnd.Transfer; |
|
|
130 |
import org.eclipse.swt.events.FocusEvent; |
| 131 |
import org.eclipse.swt.events.FocusListener; |
| 129 |
import org.eclipse.swt.events.ModifyEvent; |
132 |
import org.eclipse.swt.events.ModifyEvent; |
| 130 |
import org.eclipse.swt.events.ModifyListener; |
133 |
import org.eclipse.swt.events.ModifyListener; |
| 131 |
import org.eclipse.swt.events.SelectionAdapter; |
134 |
import org.eclipse.swt.events.SelectionAdapter; |
|
Lines 300-305
Link Here
|
| 300 |
|
303 |
|
| 301 |
private boolean ignoreLocationEvents = false; |
304 |
private boolean ignoreLocationEvents = false; |
| 302 |
|
305 |
|
|
|
306 |
private static final String LABEL_NEW_BUG = "Create New Bug"; |
| 307 |
|
| 303 |
/** |
308 |
/** |
| 304 |
* @author Raphael Ackermann (bug 195514) |
309 |
* @author Raphael Ackermann (bug 195514) |
| 305 |
*/ |
310 |
*/ |
|
Lines 859-865
Link Here
|
| 859 |
protected Composite createAttributeSection() { |
864 |
protected Composite createAttributeSection() { |
| 860 |
attributesSection = createSection(editorComposite, getSectionLabel(SECTION_NAME.ATTRIBTUES_SECTION)); |
865 |
attributesSection = createSection(editorComposite, getSectionLabel(SECTION_NAME.ATTRIBTUES_SECTION)); |
| 861 |
attributesSection.setExpanded(expandedStateAttributes || hasAttributeChanges); |
866 |
attributesSection.setExpanded(expandedStateAttributes || hasAttributeChanges); |
| 862 |
|
867 |
|
| 863 |
Composite toolbarComposite = toolkit.createComposite(attributesSection); |
868 |
Composite toolbarComposite = toolkit.createComposite(attributesSection); |
| 864 |
toolbarComposite.setBackground(null); |
869 |
toolbarComposite.setBackground(null); |
| 865 |
RowLayout rowLayout = new RowLayout(); |
870 |
RowLayout rowLayout = new RowLayout(); |
|
Lines 937-946
Link Here
|
| 937 |
attributesData.horizontalSpan = 1; |
942 |
attributesData.horizontalSpan = 1; |
| 938 |
attributesData.grabExcessVerticalSpace = false; |
943 |
attributesData.grabExcessVerticalSpace = false; |
| 939 |
attribComp.setLayoutData(attributesData); |
944 |
attribComp.setLayoutData(attributesData); |
| 940 |
|
945 |
|
| 941 |
return attribComp; |
946 |
return attribComp; |
| 942 |
} |
947 |
} |
| 943 |
|
948 |
|
| 944 |
/** |
949 |
/** |
| 945 |
* Creates the attribute section, which contains most of the basic attributes of the task (some of which are |
950 |
* Creates the attribute section, which contains most of the basic attributes of the task (some of which are |
| 946 |
* editable). |
951 |
* editable). |
|
Lines 1507-1514
Link Here
|
| 1507 |
Button attachFileButton = toolkit.createButton(attachmentControlsComposite, "Add File...", SWT.PUSH); |
1512 |
Button attachFileButton = toolkit.createButton(attachmentControlsComposite, "Add File...", SWT.PUSH); |
| 1508 |
attachFileButton.setImage(WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FILE)); |
1513 |
attachFileButton.setImage(WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FILE)); |
| 1509 |
|
1514 |
|
| 1510 |
Button attachScreenshotButton = toolkit.createButton(attachmentControlsComposite, "Add Screenshot...", |
1515 |
Button attachScreenshotButton = toolkit.createButton(attachmentControlsComposite, "Add Screenshot...", SWT.PUSH); |
| 1511 |
SWT.PUSH); |
|
|
| 1512 |
attachScreenshotButton.setImage(TasksUiImages.getImage(TasksUiImages.IMAGE_CAPTURE)); |
1516 |
attachScreenshotButton.setImage(TasksUiImages.getImage(TasksUiImages.IMAGE_CAPTURE)); |
| 1513 |
|
1517 |
|
| 1514 |
final AbstractTask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), |
1518 |
final AbstractTask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), |
|
Lines 1715-1720
Link Here
|
| 1715 |
return replyLink; |
1719 |
return replyLink; |
| 1716 |
} |
1720 |
} |
| 1717 |
|
1721 |
|
|
|
1722 |
public ImageHyperlink createNewBugHyperlink(Composite composite, final TaskComment taskComment) { |
| 1723 |
final ImageHyperlink newLink = new ImageHyperlink(composite, SWT.NULL); |
| 1724 |
toolkit.adapt(newLink, true, true); |
| 1725 |
newLink.setImage(TasksUiImages.getImage(TasksUiImages.TASK_NEW)); |
| 1726 |
newLink.setToolTipText(LABEL_NEW_BUG); |
| 1727 |
// no need for the background - transparency will take care of it |
| 1728 |
newLink.setBackground(null); |
| 1729 |
// replyLink.setBackground(section.getTitleBarGradientBackground()); |
| 1730 |
newLink.addHyperlinkListener(new HyperlinkAdapter() { |
| 1731 |
public void linkActivated(HyperlinkEvent e) { |
| 1732 |
NewBugFromCommentAction newBugFromCommentAction = new NewBugFromCommentAction(); |
| 1733 |
newBugFromCommentAction.setTaskComment(taskComment); |
| 1734 |
newBugFromCommentAction.setTaskData(taskData); |
| 1735 |
newBugFromCommentAction.run(); |
| 1736 |
} |
| 1737 |
}); |
| 1738 |
return newLink; |
| 1739 |
} |
| 1740 |
|
| 1718 |
protected void addDuplicateDetection(Composite composite) { |
1741 |
protected void addDuplicateDetection(Composite composite) { |
| 1719 |
List<AbstractDuplicateDetector> allCollectors = new ArrayList<AbstractDuplicateDetector>(); |
1742 |
List<AbstractDuplicateDetector> allCollectors = new ArrayList<AbstractDuplicateDetector>(); |
| 1720 |
if (getDuplicateSearchCollectorsList() != null) { |
1743 |
if (getDuplicateSearchCollectorsList() != null) { |
|
Lines 1914-1919
Link Here
|
| 1914 |
} |
1937 |
} |
| 1915 |
} |
1938 |
} |
| 1916 |
|
1939 |
|
|
|
1940 |
protected TaskComment selectedTaskComment; |
| 1941 |
|
| 1942 |
protected class CommentFocusListener implements FocusListener { |
| 1943 |
private TaskComment taskComment; |
| 1944 |
|
| 1945 |
public CommentFocusListener(TaskComment taskComment) { |
| 1946 |
this.taskComment = taskComment; |
| 1947 |
} |
| 1948 |
|
| 1949 |
public void focusGained(FocusEvent e) { |
| 1950 |
selectedTaskComment = taskComment; |
| 1951 |
} |
| 1952 |
|
| 1953 |
public void focusLost(FocusEvent e) { |
| 1954 |
selectedTaskComment = null; |
| 1955 |
} |
| 1956 |
} |
| 1957 |
|
| 1958 |
public TaskComment getSelectedTaskComment() { |
| 1959 |
return selectedTaskComment; |
| 1960 |
} |
| 1961 |
|
| 1917 |
protected boolean supportsCommentDelete() { |
1962 |
protected boolean supportsCommentDelete() { |
| 1918 |
return false; |
1963 |
return false; |
| 1919 |
} |
1964 |
} |
|
Lines 2061-2066
Link Here
|
| 2061 |
final ImageHyperlink replyLink = createReplyHyperlink(taskComment.getNumber(), toolbarButtonComp, |
2106 |
final ImageHyperlink replyLink = createReplyHyperlink(taskComment.getNumber(), toolbarButtonComp, |
| 2062 |
taskComment.getText()); |
2107 |
taskComment.getText()); |
| 2063 |
|
2108 |
|
|
|
2109 |
final ImageHyperlink newLink = createNewBugHyperlink(toolbarButtonComp, taskComment); |
| 2110 |
|
| 2064 |
expandableComposite.addExpansionListener(new ExpansionAdapter() { |
2111 |
expandableComposite.addExpansionListener(new ExpansionAdapter() { |
| 2065 |
|
2112 |
|
| 2066 |
@Override |
2113 |
@Override |
|
Lines 2083-2094
Link Here
|
| 2083 |
@Override |
2130 |
@Override |
| 2084 |
public void linkEntered(HyperlinkEvent e) { |
2131 |
public void linkEntered(HyperlinkEvent e) { |
| 2085 |
replyLink.setUnderlined(true); |
2132 |
replyLink.setUnderlined(true); |
|
|
2133 |
newLink.setUnderlined(true); |
| 2086 |
super.linkEntered(e); |
2134 |
super.linkEntered(e); |
| 2087 |
} |
2135 |
} |
| 2088 |
|
2136 |
|
| 2089 |
@Override |
2137 |
@Override |
| 2090 |
public void linkExited(HyperlinkEvent e) { |
2138 |
public void linkExited(HyperlinkEvent e) { |
| 2091 |
replyLink.setUnderlined(false); |
2139 |
replyLink.setUnderlined(false); |
|
|
2140 |
newLink.setUnderlined(false); |
| 2092 |
super.linkExited(e); |
2141 |
super.linkExited(e); |
| 2093 |
} |
2142 |
} |
| 2094 |
}); |
2143 |
}); |
|
Lines 2125-2130
Link Here
|
| 2125 |
// code for outline |
2174 |
// code for outline |
| 2126 |
commentStyleText.add(styledText); |
2175 |
commentStyleText.add(styledText); |
| 2127 |
controlBySelectableObject.put(taskComment, styledText); |
2176 |
controlBySelectableObject.put(taskComment, styledText); |
|
|
2177 |
styledText.addFocusListener(new CommentFocusListener(taskComment)); |
| 2128 |
|
2178 |
|
| 2129 |
// if (supportsCommentDelete()) { |
2179 |
// if (supportsCommentDelete()) { |
| 2130 |
// Button deleteButton = toolkit.createButton(ecComposite, null, |
2180 |
// Button deleteButton = toolkit.createButton(ecComposite, null, |