Search in sources :

Example 1 with SeparatorComponent

use of com.intellij.ui.SeparatorComponent in project intellij-community by JetBrains.

the class DetailsPanel method rebuildCommitPanels.

private void rebuildCommitPanels(int[] selection) {
    myEmptyText.setText("");
    int selectionLength = selection.length;
    // for each commit besides the first there are two components: Separator and CommitPanel
    int existingCount = (myMainContentPanel.getComponentCount() + 1) / 2;
    int requiredCount = Math.min(selectionLength, MAX_ROWS);
    for (int i = existingCount; i < requiredCount; i++) {
        if (i > 0) {
            myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null));
        }
        myMainContentPanel.add(new CommitPanel(myLogData, myColorManager));
    }
    // clear superfluous items
    while (myMainContentPanel.getComponentCount() > 2 * requiredCount - 1) {
        myMainContentPanel.remove(myMainContentPanel.getComponentCount() - 1);
    }
    if (selectionLength > MAX_ROWS) {
        myMainContentPanel.add(new SeparatorComponent(0, OnePixelDivider.BACKGROUND, null));
        JBLabel label = new JBLabel("(showing " + MAX_ROWS + " of " + selectionLength + " selected commits)");
        label.setFont(VcsHistoryUtil.getCommitDetailsFont());
        label.setBorder(CommitPanel.getDetailsBorder());
        myMainContentPanel.add(label);
    }
    mySelection = Ints.asList(Arrays.copyOf(selection, requiredCount));
    repaint();
}
Also used : SeparatorComponent(com.intellij.ui.SeparatorComponent) JBLabel(com.intellij.ui.components.JBLabel)

Example 2 with SeparatorComponent

use of com.intellij.ui.SeparatorComponent in project intellij-community by JetBrains.

the class WizardDialog method createCenterPanel.

protected JComponent createCenterPanel() {
    JPanel result = new JPanel(new BorderLayout());
    JPanel icon = new JPanel(new BorderLayout());
    icon.add(myIcon, BorderLayout.NORTH);
    result.add(icon, BorderLayout.WEST);
    JPanel header = new JPanel();
    header.setLayout(new BoxLayout(header, BoxLayout.Y_AXIS));
    header.add(myHeader);
    header.add(Box.createVerticalStrut(4));
    header.add(myExplanation);
    header.add(Box.createVerticalStrut(4));
    header.add(new SeparatorComponent(0, Color.gray, null));
    header.setBorder(BorderFactory.createEmptyBorder(4, 2, 4, 2));
    JPanel content = new JPanel(new BorderLayout(12, 12));
    content.add(header, BorderLayout.NORTH);
    myCardLayout = new CardLayout();
    myStepContent = new JPanel(myCardLayout) {

        public Dimension getPreferredSize() {
            Dimension custom = getWindowPreferredSize();
            Dimension superSize = super.getPreferredSize();
            if (custom != null) {
                custom.width = custom.width > 0 ? custom.width : superSize.width;
                custom.height = custom.height > 0 ? custom.height : superSize.height;
            } else {
                custom = superSize;
            }
            return custom;
        }
    };
    content.add(header, BorderLayout.NORTH);
    content.add(myStepContent, BorderLayout.CENTER);
    result.add(content, BorderLayout.CENTER);
    return result;
}
Also used : SeparatorComponent(com.intellij.ui.SeparatorComponent)

Example 3 with SeparatorComponent

use of com.intellij.ui.SeparatorComponent in project android by JetBrains.

the class DeveloperServicesPanel method updateServicePanels.

private void updateServicePanels(@NotNull ServiceCategory serviceCategory) {
    for (DeveloperServicePanel developerServicePanel : myPanelsList) {
        developerServicePanel.dispose();
    }
    myPanelsList.clear();
    myServicesPanel.removeAll();
    Module module = (Module) myModuleCombo.getSelectedItem();
    if (module == null) {
        return;
    }
    for (DeveloperService service : DeveloperServices.getFor(module, serviceCategory)) {
        if (service.getContext().hiddenFromStructureDialog().get()) {
            continue;
        }
        myPanelsList.add(new DeveloperServicePanel(service));
    }
    for (DeveloperServicePanel panel : myPanelsList) {
        if (myServicesPanel.getComponentCount() > 0) {
            myServicesPanel.add(new SeparatorComponent());
        }
        myServicesPanel.add(panel);
    }
    // For some reason, requesting a layout and paint update is required here, as otherwise
    // previous content may not be cleared and new content may not be laid out.
    myServicesPanel.validate();
    myServicesPanel.repaint();
}
Also used : DeveloperService(com.android.tools.idea.structure.services.DeveloperService) SeparatorComponent(com.intellij.ui.SeparatorComponent) Module(com.intellij.openapi.module.Module)

Example 4 with SeparatorComponent

use of com.intellij.ui.SeparatorComponent in project intellij-plugins by JetBrains.

the class IDEtalkToolWindow method createToolWindowComponent.

@Override
protected void createToolWindowComponent() {
    StartupManager.getInstance(myProject).registerPostStartupActivity(() -> initializeTransports(myProject.getName()));
    StatusToolbar statusToolbar = ((StatusToolbar) myContainer.getComponentInstanceOfType(StatusToolbar.class));
    DefaultActionGroup toolbarActions = new DefaultActionGroup();
    ActionGroup actions = (ActionGroup) myActionManager.getAction("IDEtalk");
    if (actions != null) {
        toolbarActions.addAll(actions);
    }
    toolbarActions.add(new ContextHelpAction("reference.toolWindows.idetalk"));
    ActionGroup treeActions = (ActionGroup) myActionManager.getAction("IDEtalk_Tree");
    JPanel toolbarPanel = new JPanel();
    toolbarPanel.setLayout(new BoxLayout(toolbarPanel, BoxLayout.X_AXIS));
    toolbarPanel.add(DropDownButton.wrap(new DropDownButton(new FindUsersAction(), IconUtil.getAddIcon())));
    toolbarPanel.add(createToolbar(toolbarActions).getComponent());
    toolbarPanel.add(Box.createHorizontalStrut(10));
    toolbarPanel.add(new SeparatorComponent(JBColor.LIGHT_GRAY, SeparatorOrientation.VERTICAL));
    toolbarPanel.add(Box.createHorizontalStrut(3));
    toolbarPanel.add(DropDownButton.wrap(new OptionsButton()));
    toolbarPanel.add(statusToolbar.createComponent());
    toolbarPanel.add(new JPanel() {

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(Short.MAX_VALUE, 10);
        }
    });
    if (treeActions != null) {
        JComponent component = createToolbar(treeActions).getComponent();
        component.setMinimumSize(component.getPreferredSize());
        toolbarPanel.add(component);
    }
    toolbarPanel.setAlignmentX(0);
    myTopPanel.add(toolbarPanel);
    myPanel.add(myTopPanel, BorderLayout.NORTH);
    myPanel.add(ScrollPaneFactory.createScrollPane(myUserListComponent.getComponent()));
    ActionGroup group = (ActionGroup) myActionManager.getAction("IDEtalkPopup");
    if (group != null) {
        IDEAFacade.installPopupMenu(group, myUserListComponent.getTree(), myActionManager);
    }
}
Also used : DropDownButton(jetbrains.communicator.idea.actions.DropDownButton) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction) StatusToolbar(jetbrains.communicator.ide.StatusToolbar) SeparatorComponent(com.intellij.ui.SeparatorComponent) ActionGroup(com.intellij.openapi.actionSystem.ActionGroup) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) OptionsButton(jetbrains.communicator.idea.actions.OptionsButton) FindUsersAction(jetbrains.communicator.idea.actions.FindUsersAction)

Aggregations

SeparatorComponent (com.intellij.ui.SeparatorComponent)4 DeveloperService (com.android.tools.idea.structure.services.DeveloperService)1 ContextHelpAction (com.intellij.ide.actions.ContextHelpAction)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 Module (com.intellij.openapi.module.Module)1 JBLabel (com.intellij.ui.components.JBLabel)1 StatusToolbar (jetbrains.communicator.ide.StatusToolbar)1 DropDownButton (jetbrains.communicator.idea.actions.DropDownButton)1 FindUsersAction (jetbrains.communicator.idea.actions.FindUsersAction)1 OptionsButton (jetbrains.communicator.idea.actions.OptionsButton)1