@Override public void valueChanged(@Nullable ListSelectionEvent notUsed) { if (notUsed != null && notUsed.getValueIsAdjusting()) return; VcsFullCommitDetails newCommitDetails = null; int[] rows = myGraphTable.getSelectedRows(); if (rows.length < 1) { showMessage("No commits selected"); } else if (rows.length > 1) { showMessage("Several commits selected"); } else { ((CardLayout) getLayout()).show(this, STANDARD_LAYER); int row = rows[0]; GraphTableModel tableModel = (GraphTableModel) myGraphTable.getModel(); VcsFullCommitDetails commitData = myLogDataHolder.getCommitDetailsGetter().getCommitData(row, tableModel); if (commitData == null) { showMessage("No commits selected"); return; } if (commitData instanceof LoadingDetails) { myLoadingPanel.startLoading(); myCommitDetailsPanel.setData(null); myReferencesPanel.setReferences(Collections.<VcsRef>emptyList()); updateDetailsBorder(null); } else { myLoadingPanel.stopLoading(); myCommitDetailsPanel.setData(commitData); myReferencesPanel.setReferences(sortRefs(commitData.getId(), commitData.getRoot())); updateDetailsBorder(commitData); newCommitDetails = commitData; } List<String> branches = null; if (!(commitData instanceof LoadingDetails)) { branches = myLogDataHolder .getContainingBranchesGetter() .requestContainingBranches(commitData.getRoot(), commitData.getId()); } myCommitDetailsPanel.setBranches(branches); if (!Comparing.equal(myCurrentCommitDetails, newCommitDetails)) { myCurrentCommitDetails = newCommitDetails; myScrollPane.getVerticalScrollBar().setValue(0); } } }
public final void setButtonsEnabled(boolean enabled) { referencesPanel.setButtonsEnabled(enabled); hierarchiesPanel.setButtonsEnabled(enabled); supplierPricelistPanel.setButtonsEnabled(enabled); insertButton1.setEnabled(enabled); editButton1.setEnabled(enabled); deleteButton1.setEnabled(enabled); exportButton1.setEnabled(enabled); treePanel.setEnabled(enabled); }