Enables the type conversion buttons based on selected items counts in the viewer.
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);
		}
	}
444438
private void addDisabledExamples() {
		add(new WHeading(HeadingLevel.H2, "Examples of disabled buttons"));

		WPanel disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
		disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
				FlowLayout.ContentAlignment.BASELINE));
		add(disabledButtonLayoutPanel);

		WButton button = new WButton("Disabled button");
		button.setDisabled(true);
		disabledButtonLayoutPanel.add(button);
		button = new WButton("Disabled button as link");
		button.setDisabled(true);
		button.setRenderAsLink(true);
		disabledButtonLayoutPanel.add(button);

		add(new WHeading(HeadingLevel.H3, "Examples of disabled buttons displaying only an image"));
		disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
		disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
				FlowLayout.ContentAlignment.BASELINE));
		add(disabledButtonLayoutPanel);

		button = new WButton("Disabled button");
		button.setDisabled(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		disabledButtonLayoutPanel.add(button);
		button = new WButton("Disabled button as link");
		button.setDisabled(true);
		button.setRenderAsLink(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		disabledButtonLayoutPanel.add(button);

		add(new WHeading(HeadingLevel.H3,
				"Examples of disabled buttons displaying an image with imagePosition EAST"));

		disabledButtonLayoutPanel = new WPanel(WPanel.Type.BOX);
		disabledButtonLayoutPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 6, 0,
				FlowLayout.ContentAlignment.BASELINE));
		add(disabledButtonLayoutPanel);
		button = new WButton("Disabled button");
		button.setDisabled(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		button.setImagePosition(ImagePosition.EAST);
		disabledButtonLayoutPanel.add(button);
		button = new WButton("Disabled button as link");
		button.setDisabled(true);
		button.setRenderAsLink(true);
		button.setImage("/image/tick.png");
		button.setToolTip("Checking currently disabled");
		button.setImagePosition(ImagePosition.EAST);
		disabledButtonLayoutPanel.add(button);
	}
785169
private void updateButtonVisibility(CmsContainerPageElementPanel elementWidget) {

        Iterator<Widget> it = elementWidget.getElementOptionBar().iterator();
        while (it.hasNext()) {
            Widget w = it.next();
            if (w instanceof I_CmsGroupEditorOption) {
                if (((I_CmsGroupEditorOption)w).checkVisibility()) {
                    w.getElement().getStyle().clearDisplay();
                } else {
                    w.getElement().getStyle().setDisplay(Display.NONE);
                }
            }
        }
    }
1323034
def switch_showfilter_icon(self, toggled):
        
        at = QtCore.Qt.DownArrow if toggled else QtCore.Qt.RightArrow
        self.showfilter_tb.setArrowType(at)
627102
function() {
      inputEx.TypeField.superclass.initEvents.call(this); 
      
      // "Toggle the properties panel" button :
      Event.addListener(this.button, 'click', this.onTogglePropertiesPanel, this, true);
      
      // Prevent the button to receive a "click" event if the propertyPanel doesn't catch it
      Event.addListener(this.propertyPanel, 'click', function(e) { Event.stopPropagation(e);}, this, true);
      
      // Listen the "type" selector to update the groupOptions
      // Hack the type selector to rebuild the group option
      this.typeSelect.updatedEvt.subscribe(this.rebuildGroupOptions, this, true);
   }
161019
protected void setTypeConversions(List<Pair<String, String>> typeConversions, boolean notifyController) {
		this.conversions.clear();
		if (typeConversions != null) {
			for (final Pair<String, String> entry : typeConversions) {
				this.conversions.add(new ConversionMapping(entry.getKey(), entry.getValue()));
			}
		}
		this.list.setInput(this.conversions);
		refreshListUI();
		if (notifyController) {
			preferenceValueChanged();
		}
	}
1232367
function _setItemTypeFormatter(oAction) {
			var that = this;

			var oBindingInfo = ManagedObject.bindingParser("{path:''}");
			// Async formatter to set ListItem type depending if the list item context is a correct navigation target (decided by the navigation service).
			oBindingInfo.formatter = function (vValue) {

				var oBindingContext = this.getBindingContext(),
					oModel = this.getModel(),
					sPath;

				if (oBindingContext) {
					sPath = oBindingContext.getPath();
				}

				var mParameters = BindingResolver.resolveValue(oAction.parameters, oModel, sPath);

				if (vValue.__resolved) {
					if (vValue.__enabled) {
						return "Navigation";
					} else {
						return "Inactive";
					}
				}

				if (!vValue.__promise) {
					vValue.__promise = true;
					that._oServiceManager.getService(_getServiceName(oAction.service)).then(function (oNavigationService) {
						if (oNavigationService) {
							oNavigationService
								.enabled({
									parameters: mParameters
								})
								.then(function (bEnabled) {
									vValue.__resolved = true;
									vValue.__enabled = bEnabled;
									that.getModel().checkUpdate(true);
								})
								.catch(function () {
									vValue.__resolved = true;
									vValue.__enabled = false;
								});
						} else {
							vValue.__resolved = true;
							vValue.__enabled = false;
						}
					});
				}
				return "Inactive";
			};
			this._oItemTemplate.bindProperty("type", oBindingInfo);
		}
1110699
private void adaptButtonBarDividerVisibility() {
        if (buttonBarDivider != null) {
            buttonBarDivider.setVisibility(showButtonBarDivider ? View.VISIBLE : View.GONE);
            buttonBarDivider.setVisibleByDefault(showButtonBarDivider);
        }
    }
473684
def ConfigureViewTypeChoices( self, event=None ):
        """"""
        self.viewTypeTool.SetItems( getattr( self.loader, 'ROOTS', [] ))
        if self.loader and self.viewType in self.loader.ROOTS:
            self.viewTypeTool.SetSelection( self.loader.ROOTS.index( self.viewType ))
            
        # configure the menu with the available choices...
        def chooser( typ ):
            def Callback( event ):
                if typ != self.viewType:
                    self.viewType = typ 
                    self.OnRootView( event )
            return Callback
        # Clear all previous items
        for item in self.viewTypeMenu.GetMenuItems():
            self.viewTypeMenu.DeleteItem( item )
        if self.loader and self.loader.ROOTS:
            for root in self.loader.ROOTS:
                item = wx.MenuItem( 
                    self.viewTypeMenu, -1, root.title(), 
                    _("View hierarchy by %(name)s")%{
                        'name': root.title(),
                    },
                    kind=wx.ITEM_RADIO,
                )
                item.SetCheckable( True )
                self.viewTypeMenu.AppendItem( item )
                item.Check( root == self.viewType )
                wx.EVT_MENU( self, item.GetId(), chooser( root ))
121886
private QuestionnaireItemType answerTypeForBinding(ElementDefinitionBindingComponent binding) {
    if (binding == null) 
      return QuestionnaireItemType.OPENCHOICE;
    else if (binding.getStrength() != BindingStrength.REQUIRED) 
      return QuestionnaireItemType.OPENCHOICE;
    else
      return QuestionnaireItemType.CHOICE;
  }
1200951
public void setConvertLinks(boolean convert) {
		try {
			runner.callMethod("setConvertLinks", engine, convert);
		} catch (ScriptRunnerException e) {
			throw new IllegalArgumentException("Could not set option", e);
		}
	}
302080
private void adaptButtonBarVisibility() {
        if (buttonBar != null && buttonBarShadowView != null) {
            buttonBar.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE);
            buttonBarShadowView.setVisibility(isButtonBarShown() ? View.VISIBLE : View.GONE);

            if (isButtonBarShown() && !isSplitScreen()) {
                adaptNavigationVisibility();
            }

            adaptNavigationEnabledState();
            adaptWizardButtonVisibilities();
        }
    }
333182
private void enableSetButton(boolean enabled) {

        if (enabled) {
            if (m_addPermissionSetButton == null) {
                m_addPermissionSetButton = new Button(FontAwesome.PLUS);
                m_addPermissionSetButton.addStyleName(OpenCmsTheme.BUTTON_ICON);
                m_addPermissionSetButton.addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        onSelect();
                    }
                });
                m_main.addComponent(m_addPermissionSetButton);
            }
        } else if (m_addPermissionSetButton != null) {
            m_main.removeComponent(m_addPermissionSetButton);
            m_addPermissionSetButton = null;
        }
    }
1354376
private void adaptButtonTypeface() {
        if (buttonTypeface != null) {
            if (positiveButton != null) {
                positiveButton.setTypeface(buttonTypeface);
            }

            if (neutralButton != null) {
                neutralButton.setTypeface(buttonTypeface);
            }

            if (negativeButton != null) {
                negativeButton.setTypeface(buttonTypeface);
            }
        }
    }
1255849
function ItemEventsHandler_toggleItemSelection(itemIndex) {
                    var site = this._site,
                        selection = site.selection,
                        selected = selection._isIncluded(itemIndex);

                    if (site.selectionMode === _UI.SelectionMode.single) {
                        if (!selected) {
                            selection.set(itemIndex);
                        } else {
                            selection.clear();
                        }
                    } else {
                        if (!selected) {
                            selection.add(itemIndex);
                        } else {
                            selection.remove(itemIndex);
                        }
                    }
                }
822002
private void setPresets() {
		TriggerType selectedTrigger = (TriggerType) drpTriggerType.getSelected();

		comboField.setVisible(
				selectedTrigger != TriggerType.DateField && selectedTrigger != TriggerType.NumberField);
		dateField.setVisible(selectedTrigger == TriggerType.DateField);
		numberField.setVisible(selectedTrigger == TriggerType.NumberField);

		// If a group action selected, then target can only be the field (as it is defined in a group)
		switch ((ControlActionType) drpActionType.getSelected()) {
			case ENABLEIN_DISABLEIN:
			case SHOWIN_HIDEIN:
				drpTargetType.setSelected(TargetType.WFIELD);
				drpTargetType.setDisabled(true);
				break;
			default:
				drpTargetType.setDisabled(false);
		}
	}
66415
function _toggleIndentType() {
        var current = EditorManager.getActiveEditor(),
            fullPath = current && current.document.file.fullPath;

        Editor.setUseTabChar(!Editor.getUseTabChar(fullPath), fullPath);
        _updateIndentType(fullPath);
        _updateIndentSize(fullPath);
    }