本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}