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


Java VerticalStackLayout类代码示例

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


VerticalStackLayout类属于com.intellij.openapi.roots.ui.componentsList.layout包,在下文中一共展示了VerticalStackLayout类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createComponentImpl

import com.intellij.openapi.roots.ui.componentsList.layout.VerticalStackLayout; //导入依赖的package包/类
@Override
public JPanel createComponentImpl() {
  final Module module = getModule();
  final Project project = module.getProject();

  myContentEntryEditorListener = new MyContentEntryEditorListener();

  final JPanel mainPanel = new JPanel(new BorderLayout());
  if (!Registry.is("ide.new.project.settings")) {
    mainPanel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
  }

  addAdditionalSettingsToPanel(mainPanel);

  final JPanel entriesPanel = new JPanel(new BorderLayout());

  final DefaultActionGroup group = new DefaultActionGroup();
  final AddContentEntryAction action = new AddContentEntryAction();
  action.registerCustomShortcutSet(KeyEvent.VK_C, InputEvent.ALT_DOWN_MASK, mainPanel);
  group.add(action);

  myEditorsPanel = new ScrollablePanel(new VerticalStackLayout());
  myEditorsPanel.setBackground(BACKGROUND_COLOR);
  JScrollPane myScrollPane = ScrollPaneFactory.createScrollPane(myEditorsPanel, Registry.is("ide.new.project.settings"));
  final ToolbarPanel toolbarPanel = new ToolbarPanel(myScrollPane, group);
  if (Registry.is("ide.new.project.settings")) {
    toolbarPanel.setBorder(new CustomLineBorder(1,0,0,0));
  }
  entriesPanel.add(toolbarPanel, BorderLayout.CENTER);

  final JBSplitter splitter = Registry.is("ide.new.project.settings") ? new OnePixelSplitter(false) : new JBSplitter(false);
  splitter.setProportion(0.6f);
  splitter.setHonorComponentsMinimumSize(true);

  myRootTreeEditor = createContentEntryTreeEditor(project);
  final JComponent component = myRootTreeEditor.createComponent();
  if (Registry.is("ide.new.project.settings")) {
    component.setBorder(new CustomLineBorder(1,0,0,0));
  }

  splitter.setFirstComponent(component);
  splitter.setSecondComponent(entriesPanel);
  JPanel contentPanel = new JPanel(new GridBagLayout());
  if (!Registry.is("ide.new.project.settings")) {
    contentPanel.setBorder(BorderFactory.createEtchedBorder());
  }
  final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, myRootTreeEditor.getEditingActionsGroup(), true);
  contentPanel.add(new JLabel("Mark as:"),
                   new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, 0, new Insets(0, 10, 0, 10), 0, 0));
  contentPanel.add(actionToolbar.getComponent(),
                   new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                                          new Insets(0, 0, 0, 0), 0, 0));
  contentPanel.add(splitter,
                   new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
                                          new Insets(0, 0, 0, 0), 0, 0));

  mainPanel.add(contentPanel, BorderLayout.CENTER);


  final JPanel innerPanel = createBottomControl(module);
  if (innerPanel != null) {
    mainPanel.add(innerPanel, BorderLayout.SOUTH);
  }

  final ModifiableRootModel model = getModel();
  if (model != null) {
    final ContentEntry[] contentEntries = model.getContentEntries();
    if (contentEntries.length > 0) {
      for (final ContentEntry contentEntry : contentEntries) {
        addContentEntryPanel(contentEntry.getUrl());
      }
      selectContentEntry(contentEntries[0].getUrl());
    }
  }

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

示例2: createComponentImpl

import com.intellij.openapi.roots.ui.componentsList.layout.VerticalStackLayout; //导入依赖的package包/类
@Override
public JPanel createComponentImpl() {
  final Module module = getModule();
  final Project project = module.getProject();

  myContentEntryEditorListener = new MyContentEntryEditorListener();

  final JPanel mainPanel = new JPanel(new BorderLayout());
  mainPanel.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));

  addAdditionalSettingsToPanel(mainPanel);

  final JPanel entriesPanel = new JPanel(new BorderLayout());

  final DefaultActionGroup group = new DefaultActionGroup();
  final AddContentEntryAction action = new AddContentEntryAction();
  action.registerCustomShortcutSet(KeyEvent.VK_C, InputEvent.ALT_DOWN_MASK, mainPanel);
  group.add(action);

  myEditorsPanel = new ScrollablePanel(new VerticalStackLayout());
  myEditorsPanel.setBackground(BACKGROUND_COLOR);
  JScrollPane myScrollPane = ScrollPaneFactory.createScrollPane(myEditorsPanel);
  entriesPanel.add(new ToolbarPanel(myScrollPane, group), BorderLayout.CENTER);

  final Splitter splitter = new Splitter(false);
  splitter.setHonorComponentsMinimumSize(true);
  mainPanel.add(splitter, BorderLayout.CENTER);

  final JPanel editorsPanel = new JPanel(new GridBagLayout());
  splitter.setFirstComponent(editorsPanel);
  editorsPanel.add(entriesPanel,
                   new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));

  myRootTreeEditor = createContentEntryTreeEditor(project);
  final JComponent treeEditorComponent = myRootTreeEditor.createComponent();
  splitter.setSecondComponent(treeEditorComponent);

  final JPanel innerPanel = createBottomControl(module);
  if (innerPanel != null) {
    mainPanel.add(innerPanel, BorderLayout.SOUTH);
  }

  final ModifiableRootModel model = getModel();
  if (model != null) {
    final ContentEntry[] contentEntries = model.getContentEntries();
    if (contentEntries.length > 0) {
      for (final ContentEntry contentEntry : contentEntries) {
        addContentEntryPanel(contentEntry.getUrl());
      }
      selectContentEntry(contentEntries[0].getUrl());
    }
  }

  return mainPanel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:56,代码来源:CommonContentEntriesEditor.java

示例3: createComponentImpl

import com.intellij.openapi.roots.ui.componentsList.layout.VerticalStackLayout; //导入依赖的package包/类
@Nonnull
@Override
public JPanel createComponentImpl() {
  final Module module = getModule();
  final Project project = module.getProject();

  myContentEntryEditorListener = new MyContentEntryEditorListener();

  final JPanel mainPanel = new JPanel(new BorderLayout());

  final JPanel entriesPanel = new JPanel(new BorderLayout());

  final DefaultActionGroup group = new DefaultActionGroup();
  final AddContentEntryAction action = new AddContentEntryAction();
  action.registerCustomShortcutSet(KeyEvent.VK_C, InputEvent.ALT_DOWN_MASK, mainPanel);
  group.add(action);

  myEditorsPanel = new ScrollablePanel(new VerticalStackLayout());
  myEditorsPanel.setBackground(BACKGROUND_COLOR);
  JScrollPane myScrollPane = ScrollPaneFactory.createScrollPane(myEditorsPanel, true);
  entriesPanel.add(new ToolbarPanel(myScrollPane, group), BorderLayout.CENTER);

  final JBSplitter splitter = new OnePixelSplitter(false);
  splitter.setProportion(0.6f);
  splitter.setHonorComponentsMinimumSize(true);

  myRootTreeEditor = new ContentEntryTreeEditor(project, myState);
  JComponent component = myRootTreeEditor.createComponent();
  component.setBorder(new CustomLineBorder(JBUI.scale(1),0,0,0));

  splitter.setFirstComponent(component);
  splitter.setSecondComponent(entriesPanel);
  JPanel contentPanel = new JPanel(new GridBagLayout());

  final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, myRootTreeEditor.getEditingActionsGroup(), true);
  contentPanel.add(new JLabel("Mark as:"),
                   new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, 0, new JBInsets(0, 5, 0, 5), 0,
                                          0));
  contentPanel.add(actionToolbar.getComponent(),
                   new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL,
                                          new JBInsets(0, 0, 0, 0), 0, 0));
  contentPanel.add(splitter,
                   new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
                                          new JBInsets(0, 0, 0, 0), 0, 0));

  mainPanel.add(contentPanel, BorderLayout.CENTER);

  final ModifiableRootModel model = getModel();
  if (model != null) {
    final ContentEntry[] contentEntries = model.getContentEntries();
    if (contentEntries.length > 0) {
      for (final ContentEntry contentEntry : contentEntries) {
        addContentEntryPanel(contentEntry);
      }
      selectContentEntry(contentEntries[0]);
    }
  }

  return mainPanel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:61,代码来源:ContentEntriesEditor.java


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