Package org.neo4j.neoclipse.view

Examples of org.neo4j.neoclipse.view.NeoGraphViewPart$NeoGraphServiceEventListener


     * Executes the action.
     */
    @Override
    public void run()
    {
        NeoGraphViewPart view = (NeoGraphViewPart) getWorkbenchPart();
        // let the user select the print mode
        PrintDialog dialog = new PrintDialog(
                view.getViewer().getControl().getShell(), SWT.NULL );
        PrinterData data = dialog.open();
        if ( data != null )
        {
            // TODO This is only a temporary implementation, until the Zest
            // Graph supports true
            // scalable printing...
            // print the neo figure
            Graph g = view.getViewer().getGraphControl();
            PrintFigureOperation p = new PrintFigureOperation( new Printer(
                    data ), g.getContents() );
            p.setPrintMode( PrintFigureOperation.FIT_PAGE );
            p.run( view.getTitle() );
        }
    }
View Full Code Here


        if ( showHelp )
        {
            IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
            helpSystem.displayDynamicHelp();

            NeoGraphViewPart graphView = (NeoGraphViewPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(
                    NeoGraphViewPart.ID );
            if ( graphView != null )
            {
                graphView.setFocus();
            }
        }
    }
View Full Code Here

        public void doubleClick( final DoubleClickEvent event )
        {
            StructuredSelection sel = (StructuredSelection) event.getSelection();
            Object s = sel.getFirstElement();
            // get the graph viewer
            NeoGraphViewPart gv = (NeoGraphViewPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(
                    NeoGraphViewPart.ID );
            if ( gv == null )
            {
                // TODO if it does not exist yet - create one? how?
                return;
            }
            if ( s instanceof Node )
            {
                gv.showNode( (Node) s );
            }
            else if ( s instanceof Relationship )
            {
                gv.showNode( ( (Relationship) s ).getStartNode() );
            }
        }
View Full Code Here

    @Override
    public void fillContextMenu( IMenuManager menu )
    {

        ConnectionsView view = Activator.getDefault().getConnectionsView();
        NeoGraphViewPart neoGraphView = Activator.getDefault().getNeoGraphViewPart();
        GraphDbServiceManager graphDbServiceManager = Activator.getDefault().getGraphDbServiceManager();

        Alias alias = view.getSelectedAlias();
        if ( alias == null )
        {
View Full Code Here

        {
            @Override
            public void run()
            {
                GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
                NeoGraphViewPart graphView = Activator.getDefault().getNeoGraphViewPart();
                ConnectionsView connectionsView = Activator.getDefault().getConnectionsView();
                try
                {
                    Alias selectedAlias = connectionsView.getSelectedAlias();
                    gsm.startGraphDbService( selectedAlias ).get();
                    graphView.showSomeNode();
                }
                catch ( Exception e )
                {
                    ErrorMessage.showDialog( "Database problem", e );
                }
View Full Code Here

        {
            @Override
            public void run()
            {
                GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
                NeoGraphViewPart graphView = Activator.getDefault().getNeoGraphViewPart();
                try
                {
                    if ( gsm.isRunning() )
                    {
                        if ( !gsm.getCurrentAlias().equals( alias ) )
                        {
                            ErrorMessage.showDialog( "Database problem",
                                    "Another Database view is already active. Please close it before starting another one." );
                        }
                        else
                        {
                            graphView.cleanTransactionBeforeShutdown();
                            gsm.stopGraphDbService().get();
                        }
                    }
                    else if ( !gsm.isRunning() )
                    {
                        gsm.startGraphDbService( alias ).get();
                        graphView.showSomeNode();
                    }
                }
                catch ( Exception e )
                {
                    ErrorMessage.showDialog( "Database problem", e );
View Full Code Here

TOP

Related Classes of org.neo4j.neoclipse.view.NeoGraphViewPart$NeoGraphServiceEventListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.