protected void buttonPressed(int buttonId) {
if (buttonId == NULL_ID) {
imgFile = null;
super.okPressed();
} else if (buttonId == IMPORT_ID) {
TreeSelection sel = (TreeSelection) view.getSelection();
if (sel != null && !sel.isEmpty()) {
Object element = sel.getFirstElement();
String path = null;
if (element instanceof IPackageFragmentRoot) {
path = ((IPackageFragmentRoot) element).getResource().getRawLocation().toFile().getAbsolutePath();
} else if (element instanceof IPackageFragment) {
path = ((IPackageFragment) element).getResource().getRawLocation().toFile().getAbsolutePath();