public final class InvalidChecker extends Object implements StructureChecker
PROPERTY_KEY_VALID
Constructor and Description |
---|
InvalidChecker(String errorMessage)
Initializes an invalid structure checker instance
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property.
|
StructureCheckerResult |
check(Molecule molecule)
Detects a specific error in the molecule.
|
StructureChecker |
cloneItem()
Returns a clone of this StructureChecker instance
|
String |
getDescription() |
StructureCheckerDescriptor |
getDescriptor()
Returns a
StructureCheckerDescriptor instance which represents the user interface
related informations of the checker |
String |
getEditorClassName() |
String |
getErrorCode()
Returns the
String represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType() ) |
String |
getErrorMessage()
Gets the error message of the checker instance
|
StructureCheckerErrorType |
getErrorType() |
String |
getHelpText()
Gets the help text of the checker
|
Icon |
getIcon()
Gets the
Icon of the current checker |
String |
getLocalMenuName()
Gets the local menu name of the checker
|
String |
getName()
Gets the name of the checker
|
boolean |
isAvailable()
Returns true if the checker is available, and can be used
|
boolean |
isValid()
Returns true if the checker's configuration is valid, false otherwise
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.
|
void |
setDescription(String description)
Sets the description of the checker
|
void |
setHelpText(String helpText)
Sets the detailed help of the checker which will shown in the tooltip on the GUI
|
void |
setIcon(Icon icon)
Sets the icon of the checker
|
void |
setLocalMenuName(String localMenuName)
Set the local menu name of the checker
|
void |
setMoreErrorMessage(String moreError)
Sets the message which will given in the result if two or more error found
|
void |
setName(String name)
Sets the name of the checker
|
void |
setNoErrorMessage(String noError)
Sets the message which will given in the result if no error found
|
void |
setOneErrorMessage(String oneError)
Sets the message which will given in the result if one error found
|
public InvalidChecker(String errorMessage)
errorMessage
- the error message of the instance.public StructureCheckerResult check(Molecule molecule) throws NullPointerException
StructureChecker
check
in interface StructureChecker
molecule
- a Molecule
instance have to be checkedStructureCheckerResult
(which contains all data needed
to fix the problem) if the molecule contains the examined error, null
otherwiseNullPointerException
- if molecule is nullpublic String getName()
StructureChecker
getName
in interface StructureChecker
public void setName(String name)
StructureChecker
setName
in interface StructureChecker
name
- the human readable name of the checkerpublic String getLocalMenuName()
StructureChecker
getLocalMenuName
in interface StructureChecker
public void setLocalMenuName(String localMenuName)
StructureChecker
setLocalMenuName
in interface StructureChecker
localMenuName
- a String
to be shown in the local menupublic String getHelpText()
StructureChecker
getHelpText
in interface StructureChecker
public void setHelpText(String helpText)
StructureChecker
setHelpText
in interface StructureChecker
helpText
- a String
to be shown in the tooltippublic void setNoErrorMessage(String noError)
StructureChecker
setNoErrorMessage
in interface StructureChecker
noError
- the error message if no error foundpublic void setOneErrorMessage(String oneError)
StructureChecker
setOneErrorMessage
in interface StructureChecker
oneError
- the error message if one error foundpublic void setMoreErrorMessage(String moreError)
StructureChecker
setMoreErrorMessage
in interface StructureChecker
moreError
- the error message if two or more error foundpublic Icon getIcon()
StructureChecker
Icon
of the current checkergetIcon
in interface StructureChecker
Icon
of the current checkerpublic void setIcon(Icon icon)
StructureChecker
setIcon
in interface StructureChecker
icon
- is an instance of Icon
public StructureCheckerErrorType getErrorType()
getErrorType
in interface StructureChecker
public String getErrorCode()
StructureChecker
String
represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType()
)getErrorCode
in interface StructureChecker
String
represented error code of the checker (this error code
should be used for external implementation support instead of StructureChecker.getErrorType()
)public String getEditorClassName()
getEditorClassName
in interface StructureChecker
public void setDescription(String description)
StructureChecker
setDescription
in interface StructureChecker
description
- the description of the checkerpublic String getDescription()
getDescription
in interface StructureChecker
public StructureChecker cloneItem()
StructureChecker
cloneItem
in interface StructureChecker
public boolean isValid()
StructureChecker
isValid
in interface StructureChecker
public boolean isAvailable()
StructureChecker
isAvailable
in interface StructureChecker
public StructureCheckerDescriptor getDescriptor()
StructureChecker
StructureCheckerDescriptor
instance which represents the user interface
related informations of the checkergetDescriptor
in interface StructureChecker
StructureCheckerDescriptor
instance which represents the user interface
related informations of the checkerpublic void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
StructureChecker
listener
was added more than once to the same event
source for the specified property, it will be notified one less time
after being removed.
If propertyName
is null, no exception is thrown and no
action is taken.
If listener
is null, or was never added for the specified
property, no exception is thrown and no action is taken.removePropertyChangeListener
in interface StructureChecker
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(String, PropertyChangeListener)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
StructureChecker
propertyName
or listener
is null, no
exception is thrown and no action is taken.addPropertyChangeListener
in interface StructureChecker
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
StructureChecker
listener
was added more than once to the same event
source, it will be notified one less time after being removed.
If listener
is null, or was never added, no exception is
thrown and no action is taken.removePropertyChangeListener
in interface StructureChecker
listener
- The PropertyChangeListener to be removedPropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener)
public void addPropertyChangeListener(PropertyChangeListener listener)
StructureChecker
listener
is null, no exception is thrown and no action
is taken.addPropertyChangeListener
in interface StructureChecker
listener
- The PropertyChangeListener to be addedPropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener)
public String getErrorMessage()