public void setContext(DialogExplorerActionContext context) throws JavaModelException { super.setContext(context); if (context == null) return; List selectedElements= context.getSelectedElements(); IJavaProject project= context.getJavaProject();  int type= MULTI; if (selectedElements.size() == 0) { type= NULL_SELECTION;  if (type == fLastType) return;
public void setContext(ActionContext context) { try { setContext((DialogExplorerActionContext)context); } catch (JavaModelException e) { JavaPlugin.log(e);
    public void setContext(DialogExplorerActionContext context) throws JavaModelException {        super.setContext(context);        if (context == null) // can happen when disposing            return;        List selectedElements= context.getSelectedElements();        IJavaProject project= context.getJavaProject();                int type= MULTI;        if (selectedElements.size() == 0) {            type= NULL_SELECTION;                        if (type == fLastType)                return;        }        else if (selectedElements.size() == 1 || identicalTypes(selectedElements, project)) {            type= getType(selectedElements.get(0), project);                        if (selectedElements.size() > 1)                type= type | MULTI;                    if (type == fLastType)                return;        }                internalSetContext(selectedElements, project, type);    }