summaryrefslogtreecommitdiffstats
path: root/ajde/src
diff options
context:
space:
mode:
authormkersten <mkersten>2003-07-25 16:05:33 +0000
committermkersten <mkersten>2003-07-25 16:05:33 +0000
commitcd1ad650b8397ac72ed3e712bf2314fca8e0c17c (patch)
treede5e90ed92cfce8021822b0813705d7466efed11 /ajde/src
parentee142f05543340b072f2975d174c3ed340b50589 (diff)
downloadaspectj-cd1ad650b8397ac72ed3e712bf2314fca8e0c17c.tar.gz
aspectj-cd1ad650b8397ac72ed3e712bf2314fca8e0c17c.zip
De-coupled AJDE APIs from javax.swing, and moved browser-specific funtionality into the the ajbrowser module.)
Diffstat (limited to 'ajde/src')
-rw-r--r--ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java29
-rw-r--r--ajde/src/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java54
2 files changed, 80 insertions, 3 deletions
diff --git a/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java b/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java
index f7228aea2..c2dbd074c 100644
--- a/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java
+++ b/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java
@@ -16,8 +16,16 @@ package org.aspectj.ajde.ui.swing;
import java.awt.Frame;
-import org.aspectj.ajde.*;
-import org.aspectj.ajde.ui.*;
+import org.aspectj.ajde.Ajde;
+import org.aspectj.ajde.BuildListener;
+import org.aspectj.ajde.BuildProgressMonitor;
+import org.aspectj.ajde.EditorAdapter;
+import org.aspectj.ajde.ErrorHandler;
+import org.aspectj.ajde.ProjectPropertiesAdapter;
+import org.aspectj.ajde.TaskListManager;
+import org.aspectj.ajde.ui.FileStructureView;
+import org.aspectj.ajde.ui.IdeUIAdapter;
+import org.aspectj.ajde.ui.UserPreferencesAdapter;
import org.aspectj.ajde.ui.internal.AjcBuildOptions;
/**
@@ -37,6 +45,7 @@ public class AjdeUIManager {
private OptionsFrame optionsFrame = null;
private Frame rootFrame = null;
+ private StructureViewPanel fileStructurePanel = null;
/**
* Order of initialization is critical here.
@@ -48,7 +57,8 @@ public class AjdeUIManager {
UserPreferencesAdapter userPreferencesAdapter,
IdeUIAdapter ideUIAdapter,
IconRegistry iconRegistry,
- Frame rootFrame) {
+ Frame rootFrame,
+ boolean useFileView) {
try {
BuildProgressMonitor compileProgress = new DefaultBuildProgressMonitor(rootFrame);
ErrorHandler errorHandler = new AjdeErrorHandler();
@@ -72,6 +82,15 @@ public class AjdeUIManager {
Ajde.getDefault().getBuildManager().addListener(STATUS_TEXT_UPDATER);
//Ajde.getDefault().setConfigurationManager(configManager);
+ if (useFileView) {
+ FileStructureView structureView = Ajde.getDefault().getStructureViewManager().createViewForSourceFile(
+ Ajde.getDefault().getEditorAdapter().getCurrFile(),
+ Ajde.getDefault().getStructureViewManager().getDefaultViewProperties()
+ );
+ Ajde.getDefault().getStructureViewManager().setDefaultFileView(structureView);
+ fileStructurePanel = new StructureViewPanel(structureView);
+ }
+
viewManager = new BrowserViewManager();
optionsFrame = new OptionsFrame(iconRegistry);
@@ -142,6 +161,10 @@ public class AjdeUIManager {
return buildConfigEditor;
}
+ public StructureViewPanel getFileStructurePanel() {
+ return fileStructurePanel;
+ }
+
public IconRegistry getIconRegistry() {
return iconRegistry;
}
diff --git a/ajde/src/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java b/ajde/src/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java
new file mode 100644
index 000000000..6ad79052a
--- /dev/null
+++ b/ajde/src/org/aspectj/ajde/ui/swing/BuildConfigPopupMenu.java
@@ -0,0 +1,54 @@
+/* *******************************************************************
+ * Copyright (c) 1999-2001 Xerox Corporation,
+ * 2002 Palo Alto Research Center, Incorporated (PARC).
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Common Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Xerox/PARC initial implementation
+ * ******************************************************************/
+
+
+package org.aspectj.ajde.ui.swing;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Iterator;
+
+import javax.swing.AbstractAction;
+import javax.swing.Icon;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+
+import org.aspectj.ajde.Ajde;
+import org.aspectj.asm.ProgramElementNode;
+
+public class BuildConfigPopupMenu extends JPopupMenu {
+
+ public BuildConfigPopupMenu(final AbstractAction action) {
+ java.util.List configFiles = Ajde.getDefault().getProjectProperties().getBuildConfigFiles();
+ for (Iterator it = configFiles.iterator(); it.hasNext(); ) {
+ final String buildConfig = (String)it.next();
+ JMenuItem buildItem = new JMenuItem(buildConfig);
+ buildItem.setFont(AjdeWidgetStyles.DEFAULT_LABEL_FONT);
+ buildItem.addActionListener(
+ new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ Ajde.getDefault().getConfigurationManager().setActiveConfigFile(buildConfig);
+ // ??? should we be able to do a build refresh if shift is down?
+// if (EditorManager.isShiftDown(e.getModifiers())) {
+// Ajde.getDefault().getBuildManager().buildFresh();
+// } else {
+ Ajde.getDefault().getBuildManager().build();
+// }
+ action.actionPerformed(e);
+ }
+ });
+ buildItem.setIcon((Icon)AjdeUIManager.getDefault().getIconRegistry().getStructureIcon(ProgramElementNode.Kind.FILE_LST).getIconResource());
+ this.add(buildItem);
+ }
+ }
+}