Management of fixed button pane
340713
function () {
            var t = this,
                fixedFullWidth = t.o.fixedFullWidth,
                $box = t.$box;

            if (!t.o.fixedBtnPane) {
                return;
            }

            t.isFixed = false;

            $(window)
                .on('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace, function () {
                    if (!$box) {
                        return;
                    }

                    t.syncCode();

                    var scrollTop = $(window).scrollTop(),
                        offset = $box.offset().top + 1,
                        bp = t.$btnPane,
                        oh = bp.outerHeight() - 2;

                    if ((scrollTop - offset > 0) && ((scrollTop - offset - t.height) < 0)) {
                        if (!t.isFixed) {
                            t.isFixed = true;
                            bp.css({
                                position: 'fixed',
                                top: 0,
                                left: fixedFullWidth ? '0' : 'auto',
                                zIndex: 7
                            });
                            $([t.$ta, t.$ed]).css({marginTop: bp.height()});
                        }
                        bp.css({
                            width: fixedFullWidth ? '100%' : (($box.width() - 1) + 'px')
                        });

                        $('.' + t.o.prefix + 'fixed-top', $box).css({
                            position: fixedFullWidth ? 'fixed' : 'absolute',
                            top: fixedFullWidth ? oh : oh + (scrollTop - offset) + 'px',
                            zIndex: 15
                        });
                    } else if (t.isFixed) {
                        t.isFixed = false;
                        bp.removeAttr('style');
                        $([t.$ta, t.$ed]).css({marginTop: 0});
                        $('.' + t.o.prefix + 'fixed-top', $box).css({
                            position: 'absolute',
                            top: oh
                        });
                    }
                });
        }
456789
public void attach(AbstractButton button, String faceDescriptorId, CommandButtonConfigurer configurer) {
		getButtonManager(faceDescriptorId).attachAndConfigure(button, configurer);
		onButtonAttached(button);
	}
467344
function _keyLeft() {
            if (lxSelect.choicesViewMode !== 'panes' || lxSelect.panes.length < 2) {
                return;
            }

            var previousPaneIndex = lxSelect.panes.length - 2;

            lxSelect.activeChoiceIndex = (
                Object.keys(lxSelect.panes[previousPaneIndex]) || []
            ).indexOf(
                (toggledPanes[previousPaneIndex] || {}).key
            );

            _closePane(previousPaneIndex);
        }
769174
def disable_buttons(self):
        
        self.main_btn.set_sensitive(False)
        self.back_btn.hide()
        self.info_label.set_label('<span color="#FFA500">In progress...</span>')
        self.disable_close_window()
        if self.link is not None:
            self.link.hide()
41127
private void showProcessScopePanels() {
        if (rules.containsKey(type) && (rules.get(type) & OPTION_PROCESS_SCOPE) != 0) {
            jPanelPID.setVisible(jRadioScopePerProcess.isSelected());
            jPanelPrimaryMetrics.removeAll();
            jPanelAdditionaMetrics.removeAll();
            Enumeration<AbstractButton> enu = buttonGroupMetrics.getElements();
            while (enu.hasMoreElements()) {
                buttonGroupMetrics.remove(enu.nextElement());
            }
            String[] primaryMetrics = null;
            String[] additionalMetrics = null;

            if (jRadioScopePerProcess.isSelected()) {
                if (type.equals(METRIC_CPU)) {
                    primaryMetrics = cpuProcessMetricsPrimary;
                } else if (type.equals(METRIC_MEM)) {
                    primaryMetrics = memProcessMetricsPrimary;
                    additionalMetrics = memProcessMetricsAdditional;
                }
            } else {
                if (type.equals(METRIC_CPU)) {
                    primaryMetrics = cpuMetricsPrimary;
                    additionalMetrics = cpuMetricsAdditional;
                } else if (type.equals(METRIC_MEM)) {
                    primaryMetrics = memMetricsPrimary;
                    additionalMetrics = memMetricsAdditional;
                }
            }

            fillMetrics(primaryMetrics, jPanelPrimaryMetrics);
            fillMetrics(additionalMetrics, jPanelAdditionaMetrics);

            jLabelUnit.setEnabled(false);
            jComboBoxUnit.setEnabled(false);
        }
        repack();
    }
694526
function _handleWorkingSetMove(event, file, sourcePaneId, destinationPaneId) {
        // Check existing list for this doc path and source pane entry
        var index = _.findIndex(_mrofList, function (record) {
            return (record && record.file === file.fullPath && record.paneId === sourcePaneId);
        }), tIndex;
        // If an entry is found update the pane info
        if (index >= 0) {
            // But an entry with the target pane Id should not exist
            tIndex = _.findIndex(_mrofList, function (record) {
                return (record && record.file === file.fullPath && record.paneId === destinationPaneId);
            });
            if (tIndex === -1) {
                _mrofList[index].paneId = destinationPaneId;
            } else {
                // Remove this entry as it has been moved.
                _mrofList.splice(index, 1);
            }
        }
    }
733161
function _closePane(index) {
            if (index === 0) {
                _closePanes();

                return;
            }

            if (angular.isUndefined(toggledPanes[index])) {
                return;
            }

            _closePane(index + 1);

            if (lxSelect.choicesViewSize === 'large') {
                lxSelect.panes.splice(toggledPanes[index].position, 1);
            } else {
                lxSelect.openedPanes.splice(toggledPanes[index].position, 1);
            }

            delete toggledPanes[index];
        }
603568
function handleWindowResize () {
    ctrl.lastSelectedIndex = ctrl.selectedIndex;
    ctrl.offsetLeft        = fixOffset(ctrl.offsetLeft);

    $mdUtil.nextTick(function () {
      ctrl.updateInkBarStyles();
      updatePagination();
    });
  }
742920
function() {
		var closeStack, popout, label, maximise;

		/**
		 * Popout control to launch component in new window.
		 */
		popout = lm.utils.fnBind( this.parent.popout, this.parent );
		label = this.layoutManager.config.labels.popout;
		new lm.controls.HeaderButton( this, label, 'lm_popout', popout );

		/**
		 * Maximise control - set the component to the full size of the layout
		 */
		maximise = lm.utils.fnBind( this.parent.toggleMaximise, this.parent );
		label = this.layoutManager.config.labels.maximise;
		new lm.controls.HeaderButton( this, label, 'lm_maximise', maximise );

		/**
		 * Close button
		 */
		if( this.parent.config.isClosable ) {
			closeStack = lm.utils.fnBind( this.parent.remove, this.parent );
			label = this.layoutManager.config.labels.close;
			new lm.controls.HeaderButton( this, label, 'lm_close', closeStack );
		}
	}
664818
private void adaptButtonVisibility() {
        if (viewPager != null && viewPagerAdapter != null && backButton != null &&
                nextButton != null && finishButton != null) {
            int selectedIndex = viewPager.getCurrentItem();
            backButton.setVisibility(selectedIndex > 0 ? View.VISIBLE : View.GONE);
            nextButton.setVisibility(
                    selectedIndex < viewPagerAdapter.getCount() - 1 ? View.VISIBLE : View.GONE);
            finishButton.setVisibility(
                    selectedIndex == viewPagerAdapter.getCount() - 1 ? View.VISIBLE : View.GONE);
        }
    }
702046
def remove_pane(self, pane):
        
        assert isinstance(pane, Pane)

        for w in self.windows:
            w.remove_pane(pane)

            # No panes left in this window?
            if not w.has_panes:
                # Focus next.
                for app, active_w in self._active_window_for_cli.items():
                    if w == active_w:
                        with set_app(app):
                            self.focus_next_window()

                self.windows.remove(w)
85536
def adjustButtons( self ):
        
        tabbar = self.tabBar()
        tabbar.adjustSize()
        
        w = self.width() - self._optionsButton.width() - 2
        self._optionsButton.move(w, 0)
        
        if self.count():
            need_update = self._addButton.property('alone') != False
            if need_update:
                self._addButton.setProperty('alone', False)
                
            
            self._addButton.move(tabbar.width(), 1)
            self._addButton.setFixedHeight(tabbar.height())
        else:
            need_update = self._addButton.property('alone') != True
            if need_update:
                self._addButton.setProperty('alone', True)
            
            self._addButton.move(tabbar.width() + 2, 1)
        
        self._addButton.stackUnder(self.currentWidget())
        
        # force refresh on the stylesheet (Qt limitation for updates)
        if need_update:
            app = QApplication.instance()
            app.setStyleSheet(app.styleSheet())
1171313
protected void adjustContentSize() {

        if (m_isFrame && m_isShowing) {
            if (m_buttonPanel != null) {
                m_contentPanel.getElement().getStyle().setBottom(m_buttonPanel.getOffsetHeight() + 6, Unit.PX);
            } else {
                m_contentPanel.getElement().getStyle().clearBottom();
            }
        }
    }
828726
private static int buttonToGlassButton(int button) {
        switch (button) {
            case X.Button1: return MouseEvent.BUTTON_LEFT;
            case X.Button2: return MouseEvent.BUTTON_OTHER;
            case X.Button3: return MouseEvent.BUTTON_RIGHT;
            default: return MouseEvent.BUTTON_NONE;
        }
    }
53496
public void fixateUndistorted() {
		if( controls.size() < 2 )
			throw new RuntimeException("Not enough control points specified.  Found "+controls.size());
		for (int row = 0; row < gridRows; row++) {
			for (int col = 0; col < gridCols; col++) {
				Cache cache = getGrid(row,col);
				cache.weights.resize(controls.size);
				cache.A.resize(controls.size);
				cache.A_s.resize(controls.size());

				float v_x = col;
				float v_y = row;

				computeWeights(cache, v_x, v_y);
				computeAverageP(cache);
				model.computeCache(cache, v_x, v_y);
			}
		}
	}
609192
private void stopPanning(HumanInputEvent<?> event) {
		mapWidget.getMapModel().getMapView().setPanDragging(false);
		panning = false;
		moving = false;
		mapWidget.setCursorString(mapWidget.getDefaultCursorString());
		if (null != event) {
			updateView(event);
		}
	}
865547
function release_button(button) {
        if (guac_touchscreen.currentState[button]) {
            guac_touchscreen.currentState[button] = false;
            if (guac_touchscreen.onmouseup)
                guac_touchscreen.onmouseup(guac_touchscreen.currentState);
        }
    }