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


Java JBScrollPane类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:andreyfomenkov,项目名称:green-cat,代码行数:19,代码来源:TelemetryToolWindow.java

示例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;
}
 
开发者ID:syuchan1005,项目名称:EmojiPrefix,代码行数:27,代码来源:EmojiCheckinHandler.java

示例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;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:25,代码来源:StudySwingToolWindow.java

示例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());

}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:27,代码来源:CourseTabFactory.java

示例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();
    }
}
 
开发者ID:hajdam,项目名称:deltahex-intellij-plugin,代码行数:17,代码来源:DeltaHexFileEditor.java

示例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();
}
 
开发者ID:maddouri,项目名称:IntelliJ-OnlineSearch,代码行数:26,代码来源:SettingsConfigurable.java

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

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

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

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

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

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

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

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

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


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