示例#1
0
  private JPanel buildFilterPanel() {
    // copied from PluginPreference
    JPanel pnl = new JPanel(new GridBagLayout());
    pnl.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    GridBagConstraints gc = new GridBagConstraints();

    gc.anchor = GridBagConstraints.NORTHWEST;
    gc.fill = GridBagConstraints.HORIZONTAL;
    gc.weightx = 0.0;
    gc.insets = new Insets(0, 0, 0, 5);
    pnl.add(new JLabel(tr("Search:")), gc);

    gc.gridx = 1;
    gc.weightx = 1.0;
    pnl.add(filterField, gc);
    filterField.setToolTipText(tr("Enter a search expression"));
    SelectAllOnFocusGainedDecorator.decorate(filterField);
    filterField.getDocument().addDocumentListener(new FilterFieldAdapter());
    pnl.setMaximumSize(new Dimension(300, 10));
    return pnl;
  }
示例#2
0
 protected void resetErrorMessage(JosmTextField tf) {
   tf.setBorder(UIManager.getBorder("TextField.border"));
   tf.setToolTipText(null);
 }
示例#3
0
 protected void setErrorMessage(JosmTextField tf, String msg) {
   tf.setBorder(errorBorder);
   tf.setToolTipText(msg);
 }