JComponent () { myDefaultProps.addAll(getDefaultMappings()); if (myMappings instanceof LanguagePerFileMappings && param(ADD_PROJECT_MAPPING)) { myDefaultProps.add(myProjectMapping); } if (myDefaultProps.size() == 0) return null; JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints cons1 = new GridBagConstraints(); cons1.fill = GridBagConstraints.HORIZONTAL; cons1.weightx = 0; cons1.gridx = 0; cons1.insets = JBUI.insets(0, 0, 5, UIUtil.DEFAULT_HGAP); GridBagConstraints cons2 = new GridBagConstraints(); cons2.fill = GridBagConstraints.NONE; cons2.anchor = GridBagConstraints.WEST; cons2.weightx = 0; cons2.gridx = 1; cons2.insets = cons1.insets; panel.add(Box.createGlue(), new GridBagConstraints(2, 0, 1, 1, 1., 1., GridBagConstraints.CENTER, GridBagConstraints.NONE, JBInsets.emptyInsets(), 0, 0)); for (Mapping<T> prop : myDefaultProps) { myDefaultVals.put(prop.name, prop.getter.get()); JPanel p = createActionPanel(null, new Value<>() { @Override public void commit() { myModel.fireTableDataChanged(); } @Override public T get() { return myDefaultVals.get(prop.name); } @Override public void set(T value) { myDefaultVals.put(prop.name, adjustChosenValue(null, value)); } }); panel.add(new JBLabel(prop.name + ":"), cons1); panel.add(p, cons2); } return panel; }