View | Details | Raw Unified | Return to bug 165968 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java (+44 lines)
Lines 286-291 Link Here
286
	private Composite editorComposite;
286
	private Composite editorComposite;
287
287
288
	protected TextViewer summaryTextViewer;
288
	protected TextViewer summaryTextViewer;
289
	
290
	private ImageHyperlink sortHyperlink;
291
	
292
	private boolean commentSortIsDown = true;
289
293
290
	/**
294
	/**
291
	 * WARNING: This is present for backward compatibility only. You can get and set text on this widget but all ui
295
	 * WARNING: This is present for backward compatibility only. You can get and set text on this widget but all ui
Lines 2035-2040 Link Here
2035
			commentsSectionClient.setLayout(rowLayout);
2039
			commentsSectionClient.setLayout(rowLayout);
2036
			commentsSectionClient.setBackground(null);
2040
			commentsSectionClient.setBackground(null);
2037
2041
2042
			sortHyperlink = new ImageHyperlink(commentsSectionClient, SWT.NONE);
2043
			sortHyperlink.setToolTipText("Change Sortorder of Comments");
2044
			toolkit.adapt(sortHyperlink, true, true);
2045
			sortHyperlink.setBackground(null);
2046
			sortHyperlink.setImage(TasksUiImages.getImage(TasksUiImages.SORT_COMMENT_DOWN));
2047
			sortHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
2048
				public void linkActivated(HyperlinkEvent e) {
2049
					sortComments();
2050
				}
2051
			});
2052
2038
			ImageHyperlink collapseAllHyperlink = new ImageHyperlink(commentsSectionClient, SWT.NONE);
2053
			ImageHyperlink collapseAllHyperlink = new ImageHyperlink(commentsSectionClient, SWT.NONE);
2039
			collapseAllHyperlink.setToolTipText("Collapse All Comments");
2054
			collapseAllHyperlink.setToolTipText("Collapse All Comments");
2040
			toolkit.adapt(collapseAllHyperlink, true, true);
2055
			toolkit.adapt(collapseAllHyperlink, true, true);
Lines 2063-2068 Link Here
2063
2078
2064
		// Additional (read-only) Comments Area
2079
		// Additional (read-only) Comments Area
2065
		Composite addCommentsComposite = toolkit.createComposite(commentsSection);
2080
		Composite addCommentsComposite = toolkit.createComposite(commentsSection);
2081
2066
		commentsSection.setClient(addCommentsComposite);
2082
		commentsSection.setClient(addCommentsComposite);
2067
		GridLayout addCommentsLayout = new GridLayout();
2083
		GridLayout addCommentsLayout = new GridLayout();
2068
		addCommentsLayout.numColumns = 1;
2084
		addCommentsLayout.numColumns = 1;
Lines 2264-2269 Link Here
2264
				commentsSection.setExpanded(newTaskComments.size() != oldTaskComments.size());
2280
				commentsSection.setExpanded(newTaskComments.size() != oldTaskComments.size());
2265
			}
2281
			}
2266
		}
2282
		}
2283
//		Control[] a = commentsSection.getChildren();
2284
//		
2285
//		if (a[3] instanceof Composite) {
2286
//			Composite b = (Composite)a[3];
2287
//			Control[] a1 = b.getChildren();
2288
//			a1[1].moveAbove(a1[0]);
2289
//			int i = 1;
2290
//			i = i * 4;
2291
//		}
2292
//		int i = 1;
2293
//		i = i * 4;
2267
	}
2294
	}
2268
2295
2269
	public String formatDate(String dateString) {
2296
	public String formatDate(String dateString) {
Lines 2827-2832 Link Here
2827
		resetLayout();
2854
		resetLayout();
2828
	}
2855
	}
2829
2856
2857
	private void sortComments() {
2858
		Control[] children = commentsSection.getChildren();	
2859
		if (children[3] instanceof Composite) {
2860
			Control[] commentControlList = ((Composite)children[3]).getChildren();
2861
			int commentControlListLength = commentControlList.length;
2862
			for (int i = 1; i < commentControlListLength; i++)
2863
				commentControlList[commentControlListLength-i].moveAbove(commentControlList[0]);
2864
		}
2865
		if (commentSortIsDown) {
2866
			sortHyperlink.setImage(TasksUiImages.getImage(TasksUiImages.SORT_COMMENT_UP));
2867
		} else {
2868
			sortHyperlink.setImage(TasksUiImages.getImage(TasksUiImages.SORT_COMMENT_DOWN));
2869
		}
2870
		commentSortIsDown = !commentSortIsDown;
2871
		resetLayout();
2872
	}
2873
2830
	/**
2874
	/**
2831
	 * Selects the given object in the editor.
2875
	 * Selects the given object in the editor.
2832
	 * 
2876
	 * 
(-)src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java (+4 lines)
Lines 269-274 Link Here
269
269
270
	public static final ImageDescriptor NEW_SUB_TASK = create(T_TOOL, "sub-task-new.gif");
270
	public static final ImageDescriptor NEW_SUB_TASK = create(T_TOOL, "sub-task-new.gif");
271
271
272
	public static final ImageDescriptor SORT_COMMENT_DOWN = create(T_TOOL, "sort-down.gif");
273
274
	public static final ImageDescriptor SORT_COMMENT_UP = create(T_TOOL, "sort-up.gif");
275
272
	private static ImageDescriptor create(String prefix, String name) {
276
	private static ImageDescriptor create(String prefix, String name) {
273
		try {
277
		try {
274
			return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
278
			return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));

Return to bug 165968