Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
50,600
Context () { final HistoryElement context = myModel.getSelectedItem(); if (context == null || context.expression == null) { final Set<Namespace> cache = myNamespaceCache != null ? myNamespaceCache : Collections.emptySet(); return new Context(new HistoryElement(myDocument.getText(), Collections.emptySet(), cache), getMo...
getContext
50,601
ContextType () { return XPathSupport.TYPE; }
getContextType
50,602
XmlElement () { return myContextElement; }
getContextElement
50,603
VariableContext () { return myVariableResolver; }
getVariableContext
50,604
Set<QName> (boolean forValidation) { return myCollectedInfo.attributes; }
getAttributes
50,605
Set<QName> (Set<QName> _set) { final Set<QName> set = new HashSet<>(_set); for (Iterator<QName> it = set.iterator(); it.hasNext();) { final QName name = it.next(); final String prefix = name.getPrefix(); if (prefix == null || prefix.length() == 0) { final String uri = name.getNamespaceURI(); if (uri != null && uri.leng...
filterDefaultNamespace
50,606
Set<QName> (boolean forValidation) { return filterDefaultNamespace(myCollectedInfo.elements); }
getElements
50,607
String (String prefix, XmlElement context) { final String s = myMap.get(prefix); if (s == null && prefix.length() == 0) { return ""; } return s; }
getNamespaceURI
50,608
String (String uri, XmlElement context) { final List<String> list = myMap.getKeysByValue(uri); return list != null && !list.isEmpty() ? list.get(0) : null; }
getPrefixForURI
50,609
Collection<String> (XmlElement context) { return myMap.keySet(); }
getKnownPrefixes
50,610
PsiElement (String prefix, XmlElement context) { return null; }
resolve
50,611
void (Map<String, String> map) { myMap = new BidirectionalMap<>(); myMap.putAll(map); }
setMap
50,612
IntentionAction[] (@NotNull PsiReference reference, String localName) { return new IntentionAction[]{ new MyRegisterPrefixAction(reference) }; }
getUnresolvedNamespaceFixes
50,613
String (XmlElement context) { if (context instanceof XmlTag) return ((XmlTag)context).getNamespaceByPrefix(""); else if (context instanceof XmlAttribute && ((XmlAttribute)context).getNamespacePrefix().isEmpty()) { return ((XmlAttribute)context).getNamespace(); } return null; }
getDefaultNamespace
50,614
String () { return getFamilyName(); }
getText
50,615
String () { return XPathBundle.message("intention.family.name.register.namespace.prefix"); }
getFamilyName
50,616
boolean (@NotNull Project project, Editor editor, PsiFile file) { return myReference instanceof PrefixReference && myReference.getElement().isValid() && ((PrefixReference)myReference).isUnresolved(); }
isAvailable
50,617
boolean () { return false; }
startInWriteAction
50,618
Component (JTable ttable, Object value, boolean isSelected, int row, int col) { myExpression = (Expression)value; myDocument = PsiDocumentManager.getInstance(project).getDocument(myExpression.getFile()); return new EditorTextField(myDocument, project, myExpression.getFileType()) { @Override protected boolean shouldHave...
getTableCellEditorComponent
50,619
boolean () { return false; }
shouldHaveBorder
50,620
void (@NotNull Editor editor) { super.onEditorAdded(editor); Runnable runnable = () -> { final Editor e = getEditor(); if (e != null) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(e.getContentComponent(), true)); } }; SwingUtilities.invokeLater(runna...
onEditorAdded
50,621
boolean (EventObject eventObject) { if (eventObject instanceof MouseEvent) { return ((MouseEvent)eventObject).getClickCount() >= 2; } return super.isCellEditable(eventObject); }
isCellEditable
50,622
Expression () { return myExpression; }
getCellEditorValue
50,623
boolean () { super.stopCellEditing(); PsiDocumentManager.getInstance(project).commitDocument(myDocument); return true; }
stopCellEditing
50,624
void (ComboBox<String> comboBox) { final ComboBoxEditor boxEditor = comboBox.getEditor(); if (boxEditor != null) { final Component component = boxEditor.getEditorComponent(); if (component instanceof JTextField) { ((JTextField)component).getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void...
addUpdateListener
50,625
void (@NotNull DocumentEvent e) { updateOkAction(); }
textChanged
50,626
void (ItemEvent e) { updateOkAction(); }
itemStateChanged
50,627
void () { getOKAction().setEnabled(getURI().length() > 0 && getPrefix().length() > 0); }
updateOkAction
50,628
JComponent () { return myRoot; }
createCenterPanel
50,629
String () { final Object item = (myPrefix.isEditable() ? myPrefix.getEditor().getItem() : myPrefix.getSelectedItem()); return ((String)item).trim(); }
getPrefix
50,630
String () { final Object item = (myURI.isEditable() ? myURI.getEditor().getItem() : myURI.getSelectedItem()); return ((String)item).trim(); }
getURI
50,631
EditorTextField () { return myEditorTextField; }
getField
50,632
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
50,633
EditorEx () { final EditorEx editor = super.createEditor(); editor.setHorizontalScrollbarVisible(true); editor.setVerticalScrollbarVisible(true); editor.setEmbeddedIntoDialogWrapper(true); editor.getComponent().setPreferredSize(null); return editor; }
createEditor
50,634
boolean () { return false; }
isOneLineMode
50,635
void (ListDataEvent e) { }
intervalAdded
50,636
void (ListDataEvent e) { }
intervalRemoved
50,637
void (ListDataEvent e) { final int selectedIndex = myModel.getSelectedIndex(); if (selectedIndex != -1) { myEditorTextField.setText(myModel.getItemString(selectedIndex)); } else { // setText(""); } }
contentsChanged
50,638
void () { final DefaultActionGroup pagerGroup = new DefaultActionGroup(); pagerGroup.add(new ItemAction("PreviousOccurence", this) { @Override public void update(@NotNull AnActionEvent e) { final Presentation presentation = e.getPresentation(); presentation.setEnabled(myModel.getSelectedIndex() < myModel.getSize() - 1)...
addHistoryPagers
50,639
void (@NotNull AnActionEvent e) { final Presentation presentation = e.getPresentation(); presentation.setEnabled(myModel.getSelectedIndex() < myModel.getSize() - 1); presentation.setText(XPathBundle.message("action.previous.history.entry.text")); presentation.setDescription(XPathBundle.message("action.navigate.to.previ...
update
50,640
void (@NotNull AnActionEvent e) { myModel.setSelectedIndex(myModel.getSelectedIndex() + 1); refocus(); }
actionPerformed
50,641
void (@NotNull AnActionEvent e) { final Presentation presentation = e.getPresentation(); presentation.setEnabled(myModel.getSelectedIndex() > 0); presentation.setText(XPathBundle.message("action.next.history.entry.text")); presentation.setDescription(XPathBundle.message("action.navigate.to.next.history.entry.descriptio...
update
50,642
void (@NotNull AnActionEvent e) { myModel.setSelectedIndex(myModel.getSelectedIndex() - 1); refocus(); }
actionPerformed
50,643
void () { SwingUtilities.invokeLater(() -> { final Editor editor = myEditorTextField.getEditor(); if (editor != null) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(editor.getContentComponent(), true)); } myEditorTextField.selectAll(); }); }
refocus
50,644
void () { final Mode mode = myMode; myMode = null; setMode(mode); super.init(); }
init
50,645
void (ActionEvent e) { putValue(Action.NAME, myMode.getName()); dimensionService.setSize(getPrivateDimensionKey(), getSize()); setMode(myMode.other()); final Dimension size = dimensionService.getSize(getPrivateDimensionKey()); if (size != null) { setSize(size.width, size.height); validate(); } else { pack(); } }
actionPerformed
50,646
Mode () { return myMode; }
getMode
50,647
void (Mode mode) { setModeImpl(mode); this.myMode = mode; }
setMode
50,648
void () { final Window window = SwingUtilities.windowForComponent(getContentPane()); window.addWindowListener(new WindowAdapter() { @Override public void windowOpened(WindowEvent e) { final Dimension size = dimensionService.getSize(getPrivateDimensionKey()); if (size != null) { setSize(size.width, size.height); validat...
show
50,649
void (WindowEvent e) { final Dimension size = dimensionService.getSize(getPrivateDimensionKey()); if (size != null) { setSize(size.width, size.height); validate(); } }
windowOpened
50,650
Point () { return dimensionService.getLocation(getPrivateDimensionKey()); }
getInitialLocation
50,651
String () { return getPrivateDimensionServiceKey() + "." + myMode.toString(); }
getPrivateDimensionKey
50,652
String () { return null; }
getDimensionServiceKey
50,653
Mode () { return this == ADVANCED ? SIMPLE : ADVANCED; }
other
50,654
HistoryElement (int i) { return history[(length - 1) - i]; }
getElementAt
50,655
int () { return length; }
getSize
50,656
HistoryElement () { if (selectedItem != null) { if (Comparing.equal(selectedItem.expression, myDocument.getCharsSequence())) { return selectedItem; } else { return selectedItem.changeExpression(myDocument.getText().trim()); } } assert length == 0; return selectedItem; }
getSelectedItem
50,657
void (int index) { setSelectedItem(getElementAt(index)); }
setSelectedIndex
50,658
int () { final int i = indexOf(this.selectedItem); return history.length - 1 - i; }
getSelectedIndex
50,659
int (HistoryElement selectedItem) { return Arrays.asList(history).indexOf(selectedItem); }
indexOf
50,660
void (Object object) { if (object instanceof String) { for (HistoryElement element : history) { if (object.equals(element.expression)) { object = element; break; } } } if (object instanceof String) { object = selectedItem.changeExpression((String)object); } if (selectedItem != null && selectedItem != object || selected...
setSelectedItem
50,661
String (int i) { return i > history.length ? getElementAt(i).expression : selectedItem.expression; }
getItemString
50,662
void () { setLayout(new BorderLayout()); JPanel c = this; scrollToFirst = new JCheckBox(XPathBundle.message("settings.scroll.first.hit.into.visible.area")); useContextAtCursor = new JCheckBox(XPathBundle.message("settings.use.node.at.cursor.as.context.node")); useContextAtCursor.addActionListener(new ActionListener() {...
init
50,663
void (ActionEvent e) { stateChanged(); }
actionPerformed
50,664
Config () { final Config config = new Config(); config.setHighlightStartTagOnly(highlightStartTagOnly.isSelected()); config.setUseContextAtCursor(useContextAtCursor.isSelected()); config.setScrollToFirst(scrollToFirst.isSelected()); config.setAddErrorStripe(addErrorStripe.isSelected()); config.getAttributes().setBackgr...
getConfig
50,665
void (@NotNull Config configuration) { scrollToFirst.setSelected(configuration.isScrollToFirst()); highlightStartTagOnly.setSelected(configuration.isHighlightStartTagOnly()); useContextAtCursor.setSelected(configuration.isUseContextAtCursor()); addErrorStripe.setSelected(configuration.isAddErrorStripe()); chooseHighlig...
setConfig
50,666
void () { chooseContext.setEnabled(useContextAtCursor.isSelected()); }
stateChanged
50,667
void (String[] args) { @SuppressWarnings("HardCodedStringLiteral") JFrame test = new JFrame("Config test"); test.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); final JPanel comp = new JPanel(new BorderLayout()); comp.add(new ConfigUI(new Config()), BorderLayout.CENTER); test.getContentPane().add(comp); test.s...
main
50,668
PsiFile () { return myFile; }
getFile
50,669
LanguageFileType () { return myFileType; }
getFileType
50,670
String () { myDocMgr.commitDocument(myDocument); final String text = myFile.getText(); assert text.equals(myDocument.getText()); return text; }
getExpression
50,671
Expression (Project project, LanguageFileType fileType) { return create(project, fileType, ""); }
create
50,672
Expression (Project project, LanguageFileType fileType, String expression) { final PsiFile file = PsiFileFactory.getInstance(project).createFileFromText("dummy.xpath", fileType, expression, LocalTimeCounter.currentTime(), true); return new Expression(file, fileType); }
create
50,673
Component (final JTable jtable, Object obj, boolean flag, boolean flag1, int i, int j) { super.getTableCellRendererComponent(jtable, "", flag, flag1, i, j); Expression expression = (Expression)obj; if (expression != null && expression.getExpression().length() != 0) { final Document document = PsiDocumentManager.getInst...
getTableCellRendererComponent
50,674
boolean () { return false; }
shouldHaveBorder
50,675
EditorEx () { final EditorEx editor = super.createEditor(); editor.setBackgroundColor(ExpressionCellRenderer.this.getBackground()); return editor; }
createEditor
50,676
JComponent () { final JPanel p = ToolbarDecorator.createDecorator(myVariableTable) .setAddAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { stopVarEditing(); myVariableTableModel.addVariable(); myNamespaceTable.editCellAt(myVariableTableModel.getRowCount() - 1, 0); } }).setRemoveA...
createCenterPanel
50,677
void (AnActionButton button) { stopVarEditing(); myVariableTableModel.addVariable(); myNamespaceTable.editCellAt(myVariableTableModel.getRowCount() - 1, 0); }
run
50,678
void (AnActionButton button) { myVariableTableModel.removeVariable(myVariableTable.getSelectedRow()); }
run
50,679
void (AnActionButton button) { final ExternalResourceManager erm = ExternalResourceManager.getInstance(); final List<String> allURIs = new ArrayList<>(Arrays.asList(erm.getResourceUrls(null, true))); final Collection<Namespace> namespaces = myNamespaceTableModel.getNamespaces(); for (Namespace namespace : namespaces) {...
run
50,680
void (AnActionButton button) { myNamespaceTableModel.removeNamespace(myNamespaceTable.getSelectedRow()); }
run
50,681
String () { return getClass().getName() + ".DIMENSION_SERVICE_KEY"; }
getDimensionServiceKey
50,682
void () { stopVarEditing(); stopNamespaceEditing(); final List<Expression> expressions = myVariableTableModel.getExpressions(); for (int i = 0; i < expressions.size(); i++) { final Expression expression = expressions.get(i); final String name = (String)myVariableTableModel.getValueAt(i, 0); final String expr = expressi...
doOKAction
50,683
String (final Expression expression) { return MyPsiUtil.checkFile(expression.getFile()); }
getError
50,684
void () { final TableCellEditor cellEditor = myVariableTable.getCellEditor(); if (cellEditor != null) { cellEditor.stopCellEditing(); } }
stopVarEditing
50,685
void () { final TableCellEditor cellEditor = myNamespaceTable.getCellEditor(); if (cellEditor != null) { cellEditor.stopCellEditing(); } }
stopNamespaceEditing
50,686
boolean (int rowIndex, int columnIndex) { return true; }
isCellEditable
50,687
String (int column) { return column == 0 ? XPathBundle.message("name") : XPathBundle.message("expression"); }
getColumnName
50,688
int () { return myVariables.size(); }
getRowCount
50,689
int () { return 2; }
getColumnCount
50,690
Object (int rowIndex, int columnIndex) { final Variable variable = myVariables.get(rowIndex); if (columnIndex == 0) { return variable.getName(); } else { return myList.get(rowIndex); } }
getValueAt
50,691
void (Object aValue, int rowIndex, int columnIndex) { if (rowIndex >= myVariables.size()) { return; } final Variable variable = myVariables.get(rowIndex); if (columnIndex == 0) { variable.setName((String)aValue); } else { variable.setExpression(((Expression)aValue).getExpression()); } fireTableDataChanged(); }
setValueAt
50,692
Collection<Variable> () { return myVariables; }
getVariables
50,693
List<Expression> () { return myList; }
getExpressions
50,694
void () { final Variable variable = new Variable(); myVariables.add(variable); final Expression expression = Expression.create(myProject, myFileType); myContextProvider.attachTo(expression.getFile()); myList.add(expression); final int firstRow = myVariables.size() - 1; fireTableRowsInserted(firstRow, firstRow); }
addVariable
50,695
void (int selectedRow) { myVariables.remove(selectedRow); myList.remove(selectedRow); fireTableRowsDeleted(selectedRow, selectedRow); }
removeVariable
50,696
Component (JTable table, Object _value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, _value, isSelected, hasFocus, row, column); setForeground(table.getForeground()); setToolTipText(null); for (int i = 0; i < myVariables.size(); i++) { Variable variable = myVar...
getTableCellRendererComponent
50,697
Collection<Namespace> () { return myNamespaces; }
getNamespaces
50,698
boolean (int rowIndex, int columnIndex) { return columnIndex == 0; }
isCellEditable
50,699
String (int column) { return column == 0 ? XPathBundle.message("prefix") : XPathBundle.message("uri"); }
getColumnName