/** * This method is used to report environmental invariants which are * violated when the user adjusts the combo box in a way that is * incompatible with the requirements for autocompletion. A message can be * specified which will be included in the {@link IllegalStateException} * that is throw out of this method after the autocompletion support is * uninstalled. * * @param message a message to the programmer explaining the environmental * invariant that was violated */ private void throwIllegalStateException(String message) { final String exceptionMsg = message + "\n" + "In order for AutoCompleteSupport to continue to " + "work, the following invariants must be maintained after " + "AutoCompleteSupport.install() has been called:\n" + "* the ComboBoxModel may not be removed\n" + "* the AbstractDocument behind the JTextField can be changed but must be changed to some subclass of AbstractDocument\n" + "* the DocumentFilter on the AbstractDocument behind the JTextField may not be removed\n"; uninstall(); throw new IllegalStateException(exceptionMsg); }
/** * This method is used to report environmental invariants which are * violated when the user adjusts the combo box in a way that is * incompatible with the requirements for autocompletion. A message can be * specified which will be included in the {@link IllegalStateException} * that is throw out of this method after the autocompletion support is * uninstalled. * * @param message a message to the programmer explaining the environmental * invariant that was violated */ private void throwIllegalStateException(String message) { final String exceptionMsg = message + "\n" + "In order for AutoCompleteSupport to continue to " + "work, the following invariants must be maintained after " + "AutoCompleteSupport.install() has been called:\n" + "* the ComboBoxModel may not be removed\n" + "* the AbstractDocument behind the JTextField can be changed but must be changed to some subclass of AbstractDocument\n" + "* the DocumentFilter on the AbstractDocument behind the JTextField may not be removed\n"; uninstall(); throw new IllegalStateException(exceptionMsg); }
/** * This method is used to report environmental invariants which are * violated when the user adjusts the combo box in a way that is * incompatible with the requirements for autocompletion. A message can be * specified which will be included in the {@link IllegalStateException} * that is throw out of this method after the autocompletion support is * uninstalled. * * @param message a message to the programmer explaining the environmental * invariant that was violated */ private void throwIllegalStateException(String message) { final String exceptionMsg = message + "\n" + "In order for AutoCompleteSupport to continue to " + "work, the following invariants must be maintained after " + "AutoCompleteSupport.install() has been called:\n" + "* the ComboBoxModel may not be removed\n" + "* the AbstractDocument behind the JTextField can be changed but must be changed to some subclass of AbstractDocument\n" + "* the DocumentFilter on the AbstractDocument behind the JTextField may not be removed\n"; uninstall(); throw new IllegalStateException(exceptionMsg); }
public void run() { if (supportConceptClass != null && supportConceptClass.isInstalled()) supportConceptClass.uninstall(); conceptClasses.removeAllItems(); list.add(Config.language.getProperty("ToolBar.Search.ConceptClass")); conceptClasses.addItem(Config.language.getProperty("ToolBar.Search.ConceptClass")); boolean hasCCs = false; for (ConceptClass conceptClass : graph.getMetaData().getConceptClasses()) { Set<ONDEXConcept> view = graph.getConceptsOfConceptClass(conceptClass); if (view.size() > 0) { hasCCs = true; MetaDataWrapper wrapper = new MetaDataWrapper(conceptClass); conceptClasses.addItem(wrapper); list.add(wrapper); } } conceptClasses.setEnabled(hasCCs); if (hasCCs) addAutoCompleteSupport(list, conceptClasses); } };
public void run() { if (supportDataSource != null && supportDataSource.isInstalled()) supportDataSource.uninstall(); dataSources.removeAllItems(); list.add(Config.language.getProperty("ToolBar.Search.DataSource")); dataSources.addItem(Config.language.getProperty("ToolBar.Search.DataSource")); boolean hasDSs = false; for (DataSource dataSource : graph.getMetaData().getDataSources()) { Set<ONDEXConcept> view = graph.getConceptsOfDataSource(dataSource); if (view.size() > 0) { hasDSs = true; MetaDataWrapper wrapper = new MetaDataWrapper(dataSource); dataSources.addItem(wrapper); list.add(wrapper); } } dataSources.setEnabled(hasDSs); if (hasDSs) addAutoCompleteSupport(list, dataSources); } };
public void run() { if (supportTag != null && supportTag.isInstalled()) supportTag.uninstall(); tags.removeAllItems(); list.add(Config.language.getProperty("ToolBar.Search.Tag")); tags.addItem(Config.language.getProperty("ToolBar.Search.Tag")); boolean hasContexts = false; for (ONDEXConcept c : graph.getAllTags()) { hasContexts = true; String name = ConceptListUtils.getDefaultNameForConcept(c); IntegerStringWrapper wrapper = new IntegerStringWrapper(c.getId(), name); tags.addItem(wrapper); list.add(wrapper); } tags.setEnabled(hasContexts); if (hasContexts) addAutoCompleteSupport(list, tags); } };
supportConceptClass.uninstall(); conceptClasses.removeAllItems(); conceptClasses.addItem(Config.language.getProperty("ToolBar.Search.ConceptClass")); supportDataSource.uninstall(); dataSources.removeAllItems(); dataSources.addItem(Config.language.getProperty("ToolBar.Search.DataSource")); supportTag.uninstall(); tags.removeAllItems(); tags.addItem(Config.language.getProperty("ToolBar.Search.Tag"));
autoComplete.uninstall(); autoComplete = null;