Java 类com.intellij.ui.components.JBScrollPane 实例源码

项目:green-cat    文件:TelemetryToolWindow.java   
private TelemetryToolWindow(Project project) {
    ToolWindowManager manager = ToolWindowManager.getInstance(project);

    if (window == null) {
        textPane = new JTextPane();
        textPane.setEditable(false);

        JBScrollPane scrollPane = new JBScrollPane(textPane);
        DefaultCaret caret = (DefaultCaret) textPane.getCaret();
        caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);

        textPane.setContentType("text/html");
        initHtmlComposer();

        window = manager.registerToolWindow(WINDOW_ID, scrollPane, ToolWindowAnchor.BOTTOM);
        window.show(EMPTY_TASK);
    }
}
项目:EmojiPrefix    文件:EmojiCheckinHandler.java   
public EmojiCheckinHandler(CheckinProjectPanel checkinProjectPanel) {
    JPanel emojiPanel = new JPanel();
    emojiPanel.setLayout(new VerticalFlowLayout());
    VirtualFile emojirc = checkinProjectPanel.getProject().getBaseDir().findChild(".emojirc");
    if (emojirc == null) return;
    PsiFile psiFile = PsiManager.getInstance(checkinProjectPanel.getProject()).findFile(emojirc);
    if (psiFile == null) return;
    for (PsiElement psiElement : psiFile.getChildren()) {
        if (!(psiElement instanceof EmojiResourceProperty)) continue;
        emojiPanel.add(createEmojiButton(psiElement.getFirstChild().getText(), psiElement.getLastChild().getText(), false, buttonGroup));
    }
    emojiPanel.add(createEmojiButton(null, NO_EMOJI, true, buttonGroup));
    Splitter splitter = (Splitter) checkinProjectPanel.getComponent();
    CommitMessage commitMessage = (CommitMessage) splitter.getSecondComponent();
    JComponent component = (JComponent) commitMessage.getComponent(1);
    JBScrollPane scrollPane = new JBScrollPane(emojiPanel);
    scrollPane.setBorder(null);
    Splitter commitSplitter = new Splitter();
    commitSplitter.setFirstComponent(scrollPane);
    commitSplitter.setSecondComponent((JComponent) commitMessage.getComponent(0));
    commitMessage.add(commitSplitter, 0);
    for (EmojiPanelFactory factory : factories) {
        factory.createPanel(commitMessage);
    }
    this.checkinProjectPanel = checkinProjectPanel;
}
项目:educational-plugin    文件:StudySwingToolWindow.java   
@Override
public JComponent createTaskInfoPanel(Project project) {
  myTaskTextPane = new JTextPane();
  final JBScrollPane scrollPane = new JBScrollPane(myTaskTextPane);
  myTaskTextPane.setContentType(new HTMLEditorKit().getContentType());
  final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
  int fontSize = editorColorsScheme.getEditorFontSize();
  final String fontName = editorColorsScheme.getEditorFontName();
  final Font font = new Font(fontName, Font.PLAIN, fontSize);
  String bodyRule = "body { font-family: " + font.getFamily() + "; " +
                    "font-size: " + font.getSize() + "pt; }" +
                    "pre {font-family: Courier; display: inline; ine-height: 50px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; background-color:"
                    + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}" +
                    "code {font-family: Courier; display: flex; float: left; background-color:"
                    + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}";
  ((HTMLDocument)myTaskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
  myTaskTextPane.setEditable(false);
  if (!UIUtil.isUnderDarcula()) {
    myTaskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
  }
  myTaskTextPane.setBorder(new EmptyBorder(20, 20, 0, 10));
  myTaskTextPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  return scrollPane;
}
项目:tmc-intellij    文件:CourseTabFactory.java   
private void addRightMouseButtonFunctionality(MouseEvent mouseEvent,
                                              final JBList list,
                                              JBScrollPane panel) {

    logger.info("Adding functionality for right mouse button. @CourseTabFactory");
    if (!SwingUtilities.isRightMouseButton(mouseEvent)) {
        return;
    }

    int index = list.locationToIndex(mouseEvent.getPoint());
    list.setSelectedIndex(index);
    PopUpMenu menu = new PopUpMenu();
    JBMenuItem openInExplorer = new JBMenuItem("Open path");
    final Object selectedItem = list.getSelectedValue();
    JBMenuItem deleteFolder = new JBMenuItem("Delete folder");

    openInExplorer.addActionListener(createOpenInExploreListener(list, selectedItem));

    deleteFolder.addActionListener(createDeleteButtonActionListener(list, selectedItem));

    menu.add(openInExplorer);
    menu.add(deleteFolder);
    menu.show(panel, mouseEvent.getX(), mouseEvent.getY());
    menu.setLocation(mouseEvent.getXOnScreen(), mouseEvent.getYOnScreen());

}
项目:deltahex-intellij-plugin    文件:DeltaHexFileEditor.java   
public void showValuesPanel() {
    if (!valuesPanelVisible) {
        valuesPanelVisible = true;
        if (valuesPanel == null) {
            valuesPanel = new ValuesPanel();
            valuesPanel.setCodeArea(codeArea, undoHandler);
            valuesPanelScrollPane = new JBScrollPane(valuesPanel);
        }
        editorPanel.add(valuesPanelScrollPane, BorderLayout.EAST);
        valuesPanel.enableUpdate();
        valuesPanel.updateValues();
        valuesPanelScrollPane.revalidate();
        valuesPanel.revalidate();
        editorPanel.revalidate();
    }
}
项目:IntelliJ-OnlineSearch    文件:SettingsConfigurable.java   
public SettingsPanel(final ArrayList<PluginSettings.SearchEngine> searchEngines) {
    super();
    setLayout(new BorderLayout());

    // title
    add(titleLabel, BorderLayout.PAGE_START);

    // search engines
    searchEnginePanel.setLayout(new BoxLayout(searchEnginePanel, BoxLayout.Y_AXIS));
    addSearchEngines(searchEngines);
    JBScrollPane sp = new JBScrollPane(searchEnginePanel);
    sp.setPreferredSize(new Dimension(512, 32));
    add(sp, BorderLayout.CENTER);

    // add search engine button
    addSearchEngineButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            addSearchEngineEntry(null);
        }
    });
    add(addSearchEngineButton, BorderLayout.PAGE_END);

    this.revalidate();
}
项目:intellij-ce-playground    文件:Messages.java   
@Override
protected JComponent createCenterPanel() {
  if (myInfoText == null) {
    return null;
  }
  final JPanel panel = new JPanel(new BorderLayout());
  final JTextArea area = new JTextArea(myInfoText);
  area.setEditable(false);
  final JBScrollPane scrollPane = new JBScrollPane(area) {
    @Override
    public Dimension getPreferredSize() {
      final Dimension preferredSize = super.getPreferredSize();
      final Container parent = getParent();
      if (parent != null) {
        return new Dimension(preferredSize.width, Math.min(150, preferredSize.height));
      }
      return preferredSize;
    }
  };
  panel.add(scrollPane);
  return panel;
}
项目:intellij-ce-playground    文件:BranchesPanel.java   
ReferencePopupComponent(@NotNull RefGroup group, @NotNull VcsLogUiImpl ui, @NotNull VcsRefPainter referencePainter) {
  super(new BorderLayout());
  myUi = ui;

  myRendererComponent = new SingleReferenceComponent(referencePainter);
  myCellRenderer = new ListCellRenderer() {
    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
      myRendererComponent.setReference((VcsRef)value);
      myRendererComponent.setSelected(isSelected);
      return myRendererComponent;
    }
  };

  myList = createList(group);
  myPopup = createPopup();
  add(new JBScrollPane(myList));
}
项目:intellij-ce-playground    文件:ReferencePopupComponent.java   
ReferencePopupComponent(@NotNull RefGroup group, @NotNull VcsLogUiImpl ui, @NotNull VcsRefPainter referencePainter) {
  super(new BorderLayout());
  myUi = ui;

  myRendererComponent = new SingleReferenceComponent(referencePainter);
  myCellRenderer = new ListCellRenderer() {
    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
      myRendererComponent.setReference((VcsRef)value);
      myRendererComponent.setSelected(isSelected);
      return myRendererComponent;
    }
  };

  myList = createList(group);
  myPopup = createPopup();
  add(new JBScrollPane(myList));
}
项目:intellij-ce-playground    文件:ProcessPopup.java   
private void buildActiveContent() {
  myActiveFocusedContent = new ActiveContent();

  final JPanel wrapper = new JPanel(new BorderLayout());
  wrapper.add(myProcessBox, BorderLayout.NORTH);

  myActiveFocusedContent.add(wrapper, BorderLayout.CENTER);

  final JScrollPane scrolls = new JBScrollPane(myActiveFocusedContent) {
    public Dimension getPreferredSize() {
      if (myProcessBox.getComponentCount() > 0) {
        return super.getPreferredSize();
      } else {
        return getEmptyPreferredSize();
      }
    }
  };
  myActiveContentComponent = scrolls;
  updateContentUI();
}
项目:intellij-ce-playground    文件:UiInspectorAction.java   
private InspectorTable(@NotNull final Component component) {
  setLayout(new BorderLayout());

  myModel = new InspectorTableModel(component);
  StripeTable table = new StripeTable(myModel);
  new TableSpeedSearch(table);

  TableColumnModel columnModel = table.getColumnModel();
  TableColumn propertyColumn = columnModel.getColumn(0);
  propertyColumn.setMinWidth(150);
  propertyColumn.setMaxWidth(150);
  propertyColumn.setResizable(false);

  TableColumn valueColumn = columnModel.getColumn(1);
  valueColumn.setMinWidth(200);
  valueColumn.setResizable(false);
  valueColumn.setCellRenderer(new ValueCellRenderer());

  table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);

  add(new JBScrollPane(table), BorderLayout.CENTER);
  myDimensionComponent = new DimensionsComponent(component);
  add(myDimensionComponent, BorderLayout.SOUTH);
}
项目:intellij-ce-playground    文件:ActionTracer.java   
@Override
public JComponent getComponent() {
  if (myComponent == null) {
    myText = new JTextArea();
    final JBScrollPane log = new JBScrollPane(myText);
    final AnAction clear = new AnAction("Clear", "Clear log", AllIcons.General.Reset) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        myText.setText(null);
      }
    };
    myComponent = new JPanel(new BorderLayout());
    final DefaultActionGroup group = new DefaultActionGroup();
    group.add(clear);
    myComponent.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true).getComponent(), BorderLayout.NORTH);
    myComponent.add(log);

    ActionManager.getInstance().addAnActionListener(this);
  }

  return myComponent;
}
项目:intellij-ce-playground    文件:SearchTextArea.java   
public SearchTextArea(boolean search) {
  myTextArea = new JTextArea();
  setBorder(JBUI.Borders.empty(6, 6, 6, 8));
  setLayout(new BorderLayout(JBUI.scale(4), 0));
  myTextArea.addPropertyChangeListener("background", this);
  myTextArea.addFocusListener(this);
  myTextArea.setBorder(null);
  myTextArea.setOpaque(false);
  JBScrollPane scrollPane = new JBScrollPane(myTextArea,
                                             ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                                             ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  scrollPane.getVerticalScrollBar().setBackground(UIUtil.TRANSPARENT_COLOR);
  scrollPane.getViewport().setBorder(null);
  scrollPane.getViewport().setOpaque(false);
  scrollPane.setBorder(JBUI.Borders.emptyRight(2));
  scrollPane.setOpaque(false);
  ShowHistoryAction historyAction = new ShowHistoryAction(search);
  ActionButton button =
    new ActionButton(historyAction, historyAction.getTemplatePresentation(), ActionPlaces.UNKNOWN, new Dimension(JBUI.scale(16), JBUI.scale(16)));
  button.setLook(new InplaceActionButtonLook());
  JPanel p = new NonOpaquePanel(new BorderLayout());
  p.add(button, BorderLayout.NORTH);
  add(p, BorderLayout.WEST);
  add(scrollPane, BorderLayout.CENTER);
}
项目:intellij-ce-playground    文件:ProjectSettingsStepBase.java   
@Override
public JPanel createPanel() {
  final JPanel mainPanel = new JPanel(new BorderLayout());

  final JLabel label = createErrorLabel();
  final JButton button = createActionButton();
  button.addActionListener(createCloseActionListener());
  final JPanel scrollPanel = createAndFillContentPanel();
  initGeneratorListeners();
  registerValidators();
  final JBScrollPane scrollPane = new JBScrollPane(scrollPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                                                   ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  scrollPane.setBorder(null);
  mainPanel.add(scrollPane, BorderLayout.CENTER);

  final JPanel bottomPanel = new JPanel(new BorderLayout());

  bottomPanel.add(label, BorderLayout.NORTH);
  bottomPanel.add(button, BorderLayout.EAST);
  mainPanel.add(bottomPanel, BorderLayout.SOUTH);
  return mainPanel;
}
项目:intellij-ce-playground    文件:CodeFragmentCodeStyleSettingsPanel.java   
@Override
protected void init() {
  List<String> settingNames = mySettingsToShow.getSettings(getSettingsType());
  String[] names = ContainerUtil.toArray(settingNames, new String[settingNames.size()]);
  showStandardOptions(names);
  initTables();

  myOptionsTree = createOptionsTree();
  myOptionsTree.setCellRenderer(new MyTreeCellRenderer());

  JBScrollPane pane = new JBScrollPane(myOptionsTree) {
    @Override
    public Dimension getMinimumSize() {
      return super.getPreferredSize();
    }
  };

  myPanel = new JPanel(new BorderLayout());
  myPanel.add(pane);

  isFirstUpdate = false;
}
项目:intellij-ce-playground    文件:CodeFragmentCodeStyleSettingsPanel.java   
@Override
protected void init() {
  Collection<String> settingNames = mySettingsToShow.getSettings(getSettingsType());
  initTables();

  Collection<String> fields = populateWithAssociatedFields(settingNames);
  fields.add("KEEP_LINE_BREAKS");

  String[] names = ContainerUtil.toArray(fields, new String[fields.size()]);
  showStandardOptions(names);

  myTreeTable = createOptionsTree(getSettings());
  JBScrollPane scrollPane = new JBScrollPane(myTreeTable) {
    @Override
    public Dimension getMinimumSize() {
      return super.getPreferredSize();
    }
  };

  myPanel = new JPanel(new BorderLayout());
  myPanel.add(scrollPane);

  showStandardOptions(names);

  isFirstUpdate = false;
}
项目:intellij-ce-playground    文件:JBTableWithRowHeaders.java   
public JBTableWithRowHeaders() {
  setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
  setRowSelectionAllowed(false);
  setMaxItemsForSizeCalculation(50);
  setTableHeader(new CustomTableHeader(this));
  getTableHeader().setDefaultRenderer(new ArrayTableForm.ColumnHeaderRenderer());
  getTableHeader().setReorderingAllowed(false);

  myScrollPane = new JBScrollPane(this);
  JBTableWithRowHeaders.RowHeaderTable rowTable = new JBTableWithRowHeaders.RowHeaderTable(this);
  myScrollPane.setRowHeaderView(rowTable);
  myScrollPane.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER,
                         rowTable.getTableHeader());

  setRowHeaderTable(rowTable);
}
项目:intellij-ce-playground    文件:FrameBufferController.java   
public FrameBufferController(@NotNull GfxTraceEditor editor,
                             @NotNull JBRunnerTabs bufferTabs,
                             @NotNull JBScrollPane colorScrollPane,
                             @NotNull JBScrollPane wireframePane,
                             @NotNull JBScrollPane depthScrollPane) {
  myEditor = editor;
  myBufferTabs = bufferTabs;

  myBufferScrollPanes = new JBScrollPane[]{colorScrollPane, wireframePane, depthScrollPane};
  assert (myBufferScrollPanes.length == BufferType.length);

  for (int i = 0; i < myBufferScrollPanes.length; ++i) {
    myBufferScrollPanes[i].getVerticalScrollBar().setUnitIncrement(20);
    myBufferScrollPanes[i].getHorizontalScrollBar().setUnitIncrement(20);
    myBufferScrollPanes[i].setBorder(BorderFactory.createLineBorder(JBColor.border()));

    myLoadingPanels[i] = new JBLoadingPanel(new BorderLayout(), myEditor.getProject());
    myBufferScrollPanes[i].setViewportView(myLoadingPanels[i]);
  }

  // TODO: Add a way to pan the viewport with the keyboard.
}
项目:intellij-ce-playground    文件:ScrubberController.java   
public ScrubberController(@NotNull GfxTraceEditor editor, @NotNull JBScrollPane scrubberScrollPane, @NotNull JBList scrubberComponent) {
  myEditor = editor;

  myPane = scrubberScrollPane;
  myList = scrubberComponent;
  myScrubberCellRenderer = new ScrubberCellRenderer();
  myScrubberCellRenderer.addDimensionChangeListener(this);

  Dimension minCellDimension = myScrubberCellRenderer.getCellDimensions();

  myList.setExpandableItemsEnabled(false); // Turn this off, since the "preview" will cause all the thumbnails to be loaded.
  myList.setMinimumSize(minCellDimension);
  myList.setVisibleRowCount(1);

  myList.getEmptyText().setText(SELECT_CAPTURE);

  resize(minCellDimension);
}
项目:intellij-ce-playground    文件:AssociationsEditor.java   
private void initUI() {
  myComponent = new JPanel(new BorderLayout());
  mySplitter = new JBSplitter("AssociationsEditor.dividerProportion", 0.3f);
  myComponent.add(mySplitter, BorderLayout.CENTER);

  JPanel leftPanel = new JPanel(new BorderLayout());
  leftPanel.setBorder(IdeBorderFactory.createTitledBorder("Project XSLT Files", false, new Insets(0, 0, 0, 0)));
  myTree = new Tree();
  myTree.setRootVisible(false);
  myTree.setShowsRootHandles(false);
  leftPanel.add(new JBScrollPane(myTree), BorderLayout.CENTER);
  mySplitter.setFirstComponent(leftPanel);

  myList = new JBList();
  myList.setCellRenderer(new MyCellRenderer());
  myList.setMinimumSize(new Dimension(120, 200));
  myList.getEmptyText().setText("No associated files");
  JPanel rightPanel = ToolbarDecorator.createDecorator(myList)
    .addExtraAction(AnActionButton.fromAction(new AddAssociationActionWrapper()))
    .addExtraAction(AnActionButton.fromAction(new RemoveAssociationAction()))
    .disableUpDownActions().disableAddAction().disableRemoveAction().createPanel();
  UIUtil.addBorder(rightPanel, IdeBorderFactory.createTitledBorder("Associated Files", false, new Insets(0, 0, 0, 0)));
  mySplitter.setSecondComponent(rightPanel);
}
项目:ultimate-pastebin-intellij-plugin    文件:UltimatePasteBinToolWindow.java   
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
  logger.info("Initializing Pastes ToolWindow");
  toolWindow.setStripeTitle("Ultimate PasteBin");
  toolWindow.setTitle("Ultimate PasteBin");

  ContentManager contentManager = toolWindow.getContentManager();

  Content content = contentManager.getFactory().createContent(toolWindow.getComponent(), null, false);

  ToolWindowService service = ServiceManager.getService(ToolWindowService.class);

  // Panel with toolbar
  SimpleToolWindowPanel simpleToolWindowPanel = new SimpleToolWindowPanel(true);

  // Scrolable panel
  JBScrollPane jbScrollPane = new JBScrollPane(service.getTree());
  simpleToolWindowPanel.add(jbScrollPane);
  simpleToolWindowPanel.setToolbar(createToolbar());

  content.setComponent(simpleToolWindowPanel);

  contentManager.addContent(content);

  toolWindow.activate(this::firstTimeOpen);
}
项目:jnihelper    文件:ModuleList.java   
private void addItems() {

        JPanel injectionsPanel = new JPanel();
        injectionsPanel.setLayout(new BoxLayout(injectionsPanel, BoxLayout.PAGE_AXIS));

        JLabel jLabel = new JLabel("Select module for *.h file.");
        injectionsPanel.add(jLabel);
        injectionsPanel.add(Box.createRigidArea(new Dimension(0, 5)));

        for (String name : mNameList) {
            JButton button = new JButton();
            button.setText(name);
            button.addActionListener(this);
            button.addMouseListener(this);

            injectionsPanel.add(button);
            injectionsPanel.add(Box.createRigidArea(new Dimension(0, 5)));

        }

        JBScrollPane scrollPane = new JBScrollPane(injectionsPanel);
        add(scrollPane,BorderLayout.CENTER);
    }
项目:jnihelper    文件:ModuleSelectDialog.java   
private JBScrollPane creatItems() {

        JPanel injectionsPanel = new JPanel();
        injectionsPanel.setLayout(new BoxLayout(injectionsPanel, BoxLayout.PAGE_AXIS));
        injectionsPanel.add(Box.createRigidArea(new Dimension(0, 5)));

        JLabel jLabel = new JLabel("Select module for *.h file.");
        injectionsPanel.add(jLabel);

        for (String name : mNameList) {
            JButton button = new JButton();
            button.setText(name);
            button.addMouseListener(this);

            injectionsPanel.add(button);
            injectionsPanel.add(Box.createRigidArea(new Dimension(0, 5)));
        }
        injectionsPanel.add(Box.createVerticalGlue());
        injectionsPanel.add(Box.createRigidArea(new Dimension(0, 5)));

        JBScrollPane scrollPane = new JBScrollPane(injectionsPanel);
        return scrollPane;
    }
项目:vso-intellij    文件:TfsTreeForm.java   
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
    final JBScrollPane jBScrollPane1 = new JBScrollPane();
    contentPane.add(jBScrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    tree = new Tree();
    jBScrollPane1.setViewportView(tree);
    pathField = new JTextField();
    pathField.setEditable(false);
    contentPane.add(pathField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    messagePanel = new JPanel();
    messagePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(messagePanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    messagePanel.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(11, 10), null, 0, false));
    messageLabel = new JLabel();
    messageLabel.setText("Label");
    messagePanel.add(messageLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
项目:android-codegenerator-plugin-intellij    文件:CodeDialogBuilder.java   
public CodeDialogBuilder(Project project, String title, String producedCode) {
    dialogBuilder = new DialogBuilder(project);
    dialogBuilder.setTitle(title);

    JPanel centerPanel = new JPanel(new BorderLayout());
    codeArea = prepareCodeArea(producedCode);
    codeArea.setLineWrap(true);
    JBScrollPane codeScroll = new JBScrollPane(codeArea);

    centerPanel.add(codeScroll, BorderLayout.CENTER);
    dialogBuilder.setCenterPanel(centerPanel);

    topPanel = new JPanel(new GridLayout(0, 2));
    centerPanel.add(topPanel, BorderLayout.PAGE_START);

    dialogBuilder.removeAllActions();
}
项目:netconsole-idea-plugin    文件:NetConsoleToolWindowFactory.java   
@Override
public void createToolWindowContent(Project project, ToolWindow toolWindow) {
    final Document document = new PlainDocument();
    final NetConsoleClient netConsole = new NetConsoleClient(document);

    final JXTextArea textArea = new JXTextArea();
    textArea.setDocument(document);
    textArea.setEditable(false);

    final DefaultActionGroup actionGroup = new DefaultActionGroup();
    actionGroup.addAction(new AutoScrollAction(netConsole, textArea));
    actionGroup.addAction(new ClearAction(netConsole));
    actionGroup.addAction(new DisableAction(netConsole, textArea));

    final SimpleToolWindowPanel netConsolePanel = new SimpleToolWindowPanel(false, false);
    final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN,
            actionGroup, false);
    netConsolePanel.setToolbar(toolbar.getComponent());
    netConsolePanel.setContent(new JBScrollPane(textArea));

    final ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
    final Content content = contentFactory.createContent(netConsolePanel, "", true);
    toolWindow.getContentManager().addContent(content);
}
项目:JHelper    文件:EditTestsDialog.java   
private JPanel generateTestPanel() {
    JPanel testPanel = new JPanel(new GridLayout(2, 1, GRID_LAYOUT_GAP, GRID_LAYOUT_GAP));

    input = generateSavingTextArea();
    JPanel inputPanel = LabeledComponent.create(new JBScrollPane(input), "Input");

    output = generateSavingTextArea();
    outputPanel = LabeledComponent.create(new JBScrollPane(output), "Output");

    knowAnswer = new JCheckBox("Know answer?");
    knowAnswer.addActionListener(e -> saveCurrentTest());
    JPanel outputAndCheckBoxPanel = new JPanel(new BorderLayout());
    outputAndCheckBoxPanel.add(knowAnswer, BorderLayout.NORTH);
    outputAndCheckBoxPanel.add(outputPanel, BorderLayout.CENTER);
    testPanel.add(inputPanel);
    testPanel.add(outputAndCheckBoxPanel);
    return testPanel;
}
项目:intellij-pants-plugin    文件:PantsProjectSettingsControl.java   
@Override
protected void fillExtraControls(@NotNull PaintAwarePanel content, int indentLevel) {

  myLibsWithSourcesCheckBox.setSelected(mySettings.isLibsWithSources());
  myEnableIncrementalImportCheckBox.setSelected(mySettings.isEnableIncrementalImport());
  myUseIdeaProjectJdkCheckBox.setSelected(mySettings.isUseIdeaProjectJdk());

  mySettings.getTargetSpecs().forEach(spec -> myTargetSpecsBox.addItem(spec, spec, true));

  List<JComponent> boxes = ContainerUtil.newArrayList(
    myLibsWithSourcesCheckBox,
    myEnableIncrementalImportCheckBox,
    myUseIdeaProjectJdkCheckBox,
    new JBLabel(PantsBundle.message("pants.settings.text.targets")),
    new JBScrollPane(myTargetSpecsBox)
  );

  GridBag lineConstraints = ExternalSystemUiUtil.getFillLineConstraints(indentLevel);

  for (JComponent component : boxes) {
    content.add(component, lineConstraints);
  }
}
项目:GitToolBox    文件:GtRepoChooser.java   
GtRepoChooser(@NotNull Project project, @Nullable Component parentComponent) {
  super(project, parentComponent, false, IdeModalityType.PROJECT);
  this.project = project;
  centerPanel = new JPanel(new BorderLayout());
  repoList = new JBList<>();
  repoList.setCellRenderer(new ColoredListCellRenderer<GitRepository>() {
    @Override
    protected void customizeCellRenderer(@NotNull JList<? extends GitRepository> list, GitRepository value, int index,
                                         boolean selected, boolean hasFocus) {
      append(GtUtil.name(value));
      StringBand url = new StringBand(" (");
      url.append(value.getRoot().getPresentableUrl());
      url.append(")");
      append(url.toString(), SimpleTextAttributes.GRAYED_ATTRIBUTES);
    }
  });
  JBScrollPane scrollPane = new JBScrollPane(repoList);
  centerPanel.add(scrollPane, BorderLayout.CENTER);
  setTitle(ResBundle.getString("configurable.prj.autoFetch.exclusions.add.title"));
  init();
}
项目:tools-idea    文件:Messages.java   
@Override
protected JComponent createCenterPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JTextArea area = new JTextArea(myInfoText);
  area.setEditable(false);
  final JBScrollPane scrollPane = new JBScrollPane(area) {
    @Override
    public Dimension getPreferredSize() {
      final Dimension preferredSize = super.getPreferredSize();
      final Container parent = getParent();
      if (parent != null) {
        return new Dimension(preferredSize.width, Math.min(150, preferredSize.height));
      }
      return preferredSize;
    }
  };
  panel.add(scrollPane);
  return panel;
}
项目:tools-idea    文件:ProcessPopup.java   
private void buildActiveContent() {
  myActiveFocusedContent = new ActiveContent();

  final JPanel wrapper = new JPanel(new BorderLayout());
  wrapper.add(myProcessBox, BorderLayout.NORTH);

  myActiveFocusedContent.add(wrapper, BorderLayout.CENTER);

  final JScrollPane scrolls = new JBScrollPane(myActiveFocusedContent) {
    public Dimension getPreferredSize() {
      if (myProcessBox.getComponentCount() > 0) {
        return super.getPreferredSize();
      } else {
        return getEmptyPreferredSize();
      }
    }
  };
  scrolls.getViewport().setBackground(myActiveFocusedContent.getBackground());
  scrolls.setBorder(null);
  myActiveContentComponent = scrolls;
}
项目:tools-idea    文件:UiInspectorAction.java   
private InspectorTable(@NotNull final Component component) {
  setLayout(new BorderLayout());

  myTitleLabel = new JLabel(component.getClass().getCanonicalName(), SwingConstants.CENTER);
  myModel = new InspectorTableModel(component);
  final StripeTable table = new StripeTable(myModel);

  TableColumnModel columnModel = table.getColumnModel();
  TableColumn propertyColumn = columnModel.getColumn(0);
  propertyColumn.setMinWidth(150);
  propertyColumn.setMaxWidth(150);
  propertyColumn.setResizable(false);

  TableColumn valueColumn = columnModel.getColumn(1);
  valueColumn.setMinWidth(200);
  valueColumn.setResizable(false);
  valueColumn.setCellRenderer(new ValueCellRenderer());

  table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);

  add(myTitleLabel, BorderLayout.NORTH);
  add(new JBScrollPane(table), BorderLayout.CENTER);
  myDimensionComponent = new DimensionsComponent(component);
  add(myDimensionComponent, BorderLayout.SOUTH);
}
项目:tools-idea    文件:ActionTracer.java   
@Override
public JComponent getComponent() {
  if (myComponent == null) {
    myText = new JTextArea();
    final JBScrollPane log = new JBScrollPane(myText);
    final AnAction clear = new AnAction("Clear", "Clear log", AllIcons.General.Reset) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        myText.setText(null);
      }
    };
    myComponent = new JPanel(new BorderLayout());
    final DefaultActionGroup group = new DefaultActionGroup();
    group.add(clear);
    myComponent.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true).getComponent(), BorderLayout.NORTH);
    myComponent.add(log);

    ActionManager.getInstance().addAnActionListener(this);
  }

  return myComponent;
}
项目:nosql4idea    文件:MongoResultPanel.java   
public void updateResultTableTree(MongoResult mongoResult) {
    resultTableView = new JsonTreeTableView(JsonTreeModel.buildJsonTree(mongoResult), JsonTreeTableView.COLUMNS_FOR_READING);
    resultTableView.setName("resultTreeTable");

    resultTableView.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent mouseEvent) {
            if (mouseEvent.getClickCount() == 2 && MongoResultPanel.this.isSelectedNodeId()) {
                MongoResultPanel.this.editSelectedMongoDocument();
            }
        }
    });

    buildPopupMenu();

    resultTreePanel.invalidate();
    resultTreePanel.removeAll();
    resultTreePanel.add(new JBScrollPane(resultTableView));
    resultTreePanel.validate();
}
项目:nosql4idea    文件:MongoEditionPanel.java   
public void updateEditionTree(DBObject mongoDocument) {
    String panelTitle = "New document";
    if (mongoDocument != null) {
        panelTitle = "Edition";
    }

    mainPanel.setBorder(IdeBorderFactory.createTitledBorder(panelTitle, true));
    editTableView = new JsonTreeTableView(JsonTreeModel.buildJsonTree(mongoDocument), JsonTreeTableView.COLUMNS_FOR_WRITING);
    editTableView.setName("editionTreeTable");

    editionTreePanel.invalidate();
    editionTreePanel.removeAll();
    editionTreePanel.add(new JBScrollPane(editTableView));
    editionTreePanel.validate();

    buildPopupMenu();
}
项目:nosql4idea    文件:NoSqlExplorerPanel.java   
public NoSqlExplorerPanel(Project project, DatabaseVendorClientManager databaseVendorClientManager) {
    this.project = project;
    this.databaseVendorClientManager = databaseVendorClientManager;

    treePanel.setLayout(new BorderLayout());

    databaseTree = createTree();
    databaseTree.setCellRenderer(new NoSqlTreeRenderer());
    databaseTree.setName("databaseTree");

    JBScrollPane mongoTreeScrollPane = new JBScrollPane(databaseTree);

    setLayout(new BorderLayout());
    treePanel.add(mongoTreeScrollPane, BorderLayout.CENTER);
    add(rootPanel, BorderLayout.CENTER);

    toolBarPanel.setLayout(new BorderLayout());

    ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
            reloadAllServerConfigurations();
        }
    });
}
项目:ali-idea-plugin    文件:TaskBoardContent.java   
@Override
public JComponent create(Project project) {
    JPanel panel = new JPanel(new BorderLayout());
    final TaskBoardPanel taskBoardPanel = new TaskBoardPanel(project);

    panel.add(taskBoardPanel.getHeader(), BorderLayout.NORTH);

    JBScrollPane scrollPane = new JBScrollPane(taskBoardPanel, JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JBScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPane.getVerticalScrollBar().setUnitIncrement(TaskPanel.SIZE.height);
    scrollPane.setColumnHeaderView(taskBoardPanel.getColumnHeader());
    panel.add(scrollPane, BorderLayout.CENTER);

    JComponent toolbar = ActionUtil.createActionToolbar("hpali.taskboard", TaskBoardPanel.PLACE, true, false).getComponent();
    panel.add(toolbar, BorderLayout.WEST);

    JPanel statusBar = new JPanel();
    statusBar.setLayout(new BorderLayout());
    statusBar.add(taskBoardPanel.getStatusComponent(), BorderLayout.WEST);
    statusBar.add(new ActiveItemLink(project), BorderLayout.EAST);
    panel.add(statusBar, BorderLayout.SOUTH);

    return panel;
}
项目:ali-idea-plugin    文件:TableFilterDialog.java   
private void displayResults(final boolean first, final List<E> result) {
    UIUtil.invokeLaterIfNeeded(new Runnable() {
        @Override
        public void run() {
            items.clear();
            items.addAll(result);

            if (first) {
                content.remove(loading);
                content.add(new JBScrollPane(table), BorderLayout.CENTER);
                content.revalidate();
                content.repaint();
            }

            model.fireTableDataChanged();
        }
    });
}
项目:intellij-plugin-v4    文件:PreviewPanel.java   
public static Pair<UberTreeViewer,JPanel> createParseTreePanel() {
    // wrap tree and slider in panel
    JPanel treePanel = new JPanel(new BorderLayout(0, 0));
    treePanel.setBackground(JBColor.white);

    final UberTreeViewer viewer =
        isTrackpadZoomSupported ?
            new TrackpadZoomingTreeView(null, null, false) :
            new UberTreeViewer(null, null, false);

    JSlider scaleSlider = createTreeViewSlider(viewer);

    // Wrap tree viewer component in scroll pane
    JScrollPane scrollPane = new JBScrollPane(viewer); // use Intellij's scroller

    treePanel.add(scrollPane, BorderLayout.CENTER);

    treePanel.add(scaleSlider, BorderLayout.SOUTH);

    return new Pair<UberTreeViewer, JPanel>(viewer,treePanel);
}
项目:asciidoctor-intellij-plugin    文件:JeditorHtmlPanel.java   
public JeditorHtmlPanel(Document document) {
  jEditorPane = new JEditorPane();
  scrollPane = new JBScrollPane(jEditorPane);
  // Setup the editor pane for rendering HTML.
  File baseDir = new File("");
  VirtualFile parent = FileDocumentManager.getInstance().getFile(document).getParent();
  if (parent != null) {
    // parent will be null if we use Language Injection and Fragment Editor
    baseDir = new File(parent.getCanonicalPath());
  }
  final HTMLEditorKit kit = new AsciiDocEditorKit(baseDir);

  // Create an AsciiDoc style, based on the default stylesheet supplied by UiUtil.getHTMLEditorKit()
  // since it contains fix for incorrect styling of tooltips
  final String cssFile = isDarcula() ? "darcula.css" : "preview.css";
  final StyleSheet customStyle = loadStyleSheet(JeditorHtmlPanel.class.getResource(cssFile));
  final StyleSheet style = UIUtil.getHTMLEditorKit().getStyleSheet();
  style.addStyleSheet(customStyle);
  kit.setStyleSheet(style);

  //
  jEditorPane.setEditorKit(kit);
  jEditorPane.setEditable(false);
  // use this to prevent scrolling to the end of the pane on setText()
  ((DefaultCaret)jEditorPane.getCaret()).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
}