Svatopluk Dedic created NETBEANS-1985:
-----------------------------------------

             Summary: Stateful context action does not initialize properly
                 Key: NETBEANS-1985
                 URL: https://issues.apache.org/jira/browse/NETBEANS-1985
             Project: NetBeans
          Issue Type: Bug
          Components: platform - Actions
            Reporter: Svatopluk Dedic
            Assignee: Svatopluk Dedic


Consider an action like
{code:java}
@ActionRegistration(displayName = "My toggle action", 
   checkedOn = @ActionState(property = "myProperty")
) 
public final class MyToggleAction implements ActionListener { 
  BeanModel model; 
  public PredSuccAction(BeanModel model) { this.model = model; }
...
{code}
This action is *context-aware* and will be bound to the context Lookup. 
However, its initial state will initialize according to last-seen *global* 
model.

During debugging I've found code in *GeneralAction* (lines 473+), which 
replaces delegate's attributes (including "selected") with the global values. 
Just values which are not defined, i.e. come from the layer definitions should 
be replaced. Not the enabled, or selected state, if already present in the 
attrs.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to