public static void collectProperties(final SapphirePart part, final Set<Property> result) { if (part.visible()) { if (part instanceof ContainerPart) { for (FormComponentPart child : ((ContainerPart<?>) part).children().visible()) { collectProperties(child, result); } } else if (part instanceof WithPart) { final WithPart w = ((WithPart) part); result.add(w.property()); } else if (part instanceof PropertyEditorPart) { final PropertyEditorPart editor = (PropertyEditorPart) part; if (!editor.isReadOnly()) { result.add(editor.property()); } for (SapphirePart related : editor.getRelatedContent()) { collectProperties(related, result); } } } }
@Override protected boolean evaluate(final PropertyEditorPart part) { final Property property = part.property(); if (property instanceof Value && property.definition().isOfType(JavaTypeName.class)) { final Reference referenceAnnotation = property.definition().getAnnotation(Reference.class); return (referenceAnnotation != null && referenceAnnotation.target() == JavaType.class && property.element().adapt(IJavaProject.class) != null); } return false; }
@Override protected boolean evaluate(final PropertyEditorPart part) { return (part.property().definition().getTypeClass() == Color.class); }
@Override protected boolean evaluate(final PropertyEditorPart part) { return (part.property().service(PossibleValuesService.class) != null); }