/** @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int) */ public String getColumnText(Object element, int columnIndex) { ResolveStatus flagged = (ResolveStatus) element; switch (columnIndex) { case 0: return flagged.getStatus(); case 1: // TODO: this is wrong when hgroot not at project root return ((IFile) flagged.getAdapter(IFile.class)).getProjectRelativePath().toString(); } throw new IllegalStateException(); }
private static void openMergeEditor(ResolveStatus flagged) { IFile file = (IFile) flagged.getAdapter(IFile.class); CompareAction compareAction = new CompareAction(file); compareAction.setEnableMerge(true); compareAction.run(null); }
private static IFile getFile(ResolveStatus adaptable) { if (adaptable != null) { return (IFile) adaptable.getAdapter(IFile.class); } return null; }