use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class DebuggerConfigurable method computeMergedConfigurables.
private static void computeMergedConfigurables(@NotNull DebuggerConfigurableProvider[] providers, @NotNull List<Configurable> result) {
for (DebuggerSettingsCategory category : MERGED_CATEGORIES) {
List<Configurable> configurables = getConfigurables(category, providers);
if (!configurables.isEmpty()) {
String id = category.name().toLowerCase(Locale.ENGLISH);
result.add(new MergedCompositeConfigurable("debugger." + id, XDebuggerBundle.message("debugger." + id + ".display.name"), configurables.toArray(new Configurable[configurables.size()])));
}
}
}
use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class MergedCompositeConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
if (rootComponent == null) {
Configurable firstConfigurable = children[0];
if (children.length == 1) {
rootComponent = firstConfigurable.createComponent();
String rootComponentDisplayName = firstConfigurable.getDisplayName();
if (!StringUtil.isEmpty(rootComponentDisplayName) && !isTargetedToProduct(firstConfigurable)) {
rootComponent.setBorder(IdeBorderFactory.createTitledBorder(rootComponentDisplayName, false, FIRST_COMPONENT_INSETS));
}
} else {
boolean isFirstNamed = true;
JPanel panel = createPanel(true);
for (Configurable configurable : children) {
JComponent component = configurable.createComponent();
assert component != null;
String displayName = configurable.getDisplayName();
if (StringUtil.isEmpty(displayName)) {
component.setBorder(BOTTOM_INSETS);
} else {
boolean addBorder = true;
if (isUseTargetedProductPolicyIfSeveralChildren() && isFirstNamed) {
isFirstNamed = false;
if (isTargetedToProduct(configurable)) {
addBorder = false;
}
}
if (addBorder) {
component.setBorder(IdeBorderFactory.createTitledBorder(displayName, false, firstConfigurable == configurable ? FIRST_COMPONENT_INSETS : N_COMPONENT_INSETS));
}
}
panel.add(component);
}
rootComponent = panel;
}
}
return rootComponent;
}
use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class InjectionsSettingsUI method buildConfigurables.
@Override
protected Configurable[] buildConfigurables() {
final ArrayList<Configurable> configurables = new ArrayList<>();
for (LanguageInjectionSupport support : InjectorUtils.getActiveInjectionSupports()) {
ContainerUtil.addAll(configurables, support.createSettings(myProject, myConfiguration));
}
Collections.sort(configurables, (o1, o2) -> Comparing.compare(o1.getDisplayName(), o2.getDisplayName()));
return configurables.toArray(new Configurable[configurables.size()]);
}
use of com.intellij.openapi.options.Configurable in project intellij-community by JetBrains.
the class SubCompositeConfigurable method disposeUIResources.
@Override
public final void disposeUIResources() {
root = null;
rootComponent = null;
if (isChildrenMerged()) {
for (Configurable child : children) {
child.disposeUIResources();
}
}
children = null;
}
use of com.intellij.openapi.options.Configurable 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();
}
Aggregations