Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
297,500
void (List<Object> history) { popup.setHistory(history); }
setHistory
297,501
List<Object> () { return popup.getHistory(); }
getHistory
297,502
void (ChoiceRenderer renderer) { if (renderer != getRenderer()) { if (renderer == null) { popup.setStringContent(format, choicesComparator, getStringComparator()); editor.setTextMode(true); } else { popup.setRenderedContent(renderer, choicesComparator == null ? comparator : choicesComparator, getStringComparator()); editor.setRenderMode(); } requestChoices(); } }
setRenderer
297,503
ChoiceRenderer () { return popup.getFilterRenderer().getUserRenderer(); }
getRenderer
297,504
boolean () { return editor.isFocused() && isEnabled(); }
isEditing
297,505
void (Collection<?> choices) { popup.clearChoices(); addChoices(choices); }
setChoices
297,506
int () { return popup.getChoicesSize(); }
getChoicesSize
297,507
void (Collection<?> choices) { popup.addChoices(choices, editor.getChoicesParser()); }
addChoices
297,508
void (boolean warning) { editor.setWarning(warning); }
setWarning
297,509
void (Object content) { editor.setContent(content); }
setEditorContent
297,510
void () { if (isEnabled()) { filtersHandler.updateEditorChoices(this); } }
requestChoices
297,511
void () { ChoiceRenderer lcr = getRenderer(); boolean updated; if (lcr == null) { updated = popup.setStringContent(format, choicesComparator, getStringComparator()); editor.updateParser(); } else { //for rendered content, it is required having a non null comparator updated = popup.setRenderedContent(lcr, choicesComparator == null ? comparator : choicesComparator, getStringComparator()); } if (updated) { requestChoices(); } }
formatOrComparatorUpdated
297,512
IParserModel () { return filtersHandler.getParserModel(); }
getParserModel
297,513
Comparator<String> () { return getParserModel().getStringComparator(ignoreCase); }
getStringComparator
297,514
void (JComponent component) { //Disposable capturedThis = this; // //component.addFocusListener(new FocusListener() { // // InlayEventDispatcher eventDispatcher = new InlayEventDispatcher(component); // // @Override public void focusLost(FocusEvent e) { // popup.hide(); // filter.consolidateFilter(); // // important: call focusMoved AFTER checking changes, to // // ensure that any changes on decoration (custom choice) // // are not lost // editor.focusMoved(false); // downButton.setFocused(false); // // IdeEventQueue.getInstance().removeDispatcher(eventDispatcher); // } // // @Override public void focusGained(FocusEvent e) { // // IdeEventQueue.getInstance().addDispatcher(eventDispatcher, capturedThis); // // downButton.setFocused(true); // if (isEnabled()) { // editor.focusMoved(true); // } // } // }); component.setFocusable(true); setupEnterKey(component); setupEscKey(component); setupHomeKey(component); setupHomeCtrlKey(component); setupEndKey(component); setupEndCtrlKey(component); setupUpKey(component); setupUpCtrlKey(component); setupUpPageKey(component); setupDownPageKey(component); setupDownKey(component); setupDownCtrlKey(component); }
setupComponent
297,515
void (JComponent component) { @NlsSafe String actionName = "FCB_ENTER"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = 6926912268574067920L; @Override public void actionPerformed(ActionEvent e) { if (popup.isPopupFocused()) { popupSelection(popup.getSelection()); } else { // use update instead of checkChanges, in case it // is needed to reset the icon of a CustomChoice filter.consolidateFilter(); } popup.hide(); } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), actionName); }
setupEnterKey
297,516
void (ActionEvent e) { if (popup.isPopupFocused()) { popupSelection(popup.getSelection()); } else { // use update instead of checkChanges, in case it // is needed to reset the icon of a CustomChoice filter.consolidateFilter(); } popup.hide(); }
actionPerformed
297,517
void (JComponent component) { @NlsSafe String actionName = "FCB_ESC"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = -4351240441578952476L; @Override public void actionPerformed(ActionEvent e) { popup.hide(); if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(textField.getCaretPosition()); } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), actionName); }
setupEscKey
297,518
void (ActionEvent e) { popup.hide(); if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(textField.getCaretPosition()); } }
actionPerformed
297,519
void (JComponent component) { @NlsSafe String actionName = "FCB_END"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = -2777729244353281164L; @Override public void actionPerformed(ActionEvent e) { if (!popup.isPopupFocused() || !popup.selectLast(false)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(textField.getText() .length()); } } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0), actionName); }
setupEndKey
297,520
void (ActionEvent e) { if (!popup.isPopupFocused() || !popup.selectLast(false)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(textField.getText() .length()); } } }
actionPerformed
297,521
void (JComponent component) { @NlsSafe String actionName = "FCB_END_CTRL"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = 1945871436968682881L; @Override public void actionPerformed(ActionEvent e) { // if focus is on the popup: select the very last item on the // popup, changing probably from the history list to the choices // list; if the item is already on the very last element, or // the focus is on the text field, move the caret to the end if (!popup.isPopupFocused() || !popup.selectLast(true)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(textField.getText() .length()); } } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.CTRL_MASK), actionName); }
setupEndCtrlKey
297,522
void (ActionEvent e) { // if focus is on the popup: select the very last item on the // popup, changing probably from the history list to the choices // list; if the item is already on the very last element, or // the focus is on the text field, move the caret to the end if (!popup.isPopupFocused() || !popup.selectLast(true)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(textField.getText() .length()); } } }
actionPerformed
297,523
void (JComponent component) { @NlsSafe String actionName = "FCB_HOME_CTRL"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = 3916227645612863334L; @Override public void actionPerformed(ActionEvent e) { // if focus is on the popup: select the very first item on the // popup, changing probably from the choices list to the history // list; if the item is already on the very first element, or // the focus is on the text field, move the caret home if (!popup.isPopupFocused() || !popup.selectFirst(true)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(0); } } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.CTRL_MASK), actionName); }
setupHomeCtrlKey
297,524
void (ActionEvent e) { // if focus is on the popup: select the very first item on the // popup, changing probably from the choices list to the history // list; if the item is already on the very first element, or // the focus is on the text field, move the caret home if (!popup.isPopupFocused() || !popup.selectFirst(true)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(0); } } }
actionPerformed
297,525
void (JComponent component) { @NlsSafe String actionName = "FCB_HOME"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = -1583258893221830664L; @Override public void actionPerformed(ActionEvent e) { if (!popup.isPopupFocused() || !popup.selectFirst(false)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(0); } } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0), actionName); }
setupHomeKey
297,526
void (ActionEvent e) { if (!popup.isPopupFocused() || !popup.selectFirst(false)) { if (e.getSource() instanceof JTextField textField) { textField.setCaretPosition(0); } } }
actionPerformed
297,527
void (JComponent component) { @NlsSafe String actionName = "FCB_PAGE_DOWN"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = -1187830005921916553L; @Override public void actionPerformed(ActionEvent e) { // without moving the focus, move down one page on the popup // menu, probably jumping to choices list if (popup.isVisible()) { boolean focusPopup = popup.isPopupFocused(); popup.selectDownPage(); popup.setPopupFocused(focusPopup); } else { showChoices(); } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), actionName); }
setupDownPageKey
297,528
void (ActionEvent e) { // without moving the focus, move down one page on the popup // menu, probably jumping to choices list if (popup.isVisible()) { boolean focusPopup = popup.isPopupFocused(); popup.selectDownPage(); popup.setPopupFocused(focusPopup); } else { showChoices(); } }
actionPerformed
297,529
void (JComponent component) { @NlsSafe String actionName = "FCB_PAGE_UP"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = 6590487133211390977L; @Override public void actionPerformed(ActionEvent e) { // without moving the focus, move up one page on the popup menu, // probably jumping to history list if (popup.isVisible()) { boolean focusPopup = popup.isPopupFocused(); popup.selectUpPage(); popup.setPopupFocused(focusPopup); } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), actionName); }
setupUpPageKey
297,530
void (ActionEvent e) { // without moving the focus, move up one page on the popup menu, // probably jumping to history list if (popup.isVisible()) { boolean focusPopup = popup.isPopupFocused(); popup.selectUpPage(); popup.setPopupFocused(focusPopup); } }
actionPerformed
297,531
void (JComponent component) { @NlsSafe String actionName = "FCB_UP_CTRL"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = 746565926592574009L; @Override public void actionPerformed(ActionEvent e) { // if focus is on the popup: move from choices to history, and, // being already on history, up to text field. if (popup.isPopupFocused()) { if (!popup.selectUp(true)) { popup.setPopupFocused(false); } } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_MASK), actionName); }
setupUpCtrlKey
297,532
void (ActionEvent e) { // if focus is on the popup: move from choices to history, and, // being already on history, up to text field. if (popup.isPopupFocused()) { if (!popup.selectUp(true)) { popup.setPopupFocused(false); } } }
actionPerformed
297,533
void (JComponent component) { @NlsSafe String actionName = "FCB_UP"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = 4555560696351340571L; @Override public void actionPerformed(ActionEvent e) { // if popup is not visible, just make it visible. // if popup has not the focus, pass it the focus // else: move up! if (popup.isVisible()) { if (popup.isPopupFocused()) { popup.selectUp(false); } else { popup.setPopupFocused(true); // if still not focused, it has empty content if (!popup.isPopupFocused()) { popup.hide(); } } } else { showChoices(); } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), actionName); }
setupUpKey
297,534
void (ActionEvent e) { // if popup is not visible, just make it visible. // if popup has not the focus, pass it the focus // else: move up! if (popup.isVisible()) { if (popup.isPopupFocused()) { popup.selectUp(false); } else { popup.setPopupFocused(true); // if still not focused, it has empty content if (!popup.isPopupFocused()) { popup.hide(); } } } else { showChoices(); } }
actionPerformed
297,535
void (JComponent component) { @NlsSafe String actionName = "FCB_DOWN_CTRL"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = -8075976293862885060L; @Override public void actionPerformed(ActionEvent e) { // if popup is not visible, make it visible // if popup has not the focus, pass it the focus // else: move to the first visible element in the choices if (popup.isVisible()) { if (popup.isPopupFocused()) { popup.selectDown(true); } else { popup.setPopupFocused(true); } } else { showChoices(); } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_MASK), actionName); }
setupDownCtrlKey
297,536
void (ActionEvent e) { // if popup is not visible, make it visible // if popup has not the focus, pass it the focus // else: move to the first visible element in the choices if (popup.isVisible()) { if (popup.isPopupFocused()) { popup.selectDown(true); } else { popup.setPopupFocused(true); } } else { showChoices(); } }
actionPerformed
297,537
void (JComponent component) { @NlsSafe String actionName = "FCB_DOWN"; Action action = new AbstractAction(actionName) { private static final long serialVersionUID = -4133513199725709434L; @Override public void actionPerformed(ActionEvent e) { // if popup is not visible, just make it visible. // if popup has not the focus, pass it the focus // else: move down! if (popup.isVisible()) { if (popup.isPopupFocused()) { popup.selectDown(false); } else { popup.setPopupFocused(true); } } else { showChoices(); } } }; component.getActionMap().put(actionName, action); component.getInputMap(JComponent.WHEN_FOCUSED) .put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), actionName); }
setupDownKey
297,538
void (ActionEvent e) { // if popup is not visible, just make it visible. // if popup has not the focus, pass it the focus // else: move down! if (popup.isVisible()) { if (popup.isPopupFocused()) { popup.selectDown(false); } else { popup.setPopupFocused(true); } } else { showChoices(); } }
actionPerformed
297,539
boolean (Entry entry) { return delegate == null || delegate.include(entry); }
include
297,540
void (boolean enable) { if (enable != isEnabled()) { setFilterEnabled(enable); delegate = enable ? editor.getFilter() : null; super.setEnabled(enable); } }
setEnabled
297,541
RowFilter () { return delegate; }
getDelegate
297,542
void (RowFilter filter) { if (isEnabled()) { if (filter != delegate) { delegate = filter; reportFilterUpdatedToObservers(); reportOnConsolidation = false; if (editor.isFocused()) { toBeConsolidated = true; } else { filtersHandler.consolidateFilterChanges(modelIndex); } } } }
editorFilterUpdated
297,543
boolean (RowFilter filter) { delegate = filter; boolean ret = filtersHandler.applyEditorFilter(this); if (ret) { toBeConsolidated = true; reportOnConsolidation = false; } else { reportOnConsolidation = true; } return ret; }
attemptEditorFilterUpdate
297,544
void () { if (isEnabled()) { // next call can imply a call to editorFilterUpdated if // there are changes on the filter editor.consolidateFilter(); if (reportOnConsolidation) { reportOnConsolidation = false; reportFilterUpdatedToObservers(); } if (toBeConsolidated) { toBeConsolidated = false; boolean warning = filtersHandler.consolidateFilterChanges( modelIndex); editor.setWarning(warning); // only add valid content creating filters that do not // filter all the content out if (editor.isValidContent() && !warning) { popup.addHistory(editor.getContent()); } } } }
consolidateFilter
297,545
Object () { return focusedList.getSelectedValue(); }
getSelection
297,546
int () { return choicesModel.getSize(); }
getChoicesSize
297,547
void (Collection<?> choices, IChoicesParser parser) { if (choicesModel.addContent(choices, parser)) { hide(); } }
addChoices
297,548
void (Object st) { if (historyModel.add(st)) { hide(); } }
addHistory
297,549
void () { choicesModel.clearContent(); hide(); }
clearChoices
297,550
void () { historyModel.clear(); hide(); }
clearHistory
297,551
boolean () { return (popup != null) && popup.isVisible(); }
isVisible
297,552
boolean (Component editor) { if (isVisible()) { return false; } prepareGui(); setPopupFocused(false); editorBoundsWatcher.displayPopup(editor); // Not yet knowing the focus, but the call to select (immediately after, // always), takes care of it focusedList = historyList; return true; }
display
297,553
boolean () { return editorBoundsWatcher.displayPopup(null); }
hide
297,554
FilterListCellRenderer () { return listRenderer; }
getFilterRenderer
297,555
boolean (ChoiceRenderer renderer, Comparator choicesComparator, Comparator stringComparator) { hide(); listRenderer.setUserRenderer(renderer); boolean ret = choicesModel.setRenderedContent(choicesComparator, stringComparator); if (ret){ historyModel.setStringContent(null); } return ret; }
setRenderedContent
297,556
boolean (Format format, Comparator choicesComparator, Comparator<String> stringComparator) { hide(); listRenderer.setUserRenderer(null); boolean ret = choicesModel.setStringContent(format, choicesComparator, stringComparator); if (ret){ historyModel.setStringContent(stringComparator); } return ret; }
setStringContent
297,557
Comparator<String> () { return choicesModel.getStringComparator(); }
getStringComparator
297,558
ChoiceMatch (Object hint) { ChoiceMatch hMatch = historyModel.getClosestMatch(hint); if (choicesModel.getSize() > 0) { ChoiceMatch match = choicesModel.getBestMatch(hint); if (isVisible() && (match.index >= 0)) { choicesList.ensureIndexIsVisible(match.index); } if (match.exact || (!hMatch.exact && (match.len >= hMatch.len))) { if (match.index >= 0) { if (isVisible()) { focusChoices(); select(match.index); } } return match; } } if (hMatch.index != -1) { if (isVisible()) { focusHistory(); select(hMatch.index); } } return hMatch; }
selectBestMatch
297,559
String (String s) { return choicesModel.getCompletion(s, historyModel.getList()); }
getCompletion
297,560
void (boolean set) { if (set != listRenderer.isFocusOnList()) { listRenderer.setFocusOnList(set); if(focusedList != null) { focusedList.repaint(); } } }
setPopupFocused
297,561
boolean () { return isVisible() && listRenderer.isFocusOnList(); }
isPopupFocused
297,562
void (int size) { historyModel.setMaxHistory(Math.max(0, Math.min(size, maxVisibleRows))); hide(); }
setMaxHistory
297,563
int () { return historyModel.getMaxHistory(); }
getMaxHistory
297,564
void (List<Object> history) { historyModel.initialize(history); }
setHistory
297,565
List<Object> () { return historyModel.getShownHistory(); }
getHistory
297,566
boolean (boolean forceJump) { boolean ret = canSwitchToHistory() && (forceJump || (choicesList.getSelectedIndex() == 0)); if (ret) { focusHistory(); } return select(0) || ret; }
selectFirst
297,567
boolean (boolean forceJump) { boolean ret = canSwitchToChoices() && (forceJump || (historyList.getSelectedIndex() == (historyModel.getSize() - 1))); if (ret) { focusChoices(); } return select(focusedList.getModel().getSize() - 1) || ret; }
selectLast
297,568
boolean (boolean jumpRequired) { if (jumpRequired || !select(focusedList.getSelectedIndex() - 1)) { if (!canSwitchToHistory()) { return false; } focusHistory(); select(historyModel.getSize() - 1); } return true; }
selectUp
297,569
void (boolean jumpRequired) { if (jumpRequired || !select(focusedList.getSelectedIndex() + 1)) { if (canSwitchToChoices()) { focusChoices(); select(choicesList.getFirstVisibleIndex()); } } }
selectDown
297,570
void () { if (isFocusInHistory()) { if (canSwitchToChoices()) { focusChoices(); } select(focusedList.getLastVisibleIndex()); } else { int lst = choicesList.getLastVisibleIndex(); if (lst == choicesList.getSelectedIndex()) { lst = Math.min(lst + lst - choicesList.getFirstVisibleIndex(), choicesModel.getSize() - 1); } select(lst); } }
selectDownPage
297,571
void () { int r = 0; if (!isFocusInHistory()) { int selected = choicesList.getSelectedIndex(); if (canSwitchToHistory() && (selected == 0)) { focusHistory(); } else { r = choicesList.getFirstVisibleIndex(); if (r == selected) { r = Math.max(0, r + r - choicesList.getLastVisibleIndex()); } } } select(r); }
selectUpPage
297,572
boolean (int n) { int current = focusedList.getSelectedIndex(); setPopupFocused(true); if (n >= 0) { focusedList.setSelectedIndex(n); focusedList.ensureIndexIsVisible(n); } return current != focusedList.getSelectedIndex(); }
select
297,573
boolean () { return (focusedList == choicesList) && historyScrollPane.isVisible(); }
canSwitchToHistory
297,574
boolean () { return (focusedList == historyList) && choicesScrollPane.isVisible(); }
canSwitchToChoices
297,575
void () { choicesList.clearSelection(); focusedList = historyList; }
focusHistory
297,576
void () { historyList.clearSelection(); focusedList = choicesList; }
focusChoices
297,577
boolean () { return focusedList == historyList; }
isFocusInHistory
297,578
void (JComponent pane, int width) { Dimension size = pane.getPreferredSize(); size.width = width; pane.setPreferredSize(size); }
configurePaneSize
297,579
void () { Object prototype; if ((listRenderer != null) && (listRenderer.getUserRenderer() == null)) { prototype = choicesList.getPrototypeCellValue(); // we need to change the prototype. The jlist will not update its // cell height if the prototype does not change prototype = "X".equals(prototype) ? "Z" : "X"; //NON-NLS } else { prototype = null; } choicesList.setPrototypeCellValue(prototype); historyList.setPrototypeCellValue(prototype); }
ensureListRowsHeight
297,580
void (IFilterEditor editor) { MouseHandler mouseHandler = new MouseHandler(); choicesList = new JList(choicesModel); choicesList.addMouseMotionListener(mouseHandler); choicesList.addMouseListener(mouseHandler); choicesScrollPane = createScrollPane(choicesList); historyList = new JList(historyModel); historyList.addMouseMotionListener(mouseHandler); historyList.addMouseListener(mouseHandler); choicesList.setBorder(null); choicesList.setFocusable(false); choicesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); historyList.setBorder(null); historyList.setFocusable(false); historyList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); ensureListRowsHeight(); separator = new JSeparator(); popup = new JPopupMenu(); popup.setLayout(new BorderLayout()); popup.setBorderPainted(true); popup.setOpaque(false); popup.addPopupMenuListener(this); historyScrollPane = createScrollPane(historyList); popup.add(historyScrollPane, BorderLayout.NORTH); popup.add(separator, BorderLayout.CENTER); popup.add(choicesScrollPane, BorderLayout.SOUTH); popup.setDoubleBuffered(true); popup.setFocusable(false); listRenderer = new FilterListCellRenderer(editor, choicesList); choicesList.setCellRenderer(listRenderer); historyList.setCellRenderer(listRenderer); }
createGui
297,581
void () { // The history size PLUS choices size must be below `maxVisibleRows` // (note that the history size is always lower than `maxVisibleRows`, // and that it should be, if possible, equal to 'maxPopupHistory') // In addition, the history should not show any of the choices that // are visible, when all choices can be displayed at once int historySize = historyModel.clearRestrictions(); // restrict none int choicesSize = choicesModel.getSize(); int maxChoices = Math.min(choicesSize, maxVisibleRows - historySize); if ((historySize > 0) && (choicesSize <= maxChoices)) { for (int i = 0; i < choicesSize; i++) { if (historyModel.restrict(choicesModel.getElementAt(i))) { --historySize; } } maxChoices = choicesSize; } boolean showHistory = historySize > 0; boolean showChoices = maxChoices > 0; choicesScrollPane.setVisible(showChoices); historyScrollPane.setVisible(showHistory); if (showHistory) { historyList.setVisibleRowCount(historySize); historyScrollPane.setPreferredSize(null); } if (showChoices) { // in fact, there are always choices choicesList.setVisibleRowCount(maxChoices); choicesScrollPane.setPreferredSize(null); } separator.setVisible(showHistory && showChoices); }
prepareGui
297,582
JScrollPane (JList list) { JScrollPane ret = new JScrollPane(list, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ret.setHorizontalScrollBar(null); ret.setFocusable(false); ret.getVerticalScrollBar().setFocusable(false); ret.setBorder(null); return ret; }
createScrollPane
297,583
boolean (Object source) { boolean ret = !popup.isVisible() && (cancelReason == source); cancelReason = null; return ret; }
isMenuCanceledForMouseEvent
297,584
void (Object object) { choiceSelected(object); hide(); }
listSelection
297,585
boolean (Component editor) { if (editor != this.editor) { if (this.editor != null) { this.editor.removeComponentListener(this); } if (editor != null) { editor.addComponentListener(this); } } this.editor = editor; if (editor != null) { showPopup(editor); } else if (popup.isVisible()) { popup.setVisible(false); return true; } return false; }
displayPopup
297,586
void () { if (popup.isVisible()) { showPopup(editor); } else { displayPopup(null); } }
handleChange
297,587
void () { controller.updateLook(); }
updateLook
297,588
RowFilter () { return controller.getFilter(); }
getFilter
297,589
Object () { return controller.getContent(); }
getContent
297,590
void (Object content) { controller.setContent(content); }
setContent
297,591
void () { if (controller instanceof TextController) { ((TextController) controller).setParser( filterEditor.createParser()); } }
updateParser
297,592
IChoicesParser () { return (controller instanceof IChoicesParser)? (IChoicesParser)controller : null; }
getChoicesParser
297,593
boolean () { return controller instanceof EditableTC; }
isEditableContent
297,594
void (boolean enable) { this.instantFiltering = enable; }
setInstantFiltering
297,595
boolean () { return instantFiltering; }
isInstantFiltering
297,596
void (boolean enable) { this.allowInstantVanishing = enable; }
setAllowedInstantVanishing
297,597
boolean () { return allowInstantVanishing; }
isAllowedInstantVanishing
297,598
void (boolean enable) { this.autoCompletion = enable; }
setAutoCompletion
297,599
boolean () { return autoCompletion; }
isAutoCompletion