Package org.neo4j.neoclipse.graphdb

Examples of org.neo4j.neoclipse.graphdb.GraphDbServiceManager$RunnableWrapper


    @Override
    public void start( final BundleContext context ) throws Exception
    {
        super.start( context );
        PLUGIN = this;
        graphDbServiceManager = new GraphDbServiceManager();
        aliasManager = new AliasManager();
        aliasManager.loadAliases();
    }
View Full Code Here


    public void run()
    {
        Node currentNode = graphView.getCurrentNode();
        final long nodeId = currentNode == null ? -1 : currentNode.getId();
        graphView.cleanPropertySheetBeforeShutdown();
        final GraphDbServiceManager gsm = Activator.getDefault()
                .getGraphDbServiceManager();
        try
        {
            gsm.restartGraphDbService()
                    .get();
            gsm.executeTask( new GraphRunnable()
            {
                @Override
                public void run( final GraphDatabaseService graphDb )
                {
                    if ( nodeId == -1 )
                    {
                        return;
                    }
                    try
                    {
                        final Node node = graphDb.getNodeById( nodeId );
                        gsm.submitDisplayTask( new Runnable()
                        {
                            @Override
                            public void run()
                            {
                                graphView.setInput( node );
                            }
                        }, "Set the current node" );
                    }
                    catch ( NotFoundException nfe )
                    {
                        gsm.submitDisplayTask( new Runnable()
                        {
                            @Override
                            public void run()
                            {
                                graphView.showSomeNode();
View Full Code Here

     * Executes the search.
     */
    @Override
    public IStatus run( final IProgressMonitor monitor ) throws OperationCanceledException
    {
        final GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
        if ( !gsm.isRunning() )
        {
            return new Status( IStatus.ERROR, Activator.PLUGIN_ID, "There is no active Neo4j service." );
        }

        try
        {
            gsm.submitTask( new GraphCallable<Boolean>()
            {
                @Override
                public Boolean call( final GraphDatabaseService graphDb )
                {
                    final Iterable<PropertyContainer> matches = getMatchingNodesFromIndices( monitor, graphDb );
View Full Code Here

    @Override
    public void run()
    {
        graphView.cleanTransactionBeforeShutdown();
        GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
        try
        {
            gsm.stopGraphDbService().get();
        }
        catch ( Exception e )
        {
            ErrorMessage.showDialog( "Database problem", e );
        }
View Full Code Here

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

    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 )
        {
            addAction( menu, new NewAliasAction() );
            return;
        }

        if ( graphDbServiceManager.isRunning() && graphDbServiceManager.getCurrentAlias().equals( alias ) )
        {
            addAction( menu, new StopAction( neoGraphView ) );
            addAction( menu, new ExportToXmlAction() );
            addAction( menu, new ExportToJsonAction() );

        }
        else
        {
            if ( !graphDbServiceManager.isRunning() )
            {
                addAction( menu, new StartAction( neoGraphView ) );
                menu.add( new Separator() );
            }
            else
View Full Code Here

        UiHelper.asyncExec( new Runnable()
        {
            @Override
            public void run()
            {
                final GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
                try
                {
                    CypherResultSet cypherResultSet = gsm.executeCypher( cypherSql );
                    displayResultSet( cypherResultSet );
                }
                catch ( Exception e )
                {
                    e.printStackTrace();
View Full Code Here

    public Image getImage( Object element )
    {
        if ( element instanceof Alias )
        {
            Alias alias = (Alias) element;
            GraphDbServiceManager graphDbServiceManager = Activator.getDefault().getGraphDbServiceManager();
            if ( graphDbServiceManager.isRunning() && graphDbServiceManager.getCurrentAlias().equals( alias ) )
            {
                return Icons.NEW_ALIAS_ENABLED.image();

            }
View Full Code Here

     * Remove Alias from the set
     *
     */
    public void removeAlias( Alias alias )
    {
        GraphDbServiceManager graphDbServiceManager = Activator.getDefault().getGraphDbServiceManager();
        if ( graphDbServiceManager.isRunning() && graphDbServiceManager.getCurrentAlias().equals( alias ) )
        {
            throw new IllegalStateException( "Please stop the service before deleting." );
        }

        aliases.remove( alias );
View Full Code Here

    @Override
    public void run()
    {
        try
        {
            final GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
            final List<NodeWrapper> resultSetList = gsm.getAllNodes();

            // final JSONArray jsonArray = new JSONArray( resultSetList );
            File file = DataExportUtils.exportToXml( ApplicationUtil.toJson( resultSetList ) );
            ErrorMessage.showDialog( "XML Export", "XML file is created at " + file );
        }
View Full Code Here

TOP

Related Classes of org.neo4j.neoclipse.graphdb.GraphDbServiceManager$RunnableWrapper

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.