Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/problemsview/ProblemsView.java |
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/problemsview/ProblemsView.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/problemsview/ProblemsView.java |
index 75766c3b3ed13fd2b4c0881198474f6581424f32..b2aa132f1f9ea596c621df116826de1285374262 100644 |
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/problemsview/ProblemsView.java |
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/problemsview/ProblemsView.java |
@@ -58,6 +58,7 @@ import org.eclipse.jface.viewers.DoubleClickEvent; |
import org.eclipse.jface.viewers.IColorProvider; |
import org.eclipse.jface.viewers.IDecoration; |
import org.eclipse.jface.viewers.IDoubleClickListener; |
+import org.eclipse.jface.viewers.ILabelProvider; |
import org.eclipse.jface.viewers.ISelection; |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
import org.eclipse.jface.viewers.IStructuredSelection; |
@@ -199,6 +200,18 @@ public class ProblemsView extends ViewPart implements MarkersChangeService.Marke |
} |
} |
+ private static class CorrectionLabelProvider extends ColumnLabelProvider { |
+ @Override |
+ public String getText(Object element) { |
+ if (element instanceof IMarker) { |
+ IMarker marker = (IMarker) element; |
+ return marker.getAttribute(DartCore.MARKER_ATTR_CORRECTION, null); |
Brian Wilkerson
2015/02/12 19:09:33
If the attribute doesn't exist, should we return "
scheglov
2015/02/12 19:16:32
It is OK to return null.
We don't want to show any
|
+ } else { |
+ return super.getText(element); |
+ } |
+ } |
+ } |
+ |
private static class DescriptionLabelProvider extends ColumnLabelProvider { |
@Override |
public Image getImage(Object element) { |
@@ -773,7 +786,8 @@ public class ProblemsView extends ViewPart implements MarkersChangeService.Marke |
} |
} |
- public static final ColumnLabelProvider LABEL_PROVIDER = new DescriptionLabelProvider(); |
+ public static final ILabelProvider DESCRIPTION_LABEL_PROVIDER = new DescriptionLabelProvider(); |
+ public static final ILabelProvider CORRECTION_LABEL_PROVIDER = new CorrectionLabelProvider(); |
private final PageSelectionListener pageSelectionListener = new PageSelectionListener(); |
@@ -942,6 +956,13 @@ public class ProblemsView extends ViewPart implements MarkersChangeService.Marke |
fileNameColumn.getColumn().setResizable(true); |
enableSorting(fileNameColumn.getColumn(), 1); |
+ TableViewerColumn correctionColumn = new TableViewerColumn(tableViewer, SWT.LEFT); |
+ correctionColumn.setLabelProvider(new CorrectionLabelProvider()); |
+ correctionColumn.getColumn().setText("Correction"); |
+ correctionColumn.getColumn().setWidth(520); |
+ correctionColumn.getColumn().setResizable(true); |
+ enableSorting(correctionColumn.getColumn(), 2); |
+ |
tableViewer.getTable().setSortColumn(fileNameColumn.getColumn()); |
restoreColumnWidths(); |