Skip to content

Move non-Swing-specific object handling upstream #73

Description

@ctrueden

See e.g. #72. The logic for whether to use SwingObjectWidget belongs in the abstract layer in scijava-common, so that other UI implementations benefit as well.

Activity

  1. imagejan commented on Sep 6, 2022

    @imagejan
    Member

    I tried moving the logic from SwingObjectWidget here:

    return super.supports(model) && ((model.getChoices() != null && model.getChoices().length>0) ||
    ((model.getObjectPool() != null) && (model.getObjectPool().size() > 0)));

    ... into the ObjectWidget interface like this:

    	@Override
    	public default boolean supports(final WidgetModel model) {
    		return InputWidget.super.supports(model) && ((model.getChoices() != null && model.getChoices().length > 0)
    				|| ((model.getObjectPool() != null) && (model.getObjectPool().size() > 0)));
    	}

    ... but I cannot call ObjectWidget.super.supports in SwingObjectWidget because there's a more specific override in AbstractInputWidget.

    @ctrueden What's the right way to put that logic in the hierarchy of abstract classes and interfaces?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions