Skip to content

Commit

Permalink
TEIIDDES-2559: Vdb Editor not displaying udf jar files
Browse files Browse the repository at this point in the history
* Vdbs contain udf jar archives and retain them when saved. However, those
  udf files not in the workspace fail to be displayed in the Vdb Editor
  tables.

* The TableViewer requires that each row have an image. Yet, images are
  obtained by finding the element in the workspace and for those Vdbs
  containing files not in the workspace, the image returned is null.

* Fallback to a standard 'file' icon for those files not in the workspace.
  • Loading branch information
Paul Richardson committed Dec 15, 2015
1 parent 5f7fd07 commit a06a902
Showing 1 changed file with 14 additions and 2 deletions.
Expand Up @@ -79,6 +79,8 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.model.WorkbenchLabelProvider;
Expand Down Expand Up @@ -1043,7 +1045,12 @@ void openEditor( final VdbEntry entry ) {
*/
@Override
public Image getImage( final VdbEntry element ) {
return workbenchLabelProvider.getImage(element.findFileInWorkspace());
Image img = workbenchLabelProvider.getImage(element.findFileInWorkspace());
if (img == null) {
img = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
}

return img;
}

/**
Expand Down Expand Up @@ -1280,7 +1287,12 @@ void openEditor( final VdbEntry entry ) {
*/
@Override
public Image getImage( final VdbEntry element ) {
return workbenchLabelProvider.getImage(element.findFileInWorkspace());
Image img = workbenchLabelProvider.getImage(element.findFileInWorkspace());
if (img == null) {
img = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
}

return img;
}

/**
Expand Down

0 comments on commit a06a902

Please sign in to comment.