本文整理汇总了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;
}
示例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;
}
示例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;
}