Example usage for com.vaadin.server FontAwesome PAUSE

List of usage examples for com.vaadin.server FontAwesome PAUSE

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome PAUSE.

Prototype

FontAwesome PAUSE

To view the source code for com.vaadin.server FontAwesome PAUSE.

Click Source Link

Usage

From source file:org.eclipse.hawkbit.ui.rollout.rollout.RolloutListGrid.java

License:Open Source License

private StatusFontIcon createPauseButtonMetadata(final RolloutStatus rolloutStatus) {
    final boolean isDisabled = hasToBeDisabled(rolloutStatus, PAUSE_BUTTON_ENABLED);
    return new StatusFontIcon(FontAwesome.PAUSE, null,
            i18n.getMessage(UIMessageIdProvider.TOOLTIP_ROLLOUT_PAUSE),
            UIComponentIdProvider.ROLLOUT_PAUSE_BUTTON_ID, isDisabled);
}

From source file:org.lucidj.browser.AbstractCell.java

License:Apache License

public void setRunning(boolean visible, ComponentState state) {
    if (visible) {
        if (state != null) {
            task_state = state.getState();

            if (task_state == ComponentState.ACTIVE || task_state == ComponentState.TERMINATED) {
                // Ready to run visible only with hover or selection
                running.removeStyleName("component-task-state-visible");
            } else {
                // All other states are always visible
                running.addStyleName("component-task-state-visible");
            }/*  w  ww .j a  v  a 2  s.  c  om*/

            String color = "inherit";
            String html = "S" + String.valueOf(state.getState());
            String title = "State " + String.valueOf(state.getState());

            switch (task_state) // Also record the rendered state
            {
            case ComponentState.INIT: {
                html = FontAwesome.CLOCK_O.getHtml();
                title = "Task awaiting initialization";
                break;
            }
            case ComponentState.ABORTED: {
                color = "red";
                html = "<span class='component-task-runnable'>" + FontAwesome.WARNING.getHtml() + "</span>";
                title = "Task aborted, can try to run";
                break;
            }
            case ComponentState.ACTIVE: {
                color = "green";
                html = FontAwesome.PLAY.getHtml();
                title = "Run task";
                break;
            }
            case ComponentState.TERMINATED: {
                color = "green";
                html = FontAwesome.PLAY.getHtml();
                title = "Task finished, can run again";
                break;
            }
            case ComponentState.INTERRUPTED: {
                color = "blue";
                html = "<span class='component-task-runnable'>" + FontAwesome.PAUSE.getHtml() + "</span>";
                title = "Task interrupted by user, can run again";
                break;
            }
            case ComponentState.RUNNING: {
                color = "red";
                html = FontAwesome.STOP.getHtml();
                title = "Task running";
                break;
            }
            }

            running.setValue("<span style='color:" + color + ";' title='" + title + "'>" + html + "</span>");
        } else {
            running.setValue("");
        }
    }
    running.setVisible(visible);
}