Change search context to use a dropdown for list of gateways.
195527
public function getDefaultSearchContext()
    {
        $context = parent::getDefaultSearchContext();
        $fields = $context->getSearchFields();

        $fields->removeByName('Gateway');
        $fields->removeByName('Created');

        $fields->insertAfter('Money', DropdownField::create(
            'Gateway',
            $this->fieldLabel('Gateway'),
            GatewayInfo::getSupportedGateways()
        )->setHasEmptyDefault(true));

        // create a localized status dropdown for the search-context
        $fields->insertAfter('Gateway', DropdownField::create(
            'Status',
            $this->fieldLabel('Status'),
            $this->getStatusValues()
        )->setHasEmptyDefault(true));

        $context->addFilter(new PartialMatchFilter('Gateway'));

        return $context;
    }
1347503
public void filterTable(String search) {

        m_container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(search)) {
            m_container.addContainerFilter(
                new Or(
                    new SimpleStringFilter(CmsResourceTableProperty.PROPERTY_RESOURCE_NAME, search, true, false),
                    new SimpleStringFilter(CmsResourceTableProperty.PROPERTY_NAVIGATION_TEXT, search, true, false),
                    new SimpleStringFilter(CmsResourceTableProperty.PROPERTY_TITLE, search, true, false)));
        }
        if ((m_fileTable.getValue() != null) & !((Set<?>)m_fileTable.getValue()).isEmpty()) {
            m_fileTable.setCurrentPageFirstItemId(((Set<?>)m_fileTable.getValue()).iterator().next());
        }
    }
798184
private void updateSearchStyle(JTextComponent c, SeaGlassContext context, String prefix) {
        searchIconWidth = 0;
        Object o = style.get(context, prefix + ".searchIconWidth");

        if (o != null && o instanceof Integer) {
            searchIconWidth = (Integer) o;
        }

        popupIconWidth = 0;
        o              = style.get(context, prefix + ".popupIconWidth");
        if (o != null && o instanceof Integer) {
            popupIconWidth = (Integer) o;
        }

        cancelIconWidth = 0;
        o               = style.get(context, prefix + ".cancelIconWidth");
        if (o != null && o instanceof Integer) {
            cancelIconWidth = (Integer) o;
        }

        searchLeftInnerMargin = 0;
        o                     = style.get(context, prefix + ".searchLeftInnerMargin");
        if (o != null && o instanceof Integer) {
            searchLeftInnerMargin = (Integer) o;
        }

        searchRightInnerMargin = 0;
        o                      = style.get(context, prefix + ".searchRightInnerMargin");
        if (o != null && o instanceof Integer) {
            searchRightInnerMargin = (Integer) o;
        }

        placeholderColor = Color.GRAY;
        o                = style.get(context, "placeholderTextColor");
        if (o != null && o instanceof Color) {
            placeholderColor = (Color) o;
        }

        Border border = c.getBorder();

        if (border == null || border instanceof UIResource && !(border instanceof TextFieldBorder)) {
            c.setBorder(createTextFieldBorder(context));
        }

        if (isSearchField.isInState(c)) {
            o = c.getClientProperty("JTextField.Search.PlaceholderText");
            if (o != null && o instanceof String) {
                placeholderText = (String) o;
            } else if (placeholderText != null) {
                placeholderText = null;
            }

            o = c.getClientProperty("JTextField.Search.FindAction");
            if (o != null && o instanceof ActionListener) {
                if (findAction == null) {
                    findAction = (ActionListener) o;
                }
            }

            o = c.getClientProperty("JTextField.Search.FindPopup");
            if (o != null && o instanceof JPopupMenu) {
                if (findPopup == null) {
                    findPopup = (JPopupMenu) o;
                }
            }

            o = c.getClientProperty("JTextField.Search.CancelAction");
            if (o != null && o instanceof ActionListener) {
                if (cancelAction == null) {
                    cancelAction = (ActionListener) o;
                }
            }

            installMouseListeners();
        } else {
            placeholderText = null;

            if (findAction != null) {
                findAction = null;
            }

            if (findPopup != null) {
                findPopup = null;
            }

            if (cancelAction != null) {
                cancelAction = null;
            }

            uninstallMouseListeners();
        }
    }
1148061
def list(self, search_opts=None):
        """"""
        query = base.get_query_string(search_opts)
        return self._list('/plugins%s' % query, 'plugins')
645052
def contextMenuEvent(self, event):
        """"""
        self.opt_menu.popup(event.globalPos())
        event.accept()
1206177
function populate_dropdown (query, results) {
          // exclude current tokens if configured
          results = excludeCurrent(results);

          if(results && results.length) {
              dropdown.empty();
              var dropdown_ul = $("<ul/>")
                  .appendTo(dropdown)
                  .mouseover(function (event) {
                      select_dropdown_item($(event.target).closest("li"));
                  })
                  .mousedown(function (event) {
                      add_token($(event.target).closest("li").data("tokeninput"));
                      hidden_input.change();
                      return false;
                  })
                  .hide();

              if ($(input).data("settings").resultsLimit && results.length > $(input).data("settings").resultsLimit) {
                  results = results.slice(0, $(input).data("settings").resultsLimit);
              }

              $.each(results, function(index, value) {
                  var this_li = $(input).data("settings").resultsFormatter(value);

                  this_li = find_value_and_highlight_term(this_li ,value[$(input).data("settings").propertyToSearch], query);
                  this_li = $(this_li).appendTo(dropdown_ul);

                  if(index % 2) {
                      this_li.addClass($(input).data("settings").classes.dropdownItem);
                  } else {
                      this_li.addClass($(input).data("settings").classes.dropdownItem2);
                  }

                  if(index === 0 && $(input).data("settings").autoSelectFirstResult) {
                      select_dropdown_item(this_li);
                  }

                  $.data(this_li.get(0), "tokeninput", value);
              });

              show_dropdown();

              if($(input).data("settings").animateDropdown) {
                  dropdown_ul.slideDown("fast");
              } else {
                  dropdown_ul.show();
              }
          } else {
              if($(input).data("settings").noResultsText) {
                  dropdown.html("<p>" + escapeHTML($(input).data("settings").noResultsText) + "</p>");
                  show_dropdown();
              }
          }
      }
580406
public <R> R doInContext(SearchContext context, Supplier<R> action) {
        R result;
        if (context == null) {
            result = action.get();
        } else {
            // store current context (without triggering exception if it was stale)
            SearchContext currentSearchContext = currentContext;
            boolean contextIsStale = currentContextIsStale;

            setCurrentContext(context);
            try {
                result = action.get();
            } finally {
                // make original current context active again
                currentContext = currentSearchContext;
                currentContextIsStale = contextIsStale;
            }
        }
        return result;
    }
610068
private void doSearch()
    {
        setSearchPanelVisible(true);
        String selectedText = textComponent.getSelectedText();
        if (selectedText != null)
        {
            searchPanel.setQuery(selectedText);
        }
        searchPanel.requestFocusForTextField();
    }
998696
def transform_gateway(result):
    
    return OrderedDict([('Name', result.get('name')),
                        ('ResourceGroup', result.get('resourceGroup')),
                        ('Location', result.get('location')),
                        ('ProvisioningState', result.get('provisioningState')),
                        ('Status', result.get('status')),
                        ('PublicIP', result.get('ipAddress'))])
1060439
def update_context(app, pagename, templatename, context, doctree):
    
    if doctree is None:
        return
    visitor = _FindTabsDirectiveVisitor(doctree)
    doctree.walk(visitor)
    if not visitor.found_tabs_directive:
        paths = [posixpath.join('_static', 'sphinx_tabs/' + f) for f in FILES]
        if 'css_files' in context:
            context['css_files'] = context['css_files'][:]
            for path in paths:
                if path.endswith('.css'):
                    context['css_files'].remove(path)
        if 'script_files' in context:
            context['script_files'] = context['script_files'][:]
            for path in paths:
                if path.endswith('.js'):
                    context['script_files'].remove(path)
1111833
void changedSearchType() {

        SearchType type = (SearchType)m_searchType.getValue();

        m_property.setVisible(type.isPropertySearch());
        m_searchPattern.setVisible(
            (!type.equals(SearchType.resourcetype)) & (!type.equals(SearchType.renameContainer)));
        m_resourceSearch.setVisible(type.equals(SearchType.resourcetype) | type.equals(SearchType.renameContainer));
        if ((!type.equals(SearchType.resourcetype)) & (!type.equals(SearchType.renameContainer))) {
            m_ignoreSubSites.setValue(Boolean.FALSE);
            m_ignoreSubSites.setVisible(false);
        } else {
            m_ignoreSubSites.setVisible(true);
        }

        m_searchIndex.setVisible(type.isSolrSearch());
        m_solrQuery.setVisible(type.isSolrSearch());
        updateReplace();
        m_xPath.setVisible(type.isContentValuesOnly());
        m_locale.setVisible(type.isContentValuesOnly());

        m_resourceType.setVisible(
            !type.isPropertySearch()
                & !type.equals(SearchType.resourcetype)
                & !type.equals(SearchType.renameContainer));

        IndexedContainer types = (IndexedContainer)m_resourceType.getContainerDataSource();
        types.removeAllContainerFilters();
        types.addContainerFilter(
            type.isContentValuesOnly() ? CmsVaadinUtils.FILTER_XML_CONTENTS : CmsVaadinUtils.FILTER_NO_FOLDERS);
    }
1099757
function updateFilter() {
            if (angular.isFunction(lxSelect.resetDropdownSize)) {
                lxSelect.resetDropdownSize();
            }

            if (angular.isDefined(lxSelect.filter)) {
                lxSelect.matchingPaths = lxSelect.filter({
                    newValue: lxSelect.filterModel
                });
            } else if (lxSelect.choicesViewMode === 'panes') {
                lxSelect.matchingPaths = lxSelect.searchPath(lxSelect.filterModel);
                _closePanes();
            }

            if (lxSelect.autocomplete) {
                lxSelect.activeChoiceIndex = -1;

                if (lxSelect.filterModel) {
                    LxDropdownService.open('dropdown-' + lxSelect.uuid, '#lx-select-selected-wrapper-' + lxSelect.uuid);
                } else {
                    LxDropdownService.close('dropdown-' + lxSelect.uuid);
                }
            }

            if (lxSelect.choicesViewMode === 'panes' && angular.isDefined(lxSelect.matchingPaths) && lxSelect.matchingPaths.length > 0) {
                var longest = _getLongestMatchingPath();
                if (!longest) {
                    return;
                }

                var longestPath = longest.split('.');
                if (longestPath.length === 0) {
                    return;
                }

                angular.forEach(longestPath, function forEachPartOfTheLongestPath(part, index) {
                    _openPane(index, part, index === (longestPath.length - 1));
                });
            }
        }
537899
async function searchPrevRoutes(target) {
    const connNames = await listConnectionNames();
    const ret = [];
    for (const connName of connNames) {
        const cmd = [
            'nmcli', '-f', 'IP4.ROUTE', 'connection', 'show', connName,
        ];
        const output = await executeCommand(cmd);
        for (const line of output.split('\n')) {
            const exs = `dst\\s*=\\s*${target},\\snh\\s*=\\s*([\\d\.]+)`;
            const re = line.match(new RegExp(exs));
            if (!re) {
                continue;
            }
            ret.push({
                connName: connName,
                target: target,
                gatewayIP: re[1],
            });
        }
    }
    return ret;
}
1337420
def extra_context(self, request, context):
        """"""
        if settings.PAGE_EXTRA_CONTEXT:
            context.update(settings.PAGE_EXTRA_CONTEXT())
13120
static void changePage(String url, TransitionIntf<?> t, boolean reverse, boolean changeHash,
                           boolean dialog) {
        changingPage = true;
        try {
            changePage(url, t.getJqmValue(), reverse, changeHash, dialog ? DATA_ROLE_DIALOG : null);
        } finally {
            changingPage = false;
        }
    }
1028603
private void setGroupSearchScope(Map<String, Object> configProps) {
        if (configProps.get("recursiveSearch") != null &&
            configProps.get("recursiveSearch") instanceof Boolean)
            iRecursiveSearch = (Boolean) configProps.get("recursiveSearch");
    }
460740
def set_gateway(self, gateway):
        '''
        
        '''
        self.gateway = gateway
        self.gewest.gateway = gateway