public with sharing class XNShowObjectCtl {
public String objName{get;set;}
public List<SelectOption> getObjNames(){
List<SelectOption> options = new List<SelectOption>();
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
for (Schema.SObjectType st : gd.values()) {
Schema.DescribeSObjectResult r = st.getDescribe();
if(r.isCustom() && r.isQueryable()){
options.add(new SelectOption(r.getName(), r.getLabel()));
}
}
return options;
}
}
VF Page:XNShowObject.page
<apex:page controller="XNShowObjectCtl" showHeader="true" sidebar="false" >
<apex:form >
<apex:selectList value="{!objName}" size="10" multiselect="false">
<apex:selectOptions value="{!ObjNames}"/>
</apex:selectList>
</apex:form>
</apex:page>