NULL can not be used as a parameter in the viewer.setinput method, because if you use null, you will not pass the parameter to the ContentProvider. In TableTreeViewer, use the tabletree to set the layout data, not Table. When using dialog, set the parent Shell's getShell (), which returns the focus back to the caller when the dialog is turned off. The location of Table.getSelectionIndex () selected in the tabletreeViewer is inconsistent with the location retrieved in getElementat (). This may be a bug. When inheriting the Dialog of the JFACE, the BUTTONPRESSED method is overwritable, the last step must pass the method to the parent Dialog (using super.buttonpressed (buttonid); otherwise the open () method does not return the ID button ID. But The default ID (generally iDialogconstants.ok_id).