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


Java JBScrollPane.setHorizontalScrollBarPolicy方法代码示例

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


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

示例1: 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

示例2: EditorPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public EditorPanel(JPanel toolbarPanel, ScenarioPanel scenarioPanel) {
    super(new BorderLayout());

    this.toolbarPanel = toolbarPanel;
    this.scenarioPanel = scenarioPanel;

    //create resizable split pane for inner panels
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    //splitPane.setBorder(BorderFactory.createLineBorder(Color.BLUE, 10));

    //set divider size
    //splitPane.setDividerSize(10);

    //set divider default location
    splitPane.setDividerLocation(200);

    //add panels to split pane
    splitPane.setLeftComponent(toolbarPanel);

    LayerUI<ScenarioPanel> layerUI = new MessageValidatorConnectorLayerUI();
    final JLayer<ScenarioPanel> jlayer = new JLayer<>(scenarioPanel, layerUI);


    //put scenario panel in scrollpane to allow scrolling when scenario is big
    JBScrollPane jbScrollPane = new JBScrollPane(jlayer);
    jbScrollPane.setHorizontalScrollBarPolicy(JBScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    jbScrollPane.setVerticalScrollBarPolicy(JBScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    splitPane.setRightComponent(jbScrollPane);

    //add split pane to editor
    add(splitPane, BorderLayout.CENTER);
}
 
开发者ID:PerfCake,项目名称:PerfCakeIDEA-deprecated,代码行数:33,代码来源:EditorPanel.java

示例3: LookupUi

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
LookupUi(LookupImpl lookup, Advertiser advertiser, JBList list, Project project) {
  myLookup = lookup;
  myAdvertiser = advertiser;
  myList = list;
  myProject = project;

  myIconPanel.setVisible(false);
  myIconPanel.setBackground(Color.LIGHT_GRAY);
  myIconPanel.add(myProcessIcon);

  JComponent adComponent = advertiser.getAdComponent();
  adComponent.setBorder(new EmptyBorder(0, 1, 1, 2 + AllIcons.Ide.LookupRelevance.getIconWidth()));
  myLayeredPane.mainPanel.add(adComponent, BorderLayout.SOUTH);

  myScrollBarIncreaseButton = new JButton();
  myScrollBarIncreaseButton.setFocusable(false);
  myScrollBarIncreaseButton.setRequestFocusEnabled(false);

  myScrollPane = new JBScrollPane(lookup.getList());
  myScrollPane.setViewportBorder(JBUI.Borders.empty());
  myScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  myScrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(13, -1));
  myScrollPane.getVerticalScrollBar().setUI(new ButtonlessScrollBarUI() {
    @Override
    protected JButton createIncreaseButton(int orientation) {
      return myScrollBarIncreaseButton;
    }
  });
  lookup.getComponent().add(myLayeredPane, BorderLayout.CENTER);

  //IDEA-82111
  fixMouseCheaters();

  myLayeredPane.mainPanel.add(myScrollPane, BorderLayout.CENTER);
  myScrollPane.setBorder(null);

  mySortingLabel.setBorder(new LineBorder(new JBColor(Color.LIGHT_GRAY, JBColor.background())));
  mySortingLabel.setOpaque(true);
  new ChangeLookupSorting().installOn(mySortingLabel);
  updateSorting();
  myModalityState = ModalityState.stateForComponent(lookup.getEditor().getComponent());

  addListeners();

  updateScrollbarVisibility();

  Disposer.register(lookup, myProcessIcon);
  Disposer.register(lookup, myHintAlarm);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:50,代码来源:LookupUi.java

示例4: LookupImpl

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public LookupImpl(Project project, Editor editor, @NotNull LookupArranger arranger) {
  super(new JPanel(new BorderLayout()));
  setForceShowAsPopup(true);
  setCancelOnClickOutside(false);
  setResizable(true);
  AbstractPopup.suppressMacCornerFor(getComponent());

  myProject = project;
  myEditor = editor;
  myArranger = arranger;
  myPresentableArranger = arranger;

  myIconPanel.setVisible(false);
  myCellRenderer = new LookupCellRenderer(this);
  myList.setCellRenderer(myCellRenderer);

  myList.setFocusable(false);
  myList.setFixedCellWidth(50);

  myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  myList.setBackground(LookupCellRenderer.BACKGROUND_COLOR);

  myList.getExpandableItemsHandler();

  myScrollBarIncreaseButton = new JButton();
  myScrollBarIncreaseButton.setFocusable(false);
  myScrollBarIncreaseButton.setRequestFocusEnabled(false);

  myScrollPane = new JBScrollPane(myList);
  myScrollPane.setViewportBorder(new EmptyBorder(0, 0, 0, 0));
  myScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  myScrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(13, -1));
  myScrollPane.getVerticalScrollBar().setUI(new ButtonlessScrollBarUI() {
    @Override
    protected JButton createIncreaseButton(int orientation) {
      return myScrollBarIncreaseButton;
    }
  });
  getComponent().add(myLayeredPane, BorderLayout.CENTER);

  //IDEA-82111
  fixMouseCheaters();

  myLayeredPane.mainPanel.add(myScrollPane, BorderLayout.CENTER);
  myScrollPane.setBorder(null);

  myAdComponent = new Advertiser();
  JComponent adComponent = myAdComponent.getAdComponent();
  adComponent.setBorder(new EmptyBorder(0, 1, 1, 2 + AllIcons.Ide.LookupRelevance.getIconWidth()));
  myLayeredPane.mainPanel.add(adComponent, BorderLayout.SOUTH);
  getComponent().setBorder(new BegPopupMenuBorder());

  myIconPanel.setBackground(Color.LIGHT_GRAY);
  myIconPanel.add(myProcessIcon);

  myOffsets = new LookupOffsets(editor);

  final CollectionListModel<LookupElement> model = getListModel();
  addEmptyItem(model);
  updateListHeight(model);


  addListeners();

  mySortingLabel.setBorder(new LineBorder(new JBColor(Color.LIGHT_GRAY, JBColor.background())));
  mySortingLabel.setOpaque(true);
  new ChangeLookupSorting().installOn(mySortingLabel);
  updateSorting();
  myModalityState = ModalityState.stateForComponent(getComponent());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:71,代码来源:LookupImpl.java

示例5: LookupUi

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
LookupUi(@Nonnull LookupImpl lookup, Advertiser advertiser, JBList list, Project project) {
  myLookup = lookup;
  myAdvertiser = advertiser;
  myList = list;
  myProject = project;

  myIconPanel.setVisible(false);
  myIconPanel.setBackground(Color.LIGHT_GRAY);
  myIconPanel.add(myProcessIcon);

  JComponent adComponent = advertiser.getAdComponent();
  adComponent.setBorder(new EmptyBorder(0, 1, 1, 2 + AllIcons.Ide.LookupRelevance.getIconWidth()));
  myLayeredPane.mainPanel.add(adComponent, BorderLayout.SOUTH);

  myScrollBarIncreaseButton = new JButton();
  myScrollBarIncreaseButton.setFocusable(false);
  myScrollBarIncreaseButton.setRequestFocusEnabled(false);

  myScrollPane = new JBScrollPane(lookup.getList());
  myScrollPane.setViewportBorder(JBUI.Borders.empty());
  myScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

  UIUtil.putClientProperty(myScrollPane, ScrollBarUIConstants.INCREASE_BUTTON_FACTORY, () -> myScrollBarIncreaseButton);

  lookup.getComponent().add(myLayeredPane, BorderLayout.CENTER);

  //IDEA-82111
  fixMouseCheaters();

  myLayeredPane.mainPanel.add(myScrollPane, BorderLayout.CENTER);
  myScrollPane.setBorder(null);

  mySortingLabel.setBorder(new LineBorder(new JBColor(Color.LIGHT_GRAY, JBColor.background())));
  mySortingLabel.setOpaque(true);
  new ChangeLookupSorting().installOn(mySortingLabel);
  updateSorting();
  myModalityState = ModalityState.stateForComponent(lookup.getTopLevelEditor().getComponent());

  addListeners();

  updateScrollbarVisibility();

  Disposer.register(lookup, myProcessIcon);
  Disposer.register(lookup, myHintAlarm);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:46,代码来源:LookupUi.java


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