Package com.dci.intellij.dbn.connection.transaction.action

Source Code of com.dci.intellij.dbn.connection.transaction.action.ShowUncommittedChangesAction

package com.dci.intellij.dbn.connection.transaction.action;

import com.dci.intellij.dbn.connection.ConnectionHandler;
import com.dci.intellij.dbn.connection.transaction.DatabaseTransactionManager;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAwareAction;
import com.intellij.openapi.project.Project;

public class ShowUncommittedChangesAction extends DumbAwareAction {
    private ConnectionHandler connectionHandler;

    public ShowUncommittedChangesAction(ConnectionHandler connectionHandler) {
        super("Show uncommitted changes");
        this.connectionHandler = connectionHandler;

    }

    public void actionPerformed(AnActionEvent e) {
        Project project = connectionHandler.getProject();
        DatabaseTransactionManager transactionManager = DatabaseTransactionManager.getInstance(project);
        transactionManager.showUncommittedChangesDialog(connectionHandler, null);
    }

    @Override
    public void update(AnActionEvent e) {
        e.getPresentation().setVisible(connectionHandler.hasUncommittedChanges());
    }
}
TOP

Related Classes of com.dci.intellij.dbn.connection.transaction.action.ShowUncommittedChangesAction

TOP
Copyright © 2018 www.massapi.com. 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.