Java Code Examples for com.intellij.ui.components.JBScrollPane

The following examples show how to use com.intellij.ui.components.JBScrollPane. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: size-analyzer   Source File: AnalyzeSizeToolWindowTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void categoryNodesHaveCorrectExtraInformation() {
  JPanel toolPanel = toolWindow.getContent();
  Component[] components = toolPanel.getComponents();
  OnePixelSplitter splitter = (OnePixelSplitter) components[0];
  JBScrollPane leftPane = (JBScrollPane) splitter.getFirstComponent();
  JViewport leftView = leftPane.getViewport();
  Tree suggestionTree = (Tree) leftView.getView();

  TreePath webPPath = getTreePathWithString(suggestionTree, webPCategoryData.toString());
  TreeCellRenderer treeCellRenderer = suggestionTree.getCellRenderer();
  Component renderedNode =
      treeCellRenderer.getTreeCellRendererComponent(
          suggestionTree,
          webPPath.getLastPathComponent(),
          false,
          false,
          false,
          suggestionTree.getRowForPath(webPPath),
          false);
  assertThat(renderedNode.toString()).contains("2 recommendations");
  assertThat(renderedNode.toString()).contains("29.30 KB");
}
 
Example 2
Source Project: size-analyzer   Source File: AnalyzeSizeToolWindowTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void autofixIsNotShownWhenNull() {
  JPanel toolPanel = toolWindow.getContent();
  Component[] components = toolPanel.getComponents();
  OnePixelSplitter splitter = (OnePixelSplitter) components[0];
  JBScrollPane leftPane = (JBScrollPane) splitter.getFirstComponent();
  JViewport leftView = leftPane.getViewport();
  Tree suggestionTree = (Tree) leftView.getView();
  JPanel rightPane = (JPanel) splitter.getSecondComponent();

  TreePath streamingPath =
      getTreePathWithString(suggestionTree, streamingSuggestionData.toString());
  suggestionTree.addSelectionPath(streamingPath);

  for (Component component : rightPane.getComponents()) {
    if (component instanceof JButton) {
      assertThat(component.isVisible()).isFalse();
    }
  }
}
 
Example 3
Source Project: consulo   Source File: ProcessPopup.java    License: Apache License 2.0 6 votes vote down vote up
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) {
    @Override
    public Dimension getPreferredSize() {
      if (myProcessBox.getComponentCount() > 0) {
        return super.getPreferredSize();
      } else {
        return getEmptyPreferredSize();
      }
    }
  };
  scrolls.getViewport().setBackground(myActiveFocusedContent.getBackground());
  scrolls.setBorder(null);
  myActiveContentComponent = scrolls;
}
 
Example 4
Source Project: leetcode-editor   Source File: SubmissionsPanel.java    License: Apache License 2.0 6 votes vote down vote up
public SubmissionsPanel(@Nullable Project project, TableModel tableModel) {
    super(project, true);
    jpanel = new JBPanel(new BorderLayout());
    jpanel.setMinimumSize(new Dimension(400, 400));
    jpanel.setPreferredSize(new Dimension(400, 400));
    table = new JBTable(tableModel);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.getTableHeader().setReorderingAllowed(false);
    table.setRowSelectionAllowed(true);
    table.setRowSelectionInterval(0, 0);
    table.getColumnModel().getColumn(0).setPreferredWidth(350);
    table.getColumnModel().getColumn(1).setPreferredWidth(200);
    table.getColumnModel().getColumn(2).setPreferredWidth(100);
    table.getColumnModel().getColumn(3).setPreferredWidth(200);
    table.getColumnModel().getColumn(4).setPreferredWidth(100);
    jpanel.add(new JBScrollPane(table, JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JBScrollPane.HORIZONTAL_SCROLLBAR_NEVER),  BorderLayout.CENTER);

    setModal(true);
    init();
}
 
Example 5
Source Project: leetcode-editor   Source File: SolutionPanel.java    License: Apache License 2.0 6 votes vote down vote up
public SolutionPanel(@Nullable Project project, TableModel tableModel) {
    super(project, true);
    this.jpanel = new JBPanel(new BorderLayout());;
    jpanel.setPreferredSize(new Dimension(600, 400));
    table = new JBTable(tableModel);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    table.getTableHeader().setReorderingAllowed(false);
    table.setRowSelectionAllowed(true);
    table.setRowSelectionInterval(0, 0);
    table.getColumnModel().getColumn(0).setPreferredWidth(350);
    table.getColumnModel().getColumn(1).setPreferredWidth(200);
    table.getColumnModel().getColumn(2).setPreferredWidth(700);
    jpanel.add(new JBScrollPane(table, JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JBScrollPane.HORIZONTAL_SCROLLBAR_NEVER),  BorderLayout.CENTER);

    setModal(true);
    init();
}
 
Example 6
Source Project: reasonml-idea-plugin   Source File: CmtFileEditor.java    License: MIT License 6 votes vote down vote up
@NotNull
@Override
public JComponent getComponent() {
    m_rootTabbedPane = new JBTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);

    InsightManager insightManager = ServiceManager.getService(m_project, InsightManager.class);
    List<String> meta = insightManager.dumpMeta(m_file);
    String xmlSource = insightManager.dumpTree(m_file);
    List<String> types = insightManager.dumpInferredTypes(m_file);

    m_rootTabbedPane.addTab("Meta", AllIcons.Nodes.DataTables, new JBScrollPane(new Table(new MetaTableModel(meta))));
    m_rootTabbedPane.addTab("AST", AllIcons.FileTypes.Xml, new CmtXmlComponent(m_project, m_rootTabbedPane, xmlSource));
    m_rootTabbedPane.addTab("Inferred", AllIcons.Nodes.DataSchema, new JBScrollPane(new Table(new InferredTableModel(types))));

    return m_rootTabbedPane;
}
 
Example 7
Source Project: tmc-intellij   Source File: CourseTabFactory.java    License: MIT License 6 votes vote down vote up
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());

}
 
Example 8
Source Project: tmc-intellij   Source File: OrganizationListWindowMock.java    License: MIT License 6 votes vote down vote up
public OrganizationListWindowMock(List<Organization> organizations) {
    Organization[] orgArray = organizations.toArray(new Organization[organizations.size()]);
    this.organizations = new JList<Organization>(orgArray);

    this.button = new JButton("Select");
    button.addActionListener(new SelectOrganizationListenerMock(this));

    JScrollPane pane = new JBScrollPane(this.organizations);

    this.organizations.addMouseListener(
            new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent event) {
                    if (event.getClickCount() >= 2) {
                        button.doClick();
                    }
                }
            });

    add(pane);
    add(button);
}
 
Example 9
Source Project: consulo   Source File: Messages.java    License: Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example 10
Source Project: consulo   Source File: ActionTracer.java    License: Apache License 2.0 6 votes vote down vote up
@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);

    myListenerDisposable = Disposable.newDisposable();
    Application.get().getMessageBus().connect(myListenerDisposable).subscribe(AnActionListener.TOPIC, this);
  }

  return myComponent;
}
 
Example 11
Source Project: consulo   Source File: NewItemWithTemplatesPopupPanel.java    License: Apache License 2.0 6 votes vote down vote up
public NewItemWithTemplatesPopupPanel(List<T> templatesList, ListCellRenderer<T> renderer) {
  setBackground(JBUI.CurrentTheme.NewClassDialog.panelBackground());

  myTemplatesListModel = new MyListModel(templatesList);
  myTemplatesList = createTemplatesList(myTemplatesListModel, renderer);

  ScrollingUtil.installMoveUpAction(myTemplatesList, (JComponent)TargetAWT.to(myTextField));
  ScrollingUtil.installMoveDownAction(myTemplatesList, (JComponent)TargetAWT.to(myTextField));

  JBScrollPane scrollPane = new JBScrollPane(myTemplatesList);
  scrollPane.setBorder(JBUI.Borders.empty());
  scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  templatesListHolder = new Box(BoxLayout.Y_AXIS);
  Border border = JBUI.Borders
          .merge(JBUI.Borders.emptyTop(JBUI.CurrentTheme.NewClassDialog.fieldsSeparatorWidth()), JBUI.Borders.customLine(JBUI.CurrentTheme.NewClassDialog.bordersColor(), 1, 0, 0, 0), true);

  templatesListHolder.setBorder(border);
  templatesListHolder.add(scrollPane);

  add(templatesListHolder, BorderLayout.CENTER);
}
 
Example 12
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;
}
 
Example 13
Source Project: GitToolBox   Source File: GtRepoChooser.java    License: Apache License 2.0 6 votes vote down vote up
GtRepoChooser(@NotNull Project project, @Nullable Component parentComponent) {
  super(project, parentComponent, false, IdeModalityType.PROJECT);
  this.project = project;
  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 = JBUI.Panels.simplePanel().addToCenter(scrollPane);
  centerPanel.setPreferredSize(JBUI.size(400, 300));
  setTitle(ResBundle.message("configurable.prj.autoFetch.exclusions.add.title"));
  init();
}
 
Example 14
Source Project: nosql4idea   Source File: MongoResultPanel.java    License: Apache License 2.0 6 votes vote down vote up
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();
}
 
Example 15
Source Project: nosql4idea   Source File: NoSqlExplorerPanel.java    License: Apache License 2.0 6 votes vote down vote up
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();
        }
    });
}
 
Example 16
Source Project: saros   Source File: SarosMainPanelView.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates the content of the tool window panel, with {@link SarosToolbar} and the {@link
 * SessionAndContactsTreeView}.
 */
public SarosMainPanelView(@NotNull Project project) throws HeadlessException {
  super(new BorderLayout());
  SessionAndContactsTreeView sarosTree = new SessionAndContactsTreeView(project);
  SarosToolbar sarosToolbar = new SarosToolbar(project);

  JScrollPane treeScrollPane = new JBScrollPane(sarosTree);
  treeScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
  treeScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

  // chartPane is empty at the moment
  Container chartPane = new JPanel(new BorderLayout());

  JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, treeScrollPane, chartPane);
  splitPane.setOneTouchExpandable(true);
  splitPane.setDividerLocation(350);

  // Provide minimum sizes for the two components in the split pane
  Dimension minimumSize = new Dimension(300, 50);
  treeScrollPane.setMinimumSize(minimumSize);
  splitPane.setMinimumSize(minimumSize);

  add(splitPane, BorderLayout.CENTER);
  add(sarosToolbar, BorderLayout.NORTH);
}
 
Example 17
Source Project: saros   Source File: TextAreaPage.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void create() {
  setLayout(new BorderLayout());

  JPanel middlePanel = new JPanel();
  middlePanel.setBorder(new TitledBorder(new EtchedBorder(), title));

  display = new JTextArea(10, 48);
  display.getDocument().putProperty(DefaultEditorKit.EndOfLineStringProperty, "\n");
  display.setEditable(false);
  display.setForeground(fontColor);

  JScrollPane scroll = new JBScrollPane(display);
  scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
  middlePanel.add(scroll);

  add(middlePanel, BorderLayout.CENTER);

  JPanel progressPanel = new JPanel();
  progressPanel.setLayout(new BoxLayout(progressPanel, BoxLayout.Y_AXIS));
}
 
Example 18
private 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<>(viewer, treePanel);
}
 
Example 19
Source Project: buck   Source File: BuckTreeViewPanelImpl.java    License: Apache License 2.0 6 votes vote down vote up
public BuckTreeViewPanelImpl() {
  mRoot = new BuckTextNode("", BuckTextNode.TextType.INFO);
  DefaultTreeModel treeModel = new DefaultTreeModel(mRoot);
  mModifiableModel =
      new ModifiableModelImpl(
          treeModel,
          new Tree(treeModel) {
            @Override
            public int getScrollableUnitIncrement(
                Rectangle visibleRect, int orientation, int direction) {
              return 5;
            }
          });
  mScrollPane = new JBScrollPane(mModifiableModel.getTree());
  mScrollPane.setAutoscrolls(true);
}
 
Example 20
Source Project: leetcode-editor   Source File: ViewManager.java    License: Apache License 2.0 5 votes vote down vote up
public static void position(JTree tree, JBScrollPane scrollPane, Question question) {

        DefaultTreeModel treeMode = (DefaultTreeModel) tree.getModel();
        DefaultMutableTreeNode root = (DefaultMutableTreeNode) treeMode.getRoot();
        if (root.isLeaf()) {
            return;
        }
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) root.getChildAt(0);
        if (node.isLeaf()) {
            return;
        }

        for (int i = 0, j = node.getChildCount(); i < j; i++) {
            DefaultMutableTreeNode childNode = (DefaultMutableTreeNode) node.getChildAt(i);
            Question nodeData = (Question) childNode.getUserObject();
            if (nodeData.getQuestionId().equals(question.getQuestionId())) {
                TreePath toShowPath = new TreePath(childNode.getPath());
                tree.setSelectionPath(toShowPath);
                Rectangle bounds = tree.getPathBounds(toShowPath);
                Point point = new Point(0, (int) bounds.getY());
                JViewport viewport = scrollPane.getViewport();
                viewport.setViewPosition(point);
                return;
            }

        }
    }
 
Example 21
Source Project: leetcode-editor   Source File: PickAction.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void actionPerformed(AnActionEvent anActionEvent, Config config) {
    JTree tree = WindowFactory.getDataContext(anActionEvent.getProject()).getData(DataKeys.LEETCODE_PROJECTS_TREE);
    if (tree == null) {
        return;
    }
    JBScrollPane scrollPane = WindowFactory.getDataContext(anActionEvent.getProject()).getData(DataKeys.LEETCODE_PROJECTS_SCROLL);
    ApplicationManager.getApplication().invokeAndWait(() -> {
        ViewManager.pick(tree, scrollPane);
    });
}
 
Example 22
Source Project: leetcode-editor   Source File: PositionAction.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void actionPerformed(AnActionEvent anActionEvent, Config config, Question question) {
    JTree tree = WindowFactory.getDataContext(anActionEvent.getProject()).getData(DataKeys.LEETCODE_PROJECTS_TREE);
    if (tree == null) {
        return;
    }
    JBScrollPane scrollPane = WindowFactory.getDataContext(anActionEvent.getProject()).getData(DataKeys.LEETCODE_PROJECTS_SCROLL);
    ApplicationManager.getApplication().invokeAndWait(() -> {
        ViewManager.position(tree, scrollPane, question);
    });
}
 
Example 23
Source Project: leetcode-editor   Source File: TestcasePanel.java    License: Apache License 2.0 5 votes vote down vote up
public TestcasePanel(@Nullable Project project) {
    super(project, true);
    jpanel = new JBPanel();
    jpanel.setLayout(new BorderLayout());
    caseText = new JTextArea();
    caseText.setMinimumSize(new Dimension(400, 200));
    caseText.setPreferredSize(new Dimension(400, 200));
    jpanel.add(new JBScrollPane(caseText, JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JBScrollPane.HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER);
    setModal(true);
    init();
}
 
Example 24
Source Project: SmartIM4IntelliJ   Source File: WXBroadcastDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override protected void initTab(JTabbedPane host) {
    // recentTree = new JTree();
    friendTree = new Tree();
    groupTree = new JTree();
    discussTree = new JTree();

    // JScrollPane scrollPane1 = new JScrollPane(recentTree);
    // tabHost.addTab("最近", null, scrollPane1, null);

    JScrollPane scrollPane2 = new JBScrollPane(friendTree);
    tabHost.addTab("好友", null, scrollPane2, null);

    JScrollPane scrollPane3 = new JBScrollPane(groupTree);
    tabHost.addTab("群组", null, scrollPane3, null);

    JScrollPane scrollPane4 = new JBScrollPane(discussTree);
    tabHost.addTab("讨论组", null, scrollPane4, null);

    initTrees(recentTree, friendTree, groupTree, discussTree);
    // root1 = new WXContactTreeNode(false, "recent", imPanel);
    root2 = new WXContactTreeNode(false, "friend", imPanel);
    root3 = new WXContactTreeNode(false, "group", imPanel);
    root4 = new WXContactTreeNode(false, "discuss", imPanel);
    root2.update();
    root3.update();
    root4.update();

    // recentModel = new ContactTreeMode(root1);
    friendModel = new ContactTreeMode(root2);
    groupModel = new ContactTreeMode(root3);
    discussModel = new ContactTreeMode(root4);

    // recentTree.setModel(recentModel);
    friendTree.setModel(friendModel);
    groupTree.setModel(groupModel);
    discussTree.setModel(discussModel);

}
 
Example 25
Source Project: consulo   Source File: CertificateConfigurable.java    License: Apache License 2.0 5 votes vote down vote up
private void addCertificatePanel(@Nonnull X509Certificate certificate) {
  String uniqueName = getCardName(certificate);
  JPanel infoPanel = new CertificateInfoPanel(certificate);
  UIUtil.addInsets(infoPanel, UIUtil.PANEL_REGULAR_INSETS);
  JBScrollPane scrollPane = new JBScrollPane(infoPanel);
  //scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  myDetailsPanel.add(scrollPane, uniqueName);
}
 
Example 26
Source Project: consulo   Source File: ScrollPaneFactory.java    License: Apache License 2.0 5 votes vote down vote up
public static JScrollPane createScrollPane(Component view,
                                           @MagicConstant(intValues = {VERTICAL_SCROLLBAR_ALWAYS, VERTICAL_SCROLLBAR_AS_NEEDED,
                                                   VERTICAL_SCROLLBAR_NEVER}) int vsbPolicy,
                                           @MagicConstant(intValues = {HORIZONTAL_SCROLLBAR_ALWAYS, HORIZONTAL_SCROLLBAR_AS_NEEDED,
                                                   HORIZONTAL_SCROLLBAR_NEVER}) int hsbPolicy) {
  return new JBScrollPane(view, vsbPolicy, hsbPolicy);
}
 
Example 27
Source Project: PackageTemplates   Source File: SimpleBaseDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected JComponent createCenterPanel() {
    panel = new JPanel(createLayout());
    buildView();

    JBScrollPane scrollPane = new JBScrollPane(panel);
    scrollPane.setMinimumSize(getMinSizeDimension());
    return scrollPane;
}
 
Example 28
Source Project: PackageTemplates   Source File: BaseDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected JComponent createCenterPanel() {
    panel = new JPanel();
    JBScrollPane scrollPane = new JBScrollPane(panel);
    panel.setBorder(new EmptyBorder(PADDING, PADDING, PADDING, PADDING));
    scrollPane.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    return scrollPane;
}
 
Example 29
@Override
protected JComponent createCenterPanel() {
    setModal(false);
    panel = new JPanel();
    JBScrollPane scrollPane = new JBScrollPane(panel);
    return scrollPane;
}
 
Example 30
Source Project: PackageTemplates   Source File: CustomPathDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected JComponent createCenterPanel() {
    panel = new JPanel();
    JBScrollPane scrollPane = new JBScrollPane(panel);
    scrollPane.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
    return scrollPane;
}