[Jarspy-commits] CVS: JarSpy/src/com/ociweb/jarspy/intellij/plugin JarSpyIntelliJPlugin.java,1.2,1.3
Status: Beta
Brought to you by:
brown_j
From: Jeff B. <br...@us...> - 2003-01-25 17:19:30
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/intellij/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv14996/src/com/ociweb/jarspy/intellij/plugin Modified Files: JarSpyIntelliJPlugin.java Log Message: add about box code Index: JarSpyIntelliJPlugin.java =================================================================== RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/intellij/plugin/JarSpyIntelliJPlugin.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JarSpyIntelliJPlugin.java 25 Jan 2003 16:34:25 -0000 1.2 --- JarSpyIntelliJPlugin.java 25 Jan 2003 17:19:28 -0000 1.3 *************** *** 6,11 **** --- 6,17 ---- import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.openapi.wm.ToolWindowAnchor; + import com.intellij.openapi.actionSystem.AnAction; + import com.intellij.openapi.actionSystem.AnActionEvent; + import com.intellij.openapi.actionSystem.DefaultActionGroup; + import com.intellij.openapi.actionSystem.ActionToolbar; + import com.intellij.openapi.actionSystem.ActionManager; import com.ociweb.jarspy.JarInspector; import com.ociweb.jarspy.gui.ClassesViewer; + import com.ociweb.jarspy.gui.AboutJarSpy; import com.ociweb.jarspy.gui.tree.JarSpyTreeCellRenderer; import java.io.File; *************** *** 15,19 **** --- 21,30 ---- import java.util.Map; import java.util.HashMap; + import java.awt.BorderLayout; + import java.awt.event.ActionEvent; import javax.swing.ImageIcon; + import javax.swing.JPanel; + import javax.swing.JFrame; + import javax.swing.SwingUtilities; public class JarSpyIntelliJPlugin implements ProjectComponent { *************** *** 51,57 **** public void projectOpened() { ToolWindowManager twm = ToolWindowManager.getInstance(myProject); ClassesViewer cv = new ClassesViewer(jarInspector); ! twm.registerToolWindow("JarSpy", cv, ToolWindowAnchor.BOTTOM); } --- 62,95 ---- public void projectOpened() { ToolWindowManager twm = ToolWindowManager.getInstance(myProject); + ClassesViewer cv = new ClassesViewer(jarInspector); ! final JPanel myPanel = new JPanel(new BorderLayout()); ! myPanel.add(BorderLayout.CENTER, cv); ! ! AnAction aboutAction = new AnAction("About", "About JarSpy", new ImageIcon(getClass().getResource("/actions/help.png"))) { ! public void actionPerformed(AnActionEvent ae) { ! JFrame parentFrame = null; ! ! try { ! parentFrame = (JFrame) SwingUtilities.getRoot(myPanel); ! } catch (Exception e) { ! } ! ! AboutJarSpy ajs = new AboutJarSpy(parentFrame); ! ajs.setVisible(true); ! ajs.dispose(); ! } ! }; ! ! DefaultActionGroup actionGroup = new DefaultActionGroup("jarspy", true); ! ! actionGroup.add(aboutAction); ! ! ActionToolbar toolBar = ActionManager.getInstance().createActionToolbar("JarSpy", ! actionGroup, ! false); ! myPanel.add(BorderLayout.WEST, toolBar.getComponent()); ! twm.registerToolWindow("JarSpy", myPanel, ToolWindowAnchor.BOTTOM); } |