ActionButton has been clicked, and validation should be run on the current
visible form. If this validation passes, an action event will be returned.

@return the action event of the current visible form or null if validation failed
975079
@Nullable
    public Object onActionPressed() {
        View existingForm = getChildAt(getChildCount() == 1 ? 0 : 2);
        if (existingForm != null) {
            FormView form = (FormView) existingForm;
            return form.submitForm();
        }
        return null;
    }
795193
@Override
	public void actionPerformed(ActionEvent event) {

		Object mysource = event.getSource();

		if ( ! (mysource instanceof JComboBox )) {
			super.actionPerformed(event);
			return;
		}

		@SuppressWarnings("unchecked")
		JComboBox<String> source = (JComboBox<String>) event.getSource();
		String value = source.getSelectedItem().toString();
		evalString("save selection; ");

		String selectLigand = "select ligand;wireframe 0.16;spacefill 0.5; color cpk ;";

		if ( value.equals("Cartoon")){
			String script = "hide null; select all;  spacefill off; wireframe off; backbone off;" +
					" cartoon on; " +
					" select ligand; wireframe 0.16;spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);
		} else if (value.equals("Backbone")){
			String script = "hide null; select all; spacefill off; wireframe off; backbone 0.4;" +
					" cartoon off; " +
					" select ligand; wireframe 0.16;spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);
		} else if (value.equals("CPK")){
			String script = "hide null; select all; spacefill off; wireframe off; backbone off;" +
					" cartoon off; cpk on;" +
					" select ligand; wireframe 0.16;spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);

		} else if (value.equals("Ligands")){
			this.executeCmd("restrict ligand; cartoon off; wireframe on;  display selected;");
		} else if (value.equals("Ligands and Pocket")){
			this.executeCmd(" select within (6.0,ligand); cartoon off; wireframe on; backbone off; display selected; ");
		} else if ( value.equals("Ball and Stick")){
			String script = "hide null; restrict not water;  wireframe 0.2; spacefill 25%;" +
					" cartoon off; backbone off; " +
					" select ligand; wireframe 0.16; spacefill 0.5; color cpk; " +
					" select *.FE; spacefill 0.7; color cpk ; " +
					" select *.CU; spacefill 0.7; color cpk ; " +
					" select *.ZN; spacefill 0.7; color cpk ; " +
					" select all; ";
			this.executeCmd(script);
		} else if ( value.equals("By Chain")){
			jmolColorByChain();
			String script = "hide null; select all;set defaultColors Jmol; color_by_chain(\"cartoon\"); color_by_chain(\"\"); " + selectLigand + "; select all; ";
			this.executeCmd(script);
		} else if ( value.equals("Rainbow")) {
			this.executeCmd("hide null; select all; set defaultColors Jmol; color group; color cartoon group; " + selectLigand + "; select all; " );
		} else if ( value.equals("Secondary Structure")){
			this.executeCmd("hide null; select all; set defaultColors Jmol; color structure; color cartoon structure;" + selectLigand + "; select all; " );

		} else if ( value.equals("By Element")){
			this.executeCmd("hide null; select all; set defaultColors Jmol; color cpk; color cartoon cpk; " + selectLigand + "; select all; ");
		} else if ( value.equals("By Amino Acid")){
			this.executeCmd("hide null; select all; set defaultColors Jmol; color amino; color cartoon amino; " + selectLigand + "; select all; " );
		} else if ( value.equals("Hydrophobicity") ){
			this.executeCmd("hide null; set defaultColors Jmol; select hydrophobic; color red; color cartoon red; select not hydrophobic ; color blue ; color cartoon blue; "+ selectLigand+"; select all; ");
		} else if ( value.equals("Suggest Domains")){
			colorByPDP();
		} else if ( value.equals("Show SCOP Domains")){
			colorBySCOP();
		}
		evalString("restore selection; ");
	}
792228
protected final JButton getButtonCancel() {
        if (buttonCancel == null) {
            buttonCancel = new JButton();
            buttonCancel.setText("Cancel");
            buttonCancel.setPreferredSize(new Dimension(80, 26));
            buttonCancel.addActionListener(new ActionListener() {
                public void actionPerformed(final ActionEvent e) {
                    if (destDirSelector != null) {
                        destDirSelector.cancel();
                    }
                }
            });
        }
        return buttonCancel;
    }
519101
protected void _notifyActionComponentsNow()
  {
    for( Iterator iter = _mapItems.keySet().iterator(); iter.hasNext(); )
    {
      JComponent item = (JComponent)iter.next();
//      if( !item.isShowing() )
//      {
//        continue;
//      }

      Action action = (Action)item.getClientProperty( GenericAction.ACTION_PROPERTY );
      if( action == null )
      {
        if( item instanceof AbstractButton )
        {
          action = ((AbstractButton)item).getAction();
        }

        if( action == null )
        {
          continue;
        }
      }

      boolean bEnabled = action.isEnabled();

//      long lTime = System.currentTime();
//      boolean bEnabled = action.isEnabled();
//      long diff = System.currentTime() - lTime;
//      if( diff > 50 )
//      {
//        //!! Uncomment following line and set a break point there to debug poor performing isEnabled() impl.
//        //action.isEnabled();
//
//        ConditionalActionHandler cah = null;
//        if( action instanceof GenericAction )
//        {
//          cah = ((GenericAction)action).getConditionalActionHandler();
//        }
//        System.out.println( "!!!!!!!!!!!!!!!!!!!!!!!\n" +
//                            "An action.isEnabled() impl needs to be optimized.\nIt took " + diff + "ms to complete.\n" +
//                            (cah == null ? "" : "ConditionalActionHandler: " + cah.getClass().getName() + "\n") +
//                            "Debug UpdateNotifier.notifyActionComponentsNow() to find the naughty code." +
//                            "\n!!!!!!!!!!!!!!!!!!!!!!!" );
//      }

      if( item.isEnabled() != bEnabled )
      {
        item.setEnabled( bEnabled );
      }


      // Also handle "selected" state for togglable :) items

      if( action instanceof GenericAction )
      {
        boolean bSelected = ((GenericAction)action).isSelected();
        if( item instanceof JToggleButton )
        {
          JToggleButton tb = (JToggleButton)item;
          if( tb.isSelected() != bSelected )
          {
            tb.setSelected( bSelected );
          }
        }
        else if( item instanceof JCheckBoxMenuItem )
        {
          JCheckBoxMenuItem tb = (JCheckBoxMenuItem)item;
          if( tb.getState() != bSelected )
          {
            tb.setState( bSelected );
          }
        }
      }
    }
  }
216196
private JButton getBtnOK() {
		if (btnOK == null) {
			btnOK = new JButton();
			btnOK.setText(Constant.messages.getString("all.button.ok"));
			btnOK.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
					saveAndClose();
				}
			});

		}
		return btnOK;
	}
1072366
private JButton getBtnCancel() {
		if (btnCancel == null) {
			btnCancel = new JButton();
			btnCancel.setText(Constant.messages.getString("all.button.cancel"));
			btnCancel.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {
					getTxtPattern().discardAllEdits();
					FilterReplaceDialog.this.dispose();
				    exitCode = JOptionPane.CANCEL_OPTION;

				}
			});

		}
		return btnCancel;
	}
574581
@Override
    public void actionPerformed(ActionEvent e) {
        int row = table.convertRowIndexToModel(table.getEditingRow());
        fireEditingStopped();

        //  Invoke the Action
        ActionEvent event = new ActionEvent(
                table,
                ActionEvent.ACTION_PERFORMED,
                Integer.toString(row));
        action.actionPerformed(event);
    }
652300
@Override
  public ActionRequestValidationException validate() {
    ActionRequestValidationException validationException = super.validate();
    if (termsEncoding != null && termsEncoding.equals(TermsEncoding.BYTES)) {
      if (maxTermsPerShard == null) {
        validationException = ValidateActions.addValidationError("maxTermsPerShard not specified for terms encoding [bytes]", validationException);
      }
    }
    return validationException;
  }
1149119
function () {
        console.log('Evaluating action rules.');
        var context = this.validateAction();
        if (context.isValid) {
            this.allowExecution = true;
            this.validationContext.state = angularRulesEngine.ValidationContextState.Success;
        }
        else {
            this.allowExecution = false;
            this.validationContext.state = angularRulesEngine.ValidationContextState.Failure;
        }
    }
839239
@Override
    public void actionPerformed(ActionEvent event) {
        if (event.getSource().equals(LED_BLINKING_TIMER)) {
            currentLedImage = ledOn == true ? getLedImageOn() : getLedImageOff();
            ledOn ^= true;

            repaint();
        }
    }
1013209
private JButton getBtnOK() {
		if (btnOK == null) {
			btnOK = new JButton();
			btnOK.setText(Constant.messages.getString("all.button.ok"));
			btnOK.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
			btnOK.addActionListener(new java.awt.event.ActionListener() { 
				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) { 
				    FilterChangeUserAgentDialog.this.dispose();
				    exitCode = JOptionPane.OK_OPTION;

				}
			});
		}
		return btnOK;
	}
102592
private JButton getBtnDecline() {
		if (btnDecline == null) {
			btnDecline = new JButton();
			btnDecline.setText("Decline");
			btnDecline.addActionListener(new java.awt.event.ActionListener() {

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {
				    accepted = false;
				    System.exit(1);

				}
			});

		}
		return btnDecline;
	}
1360543
private ModelActionEntry pollAction()
    {
        ModelActionEntry action = null;
        
        while(!stop) {
           
            synchronized(actionQueue) {
                action = this.actionQueue.poll();
            }
            
            if (action != null) {
                break;
            }
            else {
                synchronized(semaphore) {
                    try {
                        semaphore.wait();
                    } catch (InterruptedException ex) {
                        ex.printStackTrace(); //////////
                    }
                }
            }

        }
        
        return action;
        
    }
87184
private JButton getBtnApply() {
		if (btnApply == null) {
			btnApply = new JButton();
			btnApply.setText(Constant.messages.getString("history.filter.button.apply"));
			btnApply.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
					
					try {
						filter.setMethods(methodList.getSelectedValuesList());
						filter.setCodes(codeList.getSelectedValuesList());
						filter.setTags(tagList.getSelectedValuesList());
						filter.setRisks(riskList.getSelectedValuesList());
						filter.setReliabilities(confidenceList.getSelectedValuesList());
						filter.setNote(notesComboBox.getSelectedItem());
						filter.setUrlIncPatternList(strToRegexList(regexInc.getText()));
						filter.setUrlExcPatternList(strToRegexList(regexExc.getText()));
						exitResult = JOptionPane.OK_OPTION;
						HistoryFilterPlusDialog.this.dispose();
					} catch (PatternSyntaxException e1) {
						// Invalid regex
						View.getSingleton().showWarningDialog(
										Constant.messages.getString("history.filter.badregex.warning", e1.getMessage())); 

					}
					
				}
			});

		}
		return btnApply;
	}
754890
public AccordionTriggerEvent getEvent()
	{
		String literal = this.options.getLiteral("event");
		return literal == null ? AccordionTriggerEvent.CLICK : AccordionTriggerEvent
			.valueOf(literal.toUpperCase());
	}
116956
function validateAction (action, interactable) {
        if (!isObject(action)) { return null; }

        var actionName = action.name,
            options = interactable.options;

        if ((  (actionName  === 'resize'   && options.resize.enabled )
            || (actionName      === 'drag'     && options.drag.enabled  )
            || (actionName      === 'gesture'  && options.gesture.enabled))
            && actionIsEnabled[actionName]) {

            if (actionName === 'resize' || actionName === 'resizeyx') {
                actionName = 'resizexy';
            }

            return action;
        }
        return null;
    }
942186
public void runAction(ActionType action) {

        m_mode = action;
        setActionFlags();
        setCommonParameters();
        m_checkinBean.clearModules();
        for (String moduleName : getSelectedModules()) {
            m_checkinBean.addModuleToExport(moduleName);
        }
        int result = m_checkinBean.checkIn();
        String log = m_checkinBean.getLogText();
        String message = null;
        boolean error = false;
        switch (action) {
            case checkIn:
                String messageToSave = m_checkinBean.getCommitMessage();
                String emailToSave = m_checkinBean.getGitUserEmail();
                String userToSave = m_checkinBean.getGitUserName();
                CmsObject cms = m_checkinBean.getCmsObject();
                CmsUser user = cms.getRequestContext().getCurrentUser();
                setUserInfo(user, ADDINFO_USER, userToSave);
                setUserInfo(user, ADDINFO_EMAIL, emailToSave);
                setUserInfo(user, ADDINFO_MESSAGE, messageToSave);
                try {
                    cms.writeUser(user);
                } catch (CmsException e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }

                List<Button> resetButtons = new ArrayList<Button>();

                Button resetHead = new Button(CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_HEAD_0));
                resetHead.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_HEAD_DESC_0));
                resetHead.addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        runAction(ActionType.resetHead);
                    }
                });

                Button resetRemoteHead = new Button(
                    CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_REMOTE_HEAD_0));
                resetRemoteHead.setDescription(
                    CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_REMOTE_HEAD_DESC_0));
                resetRemoteHead.addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        runAction(ActionType.resetRemoteHead);
                    }
                });

                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CHECKIN_SUCCESSFUL_0);
                } else if (result == 10) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CHECKIN_FAILED_0);
                    error = true;
                    resetButtons.add(resetRemoteHead);
                    resetButtons.add(resetHead);
                } else {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CHECKIN_FAILED_0);
                    error = true;
                    resetButtons.add(resetRemoteHead);
                }
                CmsGitActionResultPanel panel = new CmsGitActionResultPanel(message, log, error, resetButtons);
                addAsWindow(panel);
                break;
            case checkOut:
                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_IMPORT_SUCCESSFUL_0);
                } else {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_IMPORT_FAILED_0);
                }
                CmsGitActionResultPanel checkoutResult = new CmsGitActionResultPanel(
                    message,
                    log,
                    error,
                    new ArrayList<Button>());
                addAsWindow(checkoutResult);
                break;
            case resetHead:
                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_SUCCESSFUL_0);
                } else {
                    error = true;
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_FAILED_0);
                }
                CmsGitActionResultPanel resetResult = new CmsGitActionResultPanel(
                    message,
                    log,
                    error,
                    new ArrayList<Button>());
                addAsWindow(resetResult);
                break;
            case resetRemoteHead:
                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_SUCCESSFUL_0);
                } else {
                    error = true;
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_FAILED_0);
                }
                CmsGitActionResultPanel resetRemoteResult = new CmsGitActionResultPanel(
                    message,
                    log,
                    error,
                    new ArrayList<Button>());
                addAsWindow(resetRemoteResult);
                break;
            default:
                // Should never happen
        }
    }