コード例 #1
0
  /** @param event */
  protected void handleTreeSelectionChanged(SelectionChangedEvent event) {
    if (getModelController() == null) return;

    IRteDependencyItem d = getSelectedDependencyItem();
    if (d == null) return;

    IRteComponentItem item = d.getComponentItem();
    if (item != null) {
      getModelController().emitRteEvent(RteEvent.COMPONENT_SHOW, item);
    }
  }
コード例 #2
0
 @Override
 public String getString(Object obj, int index) {
   IRteDependencyItem item = getDependencyItem(obj);
   if (item != null) {
     switch (index) {
       case 0:
         return item.getName();
       case 1:
         return item.getDescription();
       default:
         break;
     }
   }
   return CmsisConstants.EMPTY_STRING;
 }
コード例 #3
0
    @Override
    public Image getImage(Object obj, int columnIndex) {
      if (columnIndex == 0) {
        IRteDependencyItem item = getDependencyItem(obj);
        if (item != null) {
          if (item.isMaster()) {
            EEvaluationResult res = item.getEvaluationResult();
            if (res == EEvaluationResult.FULFILLED && item.isDeny())
              res = EEvaluationResult.INCOMPATIBLE;
            switch (res) {
              case IGNORED:
              case UNDEFINED:
              case FULFILLED:
                break;
              case CONFLICT:
              case ERROR:
              case FAILED:
              case INCOMPATIBLE:
              case INCOMPATIBLE_API:
              case INCOMPATIBLE_BUNDLE:
              case INCOMPATIBLE_VARIANT:
              case INCOMPATIBLE_VENDOR:
              case INCOMPATIBLE_VERSION:
              case MISSING:
              case MISSING_API:
              case MISSING_BUNDLE:
              case MISSING_VARIANT:
              case MISSING_VENDOR:
              case MISSING_VERSION:
              case UNAVAILABLE:
              case UNAVAILABLE_PACK:
                return CpPlugInUI.getImage(CpPlugInUI.ICON_ERROR);

              case INACTIVE:
              case INSTALLED:
              case SELECTABLE:
                return CpPlugInUI.getImage(CpPlugInUI.ICON_WARNING);
              default:
                break;
            }
            return null;
          } else if (item.getComponentItem() != null) {
            IRteComponent component = item.getComponentItem().getParentComponent();
            if (component != null) {
              ICpComponentInfo ci = component.getActiveCpComponentInfo();
              int instances = component.getMaxInstanceCount();
              if (ci != null && ci.getComponent() == null) {
                if (instances > 1) return CpPlugInUI.getImage(CpPlugInUI.ICON_MULTICOMPONENT_ERROR);
                else return CpPlugInUI.getImage(CpPlugInUI.ICON_COMPONENT_ERROR);

              } else {
                if (instances > 1) return CpPlugInUI.getImage(CpPlugInUI.ICON_MULTICOMPONENT);
                else return CpPlugInUI.getImage(CpPlugInUI.ICON_COMPONENT);
              }
            }
          }
        }
      }
      return null;
    }