本文整理汇总了Java中com.intellij.ui.components.JBScrollPane.setViewportBorder方法的典型用法代码示例。如果您正苦于以下问题:Java JBScrollPane.setViewportBorder方法的具体用法?Java JBScrollPane.setViewportBorder怎么用?Java JBScrollPane.setViewportBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.components.JBScrollPane
的用法示例。
在下文中一共展示了JBScrollPane.setViewportBorder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createScrollPane
import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public static JScrollPane createScrollPane(Component view, boolean withoutBorder) {
JBScrollPane scrollPane = new JBScrollPane(view);
if (withoutBorder) {
scrollPane.setBorder(IdeBorderFactory.createEmptyBorder()); // set empty border, because setting null doesn't always take effect
scrollPane.setViewportBorder(IdeBorderFactory.createEmptyBorder());
}
return scrollPane;
}
示例2: 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);
}
示例3: 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());
}
示例4: 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);
}