Package com.intellij.openapi.ui.popup

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


    @NotNull java.util.List<T> markedElements)
  {
    chooser.setElements(allElements, false);
    chooser.markElements(markedElements);

    ComponentPopupBuilder popupBuilder =
      JBPopupFactory.getInstance().createComponentPopupBuilder(buildContentPane(), chooser)
        .setMovable(true)
        .setFocusable(true)
        .setResizable(true)
        .setRequestFocus(true)
        .setCancelOnClickOutside(false)
        .setTitle(title);

    if (dimensionServiceKey != null)
    {
      popupBuilder.setDimensionServiceKey(project, dimensionServiceKey, true);
    }

    popup = popupBuilder.createPopup();

    Point locationOnScreen = owner.getLocationOnScreen();

    int x = (int) (locationOnScreen.getX());
    int y = (showUnderneath)
View Full Code Here


    public JComponent getComponent() {
        return mainPanel;
    }

    public void showPopup(Project project) {
        ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(mainPanel, null);
        JBPopup popup = popupBuilder.createPopup();
        popup.showCenteredInCurrentWindow(project);
    }
View Full Code Here

        popup.showInScreenCoordinates(component, point);
        return popup;
    }

    private JBPopup createPopup() {
        ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(mainPanel, valueTextArea);
        popupBuilder.setMovable(true);
        popupBuilder.setResizable(true);
        popupBuilder.setRequestFocus(true);
/*
        popupBuilder.setCancelOnMouseOutCallback(new MouseChecker() {
            @Override
            public boolean check(MouseEvent event) {
                return false;
            }
        });
*/

        popupBuilder.setCancelCallback(new Computable<Boolean>() {
            @Override
            public Boolean compute() {
                return !isPinned;
            }
        });

        if (isLargeTextLayout) {
            infoLabel.setText(contentInfoText);
            //popupBuilder.setAdText(contentInfoText);
            //popupBuilder.setTitle("Large value preview");
        }

        popup = popupBuilder.createPopup();
        popup.addListener(new JBPopupAdapter() {
            @Override
            public void onClosed(LightweightWindowEvent event) {
                dispose();
            }
View Full Code Here

        Color backgroundColor = BACKGROUND_COLOR;
        errorMessageTextArea.setBackground(backgroundColor);
        errorMessageTextArea.setFont(mainPanel.getFont());
        mainPanel.setBackground(backgroundColor);

        ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(mainPanel, mainPanel);
        popup = popupBuilder.createPopup();
    }
View Full Code Here

                                JLabel label = new JLabel(getEmptyListMessage(), Icons.EXEC_MESSAGES_INFO, SwingConstants.LEFT);
                                label.setBorder(new EmptyBorder(3, 3, 3, 3));
                                JPanel panel = new JPanel(new BorderLayout());
                                panel.add(label);
                                panel.setBackground(Colors.LIGHT_BLUE);
                                ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(panel, null);
                                JBPopup popup = popupBuilder.createPopup();
                                showPopup(popup);
                            }
                        }.start();
                    }
                }
View Full Code Here

        editorTextArea.setSelectionStart(textField.getSelectionStart());
        editorTextArea.setSelectionEnd(textField.getSelectionEnd());
        editorTextArea.getDocument().addDocumentListener(new DocumentListener());
        mainPanel.setPreferredSize(new Dimension(Math.max(200, textField.getWidth() + 32), 160));

        ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(mainPanel, editorTextArea);
        popupBuilder.setRequestFocus(true);
        popupBuilder.setResizable(true);
        return popupBuilder.createPopup();
    }
View Full Code Here

        popup.showInScreenCoordinates(component, point);
    }

    private JBPopup createPopup() {
        ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(viewer.getComponent(), viewer.getContentComponent());
        popupBuilder.setMovable(true);
        popupBuilder.setResizable(true);
        popupBuilder.setRequestFocus(true);
        popupBuilder.setTitle("<html>" + resultName + "</html>");
        JBPopup popup = popupBuilder.createPopup();

        Dimension dimension = EditorUtil.calculatePreferredSize(viewer);
        //Dimension dimension = ((EditorImpl) viewer).getPreferredSize();
        dimension.setSize(Math.min(dimension.getWidth() + 20, 1000), Math.min(dimension.getHeight() + 70, 800) );
        popup.setSize(dimension);
View Full Code Here

        int rowIndex = tableModel.getInputDateRowIndex();
        int columnIndex = tableModel.getInputDateColumnIndex();
        daysTable.setRowSelectionInterval(rowIndex, rowIndex);
        daysTable.setColumnSelectionInterval(columnIndex, columnIndex);

        ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(mainPanel, daysTable);
        popupBuilder.setRequestFocus(true);
        monthYearLabel.setText(tableModel.getCurrentMonthName() + " " + tableModel.getCurrentYear());

        timeTextField.setText(getFormatter().formatTime(date));
        timeLabel.setText("Time (" + getFormatter().getTimeFormatPattern() + ")");

        return popupBuilder.createPopup();
    }
View Full Code Here

    @Inject
    private JBPopupFactory jbPopupFactory;

    public JBPopup getNewCommentBalloon(final CommentForm balloonContent, @NotNull final String title) {
        final ComponentPopupBuilder builder = jbPopupFactory.
                createComponentPopupBuilder(balloonContent, balloonContent);
        builder.setAdText("Hit Ctrl+Enter to add comment. It will be saved once you post your review.");
        builder.setTitle(title);
        builder.setResizable(true);
        builder.setMovable(true);
        builder.setCancelOnWindowDeactivation(false);
        return builder.createPopup();
    }
View Full Code Here

TOP

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

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.