コード例 #1
0
 /*
  * check same ContextParameter or not.
  */
 private boolean checkIsSameContextParameter() {
   List<ContextItem> allContextItem = ContextUtils.getAllContextItem();
   for (IContext context : process.getContextManager().getListContext()) {
     for (IContextParameter param : context.getContextParameterList()) {
       if (allContextItem != null) {
         ContextItem contextItem =
             ContextUtils.getContextItemById(allContextItem, param.getSource());
         ContextType contextType =
             ContextUtils.getContextTypeByName(contextItem, context.getName(), true);
         ContextParameterType contextParameterType =
             ContextUtils.getContextParameterTypeByName(contextType, param.getName());
         if (!ContextUtils.samePropertiesForContextParameter(param, contextParameterType)) {
           return false;
         }
         // if don't open the job to run it(not use the "Detect and update all jobs"), will show
         // UpdateDetectionDialog to update the context ,after updated the item, the
         // contextComboViewer still
         // set the old one , so need refresh.
         IContext runJobViewContext = getSelectedContext();
         if (runJobViewContext != null) {
           for (IContextParameter tempContext : runJobViewContext.getContextParameterList()) {
             if (tempContext.getName().equals(contextParameterType.getName())
                 && !ContextUtils.samePropertiesForContextParameter(
                     tempContext, contextParameterType)) {
               return false;
             }
           }
         }
       }
     }
   }
   return true;
 }