本文整理匯總了Java中org.eclipse.jface.preference.FieldEditor.isValid方法的典型用法代碼示例。如果您正苦於以下問題:Java FieldEditor.isValid方法的具體用法?Java FieldEditor.isValid怎麽用?Java FieldEditor.isValid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.preference.FieldEditor
的用法示例。
在下文中一共展示了FieldEditor.isValid方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkState
import org.eclipse.jface.preference.FieldEditor; //導入方法依賴的package包/類
/**
* Recomputes the page's error state by calling <code>isValid</code> for
* every field editor.
*/
protected void checkState()
{
boolean valid = true;
setInvalidFieldEditor(null);
// The state can only be set to true if all
// field editors contain a valid value. So we must check them all
if (fields != null)
{
int size = fields.size();
for (int i = 0; i < size; i++)
{
FieldEditor editor = (FieldEditor) fields.get(i);
valid = valid && editor.isValid();
if (!valid)
{
setInvalidFieldEditor(editor);
break;
}
}
}
setValid(valid);
}
示例2: isValid
import org.eclipse.jface.preference.FieldEditor; //導入方法依賴的package包/類
@Override
public final boolean isValid()
{
// Search for enabled features wit invalid configuration options
for (BooleanFieldEditor featureEnabledEditor : this.controlMapping.keySet())
{
if (featureEnabledEditor.getBooleanValue() == true)
{
for (FieldEditor fieldEditor : this.controlMapping.get(featureEnabledEditor))
{
if (fieldEditor.isValid() == false)
{
return false;
}
}
}
}
return true;
}
示例3: checkState
import org.eclipse.jface.preference.FieldEditor; //導入方法依賴的package包/類
/**
* Recomputes the page's error state by calling <code>isValid</code> for every field editor.
*/
protected void checkState() {
boolean valid = true;
m_invalidFieldEditor = null;
// The state can only be set to true if all
// field editors contain a valid value. So we must check them all
if (m_fields != null) {
int size = m_fields.size();
for (int i = 0; i < size; i++) {
FieldEditor editor = m_fields.get(i);
valid = valid && editor.isValid();
if (!valid) {
m_invalidFieldEditor = editor;
break;
}
}
}
setValid(true);
}
示例4: storeEditor
import org.eclipse.jface.preference.FieldEditor; //導入方法依賴的package包/類
private static void storeEditor(FieldEditor editor, String errorValue) {
if (editor.isValid()) {
editor.store();
} else {
editor.getPreferenceStore().setValue(editor.getPreferenceName(), errorValue);
}
}
示例5: performOk
import org.eclipse.jface.preference.FieldEditor; //導入方法依賴的package包/類
@Override
public boolean performOk() {
for (FieldEditor field : fields) {
if (field.isValid()) {
field.store();
setErrorMessage(null);
} else {
setErrorMessage("Some fields do not have valid values!");
}
}
return super.performOk();
}
開發者ID:Cooperate-Project,項目名稱:CooperateModelingEnvironment,代碼行數:13,代碼來源:CDOServerConnectionPreference.java
示例6: updateChildStatus
import org.eclipse.jface.preference.FieldEditor; //導入方法依賴的package包/類
protected void updateChildStatus(final FieldEditorWrapper childFieldEditor, final boolean parentEnabled) {
if (childFieldEditor != null) { // null if on another page!
final FieldEditor fieldEditor = childFieldEditor.getFieldEditor();
fieldEditor.setEnabled(parentEnabled, childFieldEditor.getParent());
if (!parentEnabled && !fieldEditor.isValid()) {
fieldEditor.loadDefault(); // Fix invalid value
checkState(); // Enable OK & Apply buttons
}
}
}
示例7: getErrorMessages
import org.eclipse.jface.preference.FieldEditor; //導入方法依賴的package包/類
private String getErrorMessages() {
String messages = new String();
for (FieldEditor editor : editors) {
if (!editor.isValid()) {
String message = ((StringFieldEditor) editor).getErrorMessage();
if (messages.length() > 0) {
messages += "; ";
}
messages += message;
}
}
return messages;
}