Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 194936 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java (-58 / +379 lines)
Lines 127-132 Link Here
127
import org.eclipse.swt.graphics.Color;
127
import org.eclipse.swt.graphics.Color;
128
import org.eclipse.swt.graphics.Cursor;
128
import org.eclipse.swt.graphics.Cursor;
129
import org.eclipse.swt.graphics.Font;
129
import org.eclipse.swt.graphics.Font;
130
import org.eclipse.swt.graphics.Point;
131
import org.eclipse.swt.graphics.Rectangle;
130
import org.eclipse.swt.layout.GridData;
132
import org.eclipse.swt.layout.GridData;
131
import org.eclipse.swt.layout.GridLayout;
133
import org.eclipse.swt.layout.GridLayout;
132
import org.eclipse.swt.layout.RowLayout;
134
import org.eclipse.swt.layout.RowLayout;
Lines 139-146 Link Here
139
import org.eclipse.swt.widgets.Label;
141
import org.eclipse.swt.widgets.Label;
140
import org.eclipse.swt.widgets.Listener;
142
import org.eclipse.swt.widgets.Listener;
141
import org.eclipse.swt.widgets.Menu;
143
import org.eclipse.swt.widgets.Menu;
144
import org.eclipse.swt.widgets.Shell;
142
import org.eclipse.swt.widgets.Table;
145
import org.eclipse.swt.widgets.Table;
143
import org.eclipse.swt.widgets.TableColumn;
146
import org.eclipse.swt.widgets.TableColumn;
147
import org.eclipse.swt.widgets.TableItem;
144
import org.eclipse.swt.widgets.Text;
148
import org.eclipse.swt.widgets.Text;
145
import org.eclipse.ui.IEditorDescriptor;
149
import org.eclipse.ui.IEditorDescriptor;
146
import org.eclipse.ui.IEditorInput;
150
import org.eclipse.ui.IEditorInput;
Lines 479-496 Link Here
479
	// }
483
	// }
480
484
481
//	/**
485
//	/**
482
//	 * Update task state
486
//	* Update task state
483
//	 */
487
//	*/
484
//	protected void updateTask() {
488
//	protected void updateTask() {
485
//		if (taskData == null)
489
//	if (taskData == null)
486
//			return;
490
//	return;
487
//		if (repositoryTask != null) {
491
//	if (repositoryTask != null) {
488
//			TasksUiPlugin.getSynchronizationManager().saveOutgoing(repositoryTask, changedAttributes);
492
//	TasksUiPlugin.getSynchronizationManager().saveOutgoing(repositoryTask, changedAttributes);
489
//		}
493
//	}
490
//		if (parentEditor != null) {
494
//	if (parentEditor != null) {
491
//			parentEditor.notifyTaskChanged();
495
//	parentEditor.notifyTaskChanged();
492
//		}
496
//	}
493
//		markDirty(false);
497
//	markDirty(false);
494
//	}
498
//	}
495
499
496
	protected abstract void validateInput();
500
	protected abstract void validateInput();
Lines 657-663 Link Here
657
								setChecked(false);
661
								setChecked(false);
658
								new TaskDeactivateAction().run(repositoryTask);
662
								new TaskDeactivateAction().run(repositoryTask);
659
							}
663
							}
660
//						submitToRepository();
664
//							submitToRepository();
661
						}
665
						}
662
666
663
					};
667
					};
Lines 1066-1115 Link Here
1066
//		relatedBugsComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
1070
//		relatedBugsComposite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
1067
//		relatedBugsSection.setClient(relatedBugsComposite);
1071
//		relatedBugsSection.setClient(relatedBugsComposite);
1068
//		relatedBugsSection.setExpanded(repositoryTask == null);
1072
//		relatedBugsSection.setExpanded(repositoryTask == null);
1069
//
1073
1070
//		List<AbstractDuplicateDetector> allCollectors = new ArrayList<AbstractDuplicateDetector>();
1074
//		List<AbstractDuplicateDetector> allCollectors = new ArrayList<AbstractDuplicateDetector>();
1071
//		if (getDuplicateSearchCollectorsList() != null) {
1075
//		if (getDuplicateSearchCollectorsList() != null) {
1072
//			allCollectors.addAll(getDuplicateSearchCollectorsList());
1076
//		allCollectors.addAll(getDuplicateSearchCollectorsList());
1073
//		}
1077
//		}
1074
//		if (!allCollectors.isEmpty()) {
1078
//		if (!allCollectors.isEmpty()) {
1075
//			duplicateDetectorLabel = new Label(relatedBugsComposite, SWT.LEFT);
1079
//		duplicateDetectorLabel = new Label(relatedBugsComposite, SWT.LEFT);
1076
//			duplicateDetectorLabel.setText(LABEL_SELECT_DETECTOR);
1080
//		duplicateDetectorLabel.setText(LABEL_SELECT_DETECTOR);
1077
//
1081
1078
//			duplicateDetectorChooser = new CCombo(relatedBugsComposite, SWT.FLAT | SWT.READ_ONLY | SWT.BORDER);
1082
//		duplicateDetectorChooser = new CCombo(relatedBugsComposite, SWT.FLAT | SWT.READ_ONLY | SWT.BORDER);
1079
//
1083
1080
//			duplicateDetectorChooser.setLayoutData(GridDataFactory.swtDefaults().hint(150, SWT.DEFAULT).create());
1084
//		duplicateDetectorChooser.setLayoutData(GridDataFactory.swtDefaults().hint(150, SWT.DEFAULT).create());
1081
//			duplicateDetectorChooser.setFont(TEXT_FONT);
1085
//		duplicateDetectorChooser.setFont(TEXT_FONT);
1082
//
1086
1083
//			Collections.sort(allCollectors, new Comparator<AbstractDuplicateDetector>() {
1087
//		Collections.sort(allCollectors, new Comparator<AbstractDuplicateDetector>() {
1084
//
1088
1085
//				public int compare(AbstractDuplicateDetector c1, AbstractDuplicateDetector c2) {
1089
//		public int compare(AbstractDuplicateDetector c1, AbstractDuplicateDetector c2) {
1086
//					return c1.getName().compareToIgnoreCase(c2.getName());
1090
//		return c1.getName().compareToIgnoreCase(c2.getName());
1087
//				}
1091
//		}
1088
//
1092
1089
//			});
1093
//		});
1090
//
1094
1091
//			for (AbstractDuplicateDetector detector : allCollectors) {
1095
//		for (AbstractDuplicateDetector detector : allCollectors) {
1092
//				duplicateDetectorChooser.add(detector.getName());
1096
//		duplicateDetectorChooser.add(detector.getName());
1093
//			}
1097
//		}
1094
//
1098
1095
//			duplicateDetectorChooser.select(0);
1099
//		duplicateDetectorChooser.select(0);
1096
//			duplicateDetectorChooser.setEnabled(true);
1100
//		duplicateDetectorChooser.setEnabled(true);
1097
//			duplicateDetectorChooser.setData(allCollectors);
1101
//		duplicateDetectorChooser.setData(allCollectors);
1098
//
1102
1099
//			if (allCollectors.size() > 0) {
1103
//		if (allCollectors.size() > 0) {
1100
//
1104
1101
//				searchForDuplicates = toolkit.createButton(relatedBugsComposite, LABEL_SEARCH_DUPS, SWT.NONE);
1105
//		searchForDuplicates = toolkit.createButton(relatedBugsComposite, LABEL_SEARCH_DUPS, SWT.NONE);
1102
//				GridData searchDuplicatesButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1106
//		GridData searchDuplicatesButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
1103
//				searchForDuplicates.setLayoutData(searchDuplicatesButtonData);
1107
//		searchForDuplicates.setLayoutData(searchDuplicatesButtonData);
1104
//				searchForDuplicates.addListener(SWT.Selection, new Listener() {
1108
//		searchForDuplicates.addListener(SWT.Selection, new Listener() {
1105
//					public void handleEvent(Event e) {
1109
//		public void handleEvent(Event e) {
1106
//						searchForDuplicates();
1110
//		searchForDuplicates();
1107
//					}
1111
//		}
1108
//				});
1112
//		});
1109
//			}
1113
//		}
1110
//		} else {
1114
//		} else {
1111
//			Label label = new Label(relatedBugsComposite, SWT.LEFT);
1115
//		Label label = new Label(relatedBugsComposite, SWT.LEFT);
1112
//			label.setText(LABEL_NO_DETECTOR);
1116
//		label.setText(LABEL_NO_DETECTOR);
1113
//		}
1117
//		}
1114
	}
1118
	}
1115
1119
Lines 1281-1293 Link Here
1281
		section.setClient(attachmentsComposite);
1285
		section.setClient(attachmentsComposite);
1282
1286
1283
		if (taskData.getAttachments().size() > 0) {
1287
		if (taskData.getAttachments().size() > 0) {
1284
1285
			attachmentsTable = toolkit.createTable(attachmentsComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
1288
			attachmentsTable = toolkit.createTable(attachmentsComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
1286
			attachmentsTable.setLinesVisible(true);
1289
			attachmentsTable.setLinesVisible(true);
1287
			attachmentsTable.setHeaderVisible(true);
1290
			attachmentsTable.setHeaderVisible(true);
1288
			attachmentsTable.setLayout(new GridLayout());
1291
			attachmentsTable.setLayout(new GridLayout());
1289
			GridData tableGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
1292
			GridData tableGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
1290
			attachmentsTable.setLayoutData(tableGridData);
1293
			attachmentsTable.setLayoutData(tableGridData);
1294
			attachmentsTable.setToolTipText("");
1295
1296
			/**
1297
			 * create ToolTip for attachment
1298
			 * 
1299
			 * @author Frank Becker (bug 194936)
1300
			 */
1301
			final TooltipLabelListener tooltipLabelListener = new TooltipLabelListener();
1302
			Listener tableListener = new Listener() {
1303
				Shell tooltip = null;
1304
1305
				Label label11 = null;
1306
1307
				Label label12 = null;
1308
1309
				Label label21 = null;
1310
1311
				Label label22 = null;
1312
1313
				Label label31 = null;
1314
1315
				Label label32 = null;
1316
1317
				Label label41 = null;
1318
1319
				Label label42 = null;
1320
1321
				Label label51 = null;
1322
1323
				Label label52 = null;
1324
1325
				Label label61 = null;
1326
1327
				Label label62 = null;
1328
1329
				Label label71 = null;
1330
1331
				Label label72 = null;
1332
1333
				public void handleEvent(Event event) {
1334
					switch (event.type) {
1335
					case SWT.KeyDown:
1336
					case SWT.Dispose:
1337
					case SWT.MouseMove: {
1338
						if (tooltip == null)
1339
							break;
1340
						tooltip.dispose();
1341
						tooltip = null;
1342
						label11 = null;
1343
						label12 = null;
1344
						label21 = null;
1345
						label22 = null;
1346
						label31 = null;
1347
						label32 = null;
1348
						label41 = null;
1349
						label42 = null;
1350
						label51 = null;
1351
						label52 = null;
1352
						label61 = null;
1353
						label62 = null;
1354
						label71 = null;
1355
						label72 = null;
1356
						break;
1357
					}
1358
					case SWT.MouseHover: {
1359
						Point coords = new Point(event.x, event.y);
1360
						TableItem item = attachmentsTable.getItem(coords);
1361
						if (item != null) {
1362
							int columnCount = attachmentsTable.getColumnCount();
1363
							for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) {
1364
								if (item.getBounds(columnIndex).contains(coords)) {
1365
									/* Dispose of the old tooltip (if one exists */
1366
									if (tooltip != null && !tooltip.isDisposed())
1367
										tooltip.dispose();
1368
1369
									/* Create a new Tooltip */
1370
									tooltip = new Shell(attachmentsTable.getShell(), SWT.ON_TOP | SWT.NO_FOCUS
1371
											| SWT.TOOL);
1372
									tooltip.setBackground(attachmentsTable.getDisplay().getSystemColor(
1373
											SWT.COLOR_INFO_BACKGROUND));
1374
									GridLayout layout = new GridLayout(2, false);
1375
									layout.marginWidth = 2;
1376
									tooltip.setLayout(layout);
1377
									label11 = new Label(tooltip, SWT.NONE);
1378
									label11.setForeground(attachmentsTable.getDisplay().getSystemColor(
1379
											SWT.COLOR_INFO_FOREGROUND));
1380
									label11.setBackground(attachmentsTable.getDisplay().getSystemColor(
1381
											SWT.COLOR_INFO_BACKGROUND));
1382
									label12 = new Label(tooltip, SWT.NONE);
1383
									label12.setForeground(attachmentsTable.getDisplay().getSystemColor(
1384
											SWT.COLOR_INFO_FOREGROUND));
1385
									label12.setBackground(attachmentsTable.getDisplay().getSystemColor(
1386
											SWT.COLOR_INFO_BACKGROUND));
1387
									label21 = new Label(tooltip, SWT.NONE);
1388
									label21.setForeground(attachmentsTable.getDisplay().getSystemColor(
1389
											SWT.COLOR_INFO_FOREGROUND));
1390
									label21.setBackground(attachmentsTable.getDisplay().getSystemColor(
1391
											SWT.COLOR_INFO_BACKGROUND));
1392
									label22 = new Label(tooltip, SWT.NONE);
1393
									label22.setForeground(attachmentsTable.getDisplay().getSystemColor(
1394
											SWT.COLOR_INFO_FOREGROUND));
1395
									label22.setBackground(attachmentsTable.getDisplay().getSystemColor(
1396
											SWT.COLOR_INFO_BACKGROUND));
1397
									label31 = new Label(tooltip, SWT.NONE);
1398
									label31.setForeground(attachmentsTable.getDisplay().getSystemColor(
1399
											SWT.COLOR_INFO_FOREGROUND));
1400
									label31.setBackground(attachmentsTable.getDisplay().getSystemColor(
1401
											SWT.COLOR_INFO_BACKGROUND));
1402
									label32 = new Label(tooltip, SWT.NONE);
1403
									label32.setForeground(attachmentsTable.getDisplay().getSystemColor(
1404
											SWT.COLOR_INFO_FOREGROUND));
1405
									label32.setBackground(attachmentsTable.getDisplay().getSystemColor(
1406
											SWT.COLOR_INFO_BACKGROUND));
1407
									label41 = new Label(tooltip, SWT.NONE);
1408
									label41.setForeground(attachmentsTable.getDisplay().getSystemColor(
1409
											SWT.COLOR_INFO_FOREGROUND));
1410
									label41.setBackground(attachmentsTable.getDisplay().getSystemColor(
1411
											SWT.COLOR_INFO_BACKGROUND));
1412
									label42 = new Label(tooltip, SWT.NONE);
1413
									label42.setForeground(attachmentsTable.getDisplay().getSystemColor(
1414
											SWT.COLOR_INFO_FOREGROUND));
1415
									label42.setBackground(attachmentsTable.getDisplay().getSystemColor(
1416
											SWT.COLOR_INFO_BACKGROUND));
1417
									label51 = new Label(tooltip, SWT.NONE);
1418
									label51.setForeground(attachmentsTable.getDisplay().getSystemColor(
1419
											SWT.COLOR_INFO_FOREGROUND));
1420
									label51.setBackground(attachmentsTable.getDisplay().getSystemColor(
1421
											SWT.COLOR_INFO_BACKGROUND));
1422
									label52 = new Label(tooltip, SWT.NONE);
1423
									label52.setForeground(attachmentsTable.getDisplay().getSystemColor(
1424
											SWT.COLOR_INFO_FOREGROUND));
1425
									label52.setBackground(attachmentsTable.getDisplay().getSystemColor(
1426
											SWT.COLOR_INFO_BACKGROUND));
1427
									label61 = new Label(tooltip, SWT.NONE);
1428
									label61.setForeground(attachmentsTable.getDisplay().getSystemColor(
1429
											SWT.COLOR_INFO_FOREGROUND));
1430
									label61.setBackground(attachmentsTable.getDisplay().getSystemColor(
1431
											SWT.COLOR_INFO_BACKGROUND));
1432
									label62 = new Label(tooltip, SWT.NONE);
1433
									label62.setForeground(attachmentsTable.getDisplay().getSystemColor(
1434
											SWT.COLOR_INFO_FOREGROUND));
1435
									label62.setBackground(attachmentsTable.getDisplay().getSystemColor(
1436
											SWT.COLOR_INFO_BACKGROUND));
1437
									label71 = new Label(tooltip, SWT.NONE);
1438
									label71.setForeground(attachmentsTable.getDisplay().getSystemColor(
1439
											SWT.COLOR_INFO_FOREGROUND));
1440
									label71.setBackground(attachmentsTable.getDisplay().getSystemColor(
1441
											SWT.COLOR_INFO_BACKGROUND));
1442
									label72 = new Label(tooltip, SWT.NONE);
1443
									label72.setForeground(attachmentsTable.getDisplay().getSystemColor(
1444
											SWT.COLOR_INFO_FOREGROUND));
1445
									label72.setBackground(attachmentsTable.getDisplay().getSystemColor(
1446
											SWT.COLOR_INFO_BACKGROUND));
1447
1448
									/* Store the TableItem with the label so we can pass the mouse event later */
1449
									label11.setData("_TableItem_", item);
1450
									label12.setData("_TableItem_", item);
1451
									label21.setData("_TableItem_", item);
1452
									label22.setData("_TableItem_", item);
1453
									label31.setData("_TableItem_", item);
1454
									label32.setData("_TableItem_", item);
1455
									label41.setData("_TableItem_", item);
1456
									label42.setData("_TableItem_", item);
1457
									label51.setData("_TableItem_", item);
1458
									label52.setData("_TableItem_", item);
1459
									label61.setData("_TableItem_", item);
1460
									label62.setData("_TableItem_", item);
1461
									label71.setData("_TableItem_", item);
1462
									label72.setData("_TableItem_", item);
1463
1464
									/* Set the tooltip text */
1465
									Object a = item.getData();
1466
									if (a instanceof RepositoryAttachment) {
1467
										RepositoryAttachment aa = (RepositoryAttachment) a;
1468
										label11.setText("ID");
1469
										label21.setText("Date");
1470
										label31.setText("Description");
1471
										label41.setText("Filename");
1472
										label51.setText("Creator");
1473
										label61.setText("Type");
1474
										label71.setText("URL");
1475
										label12.setText(aa.getAttributeValue("attachid"));
1476
										label22.setText(aa.getAttributeValue("date"));
1477
										label32.setText(aa.getAttributeValue("desc"));
1478
										label42.setText(aa.getAttributeValue("filename"));
1479
										label52.setText(aa.getCreator());
1480
										label62.setText(aa.getAttributeValue("type"));
1481
										label72.setText(aa.getAttributeValue("task.common.attachment.url"));
1482
									}
1483
1484
									/* Setup Listeners to remove the tooltip and transfer the received mouse events */
1485
									label11.addListener(SWT.MouseExit, tooltipLabelListener);
1486
									label11.addListener(SWT.MouseDown, tooltipLabelListener);
1487
									label12.addListener(SWT.MouseExit, tooltipLabelListener);
1488
									label12.addListener(SWT.MouseDown, tooltipLabelListener);
1489
									label21.addListener(SWT.MouseExit, tooltipLabelListener);
1490
									label21.addListener(SWT.MouseDown, tooltipLabelListener);
1491
									label22.addListener(SWT.MouseExit, tooltipLabelListener);
1492
									label22.addListener(SWT.MouseDown, tooltipLabelListener);
1493
									label31.addListener(SWT.MouseExit, tooltipLabelListener);
1494
									label31.addListener(SWT.MouseDown, tooltipLabelListener);
1495
									label32.addListener(SWT.MouseExit, tooltipLabelListener);
1496
									label32.addListener(SWT.MouseDown, tooltipLabelListener);
1497
									label41.addListener(SWT.MouseExit, tooltipLabelListener);
1498
									label41.addListener(SWT.MouseDown, tooltipLabelListener);
1499
									label42.addListener(SWT.MouseExit, tooltipLabelListener);
1500
									label42.addListener(SWT.MouseDown, tooltipLabelListener);
1501
									label51.addListener(SWT.MouseExit, tooltipLabelListener);
1502
									label51.addListener(SWT.MouseDown, tooltipLabelListener);
1503
									label52.addListener(SWT.MouseExit, tooltipLabelListener);
1504
									label52.addListener(SWT.MouseDown, tooltipLabelListener);
1505
									label61.addListener(SWT.MouseExit, tooltipLabelListener);
1506
									label61.addListener(SWT.MouseDown, tooltipLabelListener);
1507
									label62.addListener(SWT.MouseExit, tooltipLabelListener);
1508
									label62.addListener(SWT.MouseDown, tooltipLabelListener);
1509
									label71.addListener(SWT.MouseExit, tooltipLabelListener);
1510
									label71.addListener(SWT.MouseDown, tooltipLabelListener);
1511
									label72.addListener(SWT.MouseExit, tooltipLabelListener);
1512
									label72.addListener(SWT.MouseDown, tooltipLabelListener);
1513
1514
									/* Set the size and position of the tooltip */
1515
									Point size = tooltip.computeSize(550, 160);
1516
									Rectangle rect = item.getBounds(columnIndex);
1517
									Point pt = attachmentsTable.toDisplay(rect.x, rect.y);
1518
									tooltip.setBounds(pt.x, pt.y, size.x, size.y);
1519
1520
									/* Show it */
1521
									tooltip.setVisible(true);
1522
									break;
1523
								}
1524
							}
1525
						}
1526
					}
1527
					}
1528
				}
1529
			};
1530
			attachmentsTable.addListener(SWT.Dispose, tableListener);
1531
			attachmentsTable.addListener(SWT.KeyDown, tableListener);
1532
			attachmentsTable.addListener(SWT.MouseMove, tableListener);
1533
1534
			attachmentsTable.addListener(SWT.MouseHover, tableListener);
1291
1535
1292
			for (int i = 0; i < attachmentsColumns.length; i++) {
1536
			for (int i = 0; i < attachmentsColumns.length; i++) {
1293
				TableColumn column = new TableColumn(attachmentsTable, SWT.LEFT, i);
1537
				TableColumn column = new TableColumn(attachmentsTable, SWT.LEFT, i);
Lines 1563-1568 Link Here
1563
		}
1807
		}
1564
	}
1808
	}
1565
1809
1810
	/**
1811
	 * This listener is added to the tooltip so that it can either dispose itself if the mouse exits the tooltip or so
1812
	 * it can pass the selection event through to the table.
1813
	 */
1814
	final TooltipLabelListener tooltipLabelListener = new TooltipLabelListener();
1815
1816
	/**
1817
	 * create ToolTip for attachment
1818
	 * 
1819
	 * @author Frank Becker (bug 194936)
1820
	 */
1821
	final class TooltipLabelListener implements Listener {
1822
		private boolean isCTRLDown(Event e) {
1823
			return (e.stateMask & SWT.CTRL) != 0;
1824
		}
1825
1826
		/*
1827
		 * (non-Javadoc)
1828
		 * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
1829
		 */
1830
		public void handleEvent(Event event) {
1831
			Label label = (Label) event.widget;
1832
			Shell shell = label.getShell();
1833
			switch (event.type) {
1834
			case SWT.MouseDown: /* Handle a user Click */
1835
				/* Extract our Data */
1836
				Event e = new Event();
1837
				e.item = (TableItem) label.getData("_TableItem_");
1838
				Table table = ((TableItem) e.item).getParent();
1839
1840
				/* Construct the new Selection[] to show */
1841
				TableItem[] newSelection = null;
1842
				if (isCTRLDown(event)) {
1843
					/* We have 2 scenario's.  
1844
					 * 	1) We are selecting an already selected element - so remove it from the selected indices
1845
					 *  2) We are selecting a non-selected element - so add it to the selected indices
1846
					 */
1847
					TableItem[] sel = table.getSelection();
1848
					for (int i = 0; i < sel.length; ++i) {
1849
						if (e.item.equals(sel[i])) {
1850
							// We are de-selecting this element
1851
							newSelection = new TableItem[sel.length - 1];
1852
							System.arraycopy(sel, 0, newSelection, 0, i);
1853
							System.arraycopy(sel, i + 1, newSelection, i, sel.length - i - 1);
1854
							break;
1855
						}
1856
					}
1857
1858
					/*
1859
					 * If we haven't created the newSelection[] yet, than we are adding the newly selected element
1860
					 * into the list of selected indicies
1861
					 */
1862
					if (newSelection == null) {
1863
						newSelection = new TableItem[sel.length + 1];
1864
						System.arraycopy(sel, 0, newSelection, 0, sel.length);
1865
						newSelection[sel.length] = (TableItem) e.item;
1866
					}
1867
1868
				} else {
1869
					/* CTRL is not down, so we simply select the single element */
1870
					newSelection = new TableItem[] { (TableItem) e.item };
1871
				}
1872
				/* Set the new selection of the table and notify the listeners */
1873
				table.setSelection(newSelection);
1874
				table.notifyListeners(SWT.Selection, e);
1875
1876
				/* Remove the Tooltip */
1877
				shell.dispose();
1878
				table.setFocus();
1879
				break;
1880
			case SWT.MouseExit:
1881
				shell.dispose();
1882
				break;
1883
			}
1884
		}
1885
	};
1886
1566
	private void registerDropListener(final Control control) {
1887
	private void registerDropListener(final Control control) {
1567
		DropTarget target = new DropTarget(control, DND.DROP_COPY | DND.DROP_DEFAULT);
1888
		DropTarget target = new DropTarget(control, DND.DROP_COPY | DND.DROP_DEFAULT);
1568
		final TextTransfer textTransfer = TextTransfer.getInstance();
1889
		final TextTransfer textTransfer = TextTransfer.getInstance();
Lines 1742-1748 Link Here
1742
					}
2063
					}
1743
				});
2064
				});
1744
			}
2065
			}
1745
//		} else {
2066
//			} else {
1746
//			Label label = new Label(composite, SWT.LEFT);
2067
//			Label label = new Label(composite, SWT.LEFT);
1747
//			label.setText(LABEL_NO_DETECTOR);
2068
//			label.setText(LABEL_NO_DETECTOR);
1748
2069
Lines 1941-1947 Link Here
1941
			expandableComposite.setTitleBarForeground(toolkit.getColors().getColor(IFormColors.TITLE));
2262
			expandableComposite.setTitleBarForeground(toolkit.getColors().getColor(IFormColors.TITLE));
1942
2263
1943
//			expandableComposite.setText(taskComment.getNumber() + ": " + taskComment.getAuthorName() + ", "
2264
//			expandableComposite.setText(taskComment.getNumber() + ": " + taskComment.getAuthorName() + ", "
1944
//					+ formatDate(taskComment.getCreated()));
2265
//			+ formatDate(taskComment.getCreated()));
1945
2266
1946
			expandableComposite.addExpansionListener(new ExpansionAdapter() {
2267
			expandableComposite.addExpansionListener(new ExpansionAdapter() {
1947
				public void expansionStateChanged(ExpansionEvent e) {
2268
				public void expansionStateChanged(ExpansionEvent e) {
Lines 2857-2865 Link Here
2857
3178
2858
				String assignmentValue = "";
3179
				String assignmentValue = "";
2859
				// NOTE: removed this because we now have content assit
3180
				// NOTE: removed this because we now have content assit
2860
// if (opName.equals(REASSIGN_BUG_TO)) {
3181
//				if (opName.equals(REASSIGN_BUG_TO)) {
2861
// assignmentValue = repository.getUserName();
3182
//				assignmentValue = repository.getUserName();
2862
// }
3183
//				}
2863
				radioOptions[i] = toolkit.createText(buttonComposite, assignmentValue);
3184
				radioOptions[i] = toolkit.createText(buttonComposite, assignmentValue);
2864
				radioOptions[i].setFont(TEXT_FONT);
3185
				radioOptions[i].setFont(TEXT_FONT);
2865
				radioOptions[i].setLayoutData(radioData);
3186
				radioOptions[i].setLayoutData(radioData);
Lines 3009-3015 Link Here
3009
	public void setAttachContextEnabled(boolean attachContextEnabled) {
3330
	public void setAttachContextEnabled(boolean attachContextEnabled) {
3010
		this.attachContextEnabled = attachContextEnabled;
3331
		this.attachContextEnabled = attachContextEnabled;
3011
//		if (attachContextButton != null && attachContextButton.isEnabled()) {
3332
//		if (attachContextButton != null && attachContextButton.isEnabled()) {
3012
//			attachContextButton.setSelection(attachContext);
3333
//		attachContextButton.setSelection(attachContext);
3013
//		}
3334
//		}
3014
	}
3335
	}
3015
3336

Return to bug 194936