Adds a constraint to when the given action can be used.

@param button the button which the constraint applies to.
@param constraint the constraint to add.
6733
public void addActionConstraint(final WButton button, final ActionConstraint constraint) {
		if (button.getParent() != actions) {
			throw new IllegalArgumentException(
					"Can only add a constraint to a button which is in this table's actions");
		}

		getOrCreateComponentModel().addActionConstraint(button, constraint);
	}
1071022
public void setDefaultButton(SBaseButton button)
    {
        this.getScreenFieldView().setDefaultButton(button == null ? null : button.getScreenFieldView());
    }
204780
public void addAlphaConstraint(AlphaNodeFieldConstraint constraint) {
        if ( constraint != null ) {
            AlphaNodeFieldConstraint[] tmp = this.alphaConstraints;
            this.alphaConstraints = new AlphaNodeFieldConstraint[tmp.length + 1];
            System.arraycopy( tmp,
                              0,
                              this.alphaConstraints,
                              0,
                              tmp.length );
            this.alphaConstraints[this.alphaConstraints.length - 1] = constraint;
            this.updateRequiredDeclarations( constraint );
        }
    }
933064
protected void noteConstraints (int constrain, int size)
    {
        switch (constrain) {
        case HORIZONTAL:
            if (size == 0) {
                _constrain = HORIZONTAL;
            } else {
                _label.setTargetWidth(size);
            }
            break;

        case VERTICAL:
            if (size == 0) {
                _constrain = VERTICAL;
            } else {
                _label.setTargetHeight(size);
            }
            break;

        case GOLDEN:
            _label.setGoldenLayout();
            break;

        case NONE:
            // nothing doing
            break;

        default:
            throw new IllegalArgumentException("Invalid constraint orientation " + constrain);
        }
    }
217458
public function createConstraint(Constraint $constraint, $table)
    {
        $this->_execSql($this->_platform->getCreateConstraintSQL($constraint, $table));
    }
181864
public void addSparseConstraint(int component, int index, double value) {
    constraints.add(new Constraint(component, index, value));
  }
1190089
private static void addButton(JFrame frame, String s) {
        AnnotatedString as = new AnnotatedString(s);
        JButton button = new JButton(as.toString());
        button.setMnemonic(as.getMnemonic());
        button.setDisplayedMnemonicIndex(as.getMnemonicIndex());
        frame.getContentPane().add(button);

        System.out.println("\"" + s + "\" \"" + as + "\" '" + as.getMnemonic() + "' " + as.getMnemonicIndex());
    }
661517
public List<ActionConstraint> getActionConstraints(final WButton button) {
		List<ActionConstraint> constraints = getComponentModel().actionConstraints.get(button);
		return constraints == null ? null : Collections.unmodifiableList(constraints);
	}
278526
public void addConstraint( final FieldConstraint constraint ) {
        if ( this.constraints == null ) {
            this.constraints = new FieldConstraint[ 1 ];
            this.constraints[ 0 ] = constraint;
        } else {
            final FieldConstraint[] newList = new FieldConstraint[ this.constraints.length + 1 ];
            for ( int i = 0; i < this.constraints.length; i++ ) {
                newList[ i ] = this.constraints[ i ];
            }
            newList[ this.constraints.length ] = constraint;
            this.constraints = newList;
        }
    }
87343
public void addButton(Component button, boolean right) {

        if (right) {
            m_buttonPanelRight.addComponent(button);
        } else {
            m_buttonPanelLeft.addComponent(button);
            m_buttonPanelLeft.setVisible(true);
        }
    }
327118
def addButton(self, button, alignment=None):
        
        if alignment == None:
            if button.pos().x() < self.pos().x():
                alignment = Qt.AlignLeft
            else:
                alignment = Qt.AlignRight
        
        all_buttons = self.buttons()
        if button in all_buttons:
            return False
        
        # move the button to this edit
        button.setParent(self)
        button.setAutoRaise(True)
        button.setIconSize(self.iconSize())
        button.setCursor(Qt.ArrowCursor)
        button.setFixedSize(QSize(self.height() - 2, self.height() - 2))
        
        self._buttons.setdefault(alignment, [])
        self._buttons[alignment].append(button)
        self.adjustButtons()
        return True
866329
public final <C extends AbstractConstraint<?>> boolean addRoutingConstraint(String activity, C constraint) throws CompatibilityException {
                return addRoutingConstraint(activity, constraint, true);
        }
406979
private void addButtons() {
		// Validation Button
		WButton buttonValidate = new WButton("Validate and Update Bean");
		add(buttonValidate);
		buttonValidate.setAction(new ValidatingAction(messages.getValidationErrors(), layout) {
			@Override
			public void executeOnValid(final ActionEvent event) {
				WebUtilities.updateBeanValue(layout);
				messages.success("OK");
			}
		});

		// Update Bean
		WButton buttonUpdate = new WButton("Update Bean");
		add(buttonUpdate);
		buttonUpdate.setAction(new Action() {

			@Override
			public void execute(final ActionEvent event) {
				WebUtilities.updateBeanValue(layout);
			}
		});

		// Reset Inputs
		WButton buttonReset = new WButton("Reset Inputs");
		add(buttonReset);
		buttonReset.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				layout.reset();
			}
		});

		// Reset Bean
		WButton buttonBean = new WButton("Reset Bean");
		add(buttonBean);
		buttonBean.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				InputBeanBindingExample.this.setBean(new MyDemoBean());
			}
		});

		add(new WButton("submit"));
	}
643564
public void addButtonRight(Component button) {

        if (m_buttonsFolded && !isAlwaysShow(button)) {
            m_rightButtons.addComponent(button);
        } else {
            int dropDownIndex = m_itemsRight.getComponentIndex(m_userDropDown);
            if (dropDownIndex >= 0) {
                m_itemsRight.addComponent(button, dropDownIndex);
            } else {
                m_itemsRight.addComponent(button);
            }
        }
        updateFoldingThreshhold();
    }
806964
private void addActivityWithConstraints(String activity) {
		Validate.notNull(activity);
		Validate.notEmpty(activity);
		Set<String> currentActivities = getActivitiesWithRoutingConstraints();
		currentActivities.add(activity);
		setProperty(ConstraintContextProperty.ACTIVITIES_WITH_CONSTRAINTS, ArrayUtils.toString(currentActivities.toArray()));
	}
115188
def add_button(self, button):
    """"""
    self._buttons.append(button)
    self._components[button.component_number] = button
1016447
public void setActiveButton(I_CmsToolbarButton button) {

        m_activeButton = button;
        setEditButtonsVisible((button == null) || m_editor.getSelection().equals(button));
    }