Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.DataContext


        e.getPresentation().setEnabled(!getSelectedChangePackages(dataContext, mksVcs).isEmpty());
    }

    @Override
    public void actionPerformed(final AnActionEvent anActionEvent) {
        final DataContext dataContext = anActionEvent.getDataContext();
        final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
        final MksVcs mksVcs = MksVcs.getInstance(project);

        final ArrayList<VcsException> errors = new ArrayList<VcsException>();
        for (final MksChangePackage aPackage : getSelectedChangePackages(dataContext, mksVcs)) {
View Full Code Here


  public static Project getProject(AnActionEvent anActionEvent) {
    return DataKeys.PROJECT.getData(anActionEvent.getDataContext());
  }

  public static Project getProject() {
    DataContext dataContext = DataManager.getInstance().getDataContext();
    return DataKeys.PROJECT.getData(dataContext);
  }
View Full Code Here

    return false;
  }

  protected void scrollToSource(Component tree)
  {
    DataContext dataContext = DataManager.getInstance().getDataContext(tree);
    final VirtualFile vFile = PlatformDataKeys.VIRTUAL_FILE.getData(dataContext);
    if (vFile != null)
    {
      // Attempt to navigate to the virtual file with unknown file type will show a modal dialog
      // asking to register some file type for this file. This behaviour is undesirable when autoscrolling.
View Full Code Here

    /**
     * @deprecated use getProject(Component)
     */
    public static Project getProject(){
        DataContext dataContext = DataManager.getInstance().getDataContextFromFocus().getResult();
        return PlatformDataKeys.PROJECT.getData(dataContext);
    }
View Full Code Here

    }

    public void keyPressed(KeyEvent e) {
        for (AnAction action : actions) {
            if (KeyUtil.match(action.getShortcutSet().getShortcuts(), e)) {
                DataContext dataContext = DataManager.getInstance().getDataContext(getComponent());
                ActionManager actionManager = ActionManager.getInstance();
                AnActionEvent actionEvent = new AnActionEvent(null, dataContext, "", action.getTemplatePresentation(), actionManager, 2);
                action.actionPerformed(actionEvent);
                e.consume();
                return;
View Full Code Here



    @NotNull
    protected DefaultActionGroup createPopupActionGroup(JComponent button) {
        DataContext dataContext = DataManager.getInstance().getDataContext(button);
        Project project = (Project) dataContext.getData(PlatformDataKeys.PROJECT.getName());

        DefaultActionGroup actionGroup = new DefaultActionGroup();
        DatasetEditor datasetEditor = AbstractDataEditorAction.getActiveDatasetEditor(project);
        if (datasetEditor != null) {
            DBDataset dataset = datasetEditor.getDataset();
View Full Code Here

    private ActionUtil() {
    }

    static Project getProject(AnActionEvent event) {
        DataContext dataContext = event.getDataContext();
        return PlatformDataKeys.PROJECT.getData(dataContext);
    }
View Full Code Here

     * Process the popup event for sending to mysticpaste
     *
     * @param event anActionEvent
     */
    public void actionPerformed(AnActionEvent event) {
        DataContext context = event.getDataContext();
        Editor editor = DataKeys.EDITOR.getData(context);

        String selectedText = null;
        SelectionModel selection = null;
        if (editor != null) {
View Full Code Here

     * Process the popup event for sending to mysticpaste
     *
     * @param event anActionEvent
     */
    public void actionPerformed(AnActionEvent event) {
        DataContext context = event.getDataContext();
        Editor editor = DataKeys.EDITOR.getData(context);

        String selectedText = null;
        SelectionModel selection = null;
        if (editor != null) {
View Full Code Here

    Project project = element.getProject();
    Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
    if (editor == null) {
      return;
    }
    DataContext dataContext = createDataContext(editor, element);
    RunConfigurationProducer jstdOriginalProducer = getJstdRunConfigurationProducer();
    if (jstdOriginalProducer == null) {
      return;
    }
    ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
View Full Code Here

TOP

Related Classes of com.intellij.openapi.actionSystem.DataContext

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.