You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BrowserViewManager.java 4.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* *******************************************************************
  2. * Copyright (c) 1999-2001 Xerox Corporation,
  3. * 2002 Palo Alto Research Center, Incorporated (PARC).
  4. * All rights reserved.
  5. * This program and the accompanying materials are made available
  6. * under the terms of the Eclipse Public License v 2.0
  7. * which accompanies this distribution and is available at
  8. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * Helen Hawkins Converted to new interface (bug 148190)
  13. * ******************************************************************/
  14. package org.aspectj.ajde.ui.swing;
  15. import java.util.ArrayList;
  16. import org.aspectj.ajde.Ajde;
  17. import org.aspectj.ajde.ui.GlobalStructureView;
  18. import org.aspectj.ajde.ui.GlobalViewProperties;
  19. import org.aspectj.ajde.ui.StructureViewProperties;
  20. /**
  21. * Responsible for displaying and controlling the configuration and output of a
  22. * master and slave structure view.
  23. *
  24. * @author Mik Kersten
  25. */
  26. public class BrowserViewManager {
  27. private StructureViewPanel browserPanel = null;
  28. // private boolean globalMode = true;
  29. // private boolean splitViewMode = false;
  30. // private IconRegistry icons;
  31. //
  32. // private Stack backHistory = new Stack();
  33. // private Stack forwardHistory = new Stack();
  34. // private IProgramElement currNode = null;
  35. private final GlobalStructureView DECLARATION_VIEW;
  36. private final GlobalStructureView CROSSCUTTING_VIEW;
  37. private final GlobalStructureView INHERITANCE_VIEW;
  38. private final GlobalViewProperties DECLARATION_VIEW_PROPERTIES;
  39. private final GlobalViewProperties CROSSCUTTING_VIEW_PROPERTIES;
  40. private final GlobalViewProperties INHERITANCE_VIEW_PROPERTIES;
  41. public BrowserViewManager() {
  42. java.util.List views = new ArrayList();
  43. views.add(DECLARATION_VIEW);
  44. views.add(CROSSCUTTING_VIEW);
  45. views.add(INHERITANCE_VIEW);
  46. browserPanel = new StructureViewPanel(views);
  47. }
  48. public StructureViewPanel getBrowserPanel() {
  49. return browserPanel;
  50. }
  51. public void extractAndInsertSignatures(java.util.List signatures, boolean calls) {
  52. PointcutWizard pointcutWizard = new PointcutWizard(signatures);
  53. pointcutWizard.setVisible(true);
  54. pointcutWizard.setLocation(Ajde.getDefault().getRootFrame().getX()+100, Ajde.getDefault().getRootFrame().getY()+100);
  55. }
  56. {
  57. DECLARATION_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.DECLARATION);
  58. CROSSCUTTING_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.CROSSCUTTING);
  59. INHERITANCE_VIEW_PROPERTIES = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE);
  60. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE);
  61. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE);
  62. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(IRelationship.Kind.ADVICE);
  63. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(AdviceAssociation.METHOD_CALL_SITE_RELATION);
  64. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(AdviceAssociation.CONSTRUCTOR_RELATION);
  65. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(AdviceAssociation.CONSTRUCTOR_CALL_SITE_RELATION);
  66. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(AdviceAssociation.HANDLER_RELATION);
  67. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(AdviceAssociation.INITIALIZER_RELATION);
  68. // CROSSCUTTING_VIEW_PROPERTIES.addRelation(AdviceAssociation.FIELD_ACCESS_RELATION);
  69. //
  70. // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.IMPLEMENTS_RELATION);
  71. // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_MEMBERS_RELATION);
  72. // INHERITANCE_VIEW_PROPERTIES.addRelation(InheritanceAssociation.INHERITS_RELATION);
  73. DECLARATION_VIEW_PROPERTIES.setRelations(Ajde.getDefault().getStructureViewManager().getAvailableRelations());
  74. CROSSCUTTING_VIEW = Ajde.getDefault().getStructureViewManager().createGlobalView(CROSSCUTTING_VIEW_PROPERTIES);
  75. INHERITANCE_VIEW = Ajde.getDefault().getStructureViewManager().createGlobalView(INHERITANCE_VIEW_PROPERTIES);
  76. DECLARATION_VIEW = Ajde.getDefault().getStructureViewManager().createGlobalView(DECLARATION_VIEW_PROPERTIES);
  77. }
  78. }