Package org.neo4j.neoclipse.graphdb

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


        UiHelper.asyncExec( new Runnable()
        {
            @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


        UiHelper.asyncExec( new Runnable()
        {
            @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 )
                {
View Full Code Here

    @Override
    public void run()
    {
        try
        {
            final GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
            if ( !gsm.isRunning() )
            {
                throw new IllegalStateException( "There is no active Neo4j service." );
            }
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView( SqlEditorView.ID );
        }
View Full Code Here

    @Override
    public void run()
    {
        try
        {
            final GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
            final List<NodeWrapper> resultSetList = gsm.getAllNodes();
            File file = DataExportUtils.exportToJson( ApplicationUtil.toJson( resultSetList ) );
            ErrorMessage.showDialog( "Json Export", "Json file is created at " + file );
        }
        catch ( Exception e )
        {
View Full Code Here

     * @param marked true if the node is marked
     * @return
     */
    private Color getNodeColor( final Node node, final boolean marked )
    {
        GraphDbServiceManager gsm = Activator.getDefault()
                .getGraphDbServiceManager();
        try
        {
            return gsm.submitTask( new Callable<Color>()
            {
                @Override
                public Color call() throws Exception
                {
                    Relationship randomRel = null;
View Full Code Here

                    }
                }
            }
        }
        // look in relations
        GraphDbServiceManager gsm = Activator.getDefault()
                .getGraphDbServiceManager();
        try
        {
            img = gsm.submitTask( new Callable<Image>()
            {
                @Override
                public Image call() throws Exception
                {
                    Image img = null;
View Full Code Here

     * @param id id of the property
     * @return true if set
     */
    protected boolean isSet( final Object id )
    {
        GraphDbServiceManager gsm = Activator.getDefault().getGraphDbServiceManager();
        try
        {
            return gsm.submitTask( new Callable<Boolean>()
            {
                @Override
                public Boolean call() throws Exception
                {
                    return container.hasProperty( (String) id );
View Full Code Here

        viewer.setLabelProvider( labelProvider );
        addListener( labelProvider );
        getSite().getPage().addSelectionListener( ID, new SelectionChangeHandler() );
        getSite().getPage().addSelectionListener( RelationshipTypeView.ID, new RelTypeSelectionChangeHandler() );
        menu = new NeoGraphMenu( this );
        GraphDbServiceManager sm = Activator.getDefault().getGraphDbServiceManager();
        sm.addServiceEventListener( new NeoGraphServiceEventListener() );
        getSite().setSelectionProvider( viewer );
        Activator.getDefault().getPluginPreferences().addPropertyChangeListener( new PreferenceChangeHandler() );
        PlatformUI.getWorkbench().getHelpSystem().setHelp( viewer.getControl(),
                HelpContextConstants.NEO_GRAPH_VIEW_PART );
View Full Code Here

    /**
     * Set context menu to the correct state.
     */
    public void updateMenuState()
    {
        GraphDbServiceManager sm = Activator.getDefault().getGraphDbServiceManager();
        if ( !sm.isReadOnlyMode() )
        {
            int selectedNodeCount = currentSelectedNodes.size();
            int selectedRelationshipCount = currentSelectedRels.size();
            menu.setEnableDeleteAction( selectedNodeCount > 0 || selectedRelationshipCount > 0 );
            boolean rel = selectedNodeCount == 2;
View Full Code Here

        if ( viewer.getContentProvider() != null )
        {
            viewer.setInput( null );
        }

        GraphDbServiceManager sm = Activator.getDefault().getGraphDbServiceManager();
        if ( MessageDialog.openQuestion( null, "Stopping the database",
                "There are changes that are not commited to the database. Do you want to commit (save) them?" ) )
        {
            sm.commit();
        }
        else
        {
            sm.rollback();
        }
    }
View Full Code Here

TOP

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

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.