Search in sources :

Example 1 with ButtonDataRenderer

use of org.apache.pivot.wtk.content.ButtonDataRenderer in project pivot by apache.

the class Pivot721 method startup.

@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    window = (Window) bxmlSerializer.readObject(Pivot721.class, "pivot_721.bxml");
    // force fill into button renderer, but only in some buttons ...
    ButtonDataRenderer filledButtonDataRenderer = new ButtonDataRenderer();
    filledButtonDataRenderer.setFillIcon(true);
    PushButton button3 = (PushButton) bxmlSerializer.getNamespace().get("button3");
    // ((ButtonDataRenderer)button3.getDataRenderer()).setFillIcon(true); //
    // ok, but note that all buttons share a common renderer instance
    // set/use the
    button3.setDataRenderer(filledButtonDataRenderer);
    // customized
    // renderer instance
    PushButton button4 = (PushButton) bxmlSerializer.getNamespace().get("button4");
    // set/use the
    button4.setDataRenderer(filledButtonDataRenderer);
    // customized
    // renderer instance
    window.open(display);
}
Also used : ButtonDataRenderer(org.apache.pivot.wtk.content.ButtonDataRenderer) PushButton(org.apache.pivot.wtk.PushButton) BXMLSerializer(org.apache.pivot.beans.BXMLSerializer)

Aggregations

BXMLSerializer (org.apache.pivot.beans.BXMLSerializer)1 PushButton (org.apache.pivot.wtk.PushButton)1 ButtonDataRenderer (org.apache.pivot.wtk.content.ButtonDataRenderer)1