Beispiel #1
0
        void IPlugin.Init(object context)
        {
            ISolidReflector reflector = context as ISolidReflector;

            mainWindow = reflector.GetMainWindow();
            IAssemblyBrowser browser = reflector.GetPlugins().GetService <IAssemblyBrowser>();

            browser.SelectionChanged += OnSelectionChanged;

            ScrolledWindow scrollWindow = new ScrolledWindow();
            Viewport       viewport     = new Viewport();

            scrollWindow.Add(viewport);
            viewport.Add(nb);
            scrollWindow.ShowAll();

            nb.AppendPage(textView, new Gtk.Label("CG Text"));
            nb.AppendPage(drawingArea, new Gtk.Label("CG Visualizer"));
            nb.ShowAll();

            cgVisualizingDock                = mainWindow.DockFrame.AddItem("CGVisualizer");
            cgVisualizingDock.DrawFrame      = true;
            cgVisualizingDock.Label          = "Call Graph Visualizer";
            cgVisualizingDock.Content        = scrollWindow;
            cgVisualizingDock.DefaultVisible = true;
            cgVisualizingDock.Visible        = true;
        }
Beispiel #2
0
        void IPlugin.Init(object context)
        {
            ISolidReflector reflector = context as ISolidReflector;

            mainWindow = reflector.GetMainWindow();
            IAssemblyBrowser browser = reflector.GetPlugins().GetService <IAssemblyBrowser>();

            browser.SelectionChanged += OnSelectionChanged;

            ScrolledWindow cfgDrawingAreaWindow   = new ScrolledWindow();
            Viewport       cfgDrawingAreaViewport = new Viewport();

            cfgDrawingAreaWindow.Add(cfgDrawingAreaViewport);
            cfgDrawingAreaViewport.Add(drawingArea);

            ScrolledWindow cfgTextAreaWindow   = new ScrolledWindow();
            Viewport       cfgTextAreaViewport = new Viewport();

            cfgTextAreaWindow.Add(cfgTextAreaViewport);
            cfgTextAreaViewport.Add(cfgTextView);

            Gtk.Notebook nb = new Gtk.Notebook();
            nb.AppendPage(cfgTextAreaWindow, new Gtk.Label("CFG Text"));
            nb.AppendPage(cfgDrawingAreaWindow, new Gtk.Label("CFG Visualizer"));
            nb.ShowAll();

            cfgVisualizingDock                = mainWindow.DockFrame.AddItem("CFG Visualizer");
            cfgVisualizingDock.Expand         = true;
            cfgVisualizingDock.DrawFrame      = true;
            cfgVisualizingDock.Label          = "CFG Visualizer";
            cfgVisualizingDock.Content        = nb;
            cfgVisualizingDock.DefaultVisible = true;
            cfgVisualizingDock.Visible        = true;

            ScrolledWindow simulationTextViewWindow = new ScrolledWindow();
            VBox           simulationVBox           = new VBox(false, 0);

            simulationTextView = new TextView();
            simulationTextViewWindow.Add(simulationTextView);
            Button simulateButton = new Button("Simulate");

            simulateButton.Clicked += HandleClicked;

            simulationVBox.PackStart(simulateButton, false, false, 0);
            simulationVBox.PackStart(new Label("New CFG: "), false, false, 0);
            simulationVBox.PackStart(simulationTextViewWindow, true, true, 0);
            simulationVBox.PackStart(new Label("Method output: "), false, false, 0);
            simulationVBox.PackEnd(outputTextView, true, true, 0);

            simulationVBox.ShowAll();

            simulationDock                = mainWindow.DockFrame.AddItem("Simulation Visualizer");
            simulationDock.Expand         = true;
            simulationDock.DrawFrame      = true;
            simulationDock.Label          = "Simulation Visualizer";
            simulationDock.Content        = simulationVBox;
            simulationDock.DefaultVisible = true;
            simulationDock.Visible        = true;
        }
Beispiel #3
0
        void IPlugin.Init(object context)
        {
            reflector = context as ISolidReflector;

            mainWindow = reflector.GetMainWindow();
            Gtk.MenuBar mainMenuBar = reflector.GetMainMenu();
            reflector.OnShutDown += HandleOnShutDown;

            Gtk.MenuItem fileMenu = null;
            // Find the File menu if present
            foreach (Gtk.Widget w in mainMenuBar.Children)
            {
                if (w.Name == "FileAction")
                {
                    fileMenu = w as Gtk.MenuItem;
                }
            }

            // If not present - create it
            if (fileMenu == null)
            {
                Gtk.Menu menu = new Gtk.Menu();
                fileMenu         = new Gtk.MenuItem("File");
                fileMenu.Submenu = menu;
                mainMenuBar.Append(fileMenu);
            }

            // Setting up the Open menu item in File
            Gtk.MenuItem open = new Gtk.MenuItem("Open");
            open.Activated += OnActivated;
            (fileMenu.Submenu as Gtk.Menu).Prepend(open);

            // Setting up the window scrollers
            Gtk.ScrolledWindow scrollWindow = new Gtk.ScrolledWindow();
            Gtk.Viewport       viewport     = new Gtk.Viewport();
            scrollWindow.Add(viewport);
            viewport.Add(assemblyTree);
            scrollWindow.ShowAll();

            // Attaching the current dockItem in the DockFrame
            dockItem           = mainWindow.DockFrame.AddItem("AssemblyBrowser");
            dockItem.DrawFrame = true;
            dockItem.Label     = "Assembly";
            dockItem.Content   = scrollWindow;

            LoadEnvironment();

            assemblyTree.RowActivated += HandleRowActivated;

            assemblyTree.Realized += delegate(object sender, EventArgs e) {
                LoadSelectedAssembliesTreePaths();
            };
        }