Fixing CoreException when refreshing (Eclipse v3)

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2156 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Philippe Herlin
2003-08-05 19:27:41 +00:00
parent 59f743f188
commit 42ba9a88bb

View File

@ -49,6 +49,9 @@ import org.eclipse.ui.part.ViewPart;
* @version $Revision$
*
* $Log$
* Revision 1.2 2003/08/05 19:27:41 phherlin
* Fixing CoreException when refreshing (Eclipse v3)
*
* Revision 1.1 2003/07/07 19:24:54 phherlin
* Adding PMD violations view
*
@ -94,7 +97,9 @@ public class ViolationView extends ViewPart implements IOpenListener, ISelection
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
public void setFocus() {
violationTableViewer.getControl().setFocus();
if (!violationTableViewer.getControl().isDisposed()) {
violationTableViewer.getControl().setFocus();
}
}
/**
@ -141,9 +146,13 @@ public class ViolationView extends ViewPart implements IOpenListener, ISelection
* Force the violation table to refresh
*/
public void refresh() {
violationTableViewer.getControl().setRedraw(false);
violationTableViewer.refresh();
violationTableViewer.getControl().setRedraw(true);
// Seems this can be called when table is disposed ; so test before
// refreshing
if (!violationTableViewer.getControl().isDisposed()) {
violationTableViewer.getControl().setRedraw(false);
violationTableViewer.refresh();
violationTableViewer.getControl().setRedraw(true);
}
}
/**
@ -285,7 +294,7 @@ public class ViolationView extends ViewPart implements IOpenListener, ISelection
}
workspace.endOperation(false, null);
} catch (CoreException e) {
// do nothing
; // do nothing
}
}
}