Source:
public void addBookmark(final IFile bookmarksFile) { fBookmarksFile = bookmarksFile; final TableItem[] selection = fTable.getSelection(); if (selection.length > 0) { final TableItem tableItem = selection[0]; if (tableItem.getData(Key.RANK) != null) { final StringBuffer defaultMessage = new StringBuffer(); for (int i : fTable.getColumnOrder()) { TableColumn column = fTable.getColumns()[i]; if (i >= EVENT_COLUMNS_START_INDEX && (column.getResizable() || column.getWidth() > 0)) { if (defaultMessage.length() > 0) { defaultMessage.append(", "); } defaultMessage.append(tableItem.getText(i)); } } final AddBookmarkDialog dialog = new AddBookmarkDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), defaultMessage.toString()); if (dialog.open() == Window.OK) { final String message = dialog.getValue(); try { final Long rank = (Long) tableItem.getData(Key.RANK); final String location = NLS.bind(Messages.TmfMarker_LocationRank, rank.toString()); final ITmfTimestamp timestamp = (ITmfTimestamp) tableItem.getData(Key.TIMESTAMP); final long[] id = new long[1]; ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { final IMarker bookmark = bookmarksFile.createMarker(IMarker.BOOKMARK); bookmark.setAttribute(IMarker.MESSAGE, message.toString()); bookmark.setAttribute(IMarker.LOCATION, location); bookmark.setAttribute(ITmfMarker.MARKER_RANK, rank.toString()); bookmark.setAttribute(ITmfMarker.MARKER_TIME, Long.toString(new TmfNanoTimestamp(timestamp).getValue())); bookmark.setAttribute(ITmfMarker.MARKER_COLOR, dialog.getColorValue().toString()); id[0] = bookmark.getId(); } }, null); fBookmarksMap.put(rank, id[0]); fTable.refresh(); } catch (final CoreException e) { displayException(e); } } } } }

Target:
public void addBookmark(final IFile bookmarksFile) { fBookmarksFile = bookmarksFile; final TableItem[] selection = fTable.getSelection(); if (selection.length > 0) { final TableItem tableItem = selection[0]; if (tableItem.getData(Key.RANK) != null) { final StringBuffer defaultMessage = new StringBuffer(); for (int i : fTable.getColumnOrder()) { TableColumn column = fTable.getColumns()[i]; if (isVisibleEventColumn(column)) { if (defaultMessage.length() > 0) { defaultMessage.append(", "); } defaultMessage.append(tableItem.getText(i)); } } final AddBookmarkDialog dialog = new AddBookmarkDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), defaultMessage.toString()); if (dialog.open() == Window.OK) { final String message = dialog.getValue(); try { final Long rank = (Long) tableItem.getData(Key.RANK); final String location = NLS.bind(Messages.TmfMarker_LocationRank, rank.toString()); final ITmfTimestamp timestamp = (ITmfTimestamp) tableItem.getData(Key.TIMESTAMP); final long[] id = new long[1]; ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { final IMarker bookmark = bookmarksFile.createMarker(IMarker.BOOKMARK); bookmark.setAttribute(IMarker.MESSAGE, message.toString()); bookmark.setAttribute(IMarker.LOCATION, location); bookmark.setAttribute(ITmfMarker.MARKER_RANK, rank.toString()); bookmark.setAttribute(ITmfMarker.MARKER_TIME, Long.toString(new TmfNanoTimestamp(timestamp).getValue())); bookmark.setAttribute(ITmfMarker.MARKER_COLOR, dialog.getColorValue().toString()); id[0] = bookmark.getId(); } }, null); fBookmarksMap.put(rank, id[0]); fTable.refresh(); } catch (final CoreException e) { displayException(e); } } } } }