Package com.intellij.openapi.ui.popup

Examples of com.intellij.openapi.ui.popup.JBPopup


    rename.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        final JTextField content = new JTextField();
        content.setText(displayedSettings.getName());
        JBPopup balloon = PopupFactoryImpl.getInstance().createComponentPopupBuilder(content, content).createPopup();
        balloon.setMinimumSize(new Dimension(200, 20));
        balloon.addListener(new JBPopupListener() {
          @Override
          public void beforeShown(LightweightWindowEvent event) {
          }

          @Override
          public void onClosed(LightweightWindowEvent event) {
            displayedSettings.setName(content.getText());
          }
        });
        balloon.showUnderneathOf(rename);
      }
    });
    delete.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
View Full Code Here


        setIcon(value.getIcon());
        setText(value.getTitle(displayName));
      }
    });
    PopupChooserBuilder builder = new PopupChooserBuilder(list);
    JBPopup popup = builder.
      setMovable(true).
      setItemChoosenCallback(new Runnable() {
        @Override
        public void run() {
          int[] ids = list.getSelectedIndices();
          if (ids.length == 0) return;
          Type type = ObjectUtils.tryCast(list.getSelectedValue(), Type.class);
          if (type != null) {
            if (psiElement.isValid()) {
              execute(type.getExecutor(), psiElement);
            }
          }
        }
      }).
      createPopup();

    popup.show(new RelativePoint(e));
  }
View Full Code Here

        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            DocumentationManager documentationManager = DocumentationManager.getInstance(project);
            DocumentationComponent component;
            JBPopup hint = documentationManager.getDocInfoHint();
            if (hint != null) {
              component = (DocumentationComponent)((AbstractPopup)hint).getComponent();
            }
            else if (documentationManager.hasActiveDockedDocWindow()) {
              ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.DOCUMENTATION);
View Full Code Here

   }

  private static void showPopup(Project project, Editor editor, String text) {
    TranslatePopupView popupView = new TranslatePopupView(project, editor, text);

    JBPopup jbPopup = JBPopupFactory.getInstance()
        .createComponentPopupBuilder(popupView.mainPanel, popupView.mainPanel)
        .setDimensionServiceKey(project, "popup", false)
        .setRequestFocus(true)
        .setResizable(true)
        .setMovable(true)
        .setTitle("Translation Preview")
        .createPopup();

    jbPopup.showInBestPositionFor(editor);
  }
View Full Code Here

    private void addVersionedComment(final Project project) {
        if (editor == null || filePath == null) return;

        final CommentForm commentForm = new CommentForm(project, editor, filePath, commentSide, commentToEdit);
        final JBPopup balloon = commentBalloonBuilder.getNewCommentBalloon(commentForm, "Comment");
        balloon.addListener(new JBPopupAdapter() {
            @Override
            public void onClosed(LightweightWindowEvent event) {
                DraftInput comment = commentForm.getComment();
                if (comment != null) {
                    handleComment(comment, project);
                }
            }
        });
        commentForm.setBalloon(balloon);
        balloon.showInBestPositionFor(editor);
        commentForm.requestFocus();
    }
View Full Code Here

}
});*/


        PopupChooserBuilder popupChooserBuilder = new PopupChooserBuilder(list);
        JBPopup popup = popupChooserBuilder.createPopup();
        popup.showCenteredInCurrentWindow(project);


        list.addMouseListener(new MouseAdapter()
        {
            @Override public void mousePressed(MouseEvent e)
View Full Code Here

TOP

Related Classes of com.intellij.openapi.ui.popup.JBPopup

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.