本文整理了Java中javax.swing.JTextField.isEnabled()
方法的一些代码示例,展示了JTextField.isEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextField.isEnabled()
方法的具体详情如下:
包路径:javax.swing.JTextField
类名称:JTextField
方法名:isEnabled
暂无
代码示例来源:origin: tomighty/tomighty
@Override
public void mouseClicked(MouseEvent e) {
if(e.getButton() == MouseEvent.BUTTON1 && filenameField.isEnabled()) {
chooseFile();
}
}
});
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
private void onOK() {
int index;
try {
index = Integer.parseInt(this.textIndex.getText());
} catch (NumberFormatException e) {
index = 0;
}
MethodParameterSetting twigPath = new MethodParameterSetting(this.textCallTo.getText(), this.textMethodName.getText(), index, (String) this.comboProvider.getSelectedItem());
twigPath.setContributorName((String) comboContributor.getSelectedItem());
if(textContributorData.isEnabled()) {
twigPath.setContributorData(textContributorData.getText());
}
twigPath.setReferenceProviderName((String) comboProvider.getSelectedItem());
// re-add old item to not use public setter wor twigpaths
// update ?
if(this.methodParameterSetting != null) {
int row = this.tableView.getSelectedRows()[0];
this.tableView.getListTableModel().removeRow(row);
this.tableView.getListTableModel().insertRow(row, twigPath);
this.tableView.setRowSelectionInterval(row, row);
} else {
int row = this.tableView.getRowCount();
this.tableView.getListTableModel().addRow(twigPath);
this.tableView.setRowSelectionInterval(row, row);
}
dispose();
}
代码示例来源:origin: jshiell/checkstyle-idea
/**
* Get the configuration location entered in the dialogue, or null if no valid location was entered.
*
* @return the location or null if no valid location entered.
*/
public ConfigurationLocation getConfigurationLocation() {
if (fileLocationField.isEnabled()) {
if (isNotBlank(fileLocation())) {
return configurationLocationFactory().create(project, typeOfFile(),
fileLocation(), descriptionField.getText());
}
} else if (urlLocationField.isEnabled()) {
if (isNotBlank(urlLocation())) {
return configurationLocationFactory().create(project, typeOfUrl(),
urlLocation(), descriptionField.getText());
}
} else if (classpathLocationField.isEnabled()) {
if (isNotBlank(classpathLocation())) {
return configurationLocationFactory().create(project, PLUGIN_CLASSPATH,
classpathLocation(), descriptionField.getText());
}
}
return null;
}
代码示例来源:origin: SonarSource/sonarlint-intellij
@Override
public JComponent getPreferredFocusedComponent() {
if (nameField.isEnabled()) {
return nameField;
} else if (urlText.isEnabled()) {
return urlText;
}
return null;
}
代码示例来源:origin: bcdev/beam
@Override
public void mouseClicked(MouseEvent e) {
if (expressionTextField.isEnabled()) {
showExpressionEditor();
}
}
});
代码示例来源:origin: MegaMek/megamek
public void mouseClicked(MouseEvent evt) {
if (textField.isEnabled()) {
textField.requestFocus();
textField.selectAll();
}
}
public void mouseEntered(MouseEvent evt) {}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
public void actionPerformed(ActionEvent e) {
versionIRIField.setEnabled(enableVersionCheckBox.isSelected());
if (versionIRIField.isEnabled()) {
versionIRIField.setText(ontologyIRIField.getText());
}
}
});
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
public void actionPerformed(ActionEvent e) {
versionIRIField.setEnabled(enableVersionCheckBox.isSelected());
if (versionIRIField.isEnabled()) {
versionIRIField.setText(ontologyIRIField.getText());
}
}
});
代码示例来源:origin: org.protege/protege-editor-owl
public void actionPerformed(ActionEvent e) {
versionIRIField.setEnabled(enableVersionCheckBox.isSelected());
if (versionIRIField.isEnabled()) {
versionIRIField.setText(ontologyIRIField.getText());
}
}
});
代码示例来源:origin: org.protege/protege-editor-owl
public void actionPerformed(ActionEvent e) {
versionIRIField.setEnabled(enableVersionCheckBox.isSelected());
if (versionIRIField.isEnabled()) {
versionIRIField.setText(ontologyIRIField.getText());
}
}
});
代码示例来源:origin: org.netbeans.modules/org-netbeans-core
public void keyReleased(KeyEvent event) {
boolean containsCurrent = containsCurrent();
String txt = itemField.getText().trim();
boolean en = itemField.isEnabled() &&
txt.length() > 0 &&
!containsCurrent;
addButton.setEnabled(en);
changeButton.setEnabled(en && itemList.getSelectedIndex() != -1);
if (containsCurrent) {
itemList.setSelectedIndex(idxOfCurrent());
}
}
});
代码示例来源:origin: org.verapdf.apps/gui
private JTextField findEmptyNumberArguments() {
for (JTextField textField : this.arguments) {
int index = this.arguments.indexOf(textField);
Feature.FeatureType argType = ((Feature) this.features.get(index).getSelectedItem()).getFeatureType();
if (textField.isEnabled() && textField.getText().isEmpty() && argType != Feature.FeatureType.STRING) {
return textField;
}
}
return null;
}
代码示例来源:origin: dboissier/jenkins-control-plugin
public void validate(JTextField component) throws ConfigurationException {
if (component.isEnabled()) { //TODO a revoir
String value = component.getText();
if (StringUtils.isEmpty(value)) {
throw new ConfigurationException(String.format("'%s' must be set", component.getName()));
}
}
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-j2me-cdc-project
@Override
boolean valid(WizardDescriptor settings) {
if (mainClassTextField.isVisible () && mainClassTextField.isEnabled ()) {
if (!valid) {
settings.putProperty( WizardDescriptor.PROP_ERROR_MESSAGE,
NbBundle.getMessage(PanelOptionsVisual.class,"ERROR_IllegalMainClassName")); //NOI18N
}
return this.valid;
}
return true;
}
代码示例来源:origin: net.sf.squirrel-sql.plugins/smarttools
private void controlTfOldValue(boolean enabled)
{
tfOldValue.setEnabled(enabled && cbOperator.getSelectedIndex() > 0 && !isNullOperator());
if (isNullOperator() || cbOperator.getSelectedIndex() == 0)
{
tfOldValue.setText("");
}
tfOldValue.setBackground(tfOldValue.isEnabled() ? Color.WHITE : Color.LIGHT_GRAY);
}
代码示例来源:origin: com.numdata/numdata-swing
@Override
public boolean isVisible()
{
final JTextField textField = _textField;
return super.isVisible() &&
// ( _isIncrement ? ( getTextFieldValue() < _limit ) : ( getTextFieldValue() > _limit ) ) &&
( ( textField == null ) || ( textField.isVisible() && textField.isEnabled() ) );
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial
private void nameChange() {
boolean isChanged = (userNameTextField.isEnabled() && !initialUserName.equals(userNameTextField.getText()))
|| !HgModuleConfig.getDefault().getExecutableBinaryPath().equals(executablePathTextField.getText())
|| !HgModuleConfig.getDefault().getExportFilename().equals(exportFilenameTextField.getText())
|| !HgModuleConfig.getDefault().getAnnotationFormat().equals(annotationTextField.getText())
|| HgModuleConfig.getDefault().getAutoOpenOutput() != cbOpenOutputWindow.isSelected()
|| HgModuleConfig.getDefault().getConfirmCommitAfterMerge() != cbAskBeforeCommitAfterMerge.isSelected()
|| HgModuleConfig.getDefault().isInternalMergeToolEnabled() != cbInternalMergeToolEnabled.isSelected()
|| HgModuleConfig.getDefault().getExludeNewFiles() != excludeNewFiles.isSelected();
controller.changed(isChanged);
}
代码示例来源:origin: triplea-game/triplea
@Test
void defaultValues() {
final JTextField field = JTextFieldBuilder.builder()
.build();
MatcherAssert.assertThat(
field.isEnabled(),
Is.is(true));
MatcherAssert.assertThat(
field.getText(),
Is.is(""));
}
代码示例来源:origin: triplea-game/triplea
@Test
void enabled() {
MatcherAssert.assertThat(
JTextFieldBuilder.builder()
.build()
.isEnabled(),
Is.is(true));
}
代码示例来源:origin: triplea-game/triplea
@Test
void disabled() {
MatcherAssert.assertThat(
JTextFieldBuilder.builder()
.disabled()
.build()
.isEnabled(),
Is.is(false));
}
}
内容来源于网络,如有侵权,请联系作者删除!