use of java.awt.FlowLayout in project gitblit by gitblit.
the class EditRepositoryDialog method newFieldPanel.
private JPanel newFieldPanel(String label, int labelSize, JComponent comp) {
JLabel fieldLabel = new JLabel(label);
fieldLabel.setFont(fieldLabel.getFont().deriveFont(Font.BOLD));
fieldLabel.setPreferredSize(new Dimension(labelSize, 20));
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
panel.add(fieldLabel);
panel.add(comp);
return panel;
}
use of java.awt.FlowLayout in project gitblit by gitblit.
the class EditTeamDialog method newFieldPanel.
private JPanel newFieldPanel(String label, JComponent comp) {
JLabel fieldLabel = new JLabel(label);
fieldLabel.setFont(fieldLabel.getFont().deriveFont(Font.BOLD));
fieldLabel.setPreferredSize(new Dimension(150, 20));
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 0));
panel.add(fieldLabel);
panel.add(comp);
return panel;
}
use of java.awt.FlowLayout in project gitblit by gitblit.
the class Utils method newFieldPanel.
public static JPanel newFieldPanel(String label, Component c, String trailingLabel) {
JLabel jlabel = new JLabel(label);
jlabel.setPreferredSize(new Dimension(Utils.LABEL_WIDTH, 20));
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
panel.add(jlabel);
panel.add(c);
if (!StringUtils.isEmpty(trailingLabel)) {
panel.add(new JLabel(trailingLabel));
}
return panel;
}
use of java.awt.FlowLayout in project gitblit by gitblit.
the class X509CertificateViewer method newField.
private JPanel newField(String label, String value, int cols) {
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 2 * Utils.MARGIN, 0));
JLabel lbl = new JLabel(label);
lbl.setHorizontalAlignment(SwingConstants.RIGHT);
lbl.setPreferredSize(new Dimension(125, 20));
panel.add(lbl);
JTextField tf = new JTextField(value, cols);
tf.setCaretPosition(0);
tf.setEditable(false);
panel.add(tf);
return panel;
}
use of java.awt.FlowLayout in project gitblit by gitblit.
the class EditRepositoryDialog method setCustomFields.
public void setCustomFields(RepositoryModel repository, Map<String, String> customFields) {
customFieldsPanel.removeAll();
customTextfields = new ArrayList<JTextField>();
final Insets insets = new Insets(5, 5, 5, 5);
JPanel fields = new JPanel(new GridLayout(0, 1, 0, 5)) {
private static final long serialVersionUID = 1L;
@Override
public Insets getInsets() {
return insets;
}
};
for (Map.Entry<String, String> entry : customFields.entrySet()) {
String field = entry.getKey();
String value = "";
if (repository.customFields != null && repository.customFields.containsKey(field)) {
value = repository.customFields.get(field);
}
JTextField textField = new JTextField(value);
textField.setName(field);
textField.setPreferredSize(new Dimension(450, 26));
fields.add(newFieldPanel(entry.getValue(), 250, textField));
customTextfields.add(textField);
}
JScrollPane jsp = new JScrollPane(fields);
jsp.getVerticalScrollBar().setBlockIncrement(100);
jsp.getVerticalScrollBar().setUnitIncrement(100);
jsp.setViewportBorder(null);
customFieldsPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
customFieldsPanel.add(jsp);
}
Aggregations