Search in sources :

Example 1 with UnnamedConfigurable

use of com.intellij.openapi.options.UnnamedConfigurable in project intellij-community by JetBrains.

the class TerminalSettingsPanel method createPanel.

public JComponent createPanel(@NotNull TerminalOptionsProvider provider, @NotNull TerminalProjectOptionsProvider projectOptionsProvider) {
    myOptionsProvider = provider;
    myProjectOptionsProvider = projectOptionsProvider;
    myProjectSettingsPanel.setBorder(IdeBorderFactory.createTitledBorder("Project settings"));
    myGlobalSettingsPanel.setBorder(IdeBorderFactory.createTitledBorder("Application settings"));
    FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
    myShellPathField.addBrowseFolderListener("", "Shell executable path", null, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
    fileChooserDescriptor = new FileChooserDescriptor(false, true, false, false, false, false);
    myStartDirectoryField.addBrowseFolderListener("", "Starting directory", null, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
    myShellPathField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {

        @Override
        protected void textChanged(DocumentEvent e) {
            myShellPathField.getTextField().setForeground(StringUtil.equals(myShellPathField.getText(), myProjectOptionsProvider.getDefaultShellPath()) ? getDefaultValueColor() : getChangedValueColor());
        }
    });
    myStartDirectoryField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {

        @Override
        protected void textChanged(DocumentEvent e) {
            myStartDirectoryField.getTextField().setForeground(StringUtil.equals(myStartDirectoryField.getText(), myProjectOptionsProvider.getDefaultStartingDirectory()) ? getDefaultValueColor() : getChangedValueColor());
        }
    });
    for (LocalTerminalCustomizer c : LocalTerminalCustomizer.EP_NAME.getExtensions()) {
        UnnamedConfigurable configurable = c.getConfigurable(projectOptionsProvider.getProject());
        if (configurable != null) {
            myConfigurables.add(configurable);
            JComponent component = configurable.createComponent();
            if (component != null) {
                myConfigurablesPanel.add(component, BorderLayout.CENTER);
            }
        }
    }
    return myWholePanel;
}
Also used : FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) DocumentAdapter(com.intellij.ui.DocumentAdapter) UnnamedConfigurable(com.intellij.openapi.options.UnnamedConfigurable) DocumentEvent(javax.swing.event.DocumentEvent)

Example 2 with UnnamedConfigurable

use of com.intellij.openapi.options.UnnamedConfigurable in project intellij-community by JetBrains.

the class MavenImportingConfigurable method apply.

public void apply() throws ConfigurationException {
    mySettingsForm.getData(myImportingSettings);
    MavenServerManager.getInstance().setMavenEmbedderVMOptions(myEmbedderVMOptions.getText());
    String jdk = myEmbedderJdk.getSelectedValue();
    if (jdk != null) {
        MavenServerManager.getInstance().setEmbedderJdk(jdk);
    }
    for (final UnnamedConfigurable additionalConfigurable : myAdditionalConfigurables) {
        additionalConfigurable.apply();
    }
}
Also used : UnnamedConfigurable(com.intellij.openapi.options.UnnamedConfigurable)

Example 3 with UnnamedConfigurable

use of com.intellij.openapi.options.UnnamedConfigurable in project intellij-community by JetBrains.

the class MavenImportingConfigurable method reset.

public void reset() {
    mySettingsForm.setData(myImportingSettings);
    myEmbedderVMOptions.setText(MavenServerManager.getInstance().getMavenEmbedderVMOptions());
    myEmbedderJdk.refreshData(MavenServerManager.getInstance().getEmbedderJdk());
    for (final UnnamedConfigurable additionalConfigurable : myAdditionalConfigurables) {
        additionalConfigurable.reset();
    }
}
Also used : UnnamedConfigurable(com.intellij.openapi.options.UnnamedConfigurable)

Example 4 with UnnamedConfigurable

use of com.intellij.openapi.options.UnnamedConfigurable in project intellij-community by JetBrains.

the class MavenImportingConfigurable method createComponent.

public JComponent createComponent() {
    final JPanel panel = mySettingsForm.getAdditionalSettingsPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
    panel.add(Box.createVerticalStrut(5));
    JPanel useMaven3Panel = new JPanel(new BorderLayout());
    panel.add(useMaven3Panel);
    JPanel embedderVMOptionPanel = new JPanel(new BorderLayout());
    JLabel vmOptionLabel = new JLabel("VM options for importer:");
    embedderVMOptionPanel.add(vmOptionLabel, BorderLayout.WEST);
    vmOptionLabel.setLabelFor(myEmbedderVMOptions);
    embedderVMOptionPanel.add(myEmbedderVMOptions);
    panel.add(Box.createVerticalStrut(3));
    panel.add(embedderVMOptionPanel);
    JPanel embedderJdkPanel = new JPanel(new BorderLayout());
    JLabel embedderJdkLabel = new JLabel("JDK for importer:");
    embedderJdkLabel.setLabelFor(myEmbedderJdk);
    embedderJdkPanel.add(embedderJdkLabel, BorderLayout.WEST);
    embedderJdkPanel.add(myEmbedderJdk);
    panel.add(Box.createVerticalStrut(3));
    panel.add(embedderJdkPanel);
    for (final UnnamedConfigurable additionalConfigurable : myAdditionalConfigurables) {
        panel.add(Box.createVerticalStrut(3));
        panel.add(additionalConfigurable.createComponent());
    }
    return mySettingsForm.createComponent();
}
Also used : UnnamedConfigurable(com.intellij.openapi.options.UnnamedConfigurable)

Example 5 with UnnamedConfigurable

use of com.intellij.openapi.options.UnnamedConfigurable in project intellij-community by JetBrains.

the class EmmetCompositeConfigurable method createComponent.

@Nullable
@Override
public JComponent createComponent() {
    final JPanel rootPanel = new JPanel(new GridLayoutManager(myInnerConfigurables.length + 1, 1, new Insets(0, 0, 0, 0), -1, -1, false, false));
    rootPanel.add(myTemplateExpandShortcutPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_CAN_SHRINK, GridConstraints.SIZEPOLICY_FIXED, null, null, null));
    for (int i = 0; i < myInnerConfigurables.length; i++) {
        UnnamedConfigurable configurable = myInnerConfigurables[i];
        final JComponent component = configurable.createComponent();
        assert component != null;
        int vSizePolicy = GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_CAN_SHRINK;
        if (i + 1 == myInnerConfigurables.length) {
            vSizePolicy |= GridConstraints.SIZEPOLICY_WANT_GROW;
        }
        rootPanel.add(component, new GridConstraints(i + 1, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW | GridConstraints.SIZEPOLICY_CAN_SHRINK, vSizePolicy, null, null, null));
    }
    rootPanel.revalidate();
    return rootPanel;
}
Also used : GridLayoutManager(com.intellij.uiDesigner.core.GridLayoutManager) GridConstraints(com.intellij.uiDesigner.core.GridConstraints) UnnamedConfigurable(com.intellij.openapi.options.UnnamedConfigurable) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

UnnamedConfigurable (com.intellij.openapi.options.UnnamedConfigurable)13 VcsDescriptor (com.intellij.openapi.vcs.impl.VcsDescriptor)3 OptionsContainingConfigurable (com.intellij.application.options.OptionsContainingConfigurable)1 AllFileTemplatesConfigurable (com.intellij.ide.fileTemplates.impl.AllFileTemplatesConfigurable)1 PluginManagerConfigurable (com.intellij.ide.plugins.PluginManagerConfigurable)1 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 KeymapPanel (com.intellij.openapi.keymap.impl.ui.KeymapPanel)1 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 SearchableConfigurable (com.intellij.openapi.options.SearchableConfigurable)1 ConfigurableWrapper (com.intellij.openapi.options.ex.ConfigurableWrapper)1 Splitter (com.intellij.openapi.ui.Splitter)1 DocumentAdapter (com.intellij.ui.DocumentAdapter)1 OptionGroup (com.intellij.ui.OptionGroup)1 TitledSeparator (com.intellij.ui.TitledSeparator)1 GridConstraints (com.intellij.uiDesigner.core.GridConstraints)1 GridLayoutManager (com.intellij.uiDesigner.core.GridLayoutManager)1 File (java.io.File)1 DocumentEvent (javax.swing.event.DocumentEvent)1 Document (org.jdom.Document)1 Element (org.jdom.Element)1