Search in sources :

Example 1 with TabbedPaneWrapper

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

the class MavenArtifactSearchDialog method initComponents.

private void initComponents(Project project, String initialText, boolean classMode) {
    myTabbedPane = new TabbedPaneWrapper(project);
    MavenArtifactSearchPanel.Listener listener = new MavenArtifactSearchPanel.Listener() {

        public void itemSelected() {
            clickDefaultButton();
        }

        public void canSelectStateChanged(MavenArtifactSearchPanel from, boolean canSelect) {
            myOkButtonStates.put(from, canSelect);
            updateOkButtonState();
        }
    };
    myArtifactsPanel = new MavenArtifactSearchPanel(project, !classMode ? initialText : "", false, listener, this, myManagedDependenciesMap);
    myClassesPanel = new MavenArtifactSearchPanel(project, classMode ? initialText : "", true, listener, this, myManagedDependenciesMap);
    myTabbedPane.addTab("Search for artifact", myArtifactsPanel);
    myTabbedPane.addTab("Search for class", myClassesPanel);
    myTabbedPane.setSelectedIndex(classMode ? 1 : 0);
    myTabbedPane.getComponent().setPreferredSize(JBUI.size(900, 600));
    myTabbedPane.addChangeListener(new ChangeListener() {

        public void stateChanged(ChangeEvent e) {
            updateOkButtonState();
        }
    });
    updateOkButtonState();
}
Also used : ChangeListener(javax.swing.event.ChangeListener) ChangeEvent(javax.swing.event.ChangeEvent) TabbedPaneWrapper(com.intellij.ui.TabbedPaneWrapper) ChangeListener(javax.swing.event.ChangeListener)

Example 2 with TabbedPaneWrapper

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

the class FacetEditorImpl method setSelectedTabName.

public void setSelectedTabName(final String tabName) {
    getComponent();
    final TabbedPaneWrapper tabbedPane = myTabbedPane;
    if (tabbedPane == null)
        return;
    for (int i = 0; i < tabbedPane.getTabCount(); i++) {
        if (tabName.equals(tabbedPane.getTitleAt(i))) {
            tabbedPane.setSelectedIndex(i);
            return;
        }
    }
}
Also used : TabbedPaneWrapper(com.intellij.ui.TabbedPaneWrapper)

Example 3 with TabbedPaneWrapper

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

the class FacetTypeEditor method createComponent.

@Override
public JComponent createComponent() {
    MultipleFacetSettingsEditor allFacetsEditor = createAllFacetsEditor();
    if (myAllFacetsEditor != null) {
        myAllFacetsEditor.disposeUIResources();
    }
    myAllFacetsEditor = allFacetsEditor;
    myCurrentConfigurables = new ArrayList<>();
    if (myDefaultSettingsConfigurable != null) {
        myCurrentConfigurables.add(myDefaultSettingsConfigurable);
    }
    if (myAllFacetsEditor != null) {
        myCurrentConfigurables.add(new AllFacetsConfigurable(myAllFacetsEditor));
    }
    if (myCurrentConfigurables.isEmpty()) {
        return new JPanel();
    }
    if (myCurrentConfigurables.size() == 1) {
        return myCurrentConfigurables.get(0).createComponent();
    }
    myTabbedPane = new TabbedPaneWrapper(myDisposable);
    for (Configurable configurable : myCurrentConfigurables) {
        myTabbedPane.addTab(configurable.getDisplayName(), configurable.createComponent());
    }
    return myTabbedPane.getComponent();
}
Also used : MultipleFacetSettingsEditor(com.intellij.facet.ui.MultipleFacetSettingsEditor) TabbedPaneWrapper(com.intellij.ui.TabbedPaneWrapper) Configurable(com.intellij.openapi.options.Configurable)

Example 4 with TabbedPaneWrapper

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

the class SearchUtil method traverseComponentsTree.

private static boolean traverseComponentsTree(SearchableConfigurable configurable, GlassPanel glassPanel, JComponent rootComponent, String option, boolean force) {
    rootComponent.putClientProperty(HIGHLIGHT_WITH_BORDER, null);
    if (option == null || option.trim().length() == 0)
        return false;
    boolean highlight = false;
    if (rootComponent instanceof JCheckBox) {
        final JCheckBox checkBox = ((JCheckBox) rootComponent);
        if (isComponentHighlighted(checkBox.getText(), option, force, configurable)) {
            highlight = true;
            glassPanel.addSpotlight(checkBox);
        }
    } else if (rootComponent instanceof JRadioButton) {
        final JRadioButton radioButton = ((JRadioButton) rootComponent);
        if (isComponentHighlighted(radioButton.getText(), option, force, configurable)) {
            highlight = true;
            glassPanel.addSpotlight(radioButton);
        }
    } else if (rootComponent instanceof JLabel) {
        final JLabel label = ((JLabel) rootComponent);
        if (isComponentHighlighted(label.getText(), option, force, configurable)) {
            highlight = true;
            glassPanel.addSpotlight(label);
        }
    } else if (rootComponent instanceof JButton) {
        final JButton button = ((JButton) rootComponent);
        if (isComponentHighlighted(button.getText(), option, force, configurable)) {
            highlight = true;
            glassPanel.addSpotlight(button);
        }
    } else if (rootComponent instanceof JTabbedPane) {
        final JTabbedPane tabbedPane = (JTabbedPane) rootComponent;
        final String path = SearchableOptionsRegistrar.getInstance().getInnerPath(configurable, option);
        if (path != null) {
            final int index = getSelection(path, tabbedPane);
            if (index > -1 && index < tabbedPane.getTabCount()) {
                if (tabbedPane.getTabComponentAt(index) instanceof JComponent) {
                    glassPanel.addSpotlight((JComponent) tabbedPane.getTabComponentAt(index));
                }
            }
        }
    } else if (rootComponent instanceof TabbedPaneWrapper.TabbedPaneHolder) {
        final TabbedPaneWrapper tabbedPaneWrapper = ((TabbedPaneWrapper.TabbedPaneHolder) rootComponent).getTabbedPaneWrapper();
        final String path = SearchableOptionsRegistrar.getInstance().getInnerPath(configurable, option);
        if (path != null) {
            final int index = getSelection(path, tabbedPaneWrapper);
            if (index > -1 && index < tabbedPaneWrapper.getTabCount()) {
                glassPanel.addSpotlight((JComponent) tabbedPaneWrapper.getTabComponentAt(index));
            }
        }
    }
    final Component[] components = rootComponent.getComponents();
    for (Component component : components) {
        if (component instanceof JComponent) {
            final boolean innerHighlight = traverseComponentsTree(configurable, glassPanel, (JComponent) component, option, force);
            if (!highlight && !innerHighlight) {
                final Border border = rootComponent.getBorder();
                if (border instanceof TitledBorder) {
                    final String title = ((TitledBorder) border).getTitle();
                    if (isComponentHighlighted(title, option, force, configurable)) {
                        highlight = true;
                        glassPanel.addSpotlight(rootComponent);
                        rootComponent.putClientProperty(HIGHLIGHT_WITH_BORDER, Boolean.TRUE);
                    }
                }
            }
            if (innerHighlight) {
                highlight = true;
            }
        }
    }
    return highlight;
}
Also used : TabbedPaneWrapper(com.intellij.ui.TabbedPaneWrapper) TitledBorder(javax.swing.border.TitledBorder) SimpleColoredComponent(com.intellij.ui.SimpleColoredComponent) SkipSelfSearchComponent(com.intellij.application.options.SkipSelfSearchComponent) Border(javax.swing.border.Border) TitledBorder(javax.swing.border.TitledBorder)

Example 5 with TabbedPaneWrapper

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

the class TabbedConfigurable method createComponent.

@Override
public JComponent createComponent() {
    myTabbedPane = new TabbedPaneWrapper(myDisposable);
    createConfigurableTabs();
    final JComponent component = myTabbedPane.getComponent();
    component.setBorder(JBUI.Borders.emptyTop(5));
    component.setPreferredSize(JBUI.size(500, 400));
    return component;
}
Also used : TabbedPaneWrapper(com.intellij.ui.TabbedPaneWrapper)

Aggregations

TabbedPaneWrapper (com.intellij.ui.TabbedPaneWrapper)15 ChangeEvent (javax.swing.event.ChangeEvent)8 ChangeListener (javax.swing.event.ChangeListener)7 SkipSelfSearchComponent (com.intellij.application.options.SkipSelfSearchComponent)2 BaseProjectTreeBuilder (com.intellij.ide.projectView.BaseProjectTreeBuilder)2 AbstractProjectTreeStructure (com.intellij.ide.projectView.impl.AbstractProjectTreeStructure)2 ProjectAbstractTreeStructureBase (com.intellij.ide.projectView.impl.ProjectAbstractTreeStructureBase)2 ProjectTreeBuilder (com.intellij.ide.projectView.impl.ProjectTreeBuilder)2 NodeRenderer (com.intellij.ide.util.treeView.NodeRenderer)2 Disposable (com.intellij.openapi.Disposable)2 ModalityState (com.intellij.openapi.application.ModalityState)2 Configurable (com.intellij.openapi.options.Configurable)2 DoubleClickListener (com.intellij.ui.DoubleClickListener)2 SimpleColoredComponent (com.intellij.ui.SimpleColoredComponent)2 TreeSpeedSearch (com.intellij.ui.TreeSpeedSearch)2 Tree (com.intellij.ui.treeStructure.Tree)2 NotNull (org.jetbrains.annotations.NotNull)2 DocumentationComponent (com.intellij.codeInsight.documentation.DocumentationComponent)1 DocumentationManager (com.intellij.codeInsight.documentation.DocumentationManager)1 FacetEditorTab (com.intellij.facet.ui.FacetEditorTab)1