Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

introduced "Default" widget type for sitemaps that is dynamically resolved #1535

Merged
merged 1 commit into from
May 19, 2016

Conversation

kaikreuzer
Copy link
Contributor

This partially addresses #635 as it is now possible to simply use a "Default" widget with a Player item, so that the switch buttons are rendered.

Signed-off-by: Kai Kreuzer [email protected]

@maggu2810
Copy link
Contributor

I am not familiar with that code, but why to the default widget be resolved all the time if the instance is already a default one?

return result;
}

private Widget resolveDefault(Widget widget) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the code be simpler (less ifs above) if we

  • return widget; if it is not an instance of Default
  • change the method so you can give the fallback: private Widget resolveDefault(Widget widget, Widget fallback) and return fallback; at the end (so you can use resolveDefault(widget, null) or resolveDefault(widget, widget)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the code according to your suggestions. It looks only slightly better, though ;-)

@kaikreuzer
Copy link
Contributor Author

The feature allows the SitemapProvider to simply say "use default widget type of this item" and the framework (uiregistry) then resolves the widget type dynamically (the uis then expect a concrete type).

} catch (NumberFormatException e) {
// no valid number, so the requested page id does not exist
}
}
if (w instanceof Default) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed now

@kaikreuzer
Copy link
Contributor Author

Ok, new try - does this look better to you?

@maggu2810 maggu2810 merged commit a84caa9 into eclipse-archived:master May 19, 2016
@maggu2810
Copy link
Contributor

👍 😉

@kaikreuzer
Copy link
Contributor Author

Uff, thanks ;-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants