Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
17,800
|
void () { mySplitter.swapComponents(); final CommanderPanel tmpPanel = myLeftPanel; myLeftPanel = myRightPanel; myRightPanel = tmpPanel; }
|
swapPanels
|
17,801
|
void () { final CommanderPanel activePanel; final CommanderPanel passivePanel; if (isLeftPanelActive()) { activePanel = myLeftPanel; passivePanel = myRightPanel; } else { activePanel = myRightPanel; passivePanel = myLeftPanel; } ProjectViewNode element = (ProjectViewNode)activePanel.getBuilder().getParentNode(); passivePanel.getBuilder().enterElement(element); }
|
syncViews
|
17,802
|
CommanderPanel () { return isLeftPanelActive() ? myLeftPanel : myRightPanel; }
|
getActivePanel
|
17,803
|
CommanderPanel () { return !isLeftPanelActive() ? myLeftPanel : myRightPanel; }
|
getInactivePanel
|
17,804
|
Object (@NotNull final String dataId) { if (PlatformCoreDataKeys.HELP_ID.is(dataId)) { return "viewingStructure.commander"; } else if (CommonDataKeys.PROJECT.is(dataId)) { return project; } else if (PlatformCoreDataKeys.BGT_DATA_PROVIDER.is(dataId)) { AbstractTreeNode<?> parent1 = getActivePanel().getBuilder().getParentNode(); AbstractTreeNode<?> selection1 = getActivePanel().getSelectedNode(); AbstractTreeNode<?> parent2 = getInactivePanel().getBuilder().getParentNode(); AbstractTreeNode<?> selection2 = getInactivePanel().getSelectedNode(); Couple<AbstractTreeNode<?>> activeSelection = Couple.of(parent1, selection1); Couple<AbstractTreeNode<?>> inactiveSelection = Couple.of(parent2, selection2); DataProvider panelProvider = (DataProvider)getActivePanel().getDataImpl(dataId); return CompositeDataProvider.compose(slowId -> getSlowData(slowId, activeSelection, inactiveSelection), panelProvider); } else { return getActivePanel().getDataImpl(dataId); } }
|
getData
|
17,805
|
Element () { Element element = new Element("commander"); if (myLeftPanel == null || myRightPanel == null) { return element; } PsiDocumentManager.getInstance(project).commitAllDocuments(); Element e = new Element(ELEMENT_LEFTPANEL); element.addContent(e); writePanel(myLeftPanel, e); e = new Element(ELEMENT_RIGHTPANEL); element.addContent(e); writePanel(myRightPanel, e); e = new Element(ELEMENT_SPLITTER); element.addContent(e); e.setAttribute(ATTRIBUTE_PROPORTION, Float.toString(mySplitter.getProportion())); if (!MOVE_FOCUS) { e = new Element(ELEMENT_OPTION); element.addContent(e); e.setAttribute(ATTRIBUTE_MOVE_FOCUS, "false"); } return element; }
|
getState
|
17,806
|
void (final CommanderPanel panel, final Element element) { /*TODO[anton,vova]: it's a patch!!!*/ final AbstractListBuilder builder = panel.getBuilder(); if (builder == null) return; final AbstractTreeNode parentNode = builder.getParentNode(); final Object parentElement = parentNode != null? parentNode.getValue() : null; if (parentElement instanceof PsiDirectory directory) { element.setAttribute(ATTRIBUTE_URL, directory.getVirtualFile().getUrl()); } else if (parentElement instanceof PsiClass) { for (PsiElement e = (PsiElement) parentElement; e != null && e.isValid(); e = e.getParent()) { if (e instanceof PsiClass) { final String qualifiedName = ((PsiClass) e).getQualifiedName(); if (qualifiedName != null) { element.setAttribute(ATTRIBUTE_CLASS, qualifiedName); break; } } } } }
|
writePanel
|
17,807
|
void (@NotNull Element state) { myElement = state; processConfigurationElement(); myElement = null; }
|
loadState
|
17,808
|
PsiElement (final Element element) { if (element.getAttributeValue(ATTRIBUTE_URL) != null) { final String url = element.getAttributeValue(ATTRIBUTE_URL); final VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url); return file != null ? PsiManager.getInstance(project).findDirectory(file) : null; } if (element.getAttributeValue(ATTRIBUTE_CLASS) != null) { final String className = element.getAttributeValue(ATTRIBUTE_CLASS); return className != null ? JavaPsiFacade.getInstance(project).findClass(className, GlobalSearchScope.allScope(project)) : null; } return null; }
|
readParentElement
|
17,809
|
void () { if (myLeftPanel == null) { // not opened project (default?) return; } myLeftPanel.dispose(); myRightPanel.dispose(); myHistory.clearHistory(); }
|
dispose
|
17,810
|
CommanderPanel () { return myRightPanel; }
|
getRightPanel
|
17,811
|
CommanderPanel () { return myLeftPanel; }
|
getLeftPanel
|
17,812
|
void (PsiElement element, boolean selectInActivePanel) { CommanderPanel panel = selectInActivePanel ? getActivePanel() : getInactivePanel(); panel.getBuilder().selectElement(element, PsiUtilCore.getVirtualFile(element)); }
|
selectElement
|
17,813
|
void (final Component comp, final int x, final int y) { CommanderPluginPanel.this.invokePopup(comp, x, y); }
|
invokePopup
|
17,814
|
void (final Component c, final int x, final int y) { if (myBuilder == null) return; if (myList.getSelectedIndices().length <= 1) { final int popupIndex = myList.locationToIndex(new Point(x, y)); if (popupIndex >= 0) { myList.setSelectedIndex(popupIndex); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(myList, true)); } } final ActionGroup group = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.GROUP_COMMANDER_POPUP); final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.COMMANDER_POPUP, group); popupMenu.getComponent().show(c, x, y); }
|
invokePopup
|
17,815
|
Object (String dataId) { if (PlatformDataKeys.COPY_PROVIDER.is(dataId)) { return myCopyPasteDelegator.getCopyProvider(); } if (PlatformDataKeys.CUT_PROVIDER.is(dataId)) { return myCopyPasteDelegator.getCutProvider(); } if (PlatformDataKeys.PASTE_PROVIDER.is(dataId)) { return myCopyPasteDelegator.getPasteProvider(); } return super.getDataImpl(dataId); }
|
getDataImpl
|
17,816
|
Component (final JList list, final Object value, final int index, boolean selected, boolean hasFocus) { hasFocus = selected; // border around inactive items if (!myCommanderPanel.isActive()) { selected = false; } return super.getListCellRendererComponent(list, value, index, selected, hasFocus); }
|
getListCellRendererComponent
|
17,817
|
void (@NotNull final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) { Color color = UIUtil.getListForeground(); SimpleTextAttributes attributes = null; String locationString = null; setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); // for separator, see below if (value instanceof NodeDescriptor descriptor) { setIcon(descriptor.getIcon()); final Color elementColor = descriptor.getColor(); if (elementColor != null) { color = elementColor; } if (descriptor instanceof AbstractTreeNode treeNode) { final TextAttributesKey attributesKey = treeNode.getPresentation().getTextAttributesKey(); if (attributesKey != null) { final TextAttributes textAttributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attributesKey); if (textAttributes != null) attributes = SimpleTextAttributes.fromTextAttributes(textAttributes); } locationString = treeNode.getPresentation().getLocationString(); final PresentationData presentation = treeNode.getPresentation(); if (presentation.hasSeparatorAbove() && !selected) { setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, JBUI.CurrentTheme.CustomFrameDecorations.separatorForeground()), BorderFactory.createEmptyBorder(0, 0, 1, 0))); } } } if(attributes == null) attributes = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color); //noinspection HardCodedStringLiteral final String text = value.toString(); if (myCommanderPanel.isEnableSearchHighlighting()) { JList list1 = myCommanderPanel.getList(); if (list1 != null) { SpeedSearchUtil.appendFragmentsForSpeedSearch(list1, text, attributes, selected, this); } } else { append(text != null ? text : "", attributes); } if (locationString != null && locationString.length() > 0) { append(" (" + locationString + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); } }
|
customizeCellRenderer
|
17,818
|
void () { myHistory.clear(); myCurrentCommandIndex = 0; }
|
clearHistory
|
17,819
|
void (final PsiElement element, boolean isElementExpanded, final boolean isLeftPanel) { if (!myStateLoggingEnabled) { return; } if (myCurrentCommandIndex >=0 && myCurrentCommandIndex < myHistory.size() - 1) { myHistory.subList(myCurrentCommandIndex + 1, myHistory.size()).clear(); } if (myHistory.size() == HISTORY_LIMIT) { myHistory.remove(0); } myHistory.add(new HistoryState(element, isElementExpanded, isLeftPanel)); myCurrentCommandIndex = myHistory.size() - 1; }
|
saveState
|
17,820
|
void () { if (applyState(getHistoryState(myCurrentCommandIndex - 1))) { myCurrentCommandIndex--; } }
|
back
|
17,821
|
boolean () { return getHistoryState(myCurrentCommandIndex - 1) != null; }
|
canGoBack
|
17,822
|
void () { if (applyState(getHistoryState(myCurrentCommandIndex + 1))) { myCurrentCommandIndex++; } }
|
forward
|
17,823
|
boolean () { return getHistoryState(myCurrentCommandIndex + 1) != null; }
|
canGoForward
|
17,824
|
boolean (HistoryState state) { myStateLoggingEnabled = false; try { if (state != null) { final PsiElement element = state.getElement(); final boolean shouldOpenInLeftPanel = state.isInLeftPanel(); if (state.isElementExpanded()) { final boolean isLeftPanelCurrentlyActive = myCommander.isLeftPanelActive(); if ((shouldOpenInLeftPanel && !isLeftPanelCurrentlyActive) || (!shouldOpenInLeftPanel && isLeftPanelCurrentlyActive)) { myCommander.switchActivePanel(); } myCommander.enterElementInActivePanel(element); } else { if (shouldOpenInLeftPanel) { myCommander.selectElementInLeftPanel(element, PsiUtilBase.getVirtualFile(element)); } else { myCommander.selectElementInRightPanel(element, PsiUtilBase.getVirtualFile(element)); } } return true; } } finally { myStateLoggingEnabled = true; } return false; }
|
applyState
|
17,825
|
HistoryState (int index) { if (index >= 0 && index < myHistory.size()) { return myHistory.get(index); } return null; }
|
getHistoryState
|
17,826
|
boolean () { return myIsLeftPanel; }
|
isInLeftPanel
|
17,827
|
boolean () { return myElementExpanded; }
|
isElementExpanded
|
17,828
|
PsiElement () { return myElement; }
|
getElement
|
17,829
|
DiffContent (@NotNull PsiElement psiElement) { DiffContentFactory factory = DiffContentFactory.getInstance(); if (psiElement instanceof PsiFile) { return factory.create(psiElement.getProject(), ((PsiFile)psiElement).getVirtualFile()); } else if (psiElement instanceof PsiDirectory) { return factory.create(psiElement.getProject(), ((PsiDirectory)psiElement).getVirtualFile()); } PsiFile containingFile = psiElement.getContainingFile(); if (containingFile == null) { String text = psiElement.getText(); if (text == null) return null; return factory.create(psiElement.getProject(), text, psiElement.getLanguage().getAssociatedFileType(), false); } DocumentContent wholeFileContent = factory.createDocument(psiElement.getProject(), containingFile.getVirtualFile()); if (wholeFileContent == null) return null; return factory.createFragment(psiElement.getProject(), wholeFileContent, psiElement.getTextRange()); }
|
fromPsiElement
|
17,830
|
DiffRequest (@NotNull PsiElement psiElement1, @NotNull PsiElement psiElement2) { if (!psiElement1.isValid() || !psiElement2.isValid()) return null; Project project = psiElement1.getProject(); LOG.assertTrue(project == psiElement2.getProject()); DiffContent content1 = fromPsiElement(psiElement1); DiffContent content2 = fromPsiElement(psiElement2); if (content1 == null || content2 == null) return null; final ElementPresentation presentation1 = ElementPresentation.forElement(psiElement1); final ElementPresentation presentation2 = ElementPresentation.forElement(psiElement2); String title = DiffBundle .message("diff.element.qualified.name.vs.element.qualified.name.dialog.title", presentation1.getQualifiedName(), presentation2.getQualifiedName()); return new SimpleDiffRequest(title, content1, content2, presentation1.getQualifiedName(), presentation2.getQualifiedName()); }
|
comparePsiElements
|
17,831
|
void (@NotNull Project project, @NotNull ToolWindow toolWindow) { Commander commander = Commander.getInstance(project); toolWindow.getContentManager().addContent(ContentFactory.getInstance().createContent(commander, "", false)); }
|
createToolWindowContent
|
17,832
|
Object (boolean showRoot) { final Object rootElement = myTreeStructure.getRootElement(); if (showRoot) return rootElement; final Object[] rootChildren = myTreeStructure.getChildElements(rootElement); if (rootChildren.length == 1 && shouldEnterSingleTopLevelElement(rootChildren[0])) { return rootChildren[0]; } else { return rootElement; } }
|
getShownRoot
|
17,833
|
void (final JLabel parentTitle) { myParentTitle = parentTitle; }
|
setParentTitle
|
17,834
|
void () { final Object value = getSelectedValue(); if (value instanceof AbstractTreeNode node) { drillDown(node, getChildren(node)); } else { // an element that denotes parent goUp(); } }
|
drillDown
|
17,835
|
void (final AbstractTreeNode node, final Object[] children) { try { buildList(node, children); ensureSelectionExist(); } finally { updateParentTitle(); } }
|
drillDown
|
17,836
|
void () { if (myCurrentParent == myShownRoot.getParent()) { return; } final AbstractTreeNode element = myCurrentParent.getParent(); if (element == null) { return; } try { AbstractTreeNode oldParent = myCurrentParent; buildList(element); for (int i = 0; i < myModel.getSize(); i++) { if (myModel.getElementAt(i) instanceof NodeDescriptor desc) { final Object elem = desc.getElement(); if (oldParent.equals(elem)) { selectItem(i); break; } } } } finally { updateParentTitle(); } }
|
goUp
|
17,837
|
Object () { return myList.getSelectedValue(); }
|
getSelectedValue
|
17,838
|
void (int i) { ScrollingUtil.selectItem(myList, i); }
|
selectItem
|
17,839
|
void () { ScrollingUtil.ensureSelectionExists(myList); }
|
ensureSelectionExist
|
17,840
|
void (final Object element, VirtualFile virtualFile) { if (element == null) { return; } try { AbstractTreeNode node = goDownToElement(element, virtualFile); if (node == null) return; AbstractTreeNode parentElement = node.getParent(); if (parentElement == null) return; buildList(parentElement); for (int i = 0; i < myModel.getSize(); i++) { if (myModel.getElementAt(i) instanceof AbstractTreeNode) { final AbstractTreeNode<?> desc = (AbstractTreeNode)myModel.getElementAt(i); if (desc.getValue() instanceof StructureViewTreeElement treeelement) { if (element.equals(treeelement.getValue())) { selectItem(i); break; } } else { if (element.equals(desc.getValue())) { selectItem(i); break; } } } } } finally { updateParentTitle(); } }
|
selectElement
|
17,841
|
void (final PsiElement element, VirtualFile file) { try { AbstractTreeNode lastPathNode = goDownToElement(element, file); if (lastPathNode == null) return; buildList(lastPathNode); ensureSelectionExist(); } finally { updateParentTitle(); } }
|
enterElement
|
17,842
|
AbstractTreeNode (final Object element, VirtualFile file) { return goDownToNode((AbstractTreeNode)myTreeStructure.getRootElement(), element, file); }
|
goDownToElement
|
17,843
|
void (final AbstractTreeNode element) { try { buildList(element); ensureSelectionExist(); } finally { updateParentTitle(); } }
|
enterElement
|
17,844
|
AbstractTreeNode (AbstractTreeNode lastPathNode, final Object lastPathElement, VirtualFile file) { if (file == null) return lastPathNode; AbstractTreeNode found = lastPathNode; while (found != null) { if (nodeIsAcceptableForElement(lastPathNode, lastPathElement)) { break; } else { found = findInChildren(lastPathNode, file, lastPathElement); if (found != null) { lastPathNode = found; } } } return lastPathNode; }
|
goDownToNode
|
17,845
|
AbstractTreeNode (AbstractTreeNode<?> rootElement, VirtualFile file, Object element) { Object[] childElements = getChildren(rootElement); List<AbstractTreeNode<?>> nodes = getAllAcceptableNodes(childElements, file); if (nodes.size() == 1) return nodes.get(0); if (nodes.isEmpty()) return null; if (file.isDirectory()) { return nodes.get(0); } else { return performDeepSearch(nodes.toArray(), element, new HashSet<>()); } }
|
findInChildren
|
17,846
|
AbstractTreeNode (Object[] nodes, Object element, Set<? super AbstractTreeNode<?>> visited) { for (Object node1 : nodes) { AbstractTreeNode<?> node = (AbstractTreeNode)node1; if (nodeIsAcceptableForElement(node, element)) return node; Object[] children = getChildren(node); if (visited.add(node)) { AbstractTreeNode<?> nodeResult = performDeepSearch(children, element, visited); if (nodeResult != null) { return nodeResult; } } } return null; }
|
performDeepSearch
|
17,847
|
void () { myIsDisposed = true; }
|
dispose
|
17,848
|
void (final AbstractTreeNode parentElement) { buildList(parentElement, getChildren(parentElement)); }
|
buildList
|
17,849
|
void (final AbstractTreeNode parentElement, final Object[] children) { myCurrentParent = parentElement; Future<?> future = AppExecutorUtil.getAppScheduledExecutorService().schedule( () -> myList.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)), 200, TimeUnit.MILLISECONDS ); myModel.removeAllElements(); if (shouldAddTopElement()) { Object value = parentElement.getValue(); if (value != null) { myModel.addElement(new TopLevelNode(myProject, value)); } } for (Object aChildren : children) { AbstractTreeNode child = (AbstractTreeNode)aChildren; ReadAction.run(() -> child.update()); } if (myComparator != null) { Arrays.sort(children, myComparator); } for (Object aChildren : children) { myModel.addElement(aChildren); } boolean canceled = future.cancel(false); if (!canceled) { ApplicationManager.getApplication().executeOnPooledThread(() -> myList.setCursor(Cursor.getDefaultCursor())); } }
|
buildList
|
17,850
|
boolean () { return !myShownRoot.equals(myCurrentParent); }
|
shouldAddTopElement
|
17,851
|
Object[] (final AbstractTreeNode parentElement) { if (parentElement == null) { return new Object[]{myTreeStructure.getRootElement()}; } else { return myTreeStructure.getChildElements(parentElement); } }
|
getChildren
|
17,852
|
void () { if (myIsDisposed || myCurrentParent == null) { return; } if (myTreeStructure.hasSomethingToCommit()) { myTreeStructure.commit(); } AbstractTreeNode<?> parentDescriptor = myCurrentParent; while (true) { parentDescriptor.update(); if (parentDescriptor.getValue() != null) break; parentDescriptor = parentDescriptor.getParent(); } Object[] children = getChildren(parentDescriptor); HashMap<Object, Integer> elementToIndexMap = new HashMap<>(); for (int i = 0; i < children.length; i++) { elementToIndexMap.put(children[i], Integer.valueOf(i)); } List<NodeDescriptor<?>> resultDescriptors = new ArrayList<>(); Object[] listChildren = myModel.toArray(); for (final Object child : listChildren) { if (!(child instanceof NodeDescriptor descriptor)) { continue; } descriptor.update(); final Object newElement = descriptor.getElement(); final Integer index = newElement != null ? elementToIndexMap.get(newElement) : null; if (index != null) { resultDescriptors.add(descriptor); descriptor.setIndex(index.intValue()); elementToIndexMap.remove(newElement); } } for (final Object child : elementToIndexMap.keySet()) { final Integer index = elementToIndexMap.get(child); if (index != null) { final NodeDescriptor childDescr = myTreeStructure.createDescriptor(child, parentDescriptor); childDescr.setIndex(index.intValue()); childDescr.update(); resultDescriptors.add(childDescr); } } SelectionInfo selection = storeSelection(); if (myComparator != null) { resultDescriptors.sort(myComparator); } else { resultDescriptors.sort(IndexComparator.INSTANCE); } if (shouldAddTopElement()) { final List<NodeDescriptor<?>> elems = new ArrayList<>(); Object value = parentDescriptor.getValue(); if (value != null) { elems.add(new TopLevelNode(myProject, value)); } elems.addAll(resultDescriptors); myModel.replaceElements(elems); } else { myModel.replaceElements(resultDescriptors); } restoreSelection(selection); updateParentTitle(); }
|
updateList
|
17,853
|
SelectionInfo () { final ListSelectionModel selectionModel = myList.getSelectionModel(); final ArrayList<Object> selectedObjects = new ArrayList<>(); final int[] selectedIndices = myList.getSelectedIndices(); final int leadSelectionIndex = selectionModel.getLeadSelectionIndex(); Object leadSelection = null; for (final int index : selectedIndices) { if (index < myList.getModel().getSize()) { final Object o = myModel.getElementAt(index); selectedObjects.add(o); if (index == leadSelectionIndex) { leadSelection = o; } } } return new SelectionInfo(selectedObjects, leadSelectionIndex, leadSelection); }
|
storeSelection
|
17,854
|
void (final SelectionInfo selection) { final ArrayList<Object> selectedObjects = selection.mySelectedObjects; final ListSelectionModel selectionModel = myList.getSelectionModel(); selectionModel.clearSelection(); if (!selectedObjects.isEmpty()) { int leadIndex = -1; for (int i = 0; i < selectedObjects.size(); i++) { final Object o = selectedObjects.get(i); final int index = myModel.indexOf(o); if (index > -1) { selectionModel.addSelectionInterval(index, index); if (o == selection.myLeadSelection) { leadIndex = index; } } } if (selectionModel.getMinSelectionIndex() == -1) { final int toSelect = Math.min(selection.myLeadSelectionIndex, myModel.getSize() - 1); if (toSelect >= 0) { myList.setSelectedIndex(toSelect); } } else if (leadIndex != -1) { selectionModel.setLeadSelectionIndex(leadIndex); } } }
|
restoreSelection
|
17,855
|
AbstractTreeNode () { return myCurrentParent; }
|
getParentNode
|
17,856
|
void () { buildList(myShownRoot); }
|
buildRoot
|
17,857
|
void (@NotNull PresentationData presentation) { }
|
update
|
17,858
|
void () { if (myParentTitle == null) return; AbstractTreeNode node = getParentNode(); if (node instanceof ProjectViewNode) { myParentTitle.setText(((ProjectViewNode<?>)node).getTitle()); } else { myParentTitle.setText(null); } }
|
updateParentTitle
|
17,859
|
boolean (Object rootChild) { return true; }
|
shouldEnterSingleTopLevelElement
|
17,860
|
boolean (AbstractTreeNode node, Object element) { return Comparing.equal(node.getValue(), element); }
|
nodeIsAcceptableForElement
|
17,861
|
void () { addUpdateRequest(false); }
|
addUpdateRequest
|
17,862
|
void (final boolean shouldRefreshSelection) { final Runnable request = new Runnable() { @Override public void run() { if (!myProject.isDisposed()) { // Rely on project view to commit PSI and wait until it's updated. if (myTreeStructure.hasSomethingToCommit() ) { myUpdateAlarm.cancelAllRequests(); myUpdateAlarm.addRequest(this, 300, ModalityState.stateForComponent(myList)); return; } updateList(shouldRefreshSelection); } } }; if (!ApplicationManager.getApplication().isUnitTestMode()) { myUpdateAlarm.cancelAllRequests(); myUpdateAlarm.addRequest(request, 300, ModalityState.stateForComponent(myList)); } else { request.run(); } }
|
addUpdateRequest
|
17,863
|
void () { if (!myProject.isDisposed()) { // Rely on project view to commit PSI and wait until it's updated. if (myTreeStructure.hasSomethingToCommit() ) { myUpdateAlarm.cancelAllRequests(); myUpdateAlarm.addRequest(this, 300, ModalityState.stateForComponent(myList)); return; } updateList(shouldRefreshSelection); } }
|
run
|
17,864
|
void (final boolean shouldRefreshSelection) { updateList(); if (shouldRefreshSelection) { refreshSelection(); } }
|
updateList
|
17,865
|
void () {}
|
refreshSelection
|
17,866
|
void (@NotNull final PsiTreeChangeEvent event) { final PsiElement child = event.getOldChild(); if (child instanceof PsiWhiteSpace) return; //optimization childrenChanged(); }
|
childRemoved
|
17,867
|
void (@NotNull final PsiTreeChangeEvent event) { final PsiElement child = event.getNewChild(); if (child instanceof PsiWhiteSpace) return; //optimization childrenChanged(); }
|
childAdded
|
17,868
|
void (@NotNull final PsiTreeChangeEvent event) { final PsiElement oldChild = event.getOldChild(); final PsiElement newChild = event.getNewChild(); if (oldChild instanceof PsiWhiteSpace && newChild instanceof PsiWhiteSpace) return; //optimization childrenChanged(); }
|
childReplaced
|
17,869
|
void (@NotNull final PsiTreeChangeEvent event) { childrenChanged(); }
|
childMoved
|
17,870
|
void (@NotNull final PsiTreeChangeEvent event) { childrenChanged(); }
|
childrenChanged
|
17,871
|
void () { long newModificationCount = myModificationTracker.getModificationCount(); if (newModificationCount == myOutOfCodeBlockModificationCount) return; myOutOfCodeBlockModificationCount = newModificationCount; addUpdateRequest(); }
|
childrenChanged
|
17,872
|
void (@NotNull final PsiTreeChangeEvent event) { final String propertyName = event.getPropertyName(); switch (propertyName) { case PsiTreeChangeEvent.PROP_ROOTS, PsiTreeChangeEvent.PROP_FILE_TYPES -> addUpdateRequest(); case PsiTreeChangeEvent.PROP_WRITABLE, PsiTreeChangeEvent.PROP_FILE_NAME, PsiTreeChangeEvent.PROP_DIRECTORY_NAME -> childrenChanged(); } }
|
propertyChanged
|
17,873
|
void () { addUpdateRequest(); }
|
fileStatusesChanged
|
17,874
|
void (@NotNull final VirtualFile vFile) { PsiFileSystemItem item = PsiUtilCore.findFileSystemItem(myProject, vFile); if (item != null) myPsiTreeChangeListener.childrenChanged(); }
|
fileStatusChanged
|
17,875
|
void (final Transferable oldTransferable, final Transferable newTransferable) { updateByTransferable(oldTransferable); updateByTransferable(newTransferable); }
|
contentChanged
|
17,876
|
void (final Transferable t) { final PsiElement[] psiElements = CopyPasteUtil.getElementsInTransferable(t); for (int i = 0; i < psiElements.length; i++) { myPsiTreeChangeListener.childrenChanged(); } }
|
updateByTransferable
|
17,877
|
void (CustomizableActionGroupRegistrar registrar) { registrar.addCustomizableActionGroup(IdeActions.GROUP_COMMANDER_POPUP, CommanderBundle.message("commender.view.popup.menu.title")); }
|
registerGroups
|
17,878
|
void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { return; } Commander.getInstance(project).swapPanels(); }
|
actionPerformed
|
17,879
|
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return; } ToolWindowManager windowManager = ToolWindowManager.getInstance(project); String id = windowManager.getActiveToolWindowId(); presentation.setEnabled(ToolWindowId.COMMANDER.equals(id)); }
|
update
|
17,880
|
ActionUpdateThread () { return ActionUpdateThread.EDT; }
|
getActionUpdateThread
|
17,881
|
void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { return; } Commander.getInstance(project).syncViews(); }
|
actionPerformed
|
17,882
|
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return; } ToolWindowManager windowManager = ToolWindowManager.getInstance(project); String id = windowManager.getActiveToolWindowId(); boolean value=ToolWindowId.COMMANDER.equals(id); presentation.setEnabled(value); }
|
update
|
17,883
|
ActionUpdateThread () { return ActionUpdateThread.EDT; }
|
getActionUpdateThread
|
17,884
|
Icon (@NotNull String path, int cacheKey, int flags) { return IconManager.getInstance().loadRasterizedIcon(path, XsltDebuggerIcons.class.getClassLoader(), cacheKey, flags); }
|
load
|
17,885
|
void () { final Debugger client = connect(); if (client == null) { // client will be null if the process terminated prematurely for some reason. no need for an error message if (!myProcess.isProcessTerminated()) { myProcess.notifyTextAvailable("Failed to connect to debugged process. Terminating.\n", ProcessOutputTypes.SYSTEM); myProcess.destroyProcess(); } return; } final XsltDebuggerSession session = XsltDebuggerSession.create(myProject, myProcess, client); final XsltDebugProcess dbgp = XsltDebugProcess.getInstance(myProcess); assert dbgp != null; dbgp.init(client); session.addListener(new XsltDebuggerSession.Listener() { @Override public void debuggerSuspended() { final OutputEventQueue queue = client.getEventQueue(); StructureTabComponent.getInstance(myProcess).getEventModel().update(queue.getEvents()); } @Override public void debuggerResumed() { } @Override public void debuggerStopped() { try { final OutputEventQueue queue = client.getEventQueue(); StructureTabComponent.getInstance(myProcess).getEventModel().finalUpdate(queue.getEvents()); } catch (Exception e) { // can fail when debugger is manually terminated } } }); session.start(); }
|
run
|
17,886
|
void () { final OutputEventQueue queue = client.getEventQueue(); StructureTabComponent.getInstance(myProcess).getEventModel().update(queue.getEvents()); }
|
debuggerSuspended
|
17,887
|
void () { }
|
debuggerResumed
|
17,888
|
void () { try { final OutputEventQueue queue = client.getEventQueue(); StructureTabComponent.getInstance(myProcess).getEventModel().finalUpdate(queue.getEvents()); } catch (Exception e) { // can fail when debugger is manually terminated } }
|
debuggerStopped
|
17,889
|
Debugger () { Throwable lastException = null; for (int i = 0; i < 10; i++) { if (myProcess.isProcessTerminated()) return null; try { final Debugger realClient = EDTGuard.create(new RemoteDebuggerClient(myPort, myAccessToken), myProcess); myProcess.notifyTextAvailable("Connected to XSLT debugger on port " + myPort + "\n", ProcessOutputTypes.SYSTEM); return realClient; } catch (ConnectException e) { lastException = e; try { Thread.sleep(500); } catch (InterruptedException e1) { break; } } catch (NotBoundException e) { lastException = e; try { Thread.sleep(200); } catch (InterruptedException e1) { break; } } catch (IOException e) { lastException = e; break; } } Logger.getInstance(getClass().getName()).info("Could not connect to debugger", lastException); if (lastException.getMessage() != null) { myProcess.notifyTextAvailable("Connection error: " + lastException.getMessage() + "\n", ProcessOutputTypes.SYSTEM); } return null; }
|
connect
|
17,890
|
void () { myClient.start(); myState = Debugger.State.RUNNING; final BreakpointManager breakpointManager = myClient.getBreakpointManager(); final Listener multicaster = myEventDispatcher.getMulticaster(); try { if (!myClient.waitForDebuggee()) { multicaster.debuggerStopped(); return; } myState = Debugger.State.SUSPENDED; do { if (myState == Debugger.State.SUSPENDED) { if (myTempBreakpoint != null) { breakpointManager.removeBreakpoint(myTempBreakpoint); myTempBreakpoint = null; } multicaster.debuggerSuspended(); } else if (myState == Debugger.State.RUNNING) { multicaster.debuggerResumed(); } else if (myState == Debugger.State.STOPPED) { break; } } while ((myState = myClient.waitForStateChange(myState)) != null); multicaster.debuggerStopped(); } catch (DebuggerStoppedException e) { multicaster.debuggerStopped(); } catch (RuntimeException e) { if (e.getCause() instanceof RemoteException) { if (e.getCause().getCause() instanceof SocketException) { multicaster.debuggerStopped(); return; } } throw e; } finally { myState = Debugger.State.STOPPED; close(); } }
|
start
|
17,891
|
void (Listener listener) { myEventDispatcher.addListener(listener); }
|
addListener
|
17,892
|
void (Listener listener) { myEventDispatcher.removeListener(listener); }
|
removeListener
|
17,893
|
Debugger () { return myClient; }
|
getClient
|
17,894
|
void () { myClient.pause(); }
|
pause
|
17,895
|
void () { myClient.resume(); }
|
resume
|
17,896
|
void () { try { myClient.stop(false); } catch (DebuggerStoppedException ignore) { } }
|
stop
|
17,897
|
void () { myClient.step(); }
|
stepOver
|
17,898
|
void () { myClient.stepInto(); }
|
stepInto
|
17,899
|
boolean (final XSourcePosition position) { return XsltBreakpointHandler.getActualLineNumber(myProject, position) != -1; }
|
canRunTo
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.