Toggle the toggleComponent view and attach/detach listeners
@param isOpen
197640
function updateIsOpen(isOpen) {
        var parent = element.parent();

        if (scope.keyDown) {
          parent[isOpen ? 'on' : 'off']('keydown', onKeyDown);
        }

        if (isOpen) {
          triggeringElement = $document[0].activeElement;
        }

        return promise = $q.all([
          $animate[isOpen ? 'removeClass' : 'addClass'](element, 'toggle-component-closed')
            .then(function setElementFocus() {
              if (scope.isOpen) {
                element.focus();
              }
            })
        ]);
      }
442753
public void activateTooltip(boolean show)
    {
        if (show)
        {
            ToolTipManager.sharedInstance().registerComponent(this);
        }
        else
        {
            ToolTipManager.sharedInstance().unregisterComponent(this);
        }
        ToolTipManager.sharedInstance().setEnabled(show);
    }
249500
public static void attach(final View panelLayout,
                              final View focusView,
                              SubPanelAndTrigger... subPanelAndTriggers) {
        attach(panelLayout, focusView, null, subPanelAndTriggers);
    }
624442
private void bindButtonEnabling() {
        final BooleanBinding bexpr = new BooleanBinding() {

            @Override
            protected boolean computeValue() {
                return !(object().sourcePath() != null && object().sourcePath().exists() && object().sourcePath().isDirectory()
                        && object().targetPath() != null && object().targetPath().exists() && object().targetPath().isDirectory());
            }
        };

        final ChangeListener<File> cl = new ChangeListener<File>() {

            @Override
            public void changed(final ObservableValue<? extends File> observable, final File oldValue, final File newValue) {
                bexpr.invalidate();
            }
        };

        object().pSourcePath().addListener(cl);
        object().pTargetPath().addListener(cl);

        view().getStartButton().disableProperty().bind(bexpr);

        final SimpleListProperty<FileComparison> filteredListProperty = new SimpleListProperty<>(view().getTable().getItems());
        view().getExportCSV().disableProperty().bind(filteredListProperty.emptyProperty());

        final SimpleListProperty<FileComparison> listProperty = new SimpleListProperty<>(object().pLastResult());
        view().getMissing().disableProperty().bind(listProperty.emptyProperty());
        view().getDowngraded().disableProperty().bind(listProperty.emptyProperty());
        view().getNewer().disableProperty().bind(listProperty.emptyProperty());
        view().getSame().disableProperty().bind(listProperty.emptyProperty());
        view().getUpdated().disableProperty().bind(listProperty.emptyProperty());
        view().getUpgraded().disableProperty().bind(listProperty.emptyProperty());
    }
137890
function toggleElementClass( elm, className, on ) {
		var oldClassName = elm.className;
		var newClassName = toggleClass(oldClassName, className, on);
		if (newClassName != oldClassName) {
			elm.className = newClassName;
			elm.parentNode.className += EMPTY_STRING;
		}
	}
1054451
function (e) {
    var self = this;

    clearTimeout(self.closeTimeout);
    clearTimeout(self.deferCloseTimeout);

    if (e) {
      if (e.stopPropagation) {
        e.stopPropagation();
      }
      if (e.preventDefault) {
        e.preventDefault();
      }
      e.cancelBubble = true;
    }

    // Don't do anything if already open
    if (self.isOpen) {
      return;
    }

    self.isOpen = true;
    self.$el.addClass("open");

    // Notify child view
    self.dropdownContainerView.open();
  }
963756
function toggleOpen(isOpen) {
      if (scope.isOpen === isOpen) {
        return $q.when(true);
      } else {
        if (scope.isOpen && sidenavCtrl.onCloseCb) sidenavCtrl.onCloseCb();

        return $q(function(resolve) {
          // Toggle value to force an async `updateIsOpen()` to run
          scope.isOpen = isOpen;

          $mdUtil.nextTick(function() {
            // When the current `updateIsOpen()` animation finishes
            promise.then(function(result) {

              if (!scope.isOpen && triggeringElement && triggeringInteractionType === 'keyboard') {
                // reset focus to originating element (if available) upon close
                triggeringElement.focus();
                triggeringElement = null;
              }

              resolve(result);
            });
          });
        });
      }
    }
812620
@Override
    public boolean isOpen()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "em.isOpen();\n" + toString());

        return getEMInvocationInfo(false).isOpen();
    }
1019154
function ToggleComponentController($scope, $element, $attrs, $q, $mdComponentRegistry) {
    var self = this;

    // Use Default internal method until overridden by directive postLink

    self.toggleOpen = function () {
      return $q.when($scope.isOpen);
    };

    self.isOpen = function () {
      return !!$scope.isOpen;
    };

    self.open = function () {
      return self.$toggleOpen(true);
    };

    self.close = function () {
      return self.$toggleOpen(false);
    };

    self.toggle = function () {
      return self.$toggleOpen(!$scope.isOpen);
    };

    self.destroy = $mdComponentRegistry.register(self, $attrs.mdComponentId);
  }
725174
function expandableClickHandler() {
  this.transition.toggleExpandable();
  this.toggleTargetState( this.ui.target );

  if ( this.isAccordionGroup ) {
    if ( this.activeAccordion ) {
      this.activeAccordion = false;
    } else {
      Events.trigger( 'accordionActivated', { target: this } );
      this.activeAccordion = true;
    }
  }
}
743693
public void setCollapsed (boolean collapse)
    {
        if (collapse) {
            _content.setVisible(false);
            _trigger.setIcon(_downIcon);

        } else {
            _content.setVisible(true);
            _trigger.setIcon(_upIcon);
        }
        SwingUtil.refresh(this);
    }
137039
public void onPostBindView(IDrawerItem drawerItem, View view) {
        if (mOnPostBindViewListener != null) {
            mOnPostBindViewListener.onBindView(drawerItem, view);
        }
    }
323270
private void initComponents() {
        // Avoid warning on Mac OS X when changing the alpha
        getRootPane().putClientProperty("apple.awt.draggableWindowBackground", Boolean.FALSE);

        toolTip = new JToolTip();
        toolTip.addMouseListener(new TransparencyAdapter());

        owner.addComponentListener(locationAdapter);
        owner.addAncestorListener(locationAdapter);

        getRootPane().setWindowDecorationStyle(JRootPane.NONE); // Just in case...
        setFocusable(false); // Just in case...
        setFocusableWindowState(false);
        setContentPane(toolTip);
        pack(); // Seems to help for the very first setVisible(true) when window transparency is on
    }
933847
function Toggle({ children, ...props }) {
  const { getLabelProps, ...fieldCtx } = useFieldContext();
  const { getFocusProps, keyboardFocused } = useKeyboardFocus();

  /**
   * Due to us applying keyboard-only focus events to 2 separate elements (the input and label)
   * we must apply the original `onMouseDown` event to the `onMouseUp` event of the label.
   *
   * By passing the original props within `getFocusProps` we are able to allow
   * `event.preventDefault()` to still prevent chained events as expected.
   */
  const { onMouseDown: onFocusMouseDown, ...keyboardFocusedProps } = getFocusProps(props);

  const modifiedFieldCtx = {
    getLabelProps: ({ onMouseUp, ...other }) =>
      getLabelProps({ onMouseUp: composeEventHandlers(onMouseUp, onFocusMouseDown), ...other }),
    ...fieldCtx
  };

  return (
    <FieldContext.Provider value={modifiedFieldCtx}>
      <ToggleContext.Provider value={{ isFocused: keyboardFocused }}>
        <StyledToggle>
          <StyledToggleInput
            {...modifiedFieldCtx.getInputProps({
              'data-garden-id': 'forms.toggle',
              'data-garden-version': PACKAGE_VERSION,
              ...keyboardFocusedProps
            })}
          />
          {children}
        </StyledToggle>
      </ToggleContext.Provider>
    </FieldContext.Provider>
  );
}
302650
function(view, config, widget) {

		this.Element$init(view, config, widget);

		var self = this;

		this._IE_click_callback = function() {
			if (self._events['compatible_changed']) {
				Lava.view_manager.dispatchEvent(self._view, 'compatible_changed', null, self._events['compatible_changed']);
			}
		};

	}
859193
function(view) {
          view.hasModifier = view.removeModifier =
            view.addModifier = view.setModifier =
            view.toggleModifier = undefined;
        }
1280747
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WCollapsibleToggle toggle = (WCollapsibleToggle) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:collapsibletoggle");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendAttribute("groupName", toggle.getGroupName());
		xml.appendEnd();
	}