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.

PointcutWizard.java 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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 v1.0
  7. * which accompanies this distribution and is available at
  8. * http://www.eclipse.org/legal/epl-v10.html
  9. *
  10. * Contributors:
  11. * Xerox/PARC initial implementation
  12. * ******************************************************************/
  13. package org.aspectj.ajde.ui.swing;
  14. import java.awt.BorderLayout;
  15. //import java.awt.event.ActionEvent;
  16. import java.util.ArrayList;
  17. import javax.swing.JButton;
  18. import javax.swing.JCheckBox;
  19. import javax.swing.JFrame;
  20. import javax.swing.JLabel;
  21. import javax.swing.JPanel;
  22. //import org.aspectj.asm.IRelationship;
  23. import org.aspectj.ajde.ui.StructureViewProperties;
  24. /**
  25. * @author Mik Kersten
  26. */
  27. class PointcutWizard extends JFrame {
  28. private static final long serialVersionUID = -9058319919402871975L;
  29. // private BrowserViewPanel typeTreeView = null;
  30. // private java.util.List signatures = null;
  31. JPanel jPanel1 = new JPanel();
  32. JPanel jPanel2 = new JPanel();
  33. JPanel jPanel4 = new JPanel();
  34. JLabel jLabel1 = new JLabel();
  35. BorderLayout borderLayout1 = new BorderLayout();
  36. BorderLayout borderLayout2 = new BorderLayout();
  37. BorderLayout borderLayout3 = new BorderLayout();
  38. JLabel jLabel4 = new JLabel();
  39. JPanel jPanel3 = new JPanel();
  40. JCheckBox jCheckBox5 = new JCheckBox();
  41. JCheckBox jCheckBox4 = new JCheckBox();
  42. JCheckBox jCheckBox3 = new JCheckBox();
  43. JCheckBox jCheckBox2 = new JCheckBox();
  44. JCheckBox jCheckBox1 = new JCheckBox();
  45. JButton cancel_button = new JButton();
  46. JButton ok_button = new JButton();
  47. JPanel jPanel5 = new JPanel();
  48. public PointcutWizard(java.util.List signatures) {
  49. // this.signatures = signatures;
  50. ArrayList views = new ArrayList();
  51. views.add(StructureViewProperties.Hierarchy.INHERITANCE);
  52. // typeTreeView = new BrowserViewPanel(AjdeUIManager.getDefault().getIconRegistry(), views, StructureViewProperties.Hierarchy.INHERITANCE);
  53. throw new RuntimeException("unimplemented, can't get the current file");
  54. //typeTreeView.updateTree(Ajde.getDefault().getEditorManager().getCurrFile());
  55. // try {
  56. // jbInit();
  57. // }
  58. // catch(Exception e) {
  59. // Ajde.getDefault().getErrorHandler().handleError("Could not initialize GUI.", e);
  60. // }
  61. // this.setSize(400, 400);
  62. // this.setIconImage(((ImageIcon)AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.POINTCUT)).getImage());
  63. }
  64. // private Map getViewProperties() {
  65. // Map views = new HashMap();
  66. // GlobalViewProperties INHERITANCE_VIEW = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE);
  67. //// INHERITANCE_VIEW.addRelation(IRelationship.Kind.INHERITANCE);
  68. //// views.put(INHERITANCE_VIEW.toString(), INHERITANCE_VIEW);
  69. // return views;
  70. // }
  71. //
  72. // private void jbInit() throws Exception {
  73. // jLabel1.setFont(new java.awt.Font("Dialog", 0, 11));
  74. // jLabel1.setText("Generate pointcut designator for corresponding joinpoints:");
  75. // jPanel1.setLayout(borderLayout1);
  76. // jPanel4.setLayout(borderLayout2);
  77. // jPanel2.setLayout(borderLayout3);
  78. // jLabel4.setText("Select the target type that will host the generated pointcut:");
  79. // jLabel4.setFont(new java.awt.Font("Dialog", 0, 11));
  80. // jLabel4.setToolTipText("");
  81. // jPanel3.setMaximumSize(new Dimension(32767, 34));
  82. // jCheckBox5.setEnabled(false);
  83. // jCheckBox5.setFont(new java.awt.Font("Dialog", 0, 11));
  84. // jCheckBox5.setSelected(true);
  85. // jCheckBox5.setText("call");
  86. // jCheckBox4.setEnabled(false);
  87. // jCheckBox4.setFont(new java.awt.Font("Dialog", 0, 11));
  88. // jCheckBox4.setText("execution");
  89. // jCheckBox3.setEnabled(false);
  90. // jCheckBox3.setFont(new java.awt.Font("Dialog", 0, 11));
  91. // jCheckBox3.setText("initialization");
  92. // jCheckBox2.setEnabled(false);
  93. // jCheckBox2.setFont(new java.awt.Font("Dialog", 0, 11));
  94. // jCheckBox2.setText("static initialization");
  95. // jCheckBox1.setEnabled(false);
  96. // jCheckBox1.setFont(new java.awt.Font("Dialog", 0, 11));
  97. // jCheckBox1.setText("field get/set");
  98. // cancel_button.setFont(new java.awt.Font("Dialog", 0, 11));
  99. // cancel_button.setText("Cancel");
  100. // cancel_button.addActionListener(new java.awt.event.ActionListener() {
  101. // public void actionPerformed(ActionEvent e) {
  102. // cancel_button_actionPerformed(e);
  103. // }
  104. // });
  105. // ok_button.setText("OK");
  106. // ok_button.addActionListener(new java.awt.event.ActionListener() {
  107. // public void actionPerformed(ActionEvent e) {
  108. // ok_button_actionPerformed(e);
  109. // }
  110. // });
  111. // ok_button.setFont(new java.awt.Font("Dialog", 0, 11));
  112. // this.setTitle("Pointcut Wizard");
  113. // this.getContentPane().add(jPanel1, BorderLayout.CENTER);
  114. // jPanel1.add(jPanel4, BorderLayout.NORTH);
  115. // jPanel4.add(jLabel1, BorderLayout.NORTH);
  116. // jPanel4.add(jPanel3, BorderLayout.CENTER);
  117. // jPanel3.add(jCheckBox5, null);
  118. // jPanel3.add(jCheckBox4, null);
  119. // jPanel3.add(jCheckBox3, null);
  120. // jPanel3.add(jCheckBox2, null);
  121. // jPanel3.add(jCheckBox1, null);
  122. // jPanel1.add(jPanel2, BorderLayout.CENTER);
  123. // jPanel2.add(jLabel4, BorderLayout.NORTH);
  124. // jPanel2.add(typeTreeView, BorderLayout.CENTER);
  125. // jPanel1.add(jPanel5, BorderLayout.SOUTH);
  126. // jPanel5.add(ok_button, null);
  127. // jPanel5.add(cancel_button, null);
  128. // }
  129. // private void ok_button_actionPerformed(ActionEvent e) {
  130. // throw new RuntimeException("unimplemented, can't paste");
  131. //// Ajde.getDefault().getEditorManager().pasteToCaretPos(generatePcd());
  132. //// this.dispose();
  133. // }
  134. //
  135. // private void cancel_button_actionPerformed(ActionEvent e) {
  136. // this.dispose();
  137. // }
  138. //
  139. // private String generatePcd() {
  140. // String pcd = "\n\n" +
  141. // " pointcut temp(): \n";
  142. // for (Iterator it = signatures.iterator(); it.hasNext(); ) {
  143. // pcd += " call(* " + it.next() + ")";
  144. // if (it.hasNext()) {
  145. // pcd += " ||";
  146. // } else {
  147. // pcd += ";";
  148. // }
  149. // pcd += "\n";
  150. // }
  151. // return pcd;
  152. // }
  153. }