[jbosstools-issues] [JBoss JIRA] (JBIDE-19690) CheckboxTable and the select buttons are not being disabled

George Gastaldi (JIRA) issues at jboss.org
Mon Jun 8 11:06:03 EDT 2015


    [ https://issues.jboss.org/browse/JBIDE-19690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13075521#comment-13075521 ] 

George Gastaldi commented on JBIDE-19690:
-----------------------------------------

Hi [~psrna],

1) Create an Addon project, choose the ui addon as the single dependency (for speed purposes)
2) Create a command as the following: 
{code:java}
import java.lang.annotation.ElementType;
import java.util.concurrent.Callable;

import javax.inject.Inject;

import org.jboss.forge.addon.ui.command.AbstractUICommand;
import org.jboss.forge.addon.ui.context.UIBuilder;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.input.UIInput;
import org.jboss.forge.addon.ui.input.UIInputMany;
import org.jboss.forge.addon.ui.metadata.WithAttributes;
import org.jboss.forge.addon.ui.result.Result;
import org.jboss.forge.addon.ui.result.Results;

public class ExampleCommand extends AbstractUICommand
{
   @Inject
   @WithAttributes(label = "Enabled?", defaultValue = "true")
   private UIInput<Boolean> enabled;

   @Inject
   private UIInputMany<ElementType> types;

   @Override
   public void initializeUI(UIBuilder builder) throws Exception
   {
      types.setEnabled(new Callable<Boolean>()
      {
         @Override
         public Boolean call() throws Exception
         {
            return enabled.getValue();
         }
      });
      builder.add(enabled).add(types);
   }

   @Override
   public Result execute(UIExecutionContext context) throws Exception
   {
      return Results.success();
   }
}
{code}

3) Build and install the addon
4) Select the "Example" command and uncheck the "Enabled?" checkbox.

You should see the checkbox table and the select buttons disabled 

> CheckboxTable and the select buttons are  not being disabled
> ------------------------------------------------------------
>
>                 Key: JBIDE-19690
>                 URL: https://issues.jboss.org/browse/JBIDE-19690
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: forge
>    Affects Versions: 4.3.0.Alpha2
>            Reporter: George Gastaldi
>            Assignee: George Gastaldi
>            Priority: Minor
>             Fix For: 4.3.0.Beta1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jbosstools-issues mailing list