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