當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。