* The strucutre model is annotated with error messages after an unsuccessful compile.
*/
public void compileFinished(String buildConfig, int buildTime, boolean succeeded, boolean warnings) {
- String configFilePath = projectProperties.getDefaultBuildConfigFile();
+// String configFilePath = projectProperties.getDefaultBuildConfigFile();
if (!succeeded) {
AsmManager.getDefault().fireModelUpdated();
}
private String configFile = "";
private String lastConfigFile = null;
private int lastCompileTime = 50;
- private boolean buildStructureOnly = false;
+// private boolean buildStructureOnly = false;
private boolean buildModelMode = true;
public AspectJBuildManager(
}
}
- private void notifyCompileAborted(String configFile, String message) {
- for (Iterator it = compilerListeners.iterator(); it.hasNext(); ) {
- ((BuildListener)it.next()).compileAborted(configFile, message);
- }
- }
+// private void notifyCompileAborted(String configFile, String message) {
+// for (Iterator it = compilerListeners.iterator(); it.hasNext(); ) {
+// ((BuildListener)it.next()).compileAborted(configFile, message);
+// }
+// }
public BuildOptionsAdapter getBuildOptions() {
public class BuildNotifierAdapter implements IProgressListener {
private BuildProgressMonitor progressMonitor;
- private int numCompilationUnitPasses = 1;
- private int completedPasses = 0;
+// private int numCompilationUnitPasses = 1;
+// private int completedPasses = 0;
private boolean cancelled = false;
// ??? get rid of project coupling
public class CompilerAdapter {
- private Map optionsMap;
+// private Map optionsMap;
private AjBuildManager buildManager = null;
private MessageHandlerAdapter messageHandler = null;
private BuildNotifierAdapter currNotifier = null;
}
}
- private synchronized List getUniqueFileList(List list, Set set) {
- List uniqueList = new ArrayList();
- for (Iterator it = list.iterator(); it.hasNext(); ) {
- BuildConfigNode node = (BuildConfigNode)it.next();
- String file1 = node.getResourcePath();
- if (set.contains(file1) && !uniqueList.contains(file1)) {
- uniqueList.add(file1);
- }
- }
- return uniqueList;
- }
+// private synchronized List getUniqueFileList(List list, Set set) {
+// List uniqueList = new ArrayList();
+// for (Iterator it = list.iterator(); it.hasNext(); ) {
+// BuildConfigNode node = (BuildConfigNode)it.next();
+// String file1 = node.getResourcePath();
+// if (set.contains(file1) && !uniqueList.contains(file1)) {
+// uniqueList.add(file1);
+// }
+// }
+// return uniqueList;
+// }
public String relativizePath(String path, String rootPath) {
path = path.replace('\\', '/');
*/
public class LstBuildConfigManager implements BuildConfigManager {
- private List configFiles = new ArrayList();
+// private List configFiles = new ArrayList();
private List listeners = new ArrayList();
private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater();
protected String currConfigFilePath = null;
}
}
node.addChild(dir);
- boolean foundMatch = false;
+// boolean foundMatch = false;
for (Iterator it = importedFiles.iterator(); it.hasNext(); ) {
File importedFile = (File)it.next();
if (importedFile.getParentFile().getAbsolutePath().equals(dirs[i].getAbsolutePath())) {
- foundMatch = true;
+// foundMatch = true;
BuildConfigNode importedFileNode = new BuildConfigNode(
importedFile.getName(),
BuildConfigNode.Kind.FILE_LST,
node.setActive(true);
upPath.addChild(node);
} else if (!(new File(path).isAbsolute())) {
- String name = new File(path).getName();
+// String name = new File(path).getName();
BuildConfigNode existingNode = model.getNodeForPath(path);
existingNode.setActive(true);
} else {
}
}
- private void notifyConfigsListUpdated() {
- for (Iterator it = listeners.iterator(); it.hasNext(); ) {
- ((BuildConfigListener)it.next()).configsListUpdated(configFiles);
- }
- }
-
+// private void notifyConfigsListUpdated() {
+// for (Iterator it = listeners.iterator(); it.hasNext(); ) {
+// ((BuildConfigListener)it.next()).configsListUpdated(configFiles);
+// }
+// }
+//
private void sortModel(BuildConfigNode node, Comparator comparator) {
if (node == null || node.getChildren() == null) return;
Collections.sort(node.getChildren(), comparator);
this.parent = parent;
}
- private void setParents() {
- if (children == null) return;
- for (Iterator it = children.iterator(); it.hasNext(); ) {
- ((BuildConfigNode)it.next()).setParent(this);
- }
- }
+// private void setParents() {
+// if (children == null) return;
+// for (Iterator it = children.iterator(); it.hasNext(); ) {
+// ((BuildConfigNode)it.next()).setParent(this);
+// }
+// }
public void setName(String string) {
name = string;
import org.aspectj.ajde.Ajde;
import org.aspectj.asm.*;
-import org.aspectj.asm.internal.*;
+//import org.aspectj.asm.internal.*;
/**
* Prototype functionality for package view clients.
*/
public static Map getLinesToAspectMap(String sourceFilePath) {
- Map annotationsMap =
- AsmManager.getDefault().getInlineAnnotations(
- sourceFilePath,
- true,
- true);
+// Map annotationsMap =
+// AsmManager.getDefault().getInlineAnnotations(
+// sourceFilePath,
+// true,
+// true);
Map aspectMap = new HashMap();
- Set keys = annotationsMap.keySet();
+// Set keys = annotationsMap.keySet();
// for (Iterator it = keys.iterator(); it.hasNext();) {
// Object key = it.next();
// List annotations = (List) annotationsMap.get(key);
/**
* Helper function sorts a list of resources into alphabetical order
*/
- private List sortElements(List oldElements) {
- Object[] temp = oldElements.toArray();
- SortingComparator comparator = new SortingComparator();
-
- Arrays.sort(temp, comparator);
-
- List newResources = Arrays.asList(temp);
-
- return newResources;
- }
-
- private static List sortArray(List oldElements) {
- Object[] temp = oldElements.toArray();
- SortArrayComparator comparator = new SortArrayComparator();
-
- Arrays.sort(temp, comparator);
-
- List newElements = Arrays.asList(temp);
-
- return newElements;
- }
-
- private class SortingComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- IProgramElement p1 = (IProgramElement) o1;
- IProgramElement p2 = (IProgramElement) o2;
-
- String name1 = p1.getName();
- String name2 = p2.getName();
-
- return name1.compareTo(name2);
- }
- }
-
- private static class SortArrayComparator implements Comparator {
- public int compare(Object o1, Object o2) {
- Object[] array1 = (Object[]) o1;
- Object[] array2 = (Object[]) o2;
-
- IProgramElement p1 = (IProgramElement) array1[1];
- IProgramElement p2 = (IProgramElement) array2[1];
-
- String name1 = p1.getName();
- String name2 = p2.getName();
+// private List sortElements(List oldElements) {
+// Object[] temp = oldElements.toArray();
+// SortingComparator comparator = new SortingComparator();
+//
+// Arrays.sort(temp, comparator);
+//
+// List newResources = Arrays.asList(temp);
+//
+// return newResources;
+// }
+//
+// private static List sortArray(List oldElements) {
+// Object[] temp = oldElements.toArray();
+// SortArrayComparator comparator = new SortArrayComparator();
+//
+// Arrays.sort(temp, comparator);
+//
+// List newElements = Arrays.asList(temp);
+//
+// return newElements;
+// }
- return name1.compareTo(name2);
- }
- }
+// private class SortingComparator implements Comparator {
+// public int compare(Object o1, Object o2) {
+// IProgramElement p1 = (IProgramElement) o1;
+// IProgramElement p2 = (IProgramElement) o2;
+//
+// String name1 = p1.getName();
+// String name2 = p2.getName();
+//
+// return name1.compareTo(name2);
+// }
+// }
+//
+// private static class SortArrayComparator implements Comparator {
+// public int compare(Object o1, Object o2) {
+// Object[] array1 = (Object[]) o1;
+// Object[] array2 = (Object[]) o2;
+//
+// IProgramElement p1 = (IProgramElement) array1[1];
+// IProgramElement p2 = (IProgramElement) array2[1];
+//
+// String name1 = p1.getName();
+// String name2 = p2.getName();
+//
+// return name1.compareTo(name2);
+// }
+// }
/**
* @return all of the AspectJ and Java source files in a package
import org.aspectj.ajde.Ajde;
import org.aspectj.asm.*;
-import org.aspectj.asm.internal.*;
+//import org.aspectj.asm.internal.*;
/**
* @author Mik Kersten
public class StructureViewManager {
private TreeStructureViewBuilder treeViewBuilder;
- private String buildConfigFilePath = null;
+// private String buildConfigFilePath = null;
private NavigationHistoryModel historyModel = new NavigationHistoryModel();
private ArrayList structureViews = new ArrayList();
import org.aspectj.ajde.ui.*;
import org.aspectj.asm.*;
-import org.aspectj.asm.internal.*;
-import org.aspectj.asm.internal.ProgramElement;
+//import org.aspectj.asm.internal.*;
+//import org.aspectj.asm.internal.ProgramElement;
/**
* @author Mik Kersten
* @todo get rid of instanceof tests
*/
public void buildView(StructureView view, IHierarchy model) {
- StructureViewProperties properties = view.getViewProperties();
+// StructureViewProperties properties = view.getViewProperties();
IProgramElement modelRoot = null;
- boolean noStructure = false;
+// boolean noStructure = false;
if (isFileView(view)) {
FileStructureView fileView = (FileStructureView)view;
if (fileView.getSourceFile() == null) {
modelRoot = IHierarchy.NO_STRUCTURE;
- noStructure = true;
+// noStructure = true;
} else {
modelRoot = model.findElementForSourceFile(fileView.getSourceFile());
}
}
private IStructureViewNode getInheritanceChildren(IProgramElement node, List associations) {
- IStructureViewNode treeNode = nodeFactory.createNode(node);
- //StructureViewNode treeNode = new StructureViewNodeAdapter(node);
+// IStructureViewNode treeNode = nodeFactory.createNode(node);
+// //StructureViewNode treeNode = new StructureViewNodeAdapter(node);
// List relations = ((IProgramElement)node).getRelations();
throw new RuntimeException("unimplemented");
// if (relations != null) {
// return treeNode;
}
- private IStructureViewNode buildTree(IProgramElement node, List associations) {
- //StructureViewNode treeNode = new StructureViewNodeAdapter(node);
- IStructureViewNode treeNode = nodeFactory.createNode(node);
-// if (node instanceof IProgramElement) {
+// private IStructureViewNode buildTree(IProgramElement node, List associations) {
+// //StructureViewNode treeNode = new StructureViewNodeAdapter(node);
+// IStructureViewNode treeNode = nodeFactory.createNode(node);
+//// if (node instanceof IProgramElement) {
// List relations = ((IProgramElement)node).getRelations();
// if (relations != null) {
// for (Iterator it = relations.iterator(); it.hasNext(); ) {
// }
// }
// }
- if (node != null) {
- List children = null;
- children = node.getChildren();
- if (children != null) {
- List childList = new ArrayList();
- for (Iterator itt = children.iterator(); itt.hasNext(); ) {
- IProgramElement child = (IProgramElement)itt.next();
- if (child instanceof IProgramElement) {
- IProgramElement progNode = (IProgramElement)child;
-// if (progNode.getKind() != IProgramElement.Kind.CODE) {
- childList.add(buildTree(child, associations));
-// }
- } else {
- childList.add(buildTree(child, associations));
- }
- }
- //sortNodes(childList);
- for (Iterator it = childList.iterator(); it.hasNext(); ) {
- treeNode.add((IStructureViewNode)it.next());
- }
- }
-
- }
- return treeNode;
- }
-
- private IStructureViewNode getRelations(IRelationship node) {
- return null;
- //StructureViewNode treeNode = new StructureViewNode(node);
-// IStructureViewNode treeNode = nodeFactory.c(node);
-// for (Iterator it = node.getTargets().iterator(); it.hasNext(); ) {
-// treeNode.add(
-// nodeFactory.createNode((IProgramElement)it.next())
-// );
-// }
+// if (node != null) {
+// List children = null;
+// children = node.getChildren();
+// if (children != null) {
+// List childList = new ArrayList();
+// for (Iterator itt = children.iterator(); itt.hasNext(); ) {
+// IProgramElement child = (IProgramElement)itt.next();
+// if (child instanceof IProgramElement) {
+// IProgramElement progNode = (IProgramElement)child;
+//// if (progNode.getKind() != IProgramElement.Kind.CODE) {
+// childList.add(buildTree(child, associations));
+//// }
+// } else {
+// childList.add(buildTree(child, associations));
+// }
+// }
+// //sortNodes(childList);
+// for (Iterator it = childList.iterator(); it.hasNext(); ) {
+// treeNode.add((IStructureViewNode)it.next());
+// }
+// }
+//
+// }
// return treeNode;
- }
+// }
- /**
- * For debugging only.
- */
- private void dumpView(IStructureViewNode root, int level) {
- System.out.println(root.getStructureNode());
- for (Iterator it = root.getChildren().iterator(); it.hasNext(); ) {
- dumpView((IStructureViewNode)it.next(), level++);
- }
- for (int i = 0; i < level; i++) {
- System.out.print(' ');
- }
- }
+// private IStructureViewNode getRelations(IRelationship node) {
+// return null;
+// //StructureViewNode treeNode = new StructureViewNode(node);
+//// IStructureViewNode treeNode = nodeFactory.c(node);
+//// for (Iterator it = node.getTargets().iterator(); it.hasNext(); ) {
+//// treeNode.add(
+//// nodeFactory.createNode((IProgramElement)it.next())
+//// );
+//// }
+//// return treeNode;
+// }
+//
+// /**
+// * For debugging only.
+// */
+// private void dumpView(IStructureViewNode root, int level) {
+// System.out.println(root.getStructureNode());
+// for (Iterator it = root.getChildren().iterator(); it.hasNext(); ) {
+// dumpView((IStructureViewNode)it.next(), level++);
+// }
+// for (int i = 0; i < level; i++) {
+// System.out.print(' ');
+// }
+// }
/**
* Does not sort imports alphabetically.
protected static final AjdeUIManager INSTANCE = new AjdeUIManager();
private BrowserViewManager viewManager = null;
- private BuildProgressMonitor buildProgressMonitor = null;
- private ErrorHandler errorHandler = null;
+// private BuildProgressMonitor buildProgressMonitor = null;
+// private ErrorHandler errorHandler = null;
private UserPreferencesAdapter userPreferencesAdapter = null;
private AjcBuildOptions buildOptionsAdapter = null;
private IdeUIAdapter ideUIAdapter = null;
// treeManager.navigationAction(node, true, true);
// }
- private void order_comboBox_actionPerformed(ActionEvent e) {
- Ajde.getDefault().getStructureViewManager().refreshView(
- currentView
- );
- }
+// private void order_comboBox_actionPerformed(ActionEvent e) {
+// Ajde.getDefault().getStructureViewManager().refreshView(
+// currentView
+// );
+// }
private void jbInit() throws Exception {
this.setLayout(borderLayout2);
}
- private void order_button_actionPerformed(ActionEvent e) {
-
- }
-
- private void orderPopup_button_actionPerformed(ActionEvent e) {
-
- }
+// private void order_button_actionPerformed(ActionEvent e) {
+//
+// }
+//
+// private void orderPopup_button_actionPerformed(ActionEvent e) {
+//
+// }
void separator_button_actionPerformed(ActionEvent e) {
import org.aspectj.ajde.Ajde;
import org.aspectj.ajde.ui.*;
-import org.aspectj.asm.*;
+//import org.aspectj.asm.*;
/**
* Responsible for displaying and controlling the configuration and output of a
public class BrowserViewManager {
private StructureViewPanel browserPanel = null;
- private boolean globalMode = true;
- private boolean splitViewMode = false;
- private IconRegistry icons;
-
- private Stack backHistory = new Stack();
- private Stack forwardHistory = new Stack();
- private IProgramElement currNode = null;
+// private boolean globalMode = true;
+// private boolean splitViewMode = false;
+// private IconRegistry icons;
+//
+// private Stack backHistory = new Stack();
+// private Stack forwardHistory = new Stack();
+// private IProgramElement currNode = null;
private final GlobalStructureView DECLARATION_VIEW;
private final GlobalStructureView CROSSCUTTING_VIEW;
import javax.swing.*;
import javax.swing.event.*;
-import javax.swing.tree.TreePath;
+//import javax.swing.tree.TreePath;
import org.aspectj.asm.IProgramElement;
}
public void doubleClickNavigation(MouseEvent e) {
- int clickCount = e.getClickCount();
+// int clickCount = e.getClickCount();
SwingTreeViewNode treeNode = (SwingTreeViewNode)tree.getLastSelectedPathComponent();
if (treeNode != null) {
IProgramElement currNode = (IProgramElement)treeNode.getUserObject();
*/
private void maybeShowPopup(MouseEvent e) {
if (e.getModifiers() == InputEvent.BUTTON3_MASK && tree.getSelectionCount() > 0) {
- TreePath[] selectionPaths = tree.getSelectionPaths();
+// TreePath[] selectionPaths = tree.getSelectionPaths();
final List signatures = new ArrayList();
- for (int i = 0; i < selectionPaths.length; i++) {
- IProgramElement currNode = (IProgramElement)((SwingTreeViewNode)selectionPaths[i].getLastPathComponent()).getUserObject();
-// if (currNode instanceof LinkNode || currNode instanceof IProgramElement) {
-// signatures.add(currNode);
-// }
- }
+// for (int i = 0; i < selectionPaths.length; i++) {
+// IProgramElement currNode = (IProgramElement)((SwingTreeViewNode)selectionPaths[i].getLastPathComponent()).getUserObject();
+//// if (currNode instanceof LinkNode || currNode instanceof IProgramElement) {
+//// signatures.add(currNode);
+//// }
+// }
JPopupMenu popup = new JPopupMenu();
JMenuItem showSourcesItem = new JMenuItem("Display sources", AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.CODE));
protected static BuildOptionsPanel INSTANCE = new BuildOptionsPanel();
- private ButtonGroup compilerMode_buttonGroup = new ButtonGroup();
+// private ButtonGroup compilerMode_buttonGroup = new ButtonGroup();
private TitledBorder titledBorder1;
private Border border3;
private Border border4;
// private TitledBorder titledBorder2;
- private Border border5;
+// private Border border5;
private Border border1;
private Border border2;
private JPanel jPanel3 = new JPanel();
import java.util.Date;
import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.ButtonGroup;
+//import javax.swing.Box;
+//import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
private TitledBorder titledBorder5;
private Border border2;
private TitledBorder titledBorder6;
- private Box temp_box = Box.createVerticalBox();
+// private Box temp_box = Box.createVerticalBox();
private Border border3;
private TitledBorder titledBorder7;
private Border border4;
private TitledBorder titledBorder9;
private Border border6;
private TitledBorder titledBorder10;
- private ButtonGroup views_buttonGroup = new ButtonGroup();
+// private ButtonGroup views_buttonGroup = new ButtonGroup();
private Border border7;
private TitledBorder titledBorder11;
private Border border8;
package org.aspectj.ajde.ui.swing;
import java.awt.*;
-import java.awt.event.ActionEvent;
+//import java.awt.event.ActionEvent;
import java.util.*;
import javax.swing.*;
import org.aspectj.ajde.ui.*;
-import org.aspectj.asm.IRelationship;
+//import org.aspectj.asm.IRelationship;
/**
* @author Mik Kersten
// this.setIconImage(((ImageIcon)AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.POINTCUT)).getImage());
}
- private Map getViewProperties() {
- Map views = new HashMap();
- GlobalViewProperties INHERITANCE_VIEW = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE);
-// INHERITANCE_VIEW.addRelation(IRelationship.Kind.INHERITANCE);
-// views.put(INHERITANCE_VIEW.toString(), INHERITANCE_VIEW);
- return views;
- }
-
- private void jbInit() throws Exception {
- jLabel1.setFont(new java.awt.Font("Dialog", 0, 11));
- jLabel1.setText("Generate pointcut designator for corresponding joinpoints:");
- jPanel1.setLayout(borderLayout1);
- jPanel4.setLayout(borderLayout2);
- jPanel2.setLayout(borderLayout3);
- jLabel4.setText("Select the target type that will host the generated pointcut:");
- jLabel4.setFont(new java.awt.Font("Dialog", 0, 11));
- jLabel4.setToolTipText("");
- jPanel3.setMaximumSize(new Dimension(32767, 34));
- jCheckBox5.setEnabled(false);
- jCheckBox5.setFont(new java.awt.Font("Dialog", 0, 11));
- jCheckBox5.setSelected(true);
- jCheckBox5.setText("call");
- jCheckBox4.setEnabled(false);
- jCheckBox4.setFont(new java.awt.Font("Dialog", 0, 11));
- jCheckBox4.setText("execution");
- jCheckBox3.setEnabled(false);
- jCheckBox3.setFont(new java.awt.Font("Dialog", 0, 11));
- jCheckBox3.setText("initialization");
- jCheckBox2.setEnabled(false);
- jCheckBox2.setFont(new java.awt.Font("Dialog", 0, 11));
- jCheckBox2.setText("static initialization");
- jCheckBox1.setEnabled(false);
- jCheckBox1.setFont(new java.awt.Font("Dialog", 0, 11));
- jCheckBox1.setText("field get/set");
- cancel_button.setFont(new java.awt.Font("Dialog", 0, 11));
- cancel_button.setText("Cancel");
- cancel_button.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(ActionEvent e) {
- cancel_button_actionPerformed(e);
- }
- });
- ok_button.setText("OK");
- ok_button.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(ActionEvent e) {
- ok_button_actionPerformed(e);
- }
- });
- ok_button.setFont(new java.awt.Font("Dialog", 0, 11));
- this.setTitle("Pointcut Wizard");
- this.getContentPane().add(jPanel1, BorderLayout.CENTER);
- jPanel1.add(jPanel4, BorderLayout.NORTH);
- jPanel4.add(jLabel1, BorderLayout.NORTH);
- jPanel4.add(jPanel3, BorderLayout.CENTER);
- jPanel3.add(jCheckBox5, null);
- jPanel3.add(jCheckBox4, null);
- jPanel3.add(jCheckBox3, null);
- jPanel3.add(jCheckBox2, null);
- jPanel3.add(jCheckBox1, null);
- jPanel1.add(jPanel2, BorderLayout.CENTER);
- jPanel2.add(jLabel4, BorderLayout.NORTH);
- jPanel2.add(typeTreeView, BorderLayout.CENTER);
- jPanel1.add(jPanel5, BorderLayout.SOUTH);
- jPanel5.add(ok_button, null);
- jPanel5.add(cancel_button, null);
- }
+// private Map getViewProperties() {
+// Map views = new HashMap();
+// GlobalViewProperties INHERITANCE_VIEW = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE);
+//// INHERITANCE_VIEW.addRelation(IRelationship.Kind.INHERITANCE);
+//// views.put(INHERITANCE_VIEW.toString(), INHERITANCE_VIEW);
+// return views;
+// }
+//
+// private void jbInit() throws Exception {
+// jLabel1.setFont(new java.awt.Font("Dialog", 0, 11));
+// jLabel1.setText("Generate pointcut designator for corresponding joinpoints:");
+// jPanel1.setLayout(borderLayout1);
+// jPanel4.setLayout(borderLayout2);
+// jPanel2.setLayout(borderLayout3);
+// jLabel4.setText("Select the target type that will host the generated pointcut:");
+// jLabel4.setFont(new java.awt.Font("Dialog", 0, 11));
+// jLabel4.setToolTipText("");
+// jPanel3.setMaximumSize(new Dimension(32767, 34));
+// jCheckBox5.setEnabled(false);
+// jCheckBox5.setFont(new java.awt.Font("Dialog", 0, 11));
+// jCheckBox5.setSelected(true);
+// jCheckBox5.setText("call");
+// jCheckBox4.setEnabled(false);
+// jCheckBox4.setFont(new java.awt.Font("Dialog", 0, 11));
+// jCheckBox4.setText("execution");
+// jCheckBox3.setEnabled(false);
+// jCheckBox3.setFont(new java.awt.Font("Dialog", 0, 11));
+// jCheckBox3.setText("initialization");
+// jCheckBox2.setEnabled(false);
+// jCheckBox2.setFont(new java.awt.Font("Dialog", 0, 11));
+// jCheckBox2.setText("static initialization");
+// jCheckBox1.setEnabled(false);
+// jCheckBox1.setFont(new java.awt.Font("Dialog", 0, 11));
+// jCheckBox1.setText("field get/set");
+// cancel_button.setFont(new java.awt.Font("Dialog", 0, 11));
+// cancel_button.setText("Cancel");
+// cancel_button.addActionListener(new java.awt.event.ActionListener() {
+// public void actionPerformed(ActionEvent e) {
+// cancel_button_actionPerformed(e);
+// }
+// });
+// ok_button.setText("OK");
+// ok_button.addActionListener(new java.awt.event.ActionListener() {
+// public void actionPerformed(ActionEvent e) {
+// ok_button_actionPerformed(e);
+// }
+// });
+// ok_button.setFont(new java.awt.Font("Dialog", 0, 11));
+// this.setTitle("Pointcut Wizard");
+// this.getContentPane().add(jPanel1, BorderLayout.CENTER);
+// jPanel1.add(jPanel4, BorderLayout.NORTH);
+// jPanel4.add(jLabel1, BorderLayout.NORTH);
+// jPanel4.add(jPanel3, BorderLayout.CENTER);
+// jPanel3.add(jCheckBox5, null);
+// jPanel3.add(jCheckBox4, null);
+// jPanel3.add(jCheckBox3, null);
+// jPanel3.add(jCheckBox2, null);
+// jPanel3.add(jCheckBox1, null);
+// jPanel1.add(jPanel2, BorderLayout.CENTER);
+// jPanel2.add(jLabel4, BorderLayout.NORTH);
+// jPanel2.add(typeTreeView, BorderLayout.CENTER);
+// jPanel1.add(jPanel5, BorderLayout.SOUTH);
+// jPanel5.add(ok_button, null);
+// jPanel5.add(cancel_button, null);
+// }
- private void ok_button_actionPerformed(ActionEvent e) {
- throw new RuntimeException("unimplemented, can't paste");
-// Ajde.getDefault().getEditorManager().pasteToCaretPos(generatePcd());
+// private void ok_button_actionPerformed(ActionEvent e) {
+// throw new RuntimeException("unimplemented, can't paste");
+//// Ajde.getDefault().getEditorManager().pasteToCaretPos(generatePcd());
+//// this.dispose();
+// }
+//
+// private void cancel_button_actionPerformed(ActionEvent e) {
// this.dispose();
- }
-
- private void cancel_button_actionPerformed(ActionEvent e) {
- this.dispose();
- }
-
- private String generatePcd() {
- String pcd = "\n\n" +
- " pointcut temp(): \n";
- for (Iterator it = signatures.iterator(); it.hasNext(); ) {
- pcd += " call(* " + it.next() + ")";
- if (it.hasNext()) {
- pcd += " ||";
- } else {
- pcd += ";";
- }
- pcd += "\n";
- }
- return pcd;
- }
+// }
+//
+// private String generatePcd() {
+// String pcd = "\n\n" +
+// " pointcut temp(): \n";
+// for (Iterator it = signatures.iterator(); it.hasNext(); ) {
+// pcd += " call(* " + it.next() + ")";
+// if (it.hasNext()) {
+// pcd += " ||";
+// } else {
+// pcd += ";";
+// }
+// pcd += "\n";
+// }
+// return pcd;
+// }
}
Runnable update = new Runnable() {
public void run() {
structureTree.removeAll();
- SwingTreeViewNode currNode;
+// SwingTreeViewNode currNode;
if (structureView.getRootNode() == null) {
structureTree.setModel(NO_STRUCTURE_MODEL);
} else {
import javax.swing.tree.DefaultMutableTreeNode;
import org.aspectj.ajde.ui.*;
-import org.aspectj.ajde.ui.IStructureViewNode.Kind;
+//import org.aspectj.ajde.ui.IStructureViewNode.Kind;
import org.aspectj.asm.*;
/**
public class TreeViewBuildConfigEditor extends JPanel implements BuildConfigEditor {
private ConfigTreeNode root;
- private ConfigTreeNode currNode;
+// private ConfigTreeNode currNode;
private BuildConfigModel model = null;
private static java.util.List selectedEntries = new ArrayList();
this.dispose();
}
void ok_button_actionPerformed(ActionEvent e) {
- Object[] selected = buildConfigList.getSelectedValues();
- //LstBuildConfigFileUpdater.updateBuildConfigFiles(buildConfigFiles, filesToUpdate, addToConfiguration);
+// Object[] selected = buildConfigList.getSelectedValues();
+// //LstBuildConfigFileUpdater.updateBuildConfigFiles(buildConfigFiles, filesToUpdate, addToConfiguration);
this.dispose();
}
package org.aspectj.ajde;
-import java.util.Iterator;
+//import java.util.Iterator;
-import org.aspectj.ajdt.internal.core.builder.AsmElementFormatter;
+//import org.aspectj.ajdt.internal.core.builder.AsmElementFormatter;
import org.aspectj.asm.*;
-import org.aspectj.asm.IProgramElement.Kind;
+//import org.aspectj.asm.IProgramElement.Kind;
// TODO: add tests for java kinds, expand coverage
private IHierarchy model = null;
private static final String CONFIG_FILE_PATH = "../examples/coverage/coverage.lst";
- private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH;
+// private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH;
public AsmDeclarationsTest(String name) {
super(name);
IProgramElement clazz = AsmManager.getDefault().getHierarchy().findElementForType(null, toType);
assertNotNull(clazz);
- String set = to;
+// String set = to;
IRelationship rel2 = manager.getRelationshipMap().get(clazz, IRelationship.Kind.DECLARE_INTER_TYPE, backRelName);
- String handle2 = (String)rel2.getTargets().get(0);
+// String handle2 = (String)rel2.getTargets().get(0);
for (Iterator it = rel2.getTargets().iterator(); it.hasNext(); ) {
String currHandle = (String)it.next();
if (manager.getHierarchy().findElementForHandle(currHandle).toLabelString().equals(from)) return;
buildOptions.setNoImportError( true );
buildConfig = compilerAdapter.genBuildConfig( configFile );
assertTrue(configFile + " failed", null != buildConfig);
- Map options = buildConfig.getJavaOptions();
+// Map options = buildConfig.getJavaOptions();
// String noImport = (String) options.get( CompilerOptions.OPTION_ReportInvalidImport );
// assertEquals( "no import", CompilerOptions.WARNING, noImport );
// buildOptions.setNoImportError( false );
};
try {
- String s = null;
+// String s = null;
Ajde.init(
null,
null,
import java.io.IOException;
import java.util.List;
-import org.aspectj.bridge.*;
+//import org.aspectj.bridge.*;
import org.aspectj.bridge.IMessage;
/**
String outdirName,
Set expectedOutdirContents) {
- byte[] inManifest = null;
+// byte[] inManifest = null;
File binBase = openFile(outdirName);
String[] toResources = FileUtil.listFiles(binBase);
/**
* @param resources
*/
- private void dumpResources(HashSet resources) {
- System.err.println("Dump: " + resources.size() + " resources");
- for (Iterator iter = resources.iterator(); iter.hasNext();) {
- Object element = (Object) iter.next();
- System.err.println(" Resource: " + element);
- }
- }
+// private void dumpResources(HashSet resources) {
+// System.err.println("Dump: " + resources.size() + " resources");
+// for (Iterator iter = resources.iterator(); iter.hasNext();) {
+// Object element = (Object) iter.next();
+// System.err.println(" Resource: " + element);
+// }
+// }
private void listSourceResources(String indirName, Set resources) {
File srcBase = openFile(indirName);
}
}
- private byte[] listDirResources(File directory, Set resources) {
- return listDirResources(
- directory.getAbsolutePath(),
- directory,
- resources);
- }
-
- private byte[] listDirResources(
- String prefix,
- File directory,
- Set resources) {
- byte[] manifest = null;
-
- File[] resourceFiles = directory.listFiles(new FileFilter() {
- public boolean accept(File arg0) {
- boolean accept =
- !arg0.getName().endsWith(".class") && !arg0.isDirectory();
- return accept;
- }
- });
- for (int i = 0; i < resourceFiles.length; i++) {
- File f = resourceFiles[i];
- String name = f.getAbsolutePath();
- if (f.getAbsolutePath().startsWith(prefix))
- name = name.substring(prefix.length());
- name = name.replace('\\', '/');
-
- resources.add(resourceFiles[i]);
- }
- File[] subdirs = directory.listFiles(new FileFilter() {
- public boolean accept(File arg0) {
- return arg0.isDirectory();
- }
- });
- for (int i = 0; i < subdirs.length; i++) {
- listDirResources(prefix, subdirs[i], resources);
- }
-
- return manifest;
- }
+// private byte[] listDirResources(File directory, Set resources) {
+// return listDirResources(
+// directory.getAbsolutePath(),
+// directory,
+// resources);
+// }
+
+// private byte[] listDirResources(
+// String prefix,
+// File directory,
+// Set resources) {
+// byte[] manifest = null;
+//
+// File[] resourceFiles = directory.listFiles(new FileFilter() {
+// public boolean accept(File arg0) {
+// boolean accept =
+// !arg0.getName().endsWith(".class") && !arg0.isDirectory();
+// return accept;
+// }
+// });
+// for (int i = 0; i < resourceFiles.length; i++) {
+// File f = resourceFiles[i];
+// String name = f.getAbsolutePath();
+// if (f.getAbsolutePath().startsWith(prefix))
+// name = name.substring(prefix.length());
+// name = name.replace('\\', '/');
+//
+// resources.add(resourceFiles[i]);
+// }
+// File[] subdirs = directory.listFiles(new FileFilter() {
+// public boolean accept(File arg0) {
+// return arg0.isDirectory();
+// }
+// });
+// for (int i = 0; i < subdirs.length; i++) {
+// listDirResources(prefix, subdirs[i], resources);
+// }
+//
+// return manifest;
+// }
public static final FileFilter aspectjResourceFileFilter =
new FileFilter() {
public void compileStarted(String buildConfigFile) { }
public void compileFinished(String buildConfigFile, int buildTime, boolean succeeded, boolean warnings) {
- int timeInSeconds = buildTime/1000;
+// int timeInSeconds = buildTime/1000;
buildSucceeded = succeeded;
buildFinished = true;
}
import org.aspectj.ajde.*;
import org.aspectj.ajde.NullIdeTaskListManager.SourceLineTask;
import org.aspectj.ajde.ui.BuildConfigModel;
-import org.aspectj.ajde.ui.internal.AjcBuildOptions;
-import org.aspectj.bridge.Message;
+//import org.aspectj.ajde.ui.internal.AjcBuildOptions;
+//import org.aspectj.bridge.Message;
public class LstBuildConfigManagerTest extends AjdeTestCase {
- private AjcBuildOptions buildOptions = null;
+// private AjcBuildOptions buildOptions = null;
private BuildConfigManager buildConfigManager = new LstBuildConfigManager();
- private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater();
+// private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater();
public LstBuildConfigManagerTest(String name) {
super(name);
public void testFileRelativePathSameDir() throws IOException {
File file = openFile("file-relPath-sameDir.lst");
- BuildConfigModel model = buildConfigManager.buildModel(file.getCanonicalPath());
+ buildConfigManager.buildModel(file.getCanonicalPath());
assertTrue("single file", true);
}
- private void verifyFile(String configFile, String fileContents) {
- StringTokenizer st = new StringTokenizer(fileContents, ";");
- BuildConfigModel model1 = buildConfigManager.buildModel(configFile);
- File testFile = new File(configFile + "-test.lst");
- model1.setSourceFile(testFile.getPath());
- buildConfigManager.writeModel(model1);
- List newList = fileUpdater.readConfigFile(testFile.getPath());
- testFile.delete();
-
- assertTrue("contents: " + newList, verifyLists(st, newList));
- }
-
- private boolean verifyLists(StringTokenizer st, List list) {
- Iterator it = list.iterator();
- while (st.hasMoreElements()) {
- String s1 = (String)st.nextElement();
- String s2 = (String)it.next();
- if (!s1.equals(s2)) return false;
- }
- if (it.hasNext()) {
- return false;
- } else {
- return true;
- }
- }
+// private void verifyFile(String configFile, String fileContents) {
+// StringTokenizer st = new StringTokenizer(fileContents, ";");
+// BuildConfigModel model1 = buildConfigManager.buildModel(configFile);
+// File testFile = new File(configFile + "-test.lst");
+// model1.setSourceFile(testFile.getPath());
+// buildConfigManager.writeModel(model1);
+// List newList = fileUpdater.readConfigFile(testFile.getPath());
+// testFile.delete();
+//
+// assertTrue("contents: " + newList, verifyLists(st, newList));
+// }
+//
+// private boolean verifyLists(StringTokenizer st, List list) {
+// Iterator it = list.iterator();
+// while (st.hasMoreElements()) {
+// String s1 = (String)st.nextElement();
+// String s2 = (String)it.next();
+// if (!s1.equals(s2)) return false;
+// }
+// if (it.hasNext()) {
+// return false;
+// } else {
+// return true;
+// }
+// }
protected void setUp() throws Exception {
super.setUp("LstBuildConfigManagerTest");
super.tearDown();
}
- private static final String WILDCARDS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-config.lst";
- private static final String BAD_PATHS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-error.lst";
- private static final String INCLUDES_FILE = "C:/Dev/aspectj/tests/ajde/examples/spacewar/spacewar/demo.lst";
+// private static final String WILDCARDS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-config.lst";
+// private static final String BAD_PATHS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-error.lst";
+// private static final String INCLUDES_FILE = "C:/Dev/aspectj/tests/ajde/examples/spacewar/spacewar/demo.lst";
private static final String WILDCARDS_FILE_CONTENTS;
private static final String BAD_PATHS_FILE_CONTENTS;
}
public void testFindPatternMatch() {
- List matches = Ajde.getDefault().getStructureSearchManager().findMatches(
+ Ajde.getDefault().getStructureSearchManager().findMatches(
"Point",
null
);
}
public void testFindPatternAndKindMatch() {
- List matches = Ajde.getDefault().getStructureSearchManager().findMatches(
+ Ajde.getDefault().getStructureSearchManager().findMatches(
"Point",
IProgramElement.Kind.CONSTRUCTOR
);