Pops all {@link Controller} until only the root is left

@param changeHandler The {@link ControllerChangeHandler} to handle this transaction
@return Whether or not any {@link Controller}s were popped in order to get to the root transaction
177952
@SuppressWarnings("WeakerAccess")
    @UiThread
    public boolean popToRoot(@Nullable ControllerChangeHandler changeHandler) {
        ThreadUtils.ensureMainThread();

        if (backstack.size() > 1) {
            //noinspection ConstantConditions
            popToTransaction(backstack.root(), changeHandler);
            return true;
        } else {
            return false;
        }
    }
514193
public boolean isControllerLeft(int controller) {
		if (controller >= getControllerCount()) {
			return false;
		}
		
		if (controller == ANY_CONTROLLER) {
			for (int i=0;i<controllers.size();i++) {
				if (isControllerLeft(i)) {
					return true;
				}
			}
			
			return false;
		}
		
		return ((Controller) controllers.get(controller)).getXAxisValue() < -0.5f
				|| ((Controller) controllers.get(controller)).getPovX() < -0.5f;
	}
186968
private boolean isControlDwn(int index, int controllerIndex) {
		switch (index) {
		case LEFT:
			return isControllerLeft(controllerIndex);
		case RIGHT:
			return isControllerRight(controllerIndex);
		case UP:
			return isControllerUp(controllerIndex);
		case DOWN:
			return isControllerDown(controllerIndex);
		}
		
		if (index >= BUTTON1) {
			return isButtonPressed((index-BUTTON1), controllerIndex);
		}

		throw new RuntimeException("Unknown control index");
	}
1177795
public boolean onChangePassword()
    {
        Record record = Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS, this);
        this.removeRecord(record);
        BasePanel parentScreen = this.getParentScreen();
        ScreenLocation itsLocation = this.getScreenLocation();
        this.finalizeThisScreen();  // Validate current control, update record, get ready to close screen.
        Map<String,Object> properties = null;
        this.free();
        int docMode = record.commandToDocType(UserInfoModel.PASSWORD_CHANGE_SCREEN);
        record.makeScreen(itsLocation, parentScreen, docMode, properties);
        return true;   // Should always be successful
    }
530628
function mxCurrentRootChange(view, root)
{
	this.view = view;
	this.root = root;
	this.previous = root;
	this.isUp = root == null;
	
	if (!this.isUp)
	{
		var tmp = this.view.currentRoot;
		var model = this.view.graph.getModel();
		
		while (tmp != null)
		{
			if (tmp == root)
			{
				this.isUp = true;
				break;
			}
			
			tmp = model.getParent(tmp);
		}
	}
}
603411
public JsHandlerRegistration addLayersModelChangedHandler(final LayersModelChangedHandler handler) {
		HandlerRegistration registration = ((MapImpl) map).getMapWidget().getMapModel()
				.addMapModelChangedHandler(new MapModelChangedHandler() {

					public void onMapModelChanged(MapModelChangedEvent event) {
						handler.onLayersModelChanged(new LayersModelChangedEvent(map.getLayersModel()));
					}
				});
		return new JsHandlerRegistration(new HandlerRegistration[] { registration });
	}
519024
public HandlerRegistration addChangedHandler(final ChangedHandler handler) {
		return enabledForm.addItemChangedHandler(new ItemChangedHandler() {

			public void onItemChanged(ItemChangedEvent event) {
				handler.onChanged(new ChangedEvent(EnableToggleFormItem.this.getJsObj()));
			}
		});

	}
1093918
public boolean isControllerUp(int controller) {
		if (controller >= getControllerCount()) {
			return false;
		}

		if (controller == ANY_CONTROLLER) {
			for (int i=0;i<controllers.size();i++) {
				if (isControllerUp(i)) {
					return true;
				}
			}
			
			return false;
		}
		return ((Controller) controllers.get(controller)).getYAxisValue() < -0.5f
		   		|| ((Controller) controllers.get(controller)).getPovY() < -0.5f;
	}
372319
public static void remove(ServiceController<?> controller) {
        try {
            transition(controller, State.REMOVED);
        } catch (StartException e) {
            // This can't happen
            throw new IllegalStateException(e);
        }
    }
339495
@EventBusListenerMethod(scope = EventScope.UI)
    public void onRolloutChangeEvent(final RolloutChangeEventContainer eventContainer) {
        eventContainer.getEvents().forEach(this::handleEvent);
    }
402469
public boolean close()
    {
        if (getDelegate() == null) return true;
        try
        {
            PersistenceBrokerThreadMapping.unsetCurrentPersistenceBroker(getPBKey(), this);
            super.close();
        }
        finally
        {
            /*
            here we destroy the handle. set the
            underlying PB instance 'null', thus it's not
            possible to corrupt a closed PB instance.
            */
            setDelegate(null);
        }
        return true;
    }
942719
public ChangesHolder getChanges(final Set<String> removedNodes, final Set<String> addedNodes)
   {
      if (handler != null)
      {
         Iterator<NodeData> addedStates = new Iterator<NodeData>()
         {
            private final Iterator<String> iter = addedNodes.iterator();

            public boolean hasNext()
            {
               return iter.hasNext();
            }

            public NodeData next()
            {

               // cycle till find a next or meet the end of set
               do
               {
                  String id = iter.next();
                  try
                  {
                     ItemData item = itemMgr.getItemData(id);
                     if (item != null)
                     {
                        if (item.isNode())
                        {
                           if (!indexingTree.isExcluded(item))
                           {
                              return (NodeData)item;
                           }
                        }
                        else
                        {
                           LOG.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
                              + " found. ");
                        }
                     }
                     else
                     {
                        LOG.warn("Unable to index node with id " + id + ", node does not exist.");
                     }

                  }
                  catch (RepositoryException e)
                  {
                     LOG.error("Can't read next node data " + id, e);
                  }
               }
               while (iter.hasNext()); // get next if error or node not found

               return null; // we met the end of iterator set
            }

            public void remove()
            {
               throw new UnsupportedOperationException();
            }
         };

         Iterator<String> removedIds = new Iterator<String>()
         {
            private final Iterator<String> iter = removedNodes.iterator();

            public boolean hasNext()
            {
               return iter.hasNext();
            }

            public String next()
            {
               return nextNodeId();
            }

            public String nextNodeId() throws NoSuchElementException
            {
               return iter.next();
            }

            public void remove()
            {
               throw new UnsupportedOperationException();

            }
         };

         if (removedNodes.size() > 0 || addedNodes.size() > 0)
         {
            return handler.getChanges(removedIds, addedStates);
         }
      }
      return null;
   }
447935
public static void replaceDefaultHandler(Handler handler) {
    Logger rootlogger = LogManager.getLogManager().getLogger("");
    for(Handler h : rootlogger.getHandlers()) {
      if(h instanceof CLISmartHandler) {
        rootlogger.removeHandler(h);
      }
    }
    addHandler(handler);
  }
133211
protected void maybeBuildAndSetRetryManager(AbstractDraweeController controller) {
    if (!mTapToRetryEnabled) {
      return;
    }
    controller.getRetryManager().setTapToRetryEnabled(mTapToRetryEnabled);
    maybeBuildAndSetGestureDetector(controller);
  }
168772
public static void removeHandlersForRootLogger() {
        java.util.logging.Logger rootLogger = getRootLogger();
        java.util.logging.Handler[] handlers = rootLogger.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            rootLogger.removeHandler(handlers[i]);
        }
    }
13184
void callEditorChangeHandlers(final Set<String> changedScopes) {

        m_changedScopes.addAll(changedScopes);
        if (!m_callingChangeHandlers && (m_changedScopes.size() > 0)) {
            m_callingChangeHandlers = true;
            final Set<String> scopesToSend = new HashSet<String>(m_changedScopes);
            m_changedScopes.clear();
            final CmsEntity entity = m_entityBackend.getEntity(m_entityId);
            final org.opencms.acacia.shared.CmsEntity currentState = entity.createDeepCopy(m_entityId);
            CmsRpcAction<CmsContentDefinition> action = new CmsRpcAction<CmsContentDefinition>() {

                @Override
                public void execute() {

                    start(200, true);
                    getService().callEditorChangeHandlers(
                        getEntityId(),
                        currentState,
                        getSkipPaths(),
                        scopesToSend,
                        this);
                }

                @Override
                public void onFailure(Throwable t) {

                    m_callingChangeHandlers = false;
                    super.onFailure(t);

                }

                @Override
                protected void onResponse(CmsContentDefinition result) {

                    m_callingChangeHandlers = false;
                    stop(false);
                    updateEditorValues(currentState, result.getEntity());
                    callEditorChangeHandlers(new HashSet<String>());
                }
            };
            action.execute();
        }
    }
802720
@Override
  public boolean getUseParentHandlers()
  {
    Boolean value = _useParentHandlers.get();

    if (value != null)
      return Boolean.TRUE.equals(value);
    else
      return true;
  }