javax.swing.text.JTextComponent.setEnabled()方法的使用及代码示例

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

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

JTextComponent.setEnabled介绍

暂无

代码示例

代码示例来源:origin: nodebox/nodebox

@Override
public void setEnabled(boolean enabled) {
  super.setEnabled(enabled);
  field.setEnabled(enabled);
}

代码示例来源:origin: threerings/tripleplay

@Override
public void setEnabled (boolean enabled) {
  _textComp.setEnabled(enabled);
}

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

void toggleEnabled(boolean directTableMapping, boolean clientFieldsEnabled) {
  superClassName.getComponent().setEnabled(directTableMapping);
  superclassLabel.setEnabled(directTableMapping);
  clientSuperClassName.getComponent().setEnabled(
      directTableMapping && clientFieldsEnabled);
  clientSuperClassNameLabel.setEnabled(directTableMapping && clientFieldsEnabled);
  clientClassNameLabel.setEnabled(clientFieldsEnabled);
  clientClassName.getComponent().setEnabled(clientFieldsEnabled);
}

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

private void toggleClientProperties(boolean enabled) {
  defaultClientPackage.getComponent().setEnabled(enabled);
  updateDefaultClientPackage.setEnabled(enabled);
  defaultClientPackageLabel.setEnabled(enabled);
  defaultClientSuperclassLabel.setEnabled(enabled);
  defaultClientSuperclass.getComponent().setEnabled(enabled);
  updateDefaultClientSuperclass.setEnabled(enabled);
}

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

protected void setCacheGroupsEnabled(boolean enabled) {
  cacheGroups.getComponent().setEnabled(enabled);
  cacheGroupsLabel.setEnabled(enabled);
}

代码示例来源:origin: freeplane/freeplane

private void select(final int pIndex) {
  mScriptTextField.setEnabled(pIndex >= 0);
  mRunAction.setEnabled(pIndex >= 0);
  mSignAction.setEnabled(pIndex >= 0);
  if (pIndex < 0) {
    mScriptTextField.setText("");
    return;
  }
  storeCurrent();
  mScriptTextField.setText(mScriptModel.getScript(pIndex).getScript());
  mLastSelected = new Integer(pIndex);
  if (pIndex >= 0 && mScriptList.getSelectedIndex() != pIndex) {
    mScriptList.setSelectedIndex(pIndex);
  }
}

代码示例来源:origin: nativelibs4java/JNAerator

String svalue=(String)value;
  tc.setText(svalue==null ? "" : svalue);
  tc.setEnabled(!nullModel);
} else if (isBoolean(propertyType)) {
  Integer ivalue=(Integer)value;
  tc.setText(ivalue==null ? "" : ivalue.toString());
  tc.setEnabled(!nullModel);

代码示例来源:origin: bcdev/beam

@Override
public void updateUI() {
  super.updateUI();
  String text = getParameter().getValueAsText();
  JTextComponent textField = getTextComponent();
  if (!textField.getText().equals(text)) {
    textField.setText(text);
  }
  if (textField.isEnabled() != isEnabled()) {
    textField.setEnabled(isEnabled());
  }
}

代码示例来源:origin: net.sf.doolin/doolin-gui

/**
 * {@inheritDoc}
 */
@Override
public void setDisplayState(Field<V> field, JComponent component, DisplayState displayState) {
  JTextComponent fieldComponent = (JTextComponent) field.getProperty(AbstractFieldText.class);
  switch (displayState) {
  case ENABLED:
    fieldComponent.setEnabled(true);
    fieldComponent.setEditable(true);
    component.setVisible(true);
    break;
  case DISABLED:
    fieldComponent.setEnabled(true);
    fieldComponent.setEditable(false);
    component.setVisible(true);
    break;
  case HIDDEN:
    fieldComponent.setEnabled(false);
    fieldComponent.setEditable(false);
    component.setVisible(false);
    break;
  }
}

代码示例来源:origin: com.jgoodies/validation

/**
 * Returns a default background color that is requested from an instance
 * of a prototype component of the same type as the given component.
 * If such a component cannot be created, a JTextField is used.
 * The prototype's enabled and editable state is then set to the state
 * of the given component. Finally the prototype's background is returned.
 *
 * @param component   the component to get the default background for
 * @return the background color of a prototype text component that has
 *     the same state as the given component
 *
 * @see #restoreBackground(JTextComponent)
 */
private static Color getDefaultBackground(JTextComponent component) {
  JTextComponent prototype = getPrototypeFor(component.getClass());
  prototype.setEnabled(component.isEnabled());
  prototype.setEditable(component.isEditable());
  return prototype.getBackground();
}

代码示例来源:origin: com.jgoodies/jgoodies-validation

/**
 * Returns a default background color that is requested from an instance
 * of a prototype component of the same type as the given component.
 * If such a component cannot be created, a JTextField is used.
 * The prototype's enabled and editable state is then set to the state
 * of the given component. Finally the prototype's background is returned.
 *
 * @param component   the component to get the default background for
 * @return the background color of a prototype text component that has
 *     the same state as the given component
 *
 * @see #restoreBackground(JTextComponent)
 */
private static Color getDefaultBackground(JTextComponent component) {
  JTextComponent prototype = getPrototypeFor(component.getClass());
  prototype.setEnabled(component.isEnabled());
  prototype.setEditable(component.isEditable());
  return prototype.getBackground();
}

代码示例来源:origin: net.sf.sfac/sfac-core

@Override
protected void synchronizeEditableState() {
  if (textField != null) {
    textField.setEditable(isEditable());
    textField.setEnabled(isEnabled());
    if (isMultiline()) {
      textField.setBackground(isEditable() ? Color.WHITE : Color.LIGHT_GRAY);
    }
  }
}

代码示例来源:origin: bcdev/beam

@Override
public void updateUI() {
  super.updateUI();
  String text = getParameter().getValueAsText();
  if (!getTextComponent().getText().equals(text)) {
    getTextComponent().setText(text);
  }
  if (getTextComponent().isEnabled() != isEnabled()) {
    if (getParameter().getProperties().isReadOnly()) {
      getTextComponent().setEnabled(false);
      getComponent().setEnabled(false);
    } else {
      getTextComponent().setEnabled(isEnabled());
      getComponent().setEnabled(isEnabled());
    }
  }
}

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

catalog.getComponent().setEnabled(true);
schema.getComponent().setEnabled(true);
pkGeneratorDetail.setVisible(true);
pkGeneratorType.setVisible(true);

代码示例来源:origin: bcdev/beam

_textComponent.setEnabled(enabled);
_component.setEnabled(enabled);
String toolTiptext = getParameter().getProperties().getDescription();

代码示例来源:origin: bcdev/beam

_textComponent.setEnabled(enabled);
_component.setEnabled(enabled);
_textComponent.setInputVerifier(getDefaultInputVerifier());

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

promptComponent.setHighlighter(new PainterHighlighter(PromptSupport
    .getBackgroundPainter(txt)));
promptComponent.setEnabled(txt.isEnabled());
promptComponent.setOpaque(txt.isOpaque());
promptComponent.setBounds(txt.getBounds());

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

promptComponent.setHighlighter(new PainterHighlighter(PromptSupport
    .getBackgroundPainter(txt)));
promptComponent.setEnabled(txt.isEnabled());
promptComponent.setOpaque(txt.isOpaque());
promptComponent.setBounds(txt.getBounds());

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

promptComponent.setHighlighter(new PainterHighlighter(PromptSupport
    .getBackgroundPainter(txt)));
promptComponent.setEnabled(txt.isEnabled());
promptComponent.setOpaque(txt.isOpaque());
promptComponent.setBounds(txt.getBounds());

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

promptComponent.setHighlighter(new PainterHighlighter(PromptSupport
    .getBackgroundPainter(txt)));
promptComponent.setEnabled(txt.isEnabled());
promptComponent.setOpaque(txt.isOpaque());
promptComponent.setBounds(txt.getBounds());

相关文章

JTextComponent类方法