javax.swing.JComboBox.isEditable()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中javax.swing.JComboBox.isEditable()方法的一些代码示例,展示了JComboBox.isEditable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.isEditable()方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:isEditable

JComboBox.isEditable介绍

暂无

代码示例

代码示例来源:origin: pentaho/mondrian

originalValue = booleanEditor.isSelected();
} else if (activeEditor == listEditor) {
  if (listEditor.isEditable()) {

代码示例来源:origin: pentaho/mondrian

return booleanEditor.isSelected();
} else if (activeEditor == listEditor) {
  if (listEditor.isEditable()) {

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** Attempts to give a reasonable answer for text components and
 * combo boxes;  for everything else, returns false */
public boolean supportsTextEntry() {
  if (legacy instanceof JTextComponent) {
    return true;
  } else if ((legacy instanceof JComboBox) && ((JComboBox) legacy).isEditable()) {
    return true;
  } else {
    return false;
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** Attempts to give a reasonable answer for text components and
 * combo boxes;  for everything else, returns false */
public boolean supportsTextEntry() {
  if (legacy instanceof JTextComponent) {
    return true;
  } else if ((legacy instanceof JComboBox) && 
       ((JComboBox) legacy).isEditable()) {
    return true;
  } else {
    return false;
  }
}

代码示例来源:origin: khuxtable/seaglass

/**
   * {@inheritDoc}
   */
  public boolean isInState(JComponent c) {
    return ((JComboBox) c).isEditable();
  }
}

代码示例来源:origin: net.sf.nimrod/nimrod-laf

public Dimension getMinimumSize( JComponent c) {
 Dimension dim = super.getMinimumSize( c);
 
 if ( comboBox.isEditable() ) {
  dim.height = editor.getPreferredSize().height - 2;
 }
 
 dim.width += 20;
 
 return dim;
}

代码示例来源:origin: net.java.dev.beansbinding/beansbinding

private void cleanupForLast() {
  if (combo == null) {
    return;
  }
  combo.setSelectedItem(null);
  combo.setModel(new DefaultComboBoxModel());
  model.updateElements(null, combo.isEditable());
  combo = null;
  model = null;
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-corefields

/**
 * Returns if the field should is editable.
 * 
 * @return {@code true} if the combo box is editable or {@code false} if
 *         not.
 */
public boolean isEditable() {
  return getComponent().isEditable();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

protected JButton createArrowButton() 
{
  JButton button = new ComboBoxButton(comboBox, 
    UIManager.getIcon("ComboBox.icon"), comboBox.isEditable(), currentValuePane, listBox );
  button.setMargin( new Insets( 2, 3, 2, 5 ) );
  return button;
}

代码示例来源:origin: net.sf.cuf/cuf-swing

public boolean stopCellEditing()
  {
    if (comboBox.isEditable())
    {
      // Commit edited value.
      comboBox.actionPerformed(new ActionEvent(LOVCellEditor.this, 0, ""));
    }
    return super.stopCellEditing();
  }
};

代码示例来源:origin: org.swinglabs.swingx/swingx-all

@Override
public boolean stopCellEditing() {
  if (comboBox.isEditable()) {
    // Commit edited value.
    comboBox.actionPerformed(new ActionEvent(ComboBoxCellEditor.this, 0, ""));
  }
  return super.stopCellEditing();
}

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

@Override
public boolean stopCellEditing() {
  if (comboBox.isEditable()) {
    // Notify the combo box that editing has stopped (e.g. User pressed F2)
    comboBox.actionPerformed(new ActionEvent(this, 0, ""));
  }
  fireEditingStopped();
  return true;
}

代码示例来源:origin: joel-costigliola/assertj-swing

@RunsInCurrentThread
private static void checkAccessibleEditor(@Nonnull JComboBox<?> comboBox) {
 checkEnabledAndShowing(comboBox);
 if (!comboBox.isEditable()) {
  String msg = String.format("Expecting component %s to be editable", format(comboBox));
  throw new IllegalStateException(msg);
 }
}

代码示例来源:origin: com.jidesoft/jide-oss

@Override
protected JButton createArrowButton() {
  JButton button = new BasicJideComboBoxButton(
      comboBox, new BasicJideComboBoxIcon(),
      comboBox.isEditable(),
      currentValuePane, listBox);
  button.setMargin(new Insets(1, 3, 0, 4));
  button.setFocusPainted(comboBox.isEditable());
  button.addMouseListener(_rolloverListener);
  return button;
}

代码示例来源:origin: com.github.insubstantial/substance

@Override
  public JTextComponent getTextComponent(JComboBox t) {
    if (t.isEditable()) {
      Component editorComp = t.getEditor()
          .getEditorComponent();
      if (editorComp instanceof JTextComponent) {
        return (JTextComponent) editorComp;
      }
    }
    return null;
  }
});

代码示例来源:origin: net.sf.nimrod/nimrod-laf

protected JButton createArrowButton() {
 return new NimRODComboBoxButton( comboBox, UIManager.getIcon( "ComboBox.buttonDownIcon"), 
                  (comboBox.isEditable() ? true : false),
                  currentValuePane, listBox);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-common

private static void setSelectedItem(final JComboBox combo, final Object item) {
  combo.setSelectedItem(item);
  if (combo.isEditable() && combo.getEditor() != null) {
    // item must be set in the editor in case of editable combobox
    combo.configureEditor(combo.getEditor(), combo.getSelectedItem()); 
  }
}

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

@Override
  public void mouseReleased(MouseEvent e) {
    comboBox.setSelectedItem(list.getSelectedValue());
    comboBox.setPopupVisible(false);
    // Workaround for cancelling an edited item (JVM bug 4530953).
    if (comboBox.isEditable() && comboBox.getEditor() != null) {
      comboBox.configureEditor(comboBox.getEditor(), comboBox.getSelectedItem());
    }
    
    hide();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-docker-ui

public static String getValue(JComboBox<String> combo) {
  if (combo.isEditable()) {
    return getValue((String) combo.getEditor().getItem());
  }
  return getValue((String) combo.getSelectedItem());
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/toniclf

public void paint(Graphics g, JComponent c)
{
  hasFocus= comboBox.hasFocus();
  if (!comboBox.isEditable())
  {
    Rectangle r= rectangleForCurrentValue();
    paintCurrentValueBackground(g, r, hasFocus);
    paintCurrentValue(g, r, hasFocus);
  }
}

相关文章

JComboBox类方法