Exemplo n.º 1
0
    @Override
    protected void setValue(Object element, Object value) {
      if (element instanceof Resource) {
        ((Resource) element).setAssistant(String.valueOf(value));
      }

      if (element instanceof Repository) {
        for (Resource resource : ((Repository) element).getResources()) {
          resource.setAssistant(String.valueOf(value));
        }
      }
    }
Exemplo n.º 2
0
    @Override
    public StyledString getStyledText(Object element) {
      if (element instanceof IStructuredSelection)
        element = ((IStructuredSelection) element).getFirstElement();

      if (element instanceof Resource) {
        Resource resourceObject = (Resource) element;
        if (resourceObject.getAssistant() != null)
          return new StyledString(resourceObject.getAssistant());
        else new StyledString("");
      }

      return new StyledString("");
    }
Exemplo n.º 3
0
    @Override
    public StyledString getStyledText(Object element) {
      if (element instanceof IStructuredSelection)
        element = ((IStructuredSelection) element).getFirstElement();

      if (element instanceof Repository) {
        Repository repositoryNode = (Repository) element;
        StyledString styledString = new StyledString(repositoryNode.getName());
        return styledString;
      }

      if (element instanceof Resource) {
        Resource resourceObject = (Resource) element;
        StyledString styledString = new StyledString((String) resourceObject.getUri());

        return styledString;
      }

      return null;
    }