in src/main/java/idea/plugin/psiviewer/view/PsiViewerPanel.java [157:191]
private void buildGUI()
{
setLayout(new BorderLayout());
_tree = new PsiViewerTree(_model);
_tree.getSelectionModel().addTreeSelectionListener(_treeSelectionListener);
ActionMap actionMap = _tree.getActionMap();
actionMap.put("EditSource", new AbstractAction("EditSource") {
public void actionPerformed(ActionEvent e)
{
debug("key typed " + e);
if (getSelectedElement() == null) return;
Editor editor = _caretMover.openInEditor(getSelectedElement());
selectElementAtCaret(editor, TREE_SELECTION_CHANGED);
editor.getContentComponent().requestFocus();
}
});
InputMap inputMap = _tree.getInputMap();
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0, true), "EditSource");
_propertyPanel = new PropertySheetPanel();
_splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JBScrollPane(_tree), _propertyPanel) {
public void setDividerLocation(int location)
{
debug("Divider location changed to " + location + " component below " + (getRightComponent().isVisible() ? "visible" : "not visible"));
if (getRightComponent().isVisible())
_projectComponent.setSplitDividerLocation(location);
super.setDividerLocation(location);
}
};
_splitPane.setDividerLocation(_projectComponent.getSplitDividerLocation());
add(_splitPane);
}