/*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
   */
  public Image getImage(Object objects) {
    Node node = null;
    if (objects == null || objects.equals(StructuredSelection.EMPTY)) {
      return null;
    }
    if (!(objects instanceof IStructuredSelection)) {
      return null;
    }
    final boolean[] multiple = {false};
    Object object = getObject(objects, multiple);
    if (object == null) {
      return null;
    }

    if ((object instanceof NodeTreeEditPart)) {
      node = (Node) ((NodeTreeEditPart) object).getModel();
    } else {
      if (object instanceof NodeReturnsTreeEditPart) {
        node = lastNode;
      } else {
        if (object instanceof ProcessPart) {
          return ImageProvider.getImage(ECoreImage.PROCESS_ICON);
        }
        if (object instanceof ConnectionPart) {
          return ImageProvider.getImage(EImage.RIGHT_ICON);
        }
        if (object instanceof NoteEditPart) {
          return ImageProvider.getImage(ECoreImage.CODE_ICON);
        }
        if (object instanceof ConnLabelEditPart) {
          return ImageProvider.getImage(EImage.RIGHT_ICON);
        }
        if ((object instanceof NodeLabelEditPart)) {
          node = ((NodeContainer) ((NodeLabelEditPart) object).getParent().getModel()).getNode();
        }
        if (!(object instanceof NodePart)) {
          return null;
        }
        if (node == null) {
          node = (Node) ((NodePart) object).getModel();
        }
      }
    }
    if (lastNode != node) {
      lastNode = node;
    }
    return CoreImageProvider.getComponentIcon(node.getComponent(), ICON_SIZE.ICON_24);
  }
 @Override
 public void execute() {
   if (findProcessProvider != null) {
     oldImage = findProcessProvider.getIcons(process);
     findProcessProvider.setIcons((IProcess) elem, newImage);
   }
   if (changeCmd != null) {
     changeCmd.execute();
   }
   // see bug 15062
   final Item item = process.getProperty().getItem();
   if (item instanceof JobletProcessItem) {
     String label = item.getProperty().getLabel();
     CoreImageProvider.removeComponentImage(label);
   } // end
 }
Ejemplo n.º 3
0
 @Override
 public Image getImage() {
   return CoreImageProvider.getImage(type);
 }
Ejemplo n.º 4
0
 /*
  * (non-Javadoc)
  *
  * @see org.talend.repository.localprovider.imports.TreeBuilder.IContainerNode#getImage()
  */
 @Override
 public Image getImage() {
   return CoreImageProvider.getImage(ERepositoryObjectType.FOLDER);
 }