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();
}
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;
}
}
}
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();
}
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;
}
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;
}
Aggregations