Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

feature/big-screen
jinbokai 5 years ago
parent
commit
b3f60132b9
  1. 14
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  2. 5
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java

14
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -44,6 +44,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Objects;
import static javax.swing.JOptionPane.WARNING_MESSAGE; import static javax.swing.JOptionPane.WARNING_MESSAGE;
import static javax.swing.JOptionPane.YES_NO_OPTION; import static javax.swing.JOptionPane.YES_NO_OPTION;
@ -299,7 +300,18 @@ public class TemplateTreePane extends JPanel implements FileOperations {
} }
} }
} }
reportletsTree.refresh(); refreshAfterDelete();
}
private void refreshAfterDelete() {
TreePath[] paths = reportletsTree.getSelectionPaths();
if (paths == null) {
reportletsTree.refresh();
} else {
for (TreePath path : Objects.requireNonNull(reportletsTree.getSelectionPaths())) {
reportletsTree.refreshParent(path);
}
}
} }
private boolean deleteNodes(Collection<ExpandMutableTreeNode> nodes) { private boolean deleteNodes(Collection<ExpandMutableTreeNode> nodes) {

5
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/RefreshableJTree.java

@ -145,6 +145,11 @@ public abstract class RefreshableJTree extends CheckBoxTree {
refresh((ExpandMutableTreeNode) this.getModel().getRoot(), StringUtils.EMPTY); refresh((ExpandMutableTreeNode) this.getModel().getRoot(), StringUtils.EMPTY);
} }
//REPORT-24085,只刷新父节点
public void refreshParent(TreePath path) {
refresh((ExpandMutableTreeNode) path.getParentPath().getLastPathComponent(), StringUtils.EMPTY);
}
public void refreshChildByName(String childName) { public void refreshChildByName(String childName) {
refresh((ExpandMutableTreeNode) this.getModel().getRoot(), childName); refresh((ExpandMutableTreeNode) this.getModel().getRoot(), childName);
} }

Loading…
Cancel
Save