Package com.intellij.openapi.vcs

Examples of com.intellij.openapi.vcs.CheckinProjectPanel


    setEnabledInModalContext(true);
  }

  public void update(AnActionEvent e) {
    super.update(e);
    CheckinProjectPanel panel = (CheckinProjectPanel)e.getDataContext().getData(CheckinProjectPanel.PANEL);
    if (panel == null) {
      e.getPresentation().setVisible(false);
      e.getPresentation().setEnabled(false);
    } else {
      e.getPresentation().setVisible(true);
      final ArrayList<String> recentMessages = VcsConfiguration.getInstance(panel.getProject()).getRecentMessages();
      e.getPresentation().setEnabled(!recentMessages.isEmpty());
    }
  }
View Full Code Here


      e.getPresentation().setEnabled(!recentMessages.isEmpty());
    }
  }

  public void actionPerformed(AnActionEvent e) {
    CheckinProjectPanel panel = (CheckinProjectPanel)e.getDataContext().getData(CheckinProjectPanel.PANEL);
    if (panel != null) {
      final Project project = panel.getProject();
      final VcsConfiguration configuration = VcsConfiguration.getInstance(project);

      final ArrayList<String> recentMessages = configuration.getRecentMessages();
      Collections.reverse(recentMessages);

      if (!recentMessages.isEmpty()) {

        final ContentChooser<String> contentChooser = new ContentChooser<String>(project, VcsBundle.message("dialog.title.choose.commit.message.from.history"), false){
          protected void removeContentAt(final String content) {
          }

          protected String getStringRepresentationFor(final String content) {
            return content;
          }

          protected List<String> getContents() {
            return recentMessages;
          }
        };
        contentChooser.show();
        if (contentChooser.isOK()) {
          final int selectedIndex = contentChooser.getSelectedIndex();
          if (selectedIndex >= 0) {
            panel.setCommitMessage(contentChooser.getAllContents().get(selectedIndex));
          }
        }
      }

    }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.vcs.CheckinProjectPanel

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.