Changeset 1387 for trunk/autoquest-plugin-html/src/main/java/de/ugoe
- Timestamp:
- 02/15/14 15:26:06 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/commands/CMDcondenseHTMLGUIModel.java
r1354 r1387 15 15 package de.ugoe.cs.autoquest.plugin.html.commands; 16 16 17 import java.util.ArrayList; 17 18 import java.util.Arrays; 18 19 import java.util.Comparator; … … 512 513 513 514 if (cluster.clusteredGUIElements.size() > 0) { 515 List<List<String>> pathParts = new ArrayList<List<String>>(); 516 514 517 for (SimilarGUIElement guiElement : cluster.clusteredGUIElements) { 515 518 if (guiElement.mainClusterParent instanceof HTMLDocument) { 516 name.append(((HTMLDocument) guiElement.mainClusterParent).getPath()); 519 String path = ((HTMLDocument) guiElement.mainClusterParent).getPath(); 520 521 if (path.startsWith("/")) { 522 path = path.substring(1); 523 } 524 525 if (path.endsWith("/")) { 526 path = path.substring(0, path.length() - 1); 527 } 528 529 String[] pathElements = path.split("/"); 530 531 for (int i = 0; i < pathElements.length; i++) { 532 if (pathParts.size() <= i) { 533 pathParts.add(new LinkedList<String>()); 534 } 535 if (!pathParts.get(i).contains(pathElements[i])) { 536 pathParts.get(i).add(pathElements[i]); 537 } 538 } 517 539 } 518 540 else { 519 name.append(guiElement.mainClusterParent.getStringIdentifier()); 541 if (pathParts.size() < 1) { 542 pathParts.add(new LinkedList<String>()); 543 } 544 if (!pathParts.get(0).contains(guiElement.mainClusterParent.getStringIdentifier())) 545 { 546 pathParts.get(0).add(guiElement.mainClusterParent.getStringIdentifier()); 547 } 548 } 549 } 550 551 for (List<String> pathPart : pathParts) { 552 name.append('/'); 553 if (pathPart.size() > 1) { 554 name.append('['); 555 } 556 557 int index = 0; 558 for (String elem : pathPart) { 559 if (index++ > 0) { 560 name.append('|'); 561 } 562 name.append(elem); 563 } 564 565 if (pathPart.size() > 1) { 566 name.append(']'); 520 567 } 521 568 }
Note: See TracChangeset
for help on using the changeset viewer.