use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class NotEqual method toString.
/**
* {@inheritDoc}
*/
@Override
public String toString() {
String triggerName = getTrigger().getClass().getSimpleName();
WLabel label = getTrigger().getLabel();
if (label != null) {
triggerName = label.getText();
}
return triggerName + "!=\"" + getValue() + "\"";
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class Show method toString.
/**
* {@inheritDoc}
*/
@Override
public String toString() {
String targetName = getTarget().getClass().getSimpleName();
WLabel label = getTarget().getLabel();
if (label != null) {
targetName = label.getText();
}
return "show " + targetName;
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class Action method toString.
/**
* {@inheritDoc}
*/
@Override
public String toString() {
String targetName = target.getClass().getSimpleName();
WLabel label = target.getLabel();
if (label != null) {
targetName = label.getText();
}
switch(type) {
case DISABLE:
return "disable " + targetName;
case ENABLE:
return "enable " + targetName;
case HIDE:
return "hide " + targetName;
case MANDATORY:
return "set " + targetName + " mandatory";
case OPTIONAL:
return "set " + targetName + " optional";
case SHOW:
return "show " + targetName;
case SHOWIN:
return "show " + targetName + " in " + group;
case HIDEIN:
return "hide " + targetName + " in " + group;
case ENABLEIN:
return "enable " + targetName + " in " + group;
case DISABLEIN:
return "disable " + targetName + " in " + group;
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class AbstractFieldValidator method getMessageArguments.
/**
* Sub classes should remember to call super.getMessageArguments() to ensure that the field label is added to the
* list of arguments.
*
* @return The list of arguments to be applied to the validators error message.
*/
protected List<Serializable> getMessageArguments() {
List<Serializable> args = new ArrayList<>(1);
WLabel label = input.getLabel();
if (label == null) {
args.add("");
} else {
args.add(label.getText());
}
return args;
}
use of com.github.bordertech.wcomponents.WLabel in project wcomponents by BorderTech.
the class WApplicationRenderer_Test method testRenderedFormatWithHiddenFields.
@Test
public void testRenderedFormatWithHiddenFields() throws XpathException, IOException, SAXException {
MockWEnvironment environment = new MockWEnvironment();
environment.setPostPath("WApplicationRendererTest.postPath");
WApplication application = new WApplication();
UIContext uic = createUIContext();
uic.setEnvironment(environment);
uic.setUI(application);
setActiveContext(uic);
WLabel label = new WLabel("dummy");
application.add(label);
Map<String, String> hiddenParameters = new HashMap<>();
hiddenParameters.put("keyA", "valueA");
hiddenParameters.put("keyB", "valueB");
environment.setHiddenParameters(hiddenParameters);
assertSchemaMatch(application);
assertXpathEvaluatesTo(label.getText(), "normalize-space(//ui:application/ui:label)", application);
assertXpathEvaluatesTo("valueA", "//ui:application/ui:param[@name='keyA']/@value", application);
assertXpathEvaluatesTo("valueB", "//ui:application/ui:param[@name='keyB']/@value", application);
}
Aggregations