本文整理汇总了Java中com.intellij.ui.ScrollPaneFactory.createScrollPane方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollPaneFactory.createScrollPane方法的具体用法?Java ScrollPaneFactory.createScrollPane怎么用?Java ScrollPaneFactory.createScrollPane使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.ScrollPaneFactory
的用法示例。
在下文中一共展示了ScrollPaneFactory.createScrollPane方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doShowError
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
private static void doShowError(String title, String description, DialogBuilder builder) {
builder.setTitle(title);
final JTextArea textArea = new JTextArea();
textArea.setEditable(false);
textArea.setText(description);
textArea.setWrapStyleWord(false);
textArea.setLineWrap(true);
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(textArea);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
final JPanel panel = new JPanel(new BorderLayout(10, 0));
panel.setPreferredSize(new Dimension(600, 400));
panel.add(scrollPane, BorderLayout.CENTER);
panel.add(new JBLabel("Details:", Messages.getErrorIcon(), SwingConstants.LEFT), BorderLayout.NORTH);
builder.setCenterPanel(panel);
builder.setButtonsAlignment(SwingConstants.CENTER);
builder.addOkAction();
builder.show();
}
示例2: createListAndVisibilityPanels
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
protected JPanel createListAndVisibilityPanels() {
myList = createTargetVariableChooser();
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myList);
final JPanel hBox = new JPanel(new GridBagLayout());
final GridBagConstraints gbConstraints = new GridBagConstraints();
gbConstraints.fill = GridBagConstraints.BOTH;
gbConstraints.weightx = 1;
gbConstraints.weighty = 1;
gbConstraints.gridheight = 1;
gbConstraints.gridx = 0;
gbConstraints.gridy = 0;
gbConstraints.insets = new Insets(0, 0, 0, 0);
hBox.add(scrollPane, gbConstraints);
hBox.add(Box.createHorizontalStrut(4));
gbConstraints.weightx = 0;
gbConstraints.fill = GridBagConstraints.NONE;
gbConstraints.anchor = GridBagConstraints.NORTH;
gbConstraints.gridx++;
myVisibilityPanel = createVisibilityPanel();
hBox.add (myVisibilityPanel, gbConstraints);
return hBox;
}
示例3: createCenterPanel
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
@Override
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new BorderLayout(0, 2));
panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);
@NonNls StringBuilder buf = new StringBuilder();
for (String description : myConflictDescriptions) {
buf.append(description);
buf.append("<br><br>");
}
JEditorPane messagePane = new JEditorPane(UIUtil.HTML_MIME, buf.toString());
messagePane.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setPreferredSize(JBUI.size(500, 400));
panel.add(scrollPane, BorderLayout.CENTER);
if (getOKAction().isEnabled()) {
panel.add(new JLabel(RefactoringBundle.message("do.you.wish.to.ignore.them.and.continue")), BorderLayout.SOUTH);
}
return panel;
}
示例4: createNorthPanel
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
protected JComponent createNorthPanel() {
BorderLayoutPanel panel = JBUI.Panels.simplePanel(15, 10);
if (myIcon != null) {
JLabel iconLabel = new JLabel(myIcon);
panel.addToLeft(JBUI.Panels.simplePanel().addToTop(iconLabel));
}
BorderLayoutPanel messagePanel = JBUI.Panels.simplePanel();
if (myMessage != null) {
JLabel textLabel = new JLabel(myMessage);
textLabel.setBorder(JBUI.Borders.emptyBottom(5));
textLabel.setUI(new MultiLineLabelUI());
messagePanel.addToTop(textLabel);
}
panel.add(messagePanel, BorderLayout.CENTER);
final JScrollPane jScrollPane = ScrollPaneFactory.createScrollPane();
jScrollPane.setViewportView(myView);
jScrollPane.setPreferredSize(JBUI.size(300, 80));
panel.addToBottom(jScrollPane);
return panel;
}
示例5: createComponent
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
@Override
public JComponent createComponent() {
if (myComponent != null) return myComponent;
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(null);
DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
myTree = createTree(treeModel);
enableDnD();
myComponent = ScrollPaneFactory.createScrollPane(myTree);
myTreeStructure = createStructure();
setTreeBuilder(createBuilder(treeModel));
installComparator();
initTree();
return myComponent;
}
示例6: createCenterPanel
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
protected JComponent createCenterPanel() {
JTextArea licenseTextArea = new JTextArea(myText, 20, 50);
licenseTextArea.getCaret().setDot(0);
licenseTextArea.setFont(myFont);
licenseTextArea.setLineWrap(true);
licenseTextArea.setWrapStyleWord(true);
licenseTextArea.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(licenseTextArea);
JPanel agreePanel = new JPanel(new GridLayout(1, 1));
agreePanel.setBorder(JBUI.Borders.empty(10, 5, 5, 5));
myAcceptCheckBox = new JCheckBox(myBundle.getString("license.agreement.accept.checkbox"));
myAcceptCheckBox.setMnemonic(myAcceptCheckBox.getText().charAt(0));
myAcceptCheckBox.setFont(myFont);
agreePanel.add(myAcceptCheckBox);
myAcceptCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
getOKAction().setEnabled(myAcceptCheckBox.isSelected());
}
});
return JBUI.Panels.simplePanel()
.addToCenter(scrollPane)
.addToBottom(agreePanel);
}
示例7: MyIndentOptionsWrapper
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
protected MyIndentOptionsWrapper(CodeStyleSettings settings, LanguageCodeStyleSettingsProvider provider, IndentOptionsEditor editor) {
super(settings);
myProvider = provider;
myTopPanel.add(myLeftPanel, BorderLayout.WEST);
myRightPanel = new JPanel();
installPreviewPanel(myRightPanel);
myEditor = editor;
if (myEditor != null) {
JPanel panel = myEditor.createPanel();
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JScrollPane scroll = ScrollPaneFactory.createScrollPane(panel, true);
scroll.setPreferredSize(new Dimension(panel.getPreferredSize().width + scroll.getVerticalScrollBar().getPreferredSize().width + 5, -1));
myLeftPanel.add(scroll, BorderLayout.CENTER);
}
myTopPanel.add(myRightPanel, BorderLayout.CENTER);
}
示例8: createScrollPane
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
@Override
protected JScrollPane createScrollPane(@NotNull JLayeredPane content) {
// No background color
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(content);
scrollPane.setBackground(null);
return scrollPane;
}
示例9: ParameterInfoComponent
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler) {
super(new BorderLayout());
if (!ApplicationManager.getApplication().isUnitTestMode()) {
JComponent editorComponent = editor.getComponent();
JLayeredPane layeredPane = editorComponent.getRootPane().getLayeredPane();
myWidthLimit = layeredPane.getWidth();
}
NORMAL_FONT = UIUtil.getLabelFont();
BOLD_FONT = NORMAL_FONT.deriveFont(Font.BOLD);
myObjects = objects;
setBackground(BACKGROUND_COLOR);
myHandler = handler;
myPanels = new OneElementComponent[myObjects.length];
final JPanel panel = new JPanel(new GridBagLayout());
for (int i = 0; i < myObjects.length; i++) {
myPanels[i] = new OneElementComponent();
panel.add(myPanels[i], new GridBagConstraints(0, i, 1, 1, 1, 0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
new Insets(0, 0, 0, 0), 0, 0));
}
final JScrollPane pane = ScrollPaneFactory.createScrollPane(panel);
pane.setBorder(null);
pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
add(pane, BorderLayout.CENTER);
myCurrentParameterIndex = -1;
}
示例10: createCenterPanel
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
@Override
protected JComponent createCenterPanel(){
final JPanel panel = new JPanel(new BorderLayout());
final DefaultActionGroup actionGroup = new DefaultActionGroup();
actionGroup.add(new FilterExistentAction());
final JComponent toolbarComponent = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, true).getComponent();
toolbarComponent.setBorder(null);
panel.add(toolbarComponent, BorderLayout.NORTH);
final Runnable runnable = new Runnable() {
@Override
public void run() {
enableButtons();
}
};
myView.onSelectionChange(runnable);
final JComponent component = myView.getComponent();
final JScrollPane jScrollPane = ScrollPaneFactory.createScrollPane(component);
//noinspection HardCodedStringLiteral
int prototypeWidth = component.getFontMetrics(component.getFont()).stringWidth("X:\\1234567890\\1234567890\\com\\company\\system\\subsystem");
jScrollPane.setPreferredSize(new Dimension(Math.max(300, prototypeWidth),300));
installEnterAction(component);
panel.add(jScrollPane, BorderLayout.CENTER);
myTabbedPaneWrapper.addTab("Directory Structure", panel);
myChooseByNamePanel.invoke(new ChooseByNamePopupComponent.Callback() {
@Override
public void elementChosen(Object element) {
setSelection(element);
}
}, ModalityState.stateForComponent(getRootPane()), false);
myTabbedPaneWrapper.addTab("Choose By Neighbor Class", myChooseByNamePanel.getPanel());
return myTabbedPaneWrapper.getComponent();
}
示例11: initChunksPanel
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
private void initChunksPanel() {
List<Chunk<Module>> chunks = getCycleChunks();
if (chunks.isEmpty()) {
return;
}
myChunksPanel.setLayout(new BorderLayout());
myChunksPanel.setBorder(
IdeBorderFactory.createTitledBorder(CompilerBundle.message("generate.ant.build.dialog.cyclic.modules.table.title"),
true));
JLabel textLabel = new JLabel(CompilerBundle.message("generate.ant.build.dialog.cyclic.modules.table.description"));
textLabel.setUI(new MultiLineLabelUI());
textLabel.setBorder(IdeBorderFactory.createEmptyBorder(4, 4, 6, 4));
myChunksPanel.add(textLabel, BorderLayout.NORTH);
myTableModel = new MyTableModel(chunks);
myTable = new Table(myTableModel);
final MyTableCellRenderer cellRenderer = new MyTableCellRenderer();
final TableColumn nameColumn = myTable.getColumnModel().getColumn(MyTableModel.NAME_COLUMN);
nameColumn.setCellEditor(ComboBoxTableCellEditor.INSTANCE);
nameColumn.setCellRenderer(cellRenderer);
final TableColumn labelColumn = myTable.getColumnModel().getColumn(MyTableModel.NUMBER_COLUMN);
labelColumn.setCellRenderer(cellRenderer);
final Dimension preferredSize = new Dimension(myTable.getPreferredSize());
preferredSize.height = (myTableModel.getRowCount() + 2) * myTable.getRowHeight() + myTable.getTableHeader().getHeight();
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
scrollPane.setPreferredSize(preferredSize);
myChunksPanel.add(scrollPane, BorderLayout.CENTER);
}
示例12: doCreateCenterPanel
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
protected JComponent doCreateCenterPanel() {
JPanel panel = new JPanel(new BorderLayout(15, 0));
if (myIcon != null) {
JLabel iconLabel = new JLabel(myIcon);
Container container = new Container();
container.setLayout(new BorderLayout());
container.add(iconLabel, BorderLayout.NORTH);
panel.add(container, BorderLayout.WEST);
}
if (myMessage != null) {
final JTextPane messageComponent = createMessageComponent(myMessage);
final Dimension screenSize = messageComponent.getToolkit().getScreenSize();
final Dimension textSize = messageComponent.getPreferredSize();
if (myMessage.length() > 100) {
final JScrollPane pane = ScrollPaneFactory.createScrollPane(messageComponent);
pane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
final int scrollSize = (int)new JScrollBar(Adjustable.VERTICAL).getPreferredSize().getWidth();
final Dimension preferredSize =
new Dimension(Math.min(textSize.width, screenSize.width / 2) + scrollSize,
Math.min(textSize.height, screenSize.height / 3) + scrollSize);
pane.setPreferredSize(preferredSize);
panel.add(pane, BorderLayout.CENTER);
}
else {
panel.add(messageComponent, BorderLayout.CENTER);
}
}
return panel;
}
示例13: show
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
public static void show(final ExecutionException e, final String title, final Project project) {
if (e instanceof RunCanceledByUserException) {
return;
}
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new RuntimeException(e.getLocalizedMessage());
}
final String message = e.getMessage();
if (message == null || message.length() < 100) {
Messages.showErrorDialog(project, message == null ? "exception was thrown" : message, title);
return;
}
final DialogBuilder builder = new DialogBuilder(project);
builder.setTitle(title);
final JTextArea textArea = new JTextArea();
textArea.setEditable(false);
textArea.setForeground(UIUtil.getLabelForeground());
textArea.setBackground(UIUtil.getLabelBackground());
textArea.setFont(UIUtil.getLabelFont());
textArea.setText(message);
textArea.setWrapStyleWord(false);
textArea.setLineWrap(true);
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(textArea);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
final JPanel panel = new JPanel(new BorderLayout(10, 0));
panel.setPreferredSize(JBUI.size(500, 200));
panel.add(scrollPane, BorderLayout.CENTER);
panel.add(new JLabel(Messages.getErrorIcon()), BorderLayout.WEST);
builder.setCenterPanel(panel);
builder.setButtonsAlignment(SwingConstants.CENTER);
builder.addOkAction();
builder.show();
}
示例14: DesignerToolWindow
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
public DesignerToolWindow(Project project) {
myComponentTree = new ComponentTree(project);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myComponentTree);
scrollPane.setBorder(IdeBorderFactory.createBorder(SideBorder.BOTTOM));
scrollPane.setPreferredSize(new Dimension(250, -1));
myComponentTree.initQuickFixManager(scrollPane.getViewport());
myPropertyInspector = new PropertyInspector(project, myComponentTree);
myToolWindowPanel.setFirstComponent(scrollPane);
myToolWindowPanel.setSecondComponent(myPropertyInspector);
}
示例15: createTable
import com.intellij.ui.ScrollPaneFactory; //导入方法依赖的package包/类
@Override
protected JScrollPane createTable() {
AvailablePluginsTableModel model = new AvailablePluginsTableModel();
model.setVendor(myVendorFilter);
if (PluginManagerUISettings.getInstance().availableSortByStatus) {
model.setSortByStatus(true);
}
pluginsModel = model;
pluginTable = new PluginTable(pluginsModel);
return ScrollPaneFactory.createScrollPane(pluginTable);
}