Sets the active instance of the CareWeb shell. An exception is raised if an active instance
has already been set.

@param shell Shell to become the active instance.
964906
protected static void setShell(CareWebShell shell) {
        if (getShell() != null) {
            throw new RuntimeException("A CareWeb shell instance has already been registered.");
        }

        ExecutionContext.getPage().setAttribute(Constants.SHELL_INSTANCE, shell);
    }
1367022
public void setActive(HostPort hostPort)
        throws IOException, ServerException {
        Command cmd = new Command((controlChannel.isIPv6()) ? "EPRT" : "PORT",
                                  hostPort.toFtpCmdArgument());
        try {
            controlChannel.execute(cmd);
        } catch (UnexpectedReplyCodeException urce) {
            throw ServerException.embedUnexpectedReplyCodeException(urce);
        } catch (FTPReplyParseException rpe) {
            throw ServerException.embedFTPReplyParseException(rpe);
        }

        this.session.serverMode = Session.SERVER_ACTIVE;
    }
458964
@Override
    public void setException(Exception e) {
        if (!isTerminated()) {
            subject.onError(e);
        } else {
            throw new IllegalStateException("Response has already terminated so exception can not be set", e);
        }
    }
596142
@Override
    public void register(CareWebShell shell, ElementBase owner, boolean register) {
        if (register) {
            shell.registerStyleSheet(getUrl());
        }
    }
28032
public void setSiteRoot(String siteRoot) {

        if (siteRoot != null) {
            siteRoot = siteRoot.replaceFirst("/$", "");
        }
        m_siteRoot = siteRoot;
    }
1007305
@Override
    public void set(Instance<?> value) throws InvocationException {
        try {
            if (!field.isAccessible()) {
                field.setAccessible(true);
            }
            field.set(target, value);
        } catch (Exception e) {
            throw new InvocationException(e.getCause());
        }
    }
271683
protected void updateActivation(Activation value, String xmlTag, Counter counter, Element element)
   {
      boolean shouldExist = value != null;
      Element root = updateElement(counter, element, xmlTag, shouldExist);
      if (shouldExist)
      {
         Counter innerCount = new Counter(counter.getDepth() + 1);
         findAndReplaceSimpleElement(innerCount, root, "activeByDefault",
                  (value.isActiveByDefault() == false) ? null : String.valueOf(value.isActiveByDefault()), "false");
         findAndReplaceSimpleElement(innerCount, root, "jdk", value.getJdk(), null);
         updateActivationOS(value.getOs(), "os", innerCount, root);
         updateActivationProperty(value.getProperty(), "property", innerCount, root);
         updateActivationFile(value.getFile(), "file", innerCount, root);
      }
   }
923652
@Override
    public void setActive(boolean active) {
        TreeModelEvent event = null;
        BugTreeModel.TreeModification whatToDo;

        if (active != this.active) {
            if (active == false) {
                this.active = active;
            }

            StackedFilterMatcher theSame = this;
            FilterMatcher[] filtersInStack = theSame.getFilters();
            ArrayList<Sortables> order = MainFrame.getInstance().getSorter().getOrder();
            int sizeToCheck = filtersInStack.length;
            if (order.contains(Sortables.DIVIDER)) {
                if (order.indexOf(Sortables.DIVIDER) < filtersInStack.length) {
                    sizeToCheck++;
                }
            }
            List<Sortables> sortablesToCheck = order.subList(0, Math.min(sizeToCheck, order.size()));
            Debug.println("Size to check" + sizeToCheck + " checking list" + sortablesToCheck);
            Debug.println("checking filters");
            ArrayList<String> almostPath = new ArrayList<>();
            ArrayList<Sortables> almostPathSortables = new ArrayList<>();
            for (int x = 0; x < sortablesToCheck.size(); x++) {
                Sortables s = sortablesToCheck.get(x);
                for (FilterMatcher fm : filtersInStack) {
                    if (s.equals(fm.getFilterBy())) {
                        almostPath.add(fm.getValue());
                        almostPathSortables.add(fm.getFilterBy());
                    }
                }
            }
            ArrayList<String> finalPath = new ArrayList<>();
            for (int x = 0; x < almostPath.size(); x++) {
                Sortables s = almostPathSortables.get(x);
                if (MainFrame.getInstance().getSorter().getOrderBeforeDivider().contains(s)) {
                    finalPath.add(almostPath.get(x));
                }
            }
            try {
                if (finalPath.size() == filtersInStack.length) {
                    if (active == true) {
                        event = (MainFrame.getInstance().getBugTreeModel()).removeBranch(finalPath);
                        whatToDo = BugTreeModel.TreeModification.REMOVE;
                    } else {
                        event = (MainFrame.getInstance().getBugTreeModel()).insertBranch(finalPath);
                        whatToDo = BugTreeModel.TreeModification.INSERT;
                    }
                } else {
                    event = (MainFrame.getInstance().getBugTreeModel()).restructureBranch(finalPath, active);// if
                    // active
                    // is
                    // true,
                    // this
                    // removes,
                    // if
                    // active
                    // if
                    // false,
                    // it
                    // inserts
                    if (active) {
                        whatToDo = BugTreeModel.TreeModification.REMOVERESTRUCTURE;
                    } else {
                        whatToDo = BugTreeModel.TreeModification.INSERTRESTRUCTURE;
                    }
                }

                if (active == true) {
                    this.active = active;
                }
                (MainFrame.getInstance().getBugTreeModel()).sendEvent(event, whatToDo);
            } catch (BranchOperationException e) {
                // Another filter already filters out the branch this filter
                // would filter out, set active, but don't send any tree model
                // events.
                this.active = active;
            }
        }

    }
651753
public void setLocalActive() throws ClientException, IOException {
        if (session.serverAddress == null) {
            throw new ClientException(ClientException.CALL_PASSIVE_FIRST);
        }
        try {
            localServer.setActive(session.serverAddress);
        } catch (java.net.UnknownHostException e) {
            throw new ClientException(ClientException.UNKNOWN_HOST);
        }
    }
764936
protected function setClosure(Shell $shell, \Closure $closure)
    {
        if (self::shouldBindClosure()) {
            $that = $shell->getBoundObject();
            if (\is_object($that)) {
                $closure = $closure->bindTo($that, \get_class($that));
            } else {
                $closure = $closure->bindTo(null, $shell->getBoundClass());
            }
        }

        $this->closure = $closure;
    }
570817
private void processResources(boolean register) {
        CareWebShell shell = CareWebUtil.getShell();
        
        for (IPluginResource resource : getDefinition().getResources()) {
            resource.register(shell, this, register);
        }
    }
229969
@Override
    public void set(T value) {
        if (scope == null) {
            throw new IllegalStateException("Value can not be set, instance has no Scope defined: " + value);
        }
        manager.bindAndFire(scope, type, value);
    }
554422
@Override
	public void run(ApplicationArguments args) throws Exception {
		List<File> scriptsToRun = args.getNonOptionArgs().stream()
				.filter(s -> s.startsWith("@"))
				.map(s -> new File(s.substring(1)))
				.collect(Collectors.toList());

		boolean batchEnabled = environment.getProperty(SPRING_SHELL_SCRIPT_ENABLED, boolean.class, true);

		if (!scriptsToRun.isEmpty() && batchEnabled) {
			InteractiveShellApplicationRunner.disable(environment);
			for (File file : scriptsToRun) {
				try (Reader reader = new FileReader(file);
						FileInputProvider inputProvider = new FileInputProvider(reader, parser)) {
					shell.run(inputProvider);
				}
			}
		}
	}
1274916
public void setCARevocationPath(Path caRevocationPath)
  {
    try {
      _caRevocationPath = caRevocationPath.toRealPath().toString();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
1152235
@Override
    public void register(CareWebShell shell, ElementBase owner, boolean register) {
        if (register) {
            ElementPlugin plugin = (ElementPlugin) owner;
            BaseMenuComponent menu = plugin.getShell().addMenu(getPath(), getAction());
            plugin.registerComponent(menu);
            plugin.registerId(getId(), menu);
        }
    }
961489
@Override
    public void register(CareWebShell shell, ElementBase owner, boolean register) {
        if (register) {
            CommandUtil.associateCommand(getId(), ((ElementUI) owner).getOuterComponent());
        }
    }
1088789
public function setActive($isActive)
    {
        $this->isActive = (bool) $isActive;
        
        if ($this->parent !== null) {
            $this->parent->setActive($isActive);
        }
    }