Adapts the visibility of the dialog's buttons.
425012
private void adaptButtonBarVisibility() {
        if (buttonBarContainer != null) {
            buttonBarContainer.setVisibility(buttonBarShown ? View.VISIBLE : View.GONE);
        }
    }
1349886
public void setPreviewVisible(boolean visible) {

        m_previewVisible = visible;
        if (m_previewVisible) {
            useMaxDimensions();
            m_previewVisibility.setValue(I_CmsLayoutBundle.INSTANCE.previewDialogCss().previewVisible());
            if (m_galleryHandler instanceof CmsGalleryPopup) {
                ((CmsGalleryPopup)m_galleryHandler).center();
            }
        } else {
            m_previewVisibility.setValue(I_CmsLayoutBundle.INSTANCE.previewDialogCss().hidePreview());
            updateSizes();
        }
    }
357065
private void enableButtons() {
		final int itemCount = this.list.getTable().getItemCount();
		final boolean hasElement = itemCount > 0;
		IStructuredSelection selection;
		if (hasElement) {
			selection = this.list.getStructuredSelection();
			final int selectionCount = selection.size();
			if (selectionCount <= 0 || selectionCount > itemCount) {
				selection = null;
			}
		} else {
			selection = null;
		}
		this.removeButton.setEnabled(selection != null);
		this.clearButton.setEnabled(hasElement);
		if (this.isSortedElements) {
			final Object firstElement = selection != null ? this.list.getTable().getItem(0).getData() : null;
			final Object lastElement = selection != null ? this.list.getTable().getItem(this.list.getTable().getItemCount() - 1).getData() : null;
			final boolean isNotFirst = firstElement != null && selection != null && firstElement != selection.getFirstElement();
			final boolean isNotLast = lastElement != null && selection != null && lastElement != selection.getFirstElement();
			this.moveTopButton.setEnabled(isNotFirst);
			this.moveUpButton.setEnabled(isNotFirst);
			this.moveDownButton.setEnabled(isNotLast);
			this.moveBottomButton.setEnabled(isNotLast);
		}
	}
645452
protected void setDirectEditButtonsVisible(boolean visible) {

        m_editButtonsVisibility.setValue(
            visible
            ? I_CmsLayoutBundle.INSTANCE.directEditCss().showButtons()
            : I_CmsLayoutBundle.INSTANCE.directEditCss().hideButtons());
        getHandler().showToolbar(visible);
    }
1258771
private void adaptTabLayoutVisibility() {
        if (tabLayout != null) {
            tabLayout.setVisibility(tabLayoutShown ? View.VISIBLE : View.GONE);
        }
    }
1345047
private void setButtonBarVisible(boolean visible) {

        if (m_hasButtonBar != visible) {
            m_hasButtonBar = visible;
            if (m_hasButtonBar) {

                m_buttonBar.getStyle().clearDisplay();
                int width = CmsClientStringUtil.parseInt(m_borderTopStyle.getWidth()) + BUTTON_BAR_WIDTH;
                m_borderTopStyle.setWidth(width, Unit.PX);
                m_borderBottomStyle.setWidth(width, Unit.PX);
                m_borderRightStyle.setLeft(
                    CmsClientStringUtil.parseInt(m_borderRightStyle.getLeft()) + BUTTON_BAR_WIDTH,
                    Unit.PX);
            } else {
                m_buttonBar.getStyle().setDisplay(Display.NONE);
                int width = CmsClientStringUtil.parseInt(m_borderTopStyle.getWidth()) - BUTTON_BAR_WIDTH;
                m_borderTopStyle.setWidth(width, Unit.PX);
                m_borderBottomStyle.setWidth(width, Unit.PX);
                m_borderRightStyle.setLeft(
                    CmsClientStringUtil.parseInt(m_borderRightStyle.getLeft()) - BUTTON_BAR_WIDTH,
                    Unit.PX);
            }
        }
    }
67328
private void adaptPositiveButton() {
        if (positiveButton != null) {
            positiveButton.setText(positiveButtonText != null ?
                    positiveButtonText.toString().toUpperCase(Locale.getDefault()) : null);
            OnClickListenerWrapper onClickListener =
                    new OnClickListenerWrapper(positiveButtonListener, true, getDialog(),
                            DialogInterface.BUTTON_POSITIVE);
            positiveButton.setOnClickListener(onClickListener);
            positiveButton.setVisibility(
                    !TextUtils.isEmpty(positiveButtonText) ? View.VISIBLE : View.GONE);
            adaptButtonBarContainerVisibility();
        }
    }
536835
private void adaptHeaderDividerVisibility() {
        if (headerDivider != null) {
            headerDivider.setVisibility(showHeaderDivider ? View.VISIBLE : View.GONE);
        }
    }
1179176
private void adaptPositiveButtonEnableState(final boolean enabled) {
        Button button = getDialog().getButton(DialogInterface.BUTTON_POSITIVE);

        if (button != null) {
            button.setEnabled(enabled);
        }
    }
791032
def setVisible(self, state):
        
        super(XLineEdit, self).setVisible(state)
        
        self.adjustStyleSheet()
        self.adjustTextMargins()
1365133
private void adaptButtonBarContainerVisibility() {
        if (buttonBarContainer != null) {
            if (TextUtils.isEmpty(positiveButtonText) && TextUtils.isEmpty(neutralButtonText) &&
                    TextUtils.isEmpty(negativeButtonText)) {
                buttonBarContainer.setVisibility(View.GONE);
            } else {
                buttonBarContainer.setVisibility(View.VISIBLE);
            }
        }
    }
1154596
private void adaptLayoutParams() {
        DialogRootView rootView = getRootView();

        if (getWindow() != null && rootView != null) {
            rootView.setLayoutParams(createLayoutParams());
            rootView.setFullscreen(isFullscreen());
            rootView.setMaxWidth(getMaxWidth());
            rootView.setMaxHeight(getMaxHeight());
        }
    }
1335571
private void setPausable() {
		if (mPlayButton != null) {
			mPlayButton.setVisibility(View.GONE);
		}

		if (mPauseButton != null) {
			mPauseButton.setVisibility(View.VISIBLE);
		}
	}
1098416
def setShowOptionsButton(self, state):
        
        self._showOptionsButton = state
        self._optionsButton.setVisible(state)
64736
protected void setButtonVisibility() {

        Component tab = m_tab.getSelectedTab();
        int pos = m_tab.getTabPosition(m_tab.getTab(tab));
        //TODO: check if necessary (when it was finally known which tabs web ou users should see..
        int maxPos = m_isWebOU ? 3 : 3; //has to be changed if number of tabs is changed for web OU user
        m_next.setVisible(pos < maxPos);
        m_ok.setVisible(pos == maxPos);
    }
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())
1165194
private void adaptIconTint() {
        Drawable icon = getIcon();

        if (icon != null) {
            DrawableCompat.setTintList(icon, tintList);
            DrawableCompat.setTintMode(icon, tintMode);
        }
    }