code: public I_CmsDefaultAction getDefaultAction(
          I_CmsDialogContext context,
          I_CmsContextMenuItemProvider menuItemProvider) {
  
          I_CmsDefaultAction result = null;
          int resultRank = -1;
          if (context.getResources().size() == 1) {
              for (I_CmsContextMenuItem menuItem : menuItemProvider.getMenuItems()) {
                  if ((menuItem instanceof CmsContextMenuActionItem)
                      && (((CmsContextMenuActionItem)menuItem).getWorkplaceAction() instanceof I_CmsDefaultAction)) {
                      I_CmsDefaultAction action = (I_CmsDefaultAction)((CmsContextMenuActionItem)menuItem).getWorkplaceAction();
                      if (action.getVisibility(context).isActive()) {
                          if (result == null) {
                              result = action;
                              resultRank = action.getDefaultActionRank(context);
                          } else {
                              int rank = action.getDefaultActionRank(context);
                              if (rank > resultRank) {
                                  result = action;
                                  resultRank = rank;
                              }
                          }
                      }
                  }
              }
          }
          return result;
      }
docs: Returns the default action for the given context if available.<p>
  
  @param context the dialog context
  @param menuItemProvider the menu item provider
  
  @return the default action