use of com.codename1.rad.models.Property.Label in project CodenameOne by codenameone.
the class SMSShare method createRendererMultiButton.
private MultiButton createRendererMultiButton() {
MultiButton b = new MultiButton();
b.setIconName("icon");
b.setNameLine1("fname");
b.setNameLine2("phone");
b.setUIID("Label");
return b;
}
use of com.codename1.rad.models.Property.Label in project CodenameOne by codenameone.
the class Lifecycle method runApp.
/**
* This method is invoked by start to show the first form of the application
*/
public void runApp() {
Form hello = new Form("Hello", BoxLayout.y());
hello.add(new Label("You should override runApp() with your code"));
hello.show();
}
use of com.codename1.rad.models.Property.Label in project CodenameOne by codenameone.
the class TestUtils method assertLabel.
/**
* Asserts that we have a label with the given text baring the given name
* @param path the path of the label
* @param text the text of the label
*/
public static void assertLabel(int[] path, String text) {
if (verbose) {
log("assertLabel(" + toString(path) + ", " + text + ")");
}
Label l = (Label) getComponentByPath(path);
assertBool(l != null, "Null label" + text);
assertBool(text == l.getText() || text.equals(l.getText()), ("" + l.getText()) + " != " + text);
}
use of com.codename1.rad.models.Property.Label in project CodenameOne by codenameone.
the class TestUtils method findLabelText.
/**
* Finds a component with the given name, works even with UI's that weren't created with the GUI builder
* @param text the text of the label/button
* @return the component with the given label text within the tree
*/
private static Label findLabelText(Container root, String text) {
if (verbose) {
log("findLabelText(" + root + ", " + text + ")");
}
int count = root.getComponentCount();
for (int iter = 0; iter < count; iter++) {
Component c = root.getComponentAt(iter);
if (c instanceof Label) {
String n = ((Label) c).getText();
if (n != null && n.equals(text)) {
return (Label) c;
}
// will work for cases of upcase due to Android theme upcasing of buttons
n = (String) c.getClientProperty("cn1$origText");
if (n != null && n.equals(text)) {
return (Label) c;
}
continue;
}
if (c instanceof Container) {
Label l = findLabelText((Container) c, text);
if (l != null) {
return l;
}
}
}
return null;
}
use of com.codename1.rad.models.Property.Label in project CodenameOne by codenameone.
the class TestUtils method assertTextArea.
/**
* Asserts that we have a label with the given text baring the given name
* @param path the path to the text area
* @param text the text of the label
*/
public static void assertTextArea(int[] path, String text) {
if (verbose) {
log("assertTextArea(" + toString(path) + ", " + text + ")");
}
TextArea l = (TextArea) getComponentByPath(path);
assertBool(l != null, "Null area " + text);
assertBool(l.getText().equals(text), "assertTextArea: " + l.getText() + " != " + text);
}
Aggregations