@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)); } } }
@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(""); }
@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; }