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


Java ScrollPaneFactory类代码示例

本文整理汇总了Java中com.intellij.ui.ScrollPaneFactory的典型用法代码示例。如果您正苦于以下问题:Java ScrollPaneFactory类的具体用法?Java ScrollPaneFactory怎么用?Java ScrollPaneFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ScrollPaneFactory类属于com.intellij.ui包,在下文中一共展示了ScrollPaneFactory类的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();
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:19,代码来源:PackagesNotificationPanel.java

示例2: createCenterPanel

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
  final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP));
  myList = new JBList(myNamedElements);
  myList.setCellRenderer(new FQNameCellRenderer());
  panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER);

  panel.add(new JBLabel(myContainsClassesOnly ?
                        CodeInsightBundle.message("dialog.paste.on.import.text") :
                        CodeInsightBundle.message("dialog.paste.on.import.text2"), SMALL, BRIGHTER), BorderLayout.NORTH);

  final JPanel buttonPanel = new JPanel(new VerticalFlowLayout());
  final JButton okButton = new JButton(CommonBundle.getOkButtonText());
  getRootPane().setDefaultButton(okButton);
  buttonPanel.add(okButton);
  final JButton cancelButton = new JButton(CommonBundle.getCancelButtonText());
  buttonPanel.add(cancelButton);

  panel.setPreferredSize(JBUI.size(500, 400));

  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:RestoreReferencesDialog.java

示例3: createCenterPanel

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
@Nullable
@Override
protected JComponent createCenterPanel() {
  final List<MemberInfo> info = TestIntegrationUtils.extractClassMethods(mySourceClass, false);

  disableMethodsWithTests(info);

  final JPanel panel = new JPanel(new BorderLayout());
  myTable = new MemberSelectionTable(info, null);
  panel.add(ScrollPaneFactory.createScrollPane(myTable), BorderLayout.CENTER);
  panel.add(myIncludeInheritedCb, BorderLayout.NORTH);
  myIncludeInheritedCb.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      updateMethodsTable();
    }
  });
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MissedTestsDialog.java

示例4: 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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:MoveInstanceMethodDialogBase.java

示例5: createCenterPanel

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
protected JComponent createCenterPanel() {
  JPanel panel = new JPanel(new BorderLayout());
  final JEditorPane messagePane = new JEditorPane(UIUtil.HTML_MIME, "");
  messagePane.setEditable(false);
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane);
  scrollPane.setPreferredSize(JBUI.size(500, 400));
  panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);
  panel.add(scrollPane, BorderLayout.CENTER);

  @NonNls StringBuffer buf = new StringBuffer();
  for (String description : myConflictDescriptions) {
    buf.append(description);
    buf.append("<br><br>");
  }
  messagePane.setText(buf.toString());
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FailedConversionsDialog.java

示例6: DetectedRootsChooser

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
public DetectedRootsChooser() {
  myModel = new ListTableModel<DetectedRootData>();
  myTable = new TableView<DetectedRootData>(myModel);
  myTable.setTableHeader(null);
  myTable.setShowGrid(false);
  myComponent = ScrollPaneFactory.createScrollPane(myTable);
  myTable.registerKeyboardAction(
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        invertSelectedRows();
      }
    },
    KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0),
    JComponent.WHEN_FOCUSED
  );
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:DetectedRootsChooser.java

示例7: 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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AgreementDialog.java

示例8: createComments

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
private JComponent createComments(final JComponent addComp) {
  final Splitter splitter = new Splitter(false);
  final JLabel label = new JLabel("Commit Message:") {
    @Override
    public Dimension getPreferredSize() {
      return new Dimension(getWidth(), 21);
    }
  };

  JPanel panel = new JPanel(new BorderLayout(4, 4));
  panel.add(label, BorderLayout.NORTH);
  panel.add(ScrollPaneFactory.createScrollPane(myComments), BorderLayout.CENTER);

  myComments.setRows(5);
  myComments.setEditable(false);
  myComments.setLineWrap(true);

  splitter.setFirstComponent(panel);
  splitter.setSecondComponent(addComp);
  return splitter;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:VcsHistoryDialog.java

示例9: Browser

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
public Browser(@NotNull InspectionResultsView view) {
  super(new BorderLayout());
  myView = view;

  myCurrentEntity = null;
  myCurrentDescriptor = null;

  myHTMLViewer = new JEditorPane(UIUtil.HTML_MIME, InspectionsBundle.message("inspection.offline.view.empty.browser.text"));
  myHTMLViewer.setEditable(false);
  myHyperLinkListener = new HyperlinkListener() {
    @Override
    public void hyperlinkUpdate(HyperlinkEvent e) {
      Browser.this.hyperlinkUpdate(e);
    }
  };
  myHTMLViewer.addHyperlinkListener(myHyperLinkListener);

  final JScrollPane pane = ScrollPaneFactory.createScrollPane(myHTMLViewer);
  pane.setBorder(null);
  add(pane, BorderLayout.CENTER);
  setupStyle();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:Browser.java

示例10: 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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:TabbedLanguageCodeStylePanel.java

示例11: ContentEntryTreeEditor

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
public ContentEntryTreeEditor(Project project, List<ModuleSourceRootEditHandler<?>> editHandlers) {
  myProject = project;
  myEditHandlers = editHandlers;
  myTree = new Tree();
  myTree.setRootVisible(true);
  myTree.setShowsRootHandles(true);

  myEditingActionsGroup = new DefaultActionGroup();

  TreeUtil.installActions(myTree);
  new TreeSpeedSearch(myTree);

  myTreePanel = new MyPanel(new BorderLayout());
  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);
  myTreePanel.add(scrollPane, BorderLayout.CENTER);

  myTreePanel.setVisible(false);
  myDescriptor = FileChooserDescriptorFactory.createMultipleFoldersDescriptor();
  myDescriptor.setShowFileSystemRoots(false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ContentEntryTreeEditor.java

示例12: DisposerTree

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
private DisposerTree(Disposable parent) {
  myModificationToFilter = -1;

  final DisposerStructure structure = new DisposerStructure(this);
  final DefaultTreeModel model = new DefaultTreeModel(new DefaultMutableTreeNode());
  final Tree tree = new Tree(model);
  tree.setRootVisible(false);
  tree.setShowsRootHandles(true);
  tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  myTreeBuilder = new FilteringTreeBuilder(tree, DisposerTree.this, structure, AlphaComparator.INSTANCE) {
    @Override
    public boolean isAutoExpandNode(NodeDescriptor nodeDescriptor) {
      return structure.getRootElement() == getOriginalNode(nodeDescriptor);
    }
  };
  myTreeBuilder.setFilteringMerge(200, MergingUpdateQueue.ANY_COMPONENT);
  Disposer.register(this, myTreeBuilder);
  myTree = tree;

  setLayout(new BorderLayout());
  add(ScrollPaneFactory.createScrollPane(myTree), BorderLayout.CENTER);

  Disposer.getTree().addListener(this);

  Disposer.register(parent, this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DisposerDebugger.java

示例13: PalettePanel

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
public PalettePanel() {
  super(new GridLayout(1, 1));

  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myPaletteContainer);
  scrollPane.setBorder(null);
  add(scrollPane);

  new AnAction() {
    @Override
    public void actionPerformed(AnActionEvent e) {
      clearActiveItem();
    }
  }.registerCustomShortcutSet(CommonShortcuts.ESCAPE, scrollPane);

  if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
    DragSource.getDefaultDragSource().addDragSourceListener(myDragSourceListener);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PalettePanel.java

示例14: 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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ChooseModulesDialog.java

示例15: createCenterPanel

import com.intellij.ui.ScrollPaneFactory; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
  JPanel panel = new JPanel(new BorderLayout());
  myMessagePane = new JEditorPane(UIUtil.HTML_MIME, "");
  myMessagePane.setEditable(false);
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myMessagePane);
  scrollPane.setPreferredSize(JBUI.size(500, 400));
  panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);
  panel.add(scrollPane, BorderLayout.CENTER);

  @NonNls StringBuffer buf = new StringBuffer();
  for (String description : myConflictDescriptions) {
    buf.append(description);
    buf.append("<br><br>");
  }
  myMessagePane.setText(buf.toString());
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UnsafeUsagesDialog.java


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