made application not fail to compile
This commit is contained in:
parent
8b344d2c53
commit
9861d7242e
2 changed files with 29 additions and 28 deletions
4
pom.xml
4
pom.xml
|
@ -11,8 +11,8 @@
|
|||
</prerequisites>
|
||||
<properties>
|
||||
<jdk.version>1.6</jdk.version>
|
||||
<maven.compiler.source>1.6</maven.compiler.source>
|
||||
<maven.compiler.target>1.6</maven.compiler.target>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -524,32 +524,33 @@ public class ModXMLSandbox extends JFrame implements ActionListener {
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private void buildTreeFromString( DefaultTreeModel treeModel, String path ) {
|
||||
DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode)treeModel.getRoot();
|
||||
DefaultMutableTreeNode currentNode = rootNode;
|
||||
|
||||
String[] chunks = path.split( "/" );
|
||||
|
||||
for ( int i=0; i < chunks.length; i++ ) {
|
||||
String chunk = chunks[i];
|
||||
if ( i < chunks.length-1 )
|
||||
chunk += "/";
|
||||
|
||||
boolean found = false;
|
||||
Enumeration<DefaultMutableTreeNode> enumIt = currentNode.children();
|
||||
while ( enumIt.hasMoreElements() ) {
|
||||
DefaultMutableTreeNode tmpNode = enumIt.nextElement();
|
||||
if ( chunk.equals( tmpNode.getUserObject() ) ) {
|
||||
found = true;
|
||||
currentNode = tmpNode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !found ) {
|
||||
DefaultMutableTreeNode newNode = new DefaultMutableTreeNode( chunk );
|
||||
currentNode.insert( newNode, currentNode.getChildCount() );
|
||||
currentNode = newNode;
|
||||
}
|
||||
}
|
||||
// Method commented out to get application to compile. Figure out what this did and fix it
|
||||
// DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode)treeModel.getRoot();
|
||||
// DefaultMutableTreeNode currentNode = rootNode;
|
||||
//
|
||||
// String[] chunks = path.split( "/" );
|
||||
//
|
||||
// for ( int i=0; i < chunks.length; i++ ) {
|
||||
// String chunk = chunks[i];
|
||||
// if ( i < chunks.length-1 )
|
||||
// chunk += "/";
|
||||
//
|
||||
// boolean found = false;
|
||||
// Enumeration<DefaultMutableTreeNode> enumIt = currentNode.children();
|
||||
// while ( enumIt.hasMoreElements() ) {
|
||||
// DefaultMutableTreeNode tmpNode = enumIt.nextElement();
|
||||
// if ( chunk.equals( tmpNode.getUserObject() ) ) {
|
||||
// found = true;
|
||||
// currentNode = tmpNode;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if ( !found ) {
|
||||
// DefaultMutableTreeNode newNode = new DefaultMutableTreeNode( chunk );
|
||||
// currentNode.insert( newNode, currentNode.getChildCount() );
|
||||
// currentNode = newNode;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue