Rebuilds the buttons for the advanced actions.
183117
def rebuildButtons(self):
        
        for btn in self.findChildren(XAdvancedButton):
            btn.close()
            btn.setParent(None)
            btn.deleteLater()
        
        for standard, advanced in self._advancedMap.items():
            rect    = self.actionGeometry(standard)
            btn     = XAdvancedButton(self)
            btn.setFixedWidth(22)
            btn.setFixedHeight(rect.height())
            btn.setDefaultAction(advanced)
            btn.setAutoRaise(True)
            btn.move(rect.right() + 1, rect.top())
            btn.show()
            
            if btn.icon().isNull():
                btn.setIcon(QIcon(resources.find('img/advanced.png')))
            
            btn.clicked.connect(self.acceptAdvanced)
655094
def rebuild( self ):
        
        self._buildData.clear()
        self._dateGrid.clear()
        self._dateTimeGrid.clear()
        
        curr_min = self._minimumDate
        curr_max = self._maximumDate
        
        self._maximumDate = QDate()
        self._minimumDate = QDate()
        
        self.markForRebuild(False)
        
        # rebuilds the month view
        if ( self.currentMode() == XCalendarScene.Mode.Month ):
            self.rebuildMonth()
        elif ( self.currentMode() in (XCalendarScene.Mode.Week,
                                      XCalendarScene.Mode.Day)):
            self.rebuildDays()
        
        # rebuild the items in the scene
        items = sorted(self.items())
        for item in items:
            item.setPos(0, 0)
            item.hide()
        
        for item in items:
            if ( isinstance(item, XCalendarItem) ):
                item.rebuild()
        
        if ( curr_min != self._minimumDate or curr_max != self._maximumDate ):
            parent = self.parent()
            if ( parent and not parent.signalsBlocked() ):
                parent.dateRangeChanged.emit(self._minimumDate, 
                                             self._maximumDate)
349877
private void adaptWizardButtonVisibilities() {
        if (buttonBar != null && backButton != null && nextButton != null && finishButton != null &&
                navigationFragment != null) {
            int selectedNavigationPreferenceIndex =
                    navigationFragment.getSelectedNavigationPreferenceIndex();

            if (selectedNavigationPreferenceIndex != -1 && isButtonBarShown()) {
                int navigationPreferenceCount = navigationFragment.getNavigationPreferenceCount();
                backButton.setVisibility(
                        (selectedNavigationPreferenceIndex != 0) ? View.VISIBLE : View.GONE);
                nextButton.setVisibility(
                        (selectedNavigationPreferenceIndex != navigationPreferenceCount - 1) ?
                                View.VISIBLE : View.GONE);
                finishButton.setVisibility(
                        (selectedNavigationPreferenceIndex == navigationPreferenceCount - 1) ?
                                View.VISIBLE : View.GONE);
            } else if (isButtonBarShown()) {
                backButton.setVisibility(View.GONE);
                nextButton.setVisibility(View.GONE);
                finishButton.setVisibility(View.VISIBLE);
            }
        }
    }
1343738
public function rebuild()
    {
        $i = 0;
        $skip = [];
        while (0 != $this->filter(['lft__isnull' => true])->count()) {
            ++$i;
            $fixed = 0;
            echo 'Iteration: '.$i.PHP_EOL;

            $clone = clone $this;
            /** @var TreeModel[] $models */
            $models = $clone
                ->exclude(['pk__in' => $skip])
                ->filter(['lft__isnull' => true])
                ->order(['parent_id'])
                ->all();

            foreach ($models as $model) {
                $model->lft = $model->rgt = $model->level = $model->root = null;
                if ($model->saveRebuild()) {
                    $skip[] = $model->pk;
                    ++$fixed;
                }
                echo '.';
            }
            echo PHP_EOL;
            echo 'Fixed: '.$fixed.PHP_EOL;
        }
    }
333060
private void adaptButtonBarDividerMargin() {
        if (buttonBarDivider != null) {
            LinearLayout.LayoutParams layoutParams =
                    (LinearLayout.LayoutParams) buttonBarDivider.getLayoutParams();
            layoutParams.leftMargin = buttonBarDividerMargin;
            layoutParams.rightMargin = buttonBarDividerMargin;
            buttonBarDivider.setLayoutParams(layoutParams);
        }
    }
821278
void rebuildMenu() {

        if (!getSelectedIds().isEmpty() && (m_menuBuilder != null)) {
            m_menu.removeAllItems();
            m_menuBuilder.buildContextMenu(getContextProvider().getDialogContext(), m_menu);
        }
    }
538592
def updateUi(self):
        
        index = self._slideshow.currentIndex()
        count = self._slideshow.count()
        
        self._previousButton.setVisible(index != 0)
        self._nextButton.setText('Finish' if index == count - 1 else 'Next')
        self.autoLayout()
721072
public void rebuild(StaplerRequest req, JSONObject json, List<? extends Descriptor<T>> descriptors) throws FormException, IOException {
        List<T> newList = new ArrayList<>();

        for (Descriptor<T> d : descriptors) {
            T existing = get((D)d);
            String name = d.getJsonSafeClassName();
            JSONObject o = json.optJSONObject(name);

            T instance = null;
            if (o!=null) {
                if (existing instanceof ReconfigurableDescribable)
                    instance = (T)((ReconfigurableDescribable)existing).reconfigure(req,o);
                else
                    instance = d.newInstance(req, o);
            } else {
                if (existing instanceof ReconfigurableDescribable)
                    instance = (T)((ReconfigurableDescribable)existing).reconfigure(req,null);
            }

            if (instance!=null)
                newList.add(instance);
        }

        replaceBy(newList);
    }
281291
private void enableActions() {
        restoreAction.setEnabled(frame.isMaximum() || frame.isIcon());
        maximizeAction.setEnabled((frame.isMaximizable() && !frame.isMaximum() && !frame.isIcon())
                                      || (frame.isMaximizable() && frame.isIcon()));
        iconifyAction.setEnabled(frame.isIconifiable() && !frame.isIcon());
        closeAction.setEnabled(frame.isClosable());
        sizeAction.setEnabled(false);
        moveAction.setEnabled(false);
    }
1356754
private void setUpActionButtons() {
		// Buttons Panel
		WPanel buttonPanel = new WPanel();
		actionContainer.add(buttonPanel);

		// Edit Button
		final WButton editButton = new WButton("Edit") {
			@Override
			public boolean isVisible() {
				Object key = TableUtil.getCurrentRowKey();
				return !isEditRow(key);
			}
		};
		editButton.setImage("/image/pencil.png");
		editButton.setRenderAsLink(true);
		editButton.setToolTip("Edit");
		editButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				Object key = TableUtil.getCurrentRowKey();
				addEditRow(key);
			}
		});

		// Cancel Button
		final WButton cancelButton = new WButton("Cancel") {
			@Override
			public boolean isVisible() {
				Object key = TableUtil.getCurrentRowKey();
				return isEditRow(key);
			}
		};
		cancelButton.setImage("/image/cancel.png");
		cancelButton.setRenderAsLink(true);
		cancelButton.setToolTip("Cancel");
		cancelButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				Object key = TableUtil.getCurrentRowKey();
				removeEditRow(key);
				firstNameField.reset();
				lastNameField.reset();
				dobField.reset();
			}
		});

		// Delete Button
		WConfirmationButton deleteButton = new WConfirmationButton("Delete") {
			@Override
			public boolean isVisible() {
				Object key = TableUtil.getCurrentRowKey();
				return !isEditRow(key);
			}
		};
		deleteButton.setMessage("Do you want to delete row?");
		deleteButton.setImage("/image/remove.png");
		deleteButton.setRenderAsLink(true);
		deleteButton.setToolTip("Delete");
		deleteButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				Object key = TableUtil.getCurrentRowKey();
				removeEditRow(key);
				PersonBean bean = (PersonBean) actionContainer.getBean();
				List<PersonBean> beans = (List<PersonBean>) table.getBean();
				beans.remove(bean);
				table.handleDataChanged();
				messages.success(bean.getFirstName() + " " + bean.getLastName() + " removed.");
			}
		});

		buttonPanel.add(editButton);
		buttonPanel.add(cancelButton);
		buttonPanel.add(deleteButton);

		// Ajax - edit button
		WAjaxControl editAjax = new WAjaxControl(editButton,
				new AjaxTarget[]{firstNameField, lastNameField,
					dobField, buttonPanel}) {
			@Override
			public boolean isVisible() {
				return editButton.isVisible();
			}

		};
		buttonPanel.add(editAjax);

		// Ajax - cancel button
		WAjaxControl cancelAjax = new WAjaxControl(cancelButton,
				new AjaxTarget[]{firstNameField, lastNameField,
					dobField, buttonPanel}) {
			@Override
			public boolean isVisible() {
				return cancelButton.isVisible();
			}
		};
		buttonPanel.add(cancelAjax);

		buttonPanel.setIdName("buttons");
		editAjax.setIdName("ajax_edit");
		cancelAjax.setIdName("ajax_can");
		editButton.setIdName("edit_btn");
		cancelButton.setIdName("cancel_btn");
		deleteButton.setIdName("delete_btn");
	}
1152202
function addButtons() {

  if ( options.continue || options.follow || options.submit ) {

    var continueButton = template( defaults.buttonTemplate )
    continueButton.classList.add( 'dialog-continue' )
    if ( options.destructive ) { continueButton.classList.add( 'destructive' ) }
    continueButton.innerHTML = options.continue || 'Continue'

    dialogEl.querySelector('.dialog-actions').appendChild( continueButton )

    options.cancel = options.cancel || 'Cancel'
  }

  var cancelButton = template( defaults.buttonTemplate )

  cancelButton.classList.add( 'dialog-cancel' )
  cancelButton.innerHTML = options.cancel || ( options.continue ? 'Cancel' : 'OK' )

  dialogEl.querySelector('.dialog-actions').appendChild( cancelButton )

}
179518
function renderActionButtons() {
        $('.manage-resource-container .action-button').each(function (i, action) {
            action = $(action);
            var type = action.parent().hasClass(FOLDER_TYPE) ? FOLDER_TYPE : "";
            var id = action.attr("id"),
                dataId = action.parent('.resource-item').attr("id");

            var actions = [
                {
                    text: type ? "View" : "Download",
                    onClick: function (e) {
                        if (type) {
                            renderItemsByFolderId(dataId);

                        } else {
                            download(dataId);
                        }
                    },
                    permissionAction: "VIEW"
                },
                {
                    text: "Permission", data: {id: dataId},
                    onClick: function (e) {
                        openPermissions(dataId);
                    },
                    permissionAction: "PERMISSION"
                },
                {
                    text: "Rename", data: {id: dataId},
                    onClick: function (e) {
                        rename(dataId, true);
                    },
                    permissionAction: "UPDATE"
                },
                {
                    text: "Delete",
                    onClick: function (e) {
                        remove(dataId, type);
                    },
                    permissionAction: "DELETE"
                }
            ];
            var opts = {
                handlerId: id,
                buttonSize: "mini",
                actions: actions
            };

            var permissionConf = {
                modelId: dataId,
                modelName: modelName,
                permissionSchemaKey: permissionSchemaKey
            };

            new Rocket.ActionButton(opts, permissionConf)
        });
    }
1302120
public void reinitButton(I_CmsUploadButtonHandler buttonHandler) {

        m_buttonHandler = buttonHandler;
        m_buttonHandler.setButton(this);
        updateState("up");
        m_enabled = true;
        createFileInput();
    }
982290
public void updateButtonVisibility() {
        if (isDirty()) {
            if (m_isValid) {
                m_saveButton.setEnabled(true);
            }
            m_undoButton.setEnabled(true);
            if (m_td != null) {
                m_td.setDirty(m_itemId, true);
            }
            m_owner.indicateDirtiness();
        } else {
            m_saveButton.setEnabled(false);
            m_undoButton.setEnabled(false);
            if (m_td != null) {
                m_td.setDirty(m_itemId, false);
            }
            m_owner.indicateDirtiness();
        }
        if (!m_isValid) {
            m_saveButton.setEnabled(false);
        }
    }
573197
function() {
      inputEx.MultiAutoComplete.superclass.renderComponent.call(this);
      this.buttonAdd = inputEx.cn('button',{},{},'Add');
      Event.addListener(this.buttonAdd, 'click',this.onAdd,this,true)
      this.el.parentNode.appendChild(this.buttonAdd);

      
      this.ddlist = new inputEx.widget.ListCustom({parentEl: this.fieldContainer,maxItems: this.maxItems, maxItemsAlert: this.maxItemsAlert});
      this.ddlist.itemRemovedEvt.subscribe(function() {
         this.setClassFromState();
         this.fireUpdatedEvt();
      }, this, true);
      this.ddlist.listReorderedEvt.subscribe(this.fireUpdatedEvt, this, true);
   }
588510
private void rebuildSelector() {
        selectorRebuildCount.inc();
        Selector newSelector = newSelector(logger);
        Selector oldSelector = this.selector;

        // reset each pipeline's selectionKey, cancel the old keys
        for (SelectionKey key : oldSelector.keys()) {
            NioPipeline pipeline = (NioPipeline) key.attachment();
            SelectableChannel channel = key.channel();
            try {
                int ops = key.interestOps();
                SelectionKey newSelectionKey = channel.register(newSelector, ops, pipeline);
                pipeline.setSelectionKey(newSelectionKey);
            } catch (ClosedChannelException e) {
                logger.info("Channel was closed while trying to register with new selector.");
            } catch (CancelledKeyException e) {
                // a CancelledKeyException may be thrown in key.interestOps
                // in this case, since the key is already cancelled, just do nothing
                ignore(e);
            }
            key.cancel();
        }

        // close the old selector and substitute with new one
        closeSelector();
        this.selector = newSelector;
        logger.warning("Recreated Selector because of possible java/network stack bug.");
    }
1041746
private void addRefreshButton() {

        Button button = CmsToolBar.createButton(
            FontOpenCms.RESET,
            CmsVaadinUtils.getMessageText(Messages.GUI_LOGFILE_REFRESH_FILEVIEW_0));
        button.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            public void buttonClick(ClickEvent event) {

                m_fileView.updateView();

            }
        });
        m_uiContext.addToolbarButton(button);
    }