|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.preference.FieldEditor
org.eclipse.jface.preference.StringFieldEditor
org.mailster.gui.prefs.widgets.HostFieldEditor
public class HostFieldEditor
---
Mailster (C) 2007-2009 De Oliveira Edouard
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
See Mailster
Web Site
---
HostFieldEditor.java - A FieldEditor to edit host/ip addresses.
| Field Summary | |
|---|---|
private static java.lang.String |
_255
The pattern to identify an IPv4 address. |
private static java.util.regex.Pattern |
hostPattern
|
private static java.util.regex.Pattern |
ipv4Pattern
|
private static java.util.regex.Pattern |
ipv6Pattern
The pattern to identify an IPv6 address. |
private boolean |
isValid
Cached valid state. |
private static java.lang.String |
labelDNS
The pattern to identify a valid FQDN hostname. |
private boolean |
onlyLocalAddressAllowed
true if only local addresses are valid. |
| Fields inherited from class org.eclipse.jface.preference.StringFieldEditor |
|---|
oldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKE |
| Fields inherited from class org.eclipse.jface.preference.FieldEditor |
|---|
HORIZONTAL_GAP, IS_VALID, VALUE |
| Constructor Summary | |
|---|---|
HostFieldEditor(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.Composite parent)
|
|
| Method Summary | |
|---|---|
protected boolean |
checkState()
Checks whether the text input field contains a valid value or not. |
protected void |
clearErrorMessage()
Clears the error message from the message line. |
protected void |
clearErrorMessage(boolean force)
Clears the error message from the message line. |
org.eclipse.swt.widgets.Text |
getTextControl(org.eclipse.swt.widgets.Composite parent)
Returns this field editor's text control. |
boolean |
isOnlyLocalAddressAllowed()
|
boolean |
isValid()
|
protected void |
refreshValidState()
|
void |
setOnlyLocalAddressAllowed(boolean onlyLocalAddressAllowed)
|
protected void |
valueChanged()
Informs this field editor's listener, if it has one, about a change to the value ( VALUE property) provided that the old and
new values are different. |
| Methods inherited from class org.eclipse.jface.preference.StringFieldEditor |
|---|
adjustForNumColumns, doCheckState, doFillIntoGrid, doLoad, doLoadDefault, doStore, getErrorMessage, getNumberOfControls, getStringValue, getTextControl, isEmptyStringAllowed, setEmptyStringAllowed, setEnabled, setErrorMessage, setFocus, setStringValue, setTextLimit, setValidateStrategy, showErrorMessage |
| Methods inherited from class org.eclipse.jface.preference.FieldEditor |
|---|
applyFont, checkParent, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, createControl, dispose, fillIntoGrid, fireStateChanged, fireValueChanged, getFieldEditorFontName, getLabelControl, getLabelControl, getLabelText, getPage, getPreferenceName, getPreferencePage, getPreferenceStore, init, load, loadDefault, presentsDefaultValue, setButtonLayoutData, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String _255
private static final java.util.regex.Pattern ipv4Pattern
private static final java.util.regex.Pattern ipv6Pattern
private static final java.lang.String labelDNS
private static final java.util.regex.Pattern hostPattern
private boolean onlyLocalAddressAllowed
true if only local addresses are valid.
private boolean isValid
| Constructor Detail |
|---|
public HostFieldEditor(java.lang.String name,
java.lang.String labelText,
org.eclipse.swt.widgets.Composite parent)
| Method Detail |
|---|
protected void refreshValidState()
refreshValidState in class org.eclipse.jface.preference.StringFieldEditorpublic boolean isValid()
isValid in class org.eclipse.jface.preference.StringFieldEditorprotected boolean checkState()
checkState in class org.eclipse.jface.preference.StringFieldEditortrue if the field value is valid,
and false if invalidpublic org.eclipse.swt.widgets.Text getTextControl(org.eclipse.swt.widgets.Composite parent)
The control is created if it does not yet exist
getTextControl in class org.eclipse.jface.preference.StringFieldEditorparent - the parent
protected void valueChanged()
VALUE property) provided that the old and
new values are different.
This hook is not called when the text is initialized (or reset to the default value) from the preference store.
valueChanged in class org.eclipse.jface.preference.StringFieldEditorprotected void clearErrorMessage()
clearErrorMessage in class org.eclipse.jface.preference.FieldEditorprotected void clearErrorMessage(boolean force)
public boolean isOnlyLocalAddressAllowed()
public void setOnlyLocalAddressAllowed(boolean onlyLocalAddressAllowed)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||