use of com.intellij.openapi.vcs.changes.ui.ChangesBrowserNode in project intellij-community by JetBrains.
the class SpecificFilesViewDialog method initData.
private void initData(@NotNull final List<VirtualFile> files) {
final TreeState state = TreeState.createOn(myView, (ChangesBrowserNode) myView.getModel().getRoot());
final DefaultTreeModel model = TreeModelBuilder.buildFromVirtualFiles(myProject, myView.isShowFlatten(), files);
myView.setModel(model);
myView.expandPath(new TreePath(((ChangesBrowserNode) model.getRoot()).getPath()));
state.applyTo(myView);
}
use of com.intellij.openapi.vcs.changes.ui.ChangesBrowserNode in project intellij-community by JetBrains.
the class ChangesListView method updateModel.
public void updateModel(@NotNull DefaultTreeModel newModel) {
TreeState state = TreeState.createOn(this, getRoot());
state.setScrollToSelection(false);
DefaultTreeModel oldModel = getModel();
setModel(newModel);
ChangesBrowserNode newRoot = getRoot();
expandPath(new TreePath(newRoot.getPath()));
state.applyTo(this, newRoot);
expandDefaultChangeList(oldModel, newRoot);
}
use of com.intellij.openapi.vcs.changes.ui.ChangesBrowserNode in project intellij-community by JetBrains.
the class IntersectingLocalChangesPanel method createPanel.
@NotNull
private BorderLayoutPanel createPanel(@NotNull JLabel label, @NotNull JTree tree) {
BorderLayoutPanel panel = JBUI.Panels.simplePanel();
panel.setBackground(UIUtil.getTextFieldBackground());
panel.addToTop(label).addToCenter(tree);
new EditSourceAction().registerCustomShortcutSet(CommonShortcuts.getEditSource(), panel);
DataManager.registerDataProvider(panel, dataId -> {
if (CommonDataKeys.NAVIGATABLE_ARRAY.is(dataId)) {
return getNavigatableArray(myProject, stream(tree.getSelectionPaths()).map(TreePath::getLastPathComponent).map(node -> (ChangesBrowserNode<?>) node).flatMap(ChangesBrowserNode::getFilePathsUnderStream).map(FilePath::getVirtualFile).filter(Objects::nonNull).distinct());
}
return null;
});
return panel;
}
Aggregations