本文整理匯總了Java中com.intellij.ui.components.JBScrollPane類的典型用法代碼示例。如果您正苦於以下問題:Java JBScrollPane類的具體用法?Java JBScrollPane怎麽用?Java JBScrollPane使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JBScrollPane類屬於com.intellij.ui.components包,在下文中一共展示了JBScrollPane類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: TelemetryToolWindow
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
private TelemetryToolWindow(Project project) {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
if (window == null) {
textPane = new JTextPane();
textPane.setEditable(false);
JBScrollPane scrollPane = new JBScrollPane(textPane);
DefaultCaret caret = (DefaultCaret) textPane.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
textPane.setContentType("text/html");
initHtmlComposer();
window = manager.registerToolWindow(WINDOW_ID, scrollPane, ToolWindowAnchor.BOTTOM);
window.show(EMPTY_TASK);
}
}
示例2: EmojiCheckinHandler
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
public EmojiCheckinHandler(CheckinProjectPanel checkinProjectPanel) {
JPanel emojiPanel = new JPanel();
emojiPanel.setLayout(new VerticalFlowLayout());
VirtualFile emojirc = checkinProjectPanel.getProject().getBaseDir().findChild(".emojirc");
if (emojirc == null) return;
PsiFile psiFile = PsiManager.getInstance(checkinProjectPanel.getProject()).findFile(emojirc);
if (psiFile == null) return;
for (PsiElement psiElement : psiFile.getChildren()) {
if (!(psiElement instanceof EmojiResourceProperty)) continue;
emojiPanel.add(createEmojiButton(psiElement.getFirstChild().getText(), psiElement.getLastChild().getText(), false, buttonGroup));
}
emojiPanel.add(createEmojiButton(null, NO_EMOJI, true, buttonGroup));
Splitter splitter = (Splitter) checkinProjectPanel.getComponent();
CommitMessage commitMessage = (CommitMessage) splitter.getSecondComponent();
JComponent component = (JComponent) commitMessage.getComponent(1);
JBScrollPane scrollPane = new JBScrollPane(emojiPanel);
scrollPane.setBorder(null);
Splitter commitSplitter = new Splitter();
commitSplitter.setFirstComponent(scrollPane);
commitSplitter.setSecondComponent((JComponent) commitMessage.getComponent(0));
commitMessage.add(commitSplitter, 0);
for (EmojiPanelFactory factory : factories) {
factory.createPanel(commitMessage);
}
this.checkinProjectPanel = checkinProjectPanel;
}
示例3: createTaskInfoPanel
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
@Override
public JComponent createTaskInfoPanel(Project project) {
myTaskTextPane = new JTextPane();
final JBScrollPane scrollPane = new JBScrollPane(myTaskTextPane);
myTaskTextPane.setContentType(new HTMLEditorKit().getContentType());
final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
int fontSize = editorColorsScheme.getEditorFontSize();
final String fontName = editorColorsScheme.getEditorFontName();
final Font font = new Font(fontName, Font.PLAIN, fontSize);
String bodyRule = "body { font-family: " + font.getFamily() + "; " +
"font-size: " + font.getSize() + "pt; }" +
"pre {font-family: Courier; display: inline; ine-height: 50px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; background-color:"
+ ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}" +
"code {font-family: Courier; display: flex; float: left; background-color:"
+ ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}";
((HTMLDocument)myTaskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
myTaskTextPane.setEditable(false);
if (!UIUtil.isUnderDarcula()) {
myTaskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
}
myTaskTextPane.setBorder(new EmptyBorder(20, 20, 0, 10));
myTaskTextPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
return scrollPane;
}
示例4: addRightMouseButtonFunctionality
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
private void addRightMouseButtonFunctionality(MouseEvent mouseEvent,
final JBList list,
JBScrollPane panel) {
logger.info("Adding functionality for right mouse button. @CourseTabFactory");
if (!SwingUtilities.isRightMouseButton(mouseEvent)) {
return;
}
int index = list.locationToIndex(mouseEvent.getPoint());
list.setSelectedIndex(index);
PopUpMenu menu = new PopUpMenu();
JBMenuItem openInExplorer = new JBMenuItem("Open path");
final Object selectedItem = list.getSelectedValue();
JBMenuItem deleteFolder = new JBMenuItem("Delete folder");
openInExplorer.addActionListener(createOpenInExploreListener(list, selectedItem));
deleteFolder.addActionListener(createDeleteButtonActionListener(list, selectedItem));
menu.add(openInExplorer);
menu.add(deleteFolder);
menu.show(panel, mouseEvent.getX(), mouseEvent.getY());
menu.setLocation(mouseEvent.getXOnScreen(), mouseEvent.getYOnScreen());
}
示例5: showValuesPanel
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
public void showValuesPanel() {
if (!valuesPanelVisible) {
valuesPanelVisible = true;
if (valuesPanel == null) {
valuesPanel = new ValuesPanel();
valuesPanel.setCodeArea(codeArea, undoHandler);
valuesPanelScrollPane = new JBScrollPane(valuesPanel);
}
editorPanel.add(valuesPanelScrollPane, BorderLayout.EAST);
valuesPanel.enableUpdate();
valuesPanel.updateValues();
valuesPanelScrollPane.revalidate();
valuesPanel.revalidate();
editorPanel.revalidate();
}
}
示例6: 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();
}
示例7: createCenterPanel
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
@Override
protected JComponent createCenterPanel() {
if (myInfoText == null) {
return null;
}
final JPanel panel = new JPanel(new BorderLayout());
final JTextArea area = new JTextArea(myInfoText);
area.setEditable(false);
final JBScrollPane scrollPane = new JBScrollPane(area) {
@Override
public Dimension getPreferredSize() {
final Dimension preferredSize = super.getPreferredSize();
final Container parent = getParent();
if (parent != null) {
return new Dimension(preferredSize.width, Math.min(150, preferredSize.height));
}
return preferredSize;
}
};
panel.add(scrollPane);
return panel;
}
示例8: ReferencePopupComponent
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
ReferencePopupComponent(@NotNull RefGroup group, @NotNull VcsLogUiImpl ui, @NotNull VcsRefPainter referencePainter) {
super(new BorderLayout());
myUi = ui;
myRendererComponent = new SingleReferenceComponent(referencePainter);
myCellRenderer = new ListCellRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
myRendererComponent.setReference((VcsRef)value);
myRendererComponent.setSelected(isSelected);
return myRendererComponent;
}
};
myList = createList(group);
myPopup = createPopup();
add(new JBScrollPane(myList));
}
示例9: buildActiveContent
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
private void buildActiveContent() {
myActiveFocusedContent = new ActiveContent();
final JPanel wrapper = new JPanel(new BorderLayout());
wrapper.add(myProcessBox, BorderLayout.NORTH);
myActiveFocusedContent.add(wrapper, BorderLayout.CENTER);
final JScrollPane scrolls = new JBScrollPane(myActiveFocusedContent) {
public Dimension getPreferredSize() {
if (myProcessBox.getComponentCount() > 0) {
return super.getPreferredSize();
} else {
return getEmptyPreferredSize();
}
}
};
myActiveContentComponent = scrolls;
updateContentUI();
}
示例10: InspectorTable
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
private InspectorTable(@NotNull final Component component) {
setLayout(new BorderLayout());
myModel = new InspectorTableModel(component);
StripeTable table = new StripeTable(myModel);
new TableSpeedSearch(table);
TableColumnModel columnModel = table.getColumnModel();
TableColumn propertyColumn = columnModel.getColumn(0);
propertyColumn.setMinWidth(150);
propertyColumn.setMaxWidth(150);
propertyColumn.setResizable(false);
TableColumn valueColumn = columnModel.getColumn(1);
valueColumn.setMinWidth(200);
valueColumn.setResizable(false);
valueColumn.setCellRenderer(new ValueCellRenderer());
table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
add(new JBScrollPane(table), BorderLayout.CENTER);
myDimensionComponent = new DimensionsComponent(component);
add(myDimensionComponent, BorderLayout.SOUTH);
}
示例11: getComponent
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
@Override
public JComponent getComponent() {
if (myComponent == null) {
myText = new JTextArea();
final JBScrollPane log = new JBScrollPane(myText);
final AnAction clear = new AnAction("Clear", "Clear log", AllIcons.General.Reset) {
@Override
public void actionPerformed(AnActionEvent e) {
myText.setText(null);
}
};
myComponent = new JPanel(new BorderLayout());
final DefaultActionGroup group = new DefaultActionGroup();
group.add(clear);
myComponent.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true).getComponent(), BorderLayout.NORTH);
myComponent.add(log);
ActionManager.getInstance().addAnActionListener(this);
}
return myComponent;
}
示例12: SearchTextArea
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
public SearchTextArea(boolean search) {
myTextArea = new JTextArea();
setBorder(JBUI.Borders.empty(6, 6, 6, 8));
setLayout(new BorderLayout(JBUI.scale(4), 0));
myTextArea.addPropertyChangeListener("background", this);
myTextArea.addFocusListener(this);
myTextArea.setBorder(null);
myTextArea.setOpaque(false);
JBScrollPane scrollPane = new JBScrollPane(myTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.getVerticalScrollBar().setBackground(UIUtil.TRANSPARENT_COLOR);
scrollPane.getViewport().setBorder(null);
scrollPane.getViewport().setOpaque(false);
scrollPane.setBorder(JBUI.Borders.emptyRight(2));
scrollPane.setOpaque(false);
ShowHistoryAction historyAction = new ShowHistoryAction(search);
ActionButton button =
new ActionButton(historyAction, historyAction.getTemplatePresentation(), ActionPlaces.UNKNOWN, new Dimension(JBUI.scale(16), JBUI.scale(16)));
button.setLook(new InplaceActionButtonLook());
JPanel p = new NonOpaquePanel(new BorderLayout());
p.add(button, BorderLayout.NORTH);
add(p, BorderLayout.WEST);
add(scrollPane, BorderLayout.CENTER);
}
示例13: createPanel
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
@Override
public JPanel createPanel() {
final JPanel mainPanel = new JPanel(new BorderLayout());
final JLabel label = createErrorLabel();
final JButton button = createActionButton();
button.addActionListener(createCloseActionListener());
final JPanel scrollPanel = createAndFillContentPanel();
initGeneratorListeners();
registerValidators();
final JBScrollPane scrollPane = new JBScrollPane(scrollPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setBorder(null);
mainPanel.add(scrollPane, BorderLayout.CENTER);
final JPanel bottomPanel = new JPanel(new BorderLayout());
bottomPanel.add(label, BorderLayout.NORTH);
bottomPanel.add(button, BorderLayout.EAST);
mainPanel.add(bottomPanel, BorderLayout.SOUTH);
return mainPanel;
}
示例14: init
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
@Override
protected void init() {
List<String> settingNames = mySettingsToShow.getSettings(getSettingsType());
String[] names = ContainerUtil.toArray(settingNames, new String[settingNames.size()]);
showStandardOptions(names);
initTables();
myOptionsTree = createOptionsTree();
myOptionsTree.setCellRenderer(new MyTreeCellRenderer());
JBScrollPane pane = new JBScrollPane(myOptionsTree) {
@Override
public Dimension getMinimumSize() {
return super.getPreferredSize();
}
};
myPanel = new JPanel(new BorderLayout());
myPanel.add(pane);
isFirstUpdate = false;
}
示例15: JBTableWithRowHeaders
import com.intellij.ui.components.JBScrollPane; //導入依賴的package包/類
public JBTableWithRowHeaders() {
setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
setRowSelectionAllowed(false);
setMaxItemsForSizeCalculation(50);
setTableHeader(new CustomTableHeader(this));
getTableHeader().setDefaultRenderer(new ArrayTableForm.ColumnHeaderRenderer());
getTableHeader().setReorderingAllowed(false);
myScrollPane = new JBScrollPane(this);
JBTableWithRowHeaders.RowHeaderTable rowTable = new JBTableWithRowHeaders.RowHeaderTable(this);
myScrollPane.setRowHeaderView(rowTable);
myScrollPane.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER,
rowTable.getTableHeader());
setRowHeaderTable(rowTable);
}