Package org.terasology.rendering.nui.widgets

Examples of org.terasology.rendering.nui.widgets.UIButton.subscribe()


    }

    public static void trySubscribe(UIWidget widget, String id, ActivateEventListener listener) {
        UIButton button = widget.find(id, UIButton.class);
        if (button != null) {
            button.subscribe(listener);
        } else {
            logger.warn("Contents of {} missing button with id '{}'", widget, id);
        }
    }
View Full Code Here


            final UILabel headline = new UILabel(groupLabel);
            final MigLayout layout = new MigLayout();
            layout.setColConstraints("[min][fill]");
            layout.setRowConstraints("[min]");

            expand.subscribe(new ActivateEventListener() {

                @Override
                public void onActivated(UIWidget widget) {
                    UIButton button = (UIButton) widget;
                    if ("-".equals(button.getText())) {
View Full Code Here

                });
            }

            UIButton toggle = find("toggleActivation", UIButton.class);
            if (toggle != null) {
                toggle.subscribe(new ActivateEventListener() {
                    @Override
                    public void onActivated(UIWidget button) {
                        if (moduleList.getSelection() != null) {

                            // Toggle
View Full Code Here

                });
            }

            UIButton enableAll = find("enableAll", UIButton.class);
            if (enableAll != null) {
                enableAll.subscribe(new ActivateEventListener() {
                    @Override
                    public void onActivated(UIWidget button) {
                        for (ModuleSelectionInfo info : sortedModules) {
                            if (!info.isExplicitSelection() && info.isValidToSelect()) {
                                select(info);
View Full Code Here

                });
            }

            UIButton disableAll = find("disableAll", UIButton.class);
            if (disableAll != null) {
                disableAll.subscribe(new ActivateEventListener() {
                    @Override
                    public void onActivated(UIWidget button) {
                        for (ModuleSelectionInfo info : sortedModules) {
                            if (info.isSelected() && info.isExplicitSelection()) {
                                deselect(info);
View Full Code Here

            }
        });

        UIButton configButton = find("config", UIButton.class);
        if (configButton != null) {
            configButton.subscribe(new ActivateEventListener() {
                @Override
                public void onActivated(UIWidget button) {
                    getManager().pushScreen("engine:configWorldGen");
                }
            });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.