@Override public void run() { int i = 0; while (i < treeTable.getRowCount()) { treeTable.expandRow(i++); } } });
/** * Expand all childs of a tree table. * <p> * FIXME : Voir pour enlever le copier coller * * @param treeTable the tree to expand */ public static void expandTreeTable(final JXTreeTable treeTable) { SwingUtilities.invokeLater(() -> { int i = 0; while (i < treeTable.getRowCount()) { treeTable.expandRow(i++); } }); }
/** * This is overridden to set the height to match that of the JTable. */ @Override public void setBounds(int x, int y, int w, int h) { if (treeTable != null) { y = 0; // It is not enough to set the height to treeTable.getHeight() h = treeTable.getRowCount() * this.getRowHeight(); // int hierarchicalC = treeTable.getHierarchicalColumn(); // if (hierarchicalC >= 0) { // TableColumn column = treeTable.getColumn(hierarchicalC); // w = Math.min(w, column.getWidth()); // } } super.setBounds(x, y, w, h); }
public boolean canExpand(TestStepInstance tsi) { for (int row = 0; row < jXTreeTable.getRowCount(); row++) { if (jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal()) instanceof TestStepInstance) { if (((TestStepInstance) jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal())).getTestStepInstancePath().equals(tsi.getTestStepInstancePath())) { jXTreeTable.expandPath(jXTreeTable.getPathForRow(row)); // System.out.println("expanded: " + tsi); return true; } } } log.warn("could not expand: " + tsi); return false; }
public void canExpandRunning(TestStepInstance tsi) { if (jXTreeTable != null) { for (int row = 0; row < jXTreeTable.getRowCount(); row++) { if (jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal()) instanceof TestStepInstance) { if (((TestStepInstance) jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal())).getTestStepInstancePath().equals(tsi.getTestStepInstancePath())) { jXTreeTable.expandPath(jXTreeTable.getPathForRow(row)); // System.out.println("expanded:" + tsi); if (!tsi.isLeaf()) { List<TestStepInstance> children = tsi.getSteps(); ListIterator<TestStepInstance> li = children.listIterator(children.size()); while (li.hasPrevious()) { TestStepInstance child = li.previous(); if (child.isRunning()) { canExpandRunning(child); return; } } } jXTreeTable.setRowSelectionInterval(row, row); // jXTreeTable.scrollRectToVisible(jXTreeTable.getCellRect(row, 0, false)); Util.scrollToCenter(jXTreeTable, row, 0); selectedStep = tsi; return; } } } } log.warn("could not expand:" + tsi); } // public boolean expand(TestStepInstance tsi) {
/** * This is overridden to set the location to (0, 0) and set * the dimension to exactly fill the bounds of the hierarchical * column.<p> */ @Override public void setBounds(int x, int y, int w, int h) { // location is relative to the hierarchical column y = 0; x = 0; if (treeTable != null) { // adjust height to table height // It is not enough to set the height to treeTable.getHeight() // JW: why not? h = treeTable.getRowCount() * this.getRowHeight(); int hierarchicalC = treeTable.getHierarchicalColumn(); // JW: re-introduced to fix Issue 1168-swingx if (hierarchicalC >= 0) { TableColumn column = treeTable.getColumn(hierarchicalC); // adjust width to width of hierarchical column w = column.getWidth(); } } super.setBounds(x, y, w, h); }
/** * This is overridden to set the location to (0, 0) and set * the dimension to exactly fill the bounds of the hierarchical * column.<p> */ @Override public void setBounds(int x, int y, int w, int h) { // location is relative to the hierarchical column y = 0; x = 0; if (treeTable != null) { // adjust height to table height // It is not enough to set the height to treeTable.getHeight() // JW: why not? h = treeTable.getRowCount() * this.getRowHeight(); int hierarchicalC = treeTable.getHierarchicalColumn(); // JW: re-introduced to fix Issue 1168-swingx if (hierarchicalC >= 0) { TableColumn column = treeTable.getColumn(hierarchicalC); // adjust width to width of hierarchical column w = column.getWidth(); } } super.setBounds(x, y, w, h); }
/** * This is overridden to set the location to (0, 0) and set * the dimension to exactly fill the bounds of the hierarchical * column.<p> */ @Override public void setBounds(int x, int y, int w, int h) { // location is relative to the hierarchical column y = 0; x = 0; if (treeTable != null) { // adjust height to table height // It is not enough to set the height to treeTable.getHeight() // JW: why not? h = treeTable.getRowCount() * this.getRowHeight(); int hierarchicalC = treeTable.getHierarchicalColumn(); // JW: re-introduced to fix Issue 1168-swingx if (hierarchicalC >= 0) { TableColumn column = treeTable.getColumn(hierarchicalC); // adjust width to width of hierarchical column w = column.getWidth(); } } super.setBounds(x, y, w, h); }
/** * This is overridden to set the location to (0, 0) and set * the dimension to exactly fill the bounds of the hierarchical * column.<p> */ @Override public void setBounds(int x, int y, int w, int h) { // location is relative to the hierarchical column y = 0; x = 0; if (treeTable != null) { // adjust height to table height // It is not enough to set the height to treeTable.getHeight() // JW: why not? h = treeTable.getRowCount() * this.getRowHeight(); int hierarchicalC = treeTable.getHierarchicalColumn(); // JW: re-introduced to fix Issue 1168-swingx if (hierarchicalC >= 0) { TableColumn column = treeTable.getColumn(hierarchicalC); // adjust width to width of hierarchical column w = column.getWidth(); } } super.setBounds(x, y, w, h); }
public void selectStep(TestStepInstance selectedStep) { expand(selectedStep.getPathList()); for (int row = 0; row < jXTreeTable.getRowCount(); row++) { if (jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal()) instanceof TestStepInstance) { if (((TestStepInstance) jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal())).getTestStepInstancePath().equals(selectedStep.getTestStepInstancePath())) { //System.out.println(JXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal())); jXTreeTable.setRowSelectionInterval(row, row); // jXTreeTable.scrollRectToVisible(jXTreeTable.getCellRect(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal(), false)); Util.scrollToCenter(jXTreeTable, row, 0); return; } } } }
textArea.setEditable(false); jScrollPaneStep = new RTextScrollPane(textArea); jXTreeTable.setVisibleRowCount(Math.min(5, jXTreeTable.getRowCount())); jSplitPaneSequenceStep.setBottomComponent(jScrollPaneStep); jSplitPaneSequenceStep.setDividerSize(UIManager.getInt("SplitPane.dividerSize"));
public void canExpandFailed(TestStepInstance tsi) { if (jXTreeTable != null) { for (int row = 0; row < jXTreeTable.getRowCount(); row++) { if (jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal()) instanceof TestStepInstance) { if (((TestStepInstance) jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal())).getTestStepInstancePath().equals(tsi.getTestStepInstancePath())) { jXTreeTable.expandPath(jXTreeTable.getPathForRow(row)); // System.out.println("expanded:" + tsi); if (!tsi.isLeaf()) { for (TestStepInstance child : tsi.getSteps()) { if (child.isFailed()) { canExpandFailed(child); return; } } } jXTreeTable.setRowSelectionInterval(row, row); // jXTreeTable.scrollRectToVisible(jXTreeTable.getCellRect(row, 0, false)); Util.scrollToCenter(jXTreeTable, row, 0); selectedStep = tsi; return; } } } } log.warn("could not expand:" + tsi); }
public void canExpandAborted(TestStepInstance tsi) { if (jXTreeTable != null) { for (int row = 0; row < jXTreeTable.getRowCount(); row++) { if (jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal()) instanceof TestStepInstance) { if (((TestStepInstance) jXTreeTable.getValueAt(row, TestSequenceInstanceModel.SequenceColumn.NAME.ordinal())).getTestStepInstancePath().equals(tsi.getTestStepInstancePath())) { jXTreeTable.expandPath(jXTreeTable.getPathForRow(row)); // System.out.println("expanded:" + tsi); if (!tsi.isLeaf()) { for (TestStepInstance child : tsi.getSteps()) { if (child.isAborted()) { canExpandAborted(child); return; } } } jXTreeTable.setRowSelectionInterval(row, row); // jXTreeTable.scrollRectToVisible(jXTreeTable.getCellRect(row, 0, false)); Util.scrollToCenter(jXTreeTable, row, 0); selectedStep = tsi; return; } } } } log.warn("could not expand:" + tsi); }