コード例 #1
0
  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);
        }
      }
    }
  }
コード例 #2
0
    @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;
    }
コード例 #3
0
 @Override
 protected boolean evaluate(final PropertyEditorPart part) {
   return (part.property().definition().getTypeClass() == Color.class);
 }
コード例 #4
0
 @Override
 protected boolean evaluate(final PropertyEditorPart part) {
   return (part.property().service(PossibleValuesService.class) != null);
 }