Package com.dci.intellij.dbn.language.common.navigation

Source Code of com.dci.intellij.dbn.language.common.navigation.NavigateToObjectAction

package com.dci.intellij.dbn.language.common.navigation;

import com.dci.intellij.dbn.object.common.DBObject;
import com.dci.intellij.dbn.object.common.DBObjectType;
import com.dci.intellij.dbn.object.lookup.DBObjectRef;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;

public class NavigateToObjectAction extends AnAction {
    private DBObjectRef objectRef;
    public NavigateToObjectAction(DBObject object, DBObjectType objectType) {
        super("Navigate to " + objectType.getName(), null, objectType.getIcon());
        objectRef = DBObjectRef.from(object);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        if (objectRef != null) {
            DBObject object = objectRef.get();
            if (object != null) {
                object.navigate(true);
            }
        }

    }
}
TOP

Related Classes of com.dci.intellij.dbn.language.common.navigation.NavigateToObjectAction

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.