[JBoss JIRA] (FORGE-1847) UIContext.getSelection() always return null
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III closed FORGE-1847.
-------------------------------------
Fix Version/s: 2.5.1.Final
Resolution: Done
Implemented a sensible non-null default when getInitialSelection() has a value.
> UIContext.getSelection() always return null
> -------------------------------------------
>
> Key: FORGE-1847
> URL: https://issues.jboss.org/browse/FORGE-1847
> Project: Forge
> Issue Type: Bug
> Components: UI - Shell
> Affects Versions: 2.5.0.Final
> Reporter: Aslak Knutsen
> Assignee: Lincoln Baxter III
> Fix For: 2.5.1.Final
>
>
> {code}
> value.setDefaultValue(new Callable<JavaResource>() {
> @Override
> public JavaResource call() throws Exception {
> Object selected = builder.getUIContext().getSelection();
> if(selected != null && selected instanceof JavaResource) {
> return (JavaResource)selected;
> }
> return null;
> }
> });
> {code}
> Object selected is always null.
> Using InitalSelection works as expected.
> {code}
> Object selected = builder.getUIContext().getInitialSelection().get();
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 6 months
[JBoss JIRA] (FORGE-1847) UIContext.getSelection() always return null
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III commented on FORGE-1847:
-------------------------------------------
Actually I think we should probably alter this to return UISelection.get() from the user's context.getInitialSelection() in the case where no selection has explicitly been set. This would follow the practice of least surprise IMO.
> UIContext.getSelection() always return null
> -------------------------------------------
>
> Key: FORGE-1847
> URL: https://issues.jboss.org/browse/FORGE-1847
> Project: Forge
> Issue Type: Bug
> Components: UI - Shell
> Affects Versions: 2.5.0.Final
> Reporter: Aslak Knutsen
>
> {code}
> value.setDefaultValue(new Callable<JavaResource>() {
> @Override
> public JavaResource call() throws Exception {
> Object selected = builder.getUIContext().getSelection();
> if(selected != null && selected instanceof JavaResource) {
> return (JavaResource)selected;
> }
> return null;
> }
> });
> {code}
> Object selected is always null.
> Using InitalSelection works as expected.
> {code}
> Object selected = builder.getUIContext().getInitialSelection().get();
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 6 months
[JBoss JIRA] (FORGE-1847) UIContext.getSelection() always return null
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III reopened FORGE-1847:
---------------------------------------
Assignee: Lincoln Baxter III
> UIContext.getSelection() always return null
> -------------------------------------------
>
> Key: FORGE-1847
> URL: https://issues.jboss.org/browse/FORGE-1847
> Project: Forge
> Issue Type: Bug
> Components: UI - Shell
> Affects Versions: 2.5.0.Final
> Reporter: Aslak Knutsen
> Assignee: Lincoln Baxter III
>
> {code}
> value.setDefaultValue(new Callable<JavaResource>() {
> @Override
> public JavaResource call() throws Exception {
> Object selected = builder.getUIContext().getSelection();
> if(selected != null && selected instanceof JavaResource) {
> return (JavaResource)selected;
> }
> return null;
> }
> });
> {code}
> Object selected is always null.
> Using InitalSelection works as expected.
> {code}
> Object selected = builder.getUIContext().getInitialSelection().get();
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 6 months
[JBoss JIRA] (FORGE-1847) UIContext.getSelection() always return null
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III commented on FORGE-1847:
-------------------------------------------
We use this incorrectly in a number of addons in this case...
> UIContext.getSelection() always return null
> -------------------------------------------
>
> Key: FORGE-1847
> URL: https://issues.jboss.org/browse/FORGE-1847
> Project: Forge
> Issue Type: Bug
> Components: UI - Shell
> Affects Versions: 2.5.0.Final
> Reporter: Aslak Knutsen
>
> {code}
> value.setDefaultValue(new Callable<JavaResource>() {
> @Override
> public JavaResource call() throws Exception {
> Object selected = builder.getUIContext().getSelection();
> if(selected != null && selected instanceof JavaResource) {
> return (JavaResource)selected;
> }
> return null;
> }
> });
> {code}
> Object selected is always null.
> Using InitalSelection works as expected.
> {code}
> Object selected = builder.getUIContext().getInitialSelection().get();
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 6 months
[JBoss JIRA] (FORGE-1847) UIContext.getSelection() always return null
by Lincoln Baxter III (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
Lincoln Baxter III commented on FORGE-1847:
-------------------------------------------
Right, that's what I thought - we should probably document this better in the API.
> UIContext.getSelection() always return null
> -------------------------------------------
>
> Key: FORGE-1847
> URL: https://issues.jboss.org/browse/FORGE-1847
> Project: Forge
> Issue Type: Bug
> Components: UI - Shell
> Affects Versions: 2.5.0.Final
> Reporter: Aslak Knutsen
>
> {code}
> value.setDefaultValue(new Callable<JavaResource>() {
> @Override
> public JavaResource call() throws Exception {
> Object selected = builder.getUIContext().getSelection();
> if(selected != null && selected instanceof JavaResource) {
> return (JavaResource)selected;
> }
> return null;
> }
> });
> {code}
> Object selected is always null.
> Using InitalSelection works as expected.
> {code}
> Object selected = builder.getUIContext().getInitialSelection().get();
> {code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 6 months