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


Java JBScrollPane.setViewportView方法代码示例

本文整理汇总了Java中com.intellij.ui.components.JBScrollPane.setViewportView方法的典型用法代码示例。如果您正苦于以下问题:Java JBScrollPane.setViewportView方法的具体用法?Java JBScrollPane.setViewportView怎么用?Java JBScrollPane.setViewportView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.components.JBScrollPane的用法示例。


在下文中一共展示了JBScrollPane.setViewportView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    myContentPanel = new JPanel();
    myContentPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1));
    myContentPanel.add(panel1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    myAcceptYoursButton = new JButton();
    myAcceptYoursButton.setEnabled(false);
    myAcceptYoursButton.setText("Accept Yours");
    myAcceptYoursButton.setMnemonic('Y');
    myAcceptYoursButton.setDisplayedMnemonicIndex(7);
    panel1.add(myAcceptYoursButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    panel1.add(spacer1, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    myAcceptTheirsButton = new JButton();
    myAcceptTheirsButton.setEnabled(false);
    myAcceptTheirsButton.setText("Accept Theirs");
    myAcceptTheirsButton.setMnemonic('T');
    myAcceptTheirsButton.setDisplayedMnemonicIndex(7);
    panel1.add(myAcceptTheirsButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    myMergeButton = new JButton();
    myMergeButton.setEnabled(false);
    myMergeButton.setText("Merge");
    myMergeButton.setMnemonic('M');
    myMergeButton.setDisplayedMnemonicIndex(0);
    panel1.add(myMergeButton, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JBScrollPane jBScrollPane1 = new JBScrollPane();
    myContentPanel.add(jBScrollPane1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    myItemsTable = new JBTable();
    myItemsTable.putClientProperty("Table.isFileList", Boolean.FALSE);
    jBScrollPane1.setViewportView(myItemsTable);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:40,代码来源:ResolveConflictsForm.java

示例2: JPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
    final JBScrollPane jBScrollPane1 = new JBScrollPane();
    contentPane.add(jBScrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    tree = new Tree();
    jBScrollPane1.setViewportView(tree);
    pathField = new JTextField();
    pathField.setEditable(false);
    contentPane.add(pathField, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    messagePanel = new JPanel();
    messagePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(messagePanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    messagePanel.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(11, 10), null, 0, false));
    messageLabel = new JLabel();
    messageLabel.setText("Label");
    messagePanel.add(messageLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:27,代码来源:TfsTreeForm.java

示例3: createUIComponents

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
private void createUIComponents() {
    // TODO: place custom component creation code here
    rootPanel = new JPanel();
    sqlPanel = new JPanel();
    sqlPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    // 设置 sql text editor
    Document document = EditorFactory.getInstance().createDocument("");
    sqlTextArea = EditorFactory.getInstance().createEditor(document, ideaContext.getProject(), SqlFileType.INSTANCE, false);

    sqlScrollPane = new JBScrollPane();
    sqlScrollPane.setViewportView(sqlTextArea.getComponent());
}
 
开发者ID:hykes,项目名称:CodeGen,代码行数:13,代码来源:SqlEditorPanel.java

示例4: createUIComponents

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
private void createUIComponents() {
    contexts = new JBTable(new ModuleTableModel());
    contexts.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
    contexts.setDefaultRenderer(String.class, new ModuleCellRenderer());
    contexts.getColumnModel().getColumn(0).setPreferredWidth(25);
    tableScrollPane = new JBScrollPane();
    tableScrollPane.setViewportView(contexts);
    tableScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    tableScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    tableScrollPane.setPreferredSize(new Dimension(400, 100));
    tableScrollPane.setSize(new Dimension(400, 100));
}
 
开发者ID:vitorzachi,项目名称:tomcat-runner,代码行数:13,代码来源:TomcatRunnerConfPanel.java

示例5: createCourseSpecificTab

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public void createCourseSpecificTab(
        ObjectFinder finder,
        ProjectOpener opener,
        String course,
        JTabbedPane tabbedPaneBase,
        CourseAndExerciseManager courseAndExerciseManager) {
    logger.info("Creating course specific tab. @CourseTabFactory");
    final JBScrollPane panel = new JBScrollPane();
    final JBList list = new JBList();
    list.setCellRenderer(new ProjectListRenderer());

    DefaultListModel defaultListModel = new DefaultListModel();
    panel.setBorder(BorderFactory.createTitledBorder(""));

    ProjectListManagerHolder.get()
            .addExercisesToList(finder, course, defaultListModel, courseAndExerciseManager);

    if (defaultListModel.getSize() <= 0) {
        return;
    }

    list.setName(course);
    list.setModel(defaultListModel);

    MouseListener mouseListener = createMouseListenerForWindow(opener, panel, list);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.addMouseListener(mouseListener);

    panel.setName(course);
    panel.setViewportView(list);

    ProjectListManagerHolder.get().addList(list);
    tabbedPaneBase.addTab(course, panel);
    tabbedPaneBase.addMouseListener(tabMouseListener(tabbedPaneBase));
    setScrollBarToBottom(course, tabbedPaneBase, panel);
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:37,代码来源:CourseTabFactory.java

示例6: ArrangementRuleAliasesPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public ArrangementRuleAliasesPanel(@NotNull ArrangementStandardSettingsManager settingsManager,
                                   @NotNull ArrangementColorsProvider colorsProvider) {
  super(new GridBagLayout());
  setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementMatchingRulesControl.RepresentationCallback callback = new ArrangementMatchingRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@NotNull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = new ArrangementRuleAliasControl(settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
    myControl, ArrangementConstants.ALIAS_RULE_CONTEXT_MENU, ArrangementConstants.ALIAS_RULE_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
    ApplicationBundle.message("arrangement.settings.section.rule.sequence"),
    ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR,
    ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR_PLACE,
    myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:ArrangementRuleAliasesPanel.java

示例7: AtomController

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public AtomController(@NotNull Project project, @NotNull JBScrollPane scrollPane) {
  scrollPane.getHorizontalScrollBar().setUnitIncrement(20);
  scrollPane.getVerticalScrollBar().setUnitIncrement(20);
  myTree = new SimpleTree();
  myTree.setRowHeight(TreeUtil.TREE_ROW_HEIGHT);
  myTree.setRootVisible(false);
  myTree.setLineStyleAngled();
  myTree.getEmptyText().setText(SELECT_CAPTURE);
  myLoadingPanel = new JBLoadingPanel(new BorderLayout(), project);
  myLoadingPanel.add(myTree);
  scrollPane.setViewportView(myLoadingPanel);
  myAtomTreeRenderer = new AtomTreeRenderer();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:AtomController.java

示例8: StateController

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public StateController(@NotNull GfxTraceEditor editor, @NotNull JBScrollPane scrollPane) {
  myEditor = editor;
  myTree = new SimpleTree();
  myTree.setRowHeight(TreeUtil.TREE_ROW_HEIGHT);
  myTree.setRootVisible(false);
  myTree.setCellRenderer(new StateTreeRenderer());
  myTree.getEmptyText().setText(SELECT_CAPTURE);
  myLoadingPanel = new JBLoadingPanel(new BorderLayout(), editor.getProject());
  myLoadingPanel.add(myTree);
  scrollPane.setViewportView(myLoadingPanel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:StateController.java

示例9: JPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new BorderLayout(0, 0));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(panel1, BorderLayout.SOUTH);
    panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.LockBox")));
    lockCheckInRadioButton = new JRadioButton();
    this.$$$loadButtonText$$$(lockCheckInRadioButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.CheckinRadio"));
    panel1.add(lockCheckInRadioButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    lockCheckOutRadioButton = new JRadioButton();
    this.$$$loadButtonText$$$(lockCheckOutRadioButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.CheckoutRadio"));
    panel1.add(lockCheckOutRadioButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    recursiveCheckBox = new JCheckBox();
    recursiveCheckBox.setSelected(true);
    this.$$$loadButtonText$$$(recursiveCheckBox, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.RecursiveCheck"));
    panel1.add(recursiveCheckBox, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new BorderLayout(0, 0));
    contentPane.add(panel2, BorderLayout.CENTER);
    panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("LockDialog.ItemsBox")));
    final JBScrollPane jBScrollPane1 = new JBScrollPane();
    panel2.add(jBScrollPane1, BorderLayout.CENTER);
    lockItemsTable = new JBTable();
    lockItemsTable.setEnabled(true);
    lockItemsTable.setPreferredScrollableViewportSize(new Dimension(500, 200));
    jBScrollPane1.setViewportView(lockItemsTable);
    ButtonGroup buttonGroup;
    buttonGroup = new ButtonGroup();
    buttonGroup.add(lockCheckInRadioButton);
    buttonGroup.add(lockCheckOutRadioButton);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:40,代码来源:LockItemsForm.java

示例10: createUIComponents

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    createUIComponents();
    contentPane = new JPanel();
    contentPane.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
    final JBScrollPane jBScrollPane1 = new JBScrollPane();
    contentPane.add(jBScrollPane1, new GridConstraints(0, 0, 3, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    jBScrollPane1.setViewportView(treeTable);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(panel1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Accounts.Panel.Title")));
    reloadWorkspacesButton = new JButton();
    this.$$$loadButtonText$$$(reloadWorkspacesButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Reload.Button"));
    panel1.add(reloadWorkspacesButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    proxySettingsButton = new JButton();
    this.$$$loadButtonText$$$(proxySettingsButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Proxy.Button"));
    panel1.add(proxySettingsButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    workspacesPanel = new JPanel();
    workspacesPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(workspacesPanel, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    workspacesPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Workspaces.Panel.Title")));
    editWorkspaceButton = new JButton();
    this.$$$loadButtonText$$$(editWorkspaceButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Edit.Button"));
    workspacesPanel.add(editWorkspaceButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    deleteWorkspaceButton = new JButton();
    this.$$$loadButtonText$$$(deleteWorkspaceButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("Tfvc.ManageWorkspaces.Delete.Button"));
    workspacesPanel.add(deleteWorkspaceButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    contentPane.add(spacer1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:38,代码来源:ManageWorkspacesForm.java

示例11: ArrangementRuleAliasesPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public ArrangementRuleAliasesPanel(@Nonnull ArrangementStandardSettingsManager settingsManager,
                                   @Nonnull ArrangementColorsProvider colorsProvider) {
  super(new GridBagLayout());
  setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementMatchingRulesControl.RepresentationCallback callback = new ArrangementMatchingRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@Nonnull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = new ArrangementRuleAliasControl(settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
          myControl, ArrangementConstants.ALIAS_RULE_CONTEXT_MENU, ArrangementConstants.ALIAS_RULE_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
          ApplicationBundle.message("arrangement.settings.section.rule.sequence"),
          ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR,
          ArrangementConstants.ALIAS_RULE_CONTROL_TOOLBAR_PLACE,
          myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:41,代码来源:ArrangementRuleAliasesPanel.java

示例12: initComponents

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT
 * modify this code. The content of this method is always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
private void initComponents() {
    logger.info("Initializing components for TextQuestionPanel " + "@TextQuestionPanel");

    questionLabel = new javax.swing.JLabel();
    //textAreaScrollPane = new javax.swing.JScrollPane();
    textAreaScrollPane = new JBScrollPane();
    answerTextArea = new javax.swing.JTextArea();

    //questionLabel.setText(org.openide.util.NbBundle.getMessage(TextQuestionPanel.class, "TextQuestionPanel.questionLabel.text")); // NOI18N
    questionLabel.setText("Teting testing TextQuestionPanle"); // NOI18N

    answerTextArea.setColumns(20);
    answerTextArea.setLineWrap(true);
    answerTextArea.setRows(5);
    answerTextArea.setWrapStyleWord(true);
    textAreaScrollPane.setViewportView(answerTextArea);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(
                            layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                            layout.createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                    .addComponent(
                                                            textAreaScrollPane,
                                                            javax.swing.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                            362,
                                                            Short.MAX_VALUE)
                                                    .addComponent(questionLabel))
                                    .addContainerGap()));
    layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(
                            layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(questionLabel)
                                    .addPreferredGap(
                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                            textAreaScrollPane,
                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                            82,
                                            Short.MAX_VALUE)
                                    .addContainerGap()));
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:57,代码来源:TextQuestionPanel.java

示例13: DetailsPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
DetailsPanel(@NotNull VcsLogDataHolder logDataHolder,
             @NotNull VcsLogGraphTable graphTable,
             @NotNull VcsLogColorManager colorManager,
             @NotNull VisiblePack initialDataPack) {
  myLogDataHolder = logDataHolder;
  myGraphTable = graphTable;
  myColorManager = colorManager;
  myDataPack = initialDataPack;

  myReferencesPanel = new ReferencesPanel(myColorManager);
  myCommitDetailsPanel = new DataPanel(logDataHolder.getProject(), logDataHolder.isMultiRoot(), logDataHolder);

  myScrollPane = new JBScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
  myMainContentPanel = new JPanel(new MigLayout("flowy, ins 0, hidemode 3, gapy 0")) {
    @Override
    public Dimension getPreferredSize() {
      Dimension size = super.getPreferredSize();
      size.width = myScrollPane.getViewport().getWidth() - 5;
      return size;
    }
  };
  myMainContentPanel.setOpaque(false);
  myScrollPane.setOpaque(false);
  myScrollPane.getViewport().setOpaque(false);
  myScrollPane.setViewportView(myMainContentPanel);
  myMainContentPanel.add(myReferencesPanel, "");
  myMainContentPanel.add(myCommitDetailsPanel, "");

  myLoadingPanel = new JBLoadingPanel(new BorderLayout(), logDataHolder, ProgressWindow.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS) {
    @Override
    public Color getBackground() {
      return getDetailsBackground();
    }
  };
  myLoadingPanel.add(myScrollPane);

  myMessagePanel = new MessagePanel();

  setLayout(new CardLayout());
  add(myLoadingPanel, STANDARD_LAYER);
  add(myMessagePanel, MESSAGE_LAYER);

  showMessage("No commits selected");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:DetailsPanel.java

示例14: ArrangementMatchingRulesPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
public ArrangementMatchingRulesPanel(@NotNull Language language,
                                     @NotNull ArrangementStandardSettingsManager settingsManager,
                                     @NotNull ArrangementColorsProvider colorsProvider)
{
  super(new GridBagLayout());
  
  JBScrollPane scrollPane = new JBScrollPane();
  final JViewport viewport = scrollPane.getViewport();
  ArrangementSectionRulesControl.RepresentationCallback callback = new ArrangementSectionRulesControl.RepresentationCallback() {
    @Override
    public void ensureVisible(@NotNull Rectangle r) {
      Rectangle visibleRect = viewport.getViewRect();
      if (r.y <= visibleRect.y) {
        return;
      }

      int excessiveHeight = r.y + r.height - (visibleRect.y + visibleRect.height);
      if (excessiveHeight <= 0) {
        return;
      }

      int verticalShift = Math.min(r.y - visibleRect.y, excessiveHeight);
      if (verticalShift > 0) {
        viewport.setViewPosition(new Point(visibleRect.x, visibleRect.y + verticalShift));
      }
    }
  };
  myControl = createRulesControl(language, settingsManager, colorsProvider, callback);
  scrollPane.setViewportView(myControl);
  CustomizationUtil.installPopupHandler(
    myControl, ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTEXT_MENU, ArrangementConstants.MATCHING_RULES_CONTROL_PLACE
  );

  TitleWithToolbar top = new TitleWithToolbar(
    ApplicationBundle.message("arrangement.settings.section.match"),
    ArrangementConstants.ACTION_GROUP_MATCHING_RULES_CONTROL_TOOLBAR,
    ArrangementConstants.MATCHING_RULES_CONTROL_TOOLBAR_PLACE,
    myControl
  );
  add(top, new GridBag().coverLine().fillCellHorizontally().weightx(1));
  add(scrollPane, new GridBag().fillCell().weightx(1).weighty(1).insets(0, ArrangementConstants.HORIZONTAL_PADDING, 0, 0));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:ArrangementMatchingRulesPanel.java

示例15: JPanel

import com.intellij.ui.components.JBScrollPane; //导入方法依赖的package包/类
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new GridLayoutManager(8, 1, new Insets(0, 0, 0, 0), -1, -1));
    final JLabel label1 = new JLabel();
    this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.NameLabel"));
    contentPane.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    nameText = new JTextField();
    contentPane.add(nameText, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));
    final JLabel label2 = new JLabel();
    this.$$$loadLabelText$$$(label2, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.CommentLabel"));
    contentPane.add(label2, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JLabel label3 = new JLabel();
    this.$$$loadLabelText$$$(label3, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.ItemsLabel"));
    contentPane.add(label3, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
    contentPane.add(panel1, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    addButton = new JButton();
    this.$$$loadButtonText$$$(addButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.AddButton"));
    panel1.add(addButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    panel1.add(spacer1, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
    removeButton = new JButton();
    removeButton.setEnabled(false);
    this.$$$loadButtonText$$$(removeButton, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.RemoveButton"));
    panel1.add(removeButton, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JBScrollPane jBScrollPane1 = new JBScrollPane();
    contentPane.add(jBScrollPane1, new GridConstraints(6, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(-1, 250), null, 0, false));
    itemsTable = new JBTable();
    jBScrollPane1.setViewportView(itemsTable);
    final JBScrollPane jBScrollPane2 = new JBScrollPane();
    contentPane.add(jBScrollPane2, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    commentTextArea = new JTextArea();
    commentTextArea.setRows(4);
    jBScrollPane2.setViewportView(commentTextArea);
    recursiveCheckBox = new JCheckBox();
    recursiveCheckBox.setSelected(true);
    this.$$$loadButtonText$$$(recursiveCheckBox, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("ApplyLabelDialog.RecursiveCheckBox"));
    contentPane.add(recursiveCheckBox, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    label1.setLabelFor(nameText);
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:49,代码来源:ApplyLabelForm.java


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