Example usage for com.intellij.openapi.ui OnePixelDivider BACKGROUND

List of usage examples for com.intellij.openapi.ui OnePixelDivider BACKGROUND

Introduction

In this page you can find the example usage for com.intellij.openapi.ui OnePixelDivider BACKGROUND.

Prototype

Color BACKGROUND

To view the source code for com.intellij.openapi.ui OnePixelDivider BACKGROUND.

Click Source Link

Usage

From source file:com.android.tools.idea.gradle.project.GradleVersionRecommendedUpdateDialog.java

License:Apache License

@Override
@NotNull/*from w w  w .jav a 2 s .  c  om*/
protected JComponent createSouthPanel() {
    Action[] actions = createActions();
    List<JButton> buttons = Lists.newArrayList();

    JPanel panel = new JPanel(new BorderLayout());

    if (actions.length > 0) {
        JPanel buttonsPanel = createButtons(actions, buttons);
        panel.add(buttonsPanel, BorderLayout.CENTER);
        myButtons = buttons.toArray(new JButton[buttons.size()]);
    }

    if (getStyle() == DialogStyle.COMPACT) {
        Border line = new CustomLineBorder(OnePixelDivider.BACKGROUND, 1, 0, 0, 0);
        panel.setBorder(new CompoundBorder(line, empty(8, 12)));
    } else {
        panel.setBorder(emptyTop(8));
    }

    return panel;
}

From source file:com.android.tools.idea.gradle.project.library.LibraryPropertiesDialog.java

License:Apache License

@Nullable
@Override//w ww.j  a v  a 2 s.c  o m
protected JComponent createCenterPanel() {
    myIconLabel.setIcon(AllIcons.Modules.Library);
    myNameLabel.setText(myLibrary.getName());

    LibraryEditor editor = new SourcesAndDocsOnlyEditor(myLibrary);
    myLibraryEditorComponent = new LibraryRootsComponent(myProject, editor) {
        @Override
        public void updatePropertiesLabel() {
            JComponent c = getComponent();
            if (c != null) {
                MultiLineLabel propertiesLabel = findComponentOfType(c, MultiLineLabel.class);
                if (propertiesLabel != null) {
                    propertiesLabel.setText("Add or remove source/Javadoc attachments");
                }
            }
        }
    };
    myLibraryEditorComponent.updatePropertiesLabel();

    JComponent c = myLibraryEditorComponent.getComponent();

    // Remove "Exclude" button. We don't support this in libraries.
    List<ActionButton> actionButtons = findComponentsOfType(c, ActionButton.class);
    for (ActionButton actionButton : actionButtons) {
        String text = actionButton.getAction().getTemplatePresentation().getText();
        if (text != null && text.startsWith("Exclude")) {
            actionButton.setVisible(false);
            break;
        }
    }

    MultiLineLabel propertiesLabel = findComponentOfType(c, MultiLineLabel.class);
    if (propertiesLabel != null) {
        propertiesLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 0, 1));
    }

    myTreePanel.add(c, BorderLayout.CENTER);
    myTreePanel.setBorder(customLine(OnePixelDivider.BACKGROUND, 1, 1, 1, 1));

    return myMainPanel;
}

From source file:com.android.tools.idea.gradle.structure.configurables.ui.dependencies.AbstractDependenciesPanel.java

License:Apache License

protected AbstractDependenciesPanel(@NotNull String title, @NotNull PsContext context,
        @Nullable PsModule module) {/*from   ww  w.  j  a  v  a2  s .co  m*/
    super(new BorderLayout());
    myContext = context;
    myModule = module;

    myEmptyText = String.format("Please select a dependency from the '%1$s' view", title);

    myEmptyDetailsPanel = new EmptyPanel(myEmptyText);
    myInfoPanel = new DependencyInfoPanel();

    myInfoScrollPane = createScrollPane(myEmptyDetailsPanel, VERTICAL_SCROLLBAR_AS_NEEDED,
            HORIZONTAL_SCROLLBAR_NEVER);
    myInfoScrollPane.setBorder(createEmptyBorder());

    myHeader = new Header(title);
    add(myHeader, BorderLayout.NORTH);

    JBSplitter splitter = new JBSplitter(true, "psd.editable.dependencies.main.horizontal.splitter.proportion",
            0.55f);

    myContentsPanel = new JPanel(new BorderLayout());
    myContentsPanel.setBorder(new SideBorder(OnePixelDivider.BACKGROUND, SideBorder.BOTTOM));

    splitter.setFirstComponent(myContentsPanel);
    splitter.setSecondComponent(myInfoScrollPane);

    add(splitter, BorderLayout.CENTER);
}

From source file:com.android.tools.idea.gradle.structure.dependencies.AbstractAddDependenciesDialog.java

License:Apache License

@NotNull
private static Border createMainPanelBorder() {
    return createCompoundBorder(new SideBorder(OnePixelDivider.BACKGROUND, BOTTOM),
            createEmptyBorder(5, 5, 5, 5));
}

From source file:com.android.tools.idea.ui.resourcechooser.ChooseResourceDialog.java

License:Apache License

@NotNull
private JComponent createToolbar() {
    JComponent toolbar = Box.createHorizontalBox();
    toolbar.add(mySearchField);/*  w  w  w  .j  a  va 2 s  . c om*/
    toolbar.add(Box.createHorizontalStrut(JBUI.scale(20)));
    toolbar.add(myViewOption);

    toolbar.add(Box.createHorizontalGlue());
    JBLabel addNew = new JBLabel("Add new resource");
    addNew.setIcon(PlatformIcons.COMBOBOX_ARROW_ICON);
    addNew.setHorizontalTextPosition(SwingConstants.LEFT);
    addNew.setIconTextGap(0);
    if (ScreenReader.isActive()) {
        addNew.setFocusable(true);
    }
    toolbar.add(addNew);
    MyAddNewResourceLabelListener listener = new MyAddNewResourceLabelListener();
    addNew.addMouseListener(listener);
    addNew.addKeyListener(listener);

    toolbar.setBorder(new CompoundBorder(JBUI.Borders.customLine(OnePixelDivider.BACKGROUND, 0, 0, 1, 0),
            JBUI.Borders.empty(8)));
    return toolbar;
}

From source file:com.android.tools.idea.ui.resourcechooser.SimpleTabUI.java

License:Apache License

@Override
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
    int width = tabPane.getWidth();
    int height = tabPane.getHeight();
    Insets insets = tabPane.getInsets();

    int x = insets.left;
    int y = insets.top;
    int w = width - insets.right - insets.left;
    int h = height - insets.top - insets.bottom;

    int thickness = JBUI.scale(1);
    g.setColor(OnePixelDivider.BACKGROUND);

    // use fillRect instead of drawLine with thickness as drawLine has bugs on OS X retina
    switch (tabPlacement) {
    case LEFT:/*w  ww  .  j a  v a  2 s .  c om*/
        x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth);
        g.fillRect(x - thickness, y, thickness, h);
        break;
    case RIGHT:
        w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth);
        g.fillRect(x + w, y, thickness, h);
        break;
    case BOTTOM:
        h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);
        g.fillRect(x, y + h, w, thickness);
        break;
    case TOP:
    default:
        y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight);
        g.fillRect(x, y - thickness, w, thickness);
    }
}

From source file:com.intellij.application.options.CodeStyleAbstractPanel.java

License:Apache License

protected void installPreviewPanel(JPanel previewPanel) {
    previewPanel.setLayout(new BorderLayout());
    previewPanel.add(getEditor().getComponent(), BorderLayout.CENTER);
    previewPanel.setBorder(new CustomLineBorder(OnePixelDivider.BACKGROUND, 0, 1, 0, 0));
}