[JBoss JIRA] (FORGE-1847) UIContext.getSelection() always return null
by Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
Aslak Knutsen commented on FORGE-1847:
--------------------------------------
[~gastaldi] ok cool. Lincoln wanted me to report it just to figure out how it was suppose to work.. :)
> 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 George Gastaldi (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
George Gastaldi closed FORGE-1847.
----------------------------------
Resolution: Won't Fix
This is not a bug. UIContext.getSelection() is meant to be set by the commands so that the IDE can know which resource should be selected/opened.
Eg: https://github.com/forge/core/blob/master/projects/impl/src/main/java/org...
> 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 Aslak Knutsen (JIRA)
[ https://issues.jboss.org/browse/FORGE-1847?page=com.atlassian.jira.plugin... ]
Aslak Knutsen updated FORGE-1847:
---------------------------------
Description:
{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}
was:
{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 builder.getUIContext().getInitialSelection().get() works as expected.
> 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 Aslak Knutsen (JIRA)
Aslak Knutsen created FORGE-1847:
------------------------------------
Summary: 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 builder.getUIContext().getInitialSelection().get() works as expected.
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 6 months
[JBoss JIRA] (FORGE-1846) JAVA_CLASS_PICKER cause ClassCastException, FileResourceImpl not a JavaResource
by Aslak Knutsen (JIRA)
Aslak Knutsen created FORGE-1846:
------------------------------------
Summary: JAVA_CLASS_PICKER cause ClassCastException, FileResourceImpl not a JavaResource
Key: FORGE-1846
URL: https://issues.jboss.org/browse/FORGE-1846
Project: Forge
Issue Type: Bug
Components: UI - Eclipse
Reporter: Aslak Knutsen
The following Input field definition cause a ClassCast after selecting a Java CLass in IDE:
https://github.com/aslakknutsen/plugin-arquillian/blob/forge2/src/main/ja...
ClassCast happens here in value.getValue()
https://github.com/aslakknutsen/plugin-arquillian/blob/forge2/src/main/ja...
{code}
java.lang.ClassCastException: org.jboss.forge.addon.resource.FileResourceImpl cannot be cast to org.jboss.forge.addon.parser.java.resources.JavaResource
at org.jboss.forge.arquillian.command.CreateTestCommand.execute(CreateTestCommand.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:65)
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:81)
at org.jboss.forge.arquillian.command.CreateTestCommand_$$_javassist_df58287f-4463-4f0e-9276-0bba80b8d9b2.execute(CreateTestCommand_$$_javassist_df58287f-4463-4f0e-9276-0bba80b8d9b2.java)
at org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.execute(SingleCommandControllerImpl.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$1.call(ClassLoaderAdapterCallback.java:103)
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:34)
at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:76)
at org.jboss.forge.addon.ui.controller.CommandController_$$_javassist_f88a89a7-67f8-48a7-a982-93a6bd1c3d8a.execute(CommandController_$$_javassist_f88a89a7-67f8-48a7-a982-93a6bd1c3d8a.java)
at org.jboss.tools.forge.ui.internal.ext.wizards.ForgeWizard$1.run(ForgeWizard.java:90)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
{code}
--
This message was sent by Atlassian JIRA
(v6.2.3#6260)
10 years, 6 months