当前位置: 首页>>代码示例>>Java>>正文


Java JBScrollPane.setPreferredSize方法代码示例

本文整理汇总了Java中com.intellij.ui.components.JBScrollPane.setPreferredSize方法的典型用法代码示例。如果您正苦于以下问题:Java JBScrollPane.setPreferredSize方法的具体用法?Java JBScrollPane.setPreferredSize怎么用?Java JBScrollPane.setPreferredSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.components.JBScrollPane的用法示例。


在下文中一共展示了JBScrollPane.setPreferredSize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SettingsPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
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();
}
 
开发者ID:maddouri,项目名称:IntelliJ-OnlineSearch,代码行数:26,代码来源:SettingsConfigurable.java

示例2: createUIComponents

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
private void createUIComponents() {
    contexts = new JBTable(new ModuleTableModel());
    contexts.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    contexts.setDefaultRenderer(String.class, new ModuleCellRenderer());
    contexts.getColumnModel().getColumn(0).setPreferredWidth(25);
    tableScrollPane = new JBScrollPane();
    tableScrollPane.setViewportView(contexts);
    tableScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    tableScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    tableScrollPane.setPreferredSize(new Dimension(400, 100));
    tableScrollPane.setSize(new Dimension(400, 100));
}
 
开发者ID:vitorzachi,项目名称:tomcat-runner,代码行数:13,代码来源:TomcatRunnerConfPanel.java

示例3: ErrorDialog

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public ErrorDialog(String message, String detail) {
    super(JOptionPane.getRootFrame(), "Error", true);

    JButton ok = new JButton("OK");
    ok.addActionListener(this);
    JPanel buttons = new JPanel(new FlowLayout(FlowLayout.CENTER));
    buttons.add(ok);

    JTextPane detailPane = new JTextPane();
    detailPane.setText(detail);
    final JBScrollPane pane = new JBScrollPane(detailPane);
    pane.setPreferredSize(new Dimension(600, 300));
    getContentPane().add(buttons, BorderLayout.SOUTH);

    final JPanel content = new JPanel();
    content.add(new JLabel(IconLoader.getIcon("/general/errorDialog.png")));
    content.add(new JLabel(message));
    final LinkLabel showMoreLink = new LinkLabel("(show details)", null);
    LinkListener showMoreListener = new LinkListener() {
        public void linkSelected(LinkLabel aSource, Object aLinkData) {
            content.remove(showMoreLink);
            getContentPane().add(pane, BorderLayout.CENTER);
            setResizable(true);
            pack();
        }
    };
    showMoreLink.setListener(showMoreListener, null);
    content.add(showMoreLink);
    getContentPane().add(content, BorderLayout.NORTH);

    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    pack();
    setResizable(false);
    setLocationRelativeTo(getOwner());
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:36,代码来源:ErrorDialog.java

示例4: createCenterPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
@Override
protected JComponent createCenterPanel() {
  final JBScrollPane pane = new JBScrollPane(myCheckBoxList);
  pane.setPreferredSize(new Dimension(500, 200));
  return pane;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ImportDependenciesDialog.java

示例5: RepositoryPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
RepositoryPanel() {
  projectRootNode = new DefaultMutableTreeNode("root");
  treeModel = new DefaultTreeModel(projectRootNode);

  setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

  repositoryTree = new Tree(treeModel);
  repositoryTree.setRowHeight(0);
  repositoryTree.setRootVisible(false);
  repositoryTree.setOpaque(false);
  repositoryTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  repositoryTree.expandRow(0);

  RepositorySelectorRenderer renderer = new RepositorySelectorRenderer();
  renderer.setOpenIcon(GoogleCloudToolsIcons.CLOUD);
  renderer.setClosedIcon(GoogleCloudToolsIcons.CLOUD);
  renderer.setLeafIcon(null);
  repositoryTree.setCellRenderer(renderer);

  repositoryTree.addTreeSelectionListener(
      event -> {
        DefaultMutableTreeNode node =
            (DefaultMutableTreeNode) repositoryTree.getLastSelectedPathComponent();
        if (node != null && node instanceof RepositoryModelItem) {
          RepositoryModelItem repoNode = (RepositoryModelItem) node;
          RepositorySelector.this.setText(repoNode.getRepositoryId());
          ApplicationManager.getApplication().invokeLater(RepositorySelector.this::hidePopup);
        }
      });

  JBScrollPane scrollPane = new JBScrollPane();
  scrollPane.setPreferredSize(new Dimension(getPopupWidth(), getPreferredPopupHeight()));
  scrollPane.setViewportView(repositoryTree);
  scrollPane.setBorder(BorderFactory.createEmptyBorder());

  add(scrollPane);

  JPanel bottomPane = new JPanel();
  JPanel buttonPanel = new JPanel();

  bottomPane.setLayout(new BorderLayout());
  bottomPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.LIGHT_GRAY));
  buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
  buttonPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

  if (canCreateRepository) {
    JButton newRepositoryButton = new JButton();
    newRepositoryButton.setText(GctBundle.message("cloud.repository.selector.create.button"));
    newRepositoryButton.addActionListener(
        event -> {
          try {
            Desktop.getDesktop()
                .browse(URI.create(PANETHEON_CREATE_REPO_URL_PREFIX + cloudProject));
          } catch (IOException e) {
            logger.error(GctBundle.message("cloud.repository.selector.create.url.error"));
          }
        });

    buttonPanel.add(newRepositoryButton);
  }

  JButton refreshButton = new JButton();
  refreshButton.setIcon(GoogleCloudToolsIcons.REFRESH);
  refreshButton.addActionListener(event -> refresh());

  buttonPanel.add(Box.createHorizontalGlue());
  buttonPanel.add(refreshButton);
  bottomPane.add(buttonPanel, BorderLayout.PAGE_END);
  add(bottomPane);

  refresh();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:73,代码来源:RepositorySelector.java

示例6: createPane

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
private JBScrollPane createPane(Component component) {
    JBScrollPane pane = new JBScrollPane(component);
    pane.setPreferredSize(new Dimension(600, 30));
    pane.setMinimumSize(new Dimension(300, 30));
    return pane;
}
 
开发者ID:janotav,项目名称:ali-idea-plugin,代码行数:7,代码来源:CommentField.java


注:本文中的com.intellij.ui.components.JBScrollPane.setPreferredSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。