Search in sources :

Example 36 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project openremote by openremote.

the class ValueEditors method createNumberEditor.

public static IsWidget createNumberEditor(NumberValue currentValue, Consumer<NumberValue> onValueModified, Optional<Long> timestamp, boolean readOnly, String styleName) {
    Consumer<String> updateConsumer = readOnly ? null : str -> {
        NumberValue newValue = null;
        if (!isNullOrEmpty(str)) {
            try {
                newValue = Values.create(Double.valueOf(str));
            } catch (NumberFormatException ignored) {
            }
        }
        onValueModified.accept(newValue);
    };
    FlowPanel panel = new FlowPanel();
    panel.setStyleName("flex layout horizontal center or-ValueEditor or-NumberValueEditor");
    IsWidget widget = createStringEditorWidget(styleName, readOnly, currentValue != null ? currentValue.asString() : null, updateConsumer);
    FlowPanel widgetWrapper = new FlowPanel();
    widgetWrapper.setStyleName("flex layout horizontal center");
    widgetWrapper.add(widget);
    panel.add(widgetWrapper);
    timestamp.ifPresent(time -> addTimestampLabel(time, panel));
    return panel;
}
Also used : IsWidget(com.google.gwt.user.client.ui.IsWidget) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 37 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project drools-wb by kiegroup.

the class ColumnsPagePresenter method ruleInheritanceWidget.

Widget ruleInheritanceWidget() {
    final FlowPanel result = makeFlowPanel();
    result.setStyleName(GuidedDecisionTableResources.INSTANCE.css().ruleInheritance());
    result.add(ruleInheritanceLabel());
    result.add(ruleSelector());
    return result;
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 38 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project drools-wb by kiegroup.

the class AttributeColumnConfigRowView method addDefaultValue.

public void addDefaultValue(AttributeCol52 attributeColumn, boolean isEditable, DefaultValueWidgetFactory.DefaultValueChangedEventHandler handler) {
    final FlowPanel panel = new FlowPanel();
    panel.add(new SmallLabel(new StringBuilder(GuidedDecisionTableConstants.INSTANCE.DefaultValue()).append(GuidedDecisionTableConstants.COLON).toString()));
    panel.add(DefaultValueWidgetFactory.getDefaultValueWidget(attributeColumn, !isEditable, handler));
    add(panel);
}
Also used : SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 39 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project opennms by OpenNMS.

the class Application method onModuleLoad.

/**
 * This is the entry point method.
 */
public void onModuleLoad() {
    m_chartService = new DefaultChartService();
    Image img = new Image();
    img.setUrl("../images/logo.png");
    img.getElement().getStyle().setPaddingTop(14, Unit.PX);
    img.getElement().getStyle().setPaddingLeft(14, Unit.PX);
    FlowPanel header = new FlowPanel();
    header.getElement().setId("header");
    header.add(img);
    final DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);
    dockLayoutPanel.addNorth(header, 75.00);
    RootLayoutPanel.get().add(dockLayoutPanel);
    m_nav = new Navigation();
    m_nav.addLocationUpdateEventHandler(this);
    m_nav.addHostUpdateEventHandler(this);
    m_flowPanel = new FlowPanel();
    Runnable timelineCallback = new Runnable() {

        public void run() {
            m_chartService.getAllLocationsAvailability(new RequestCallback() {

                @Override
                public void onResponseReceived(Request request, Response response) {
                    if (response.getStatusCode() == 200) {
                        m_timeline = new AnnotatedTimeLine(ChartUtils.convertJSONToDataTable(response.getText()), createTimelineOptions(), "440px", "250px");
                        m_flowPanel.add(m_timeline);
                        m_flowPanel.add(m_nav);
                        dockLayoutPanel.add(m_flowPanel);
                    }
                }

                @Override
                public void onError(Request request, Throwable exception) {
                    Window.alert("Error Initializing Chart");
                }
            });
        }
    };
    VisualizationUtils.loadVisualizationApi(timelineCallback, AnnotatedTimeLine.PACKAGE);
    initializeNav();
}
Also used : Response(com.google.gwt.http.client.Response) AnnotatedTimeLine(com.google.gwt.visualization.client.visualizations.AnnotatedTimeLine) RequestCallback(com.google.gwt.http.client.RequestCallback) DockLayoutPanel(com.google.gwt.user.client.ui.DockLayoutPanel) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) Request(com.google.gwt.http.client.Request) Image(com.google.gwt.user.client.ui.Image)

Example 40 with FlowPanel

use of com.google.gwt.user.client.ui.FlowPanel in project che by eclipse.

the class SelectCommandComboBox method createCustomComponent.

@Override
public Widget createCustomComponent(Presentation presentation) {
    // Create widgets for custom component 'select command'.
    FlowPanel customComponentHeader = new FlowPanel();
    FlowPanel devMachineIconPanel = new FlowPanel();
    FlowPanel commandIconPanel = new FlowPanel();
    customComponentHeader.setStyleName(resources.getCss().selectCommandBox());
    devMachineIconPanel.setStyleName(resources.getCss().selectCommandBoxIconPanel());
    devMachineIconPanel.add(new SVGImage(resources.devMachine()));
    customComponentHeader.add(devMachineIconPanel);
    customComponentHeader.add((Widget) machinesListWidget);
    commandIconPanel.setStyleName(resources.getCss().selectCommandBoxIconPanel());
    commandIconPanel.add(new SVGImage(resources.cmdIcon()));
    customComponentHeader.add(commandIconPanel);
    customComponentHeader.add((Widget) commandsListWidget);
    return customComponentHeader;
}
Also used : FlowPanel(com.google.gwt.user.client.ui.FlowPanel) SVGImage(org.vectomatic.dom.svg.ui.SVGImage)

Aggregations

FlowPanel (com.google.gwt.user.client.ui.FlowPanel)81 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)18 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)15 Button (com.google.gwt.user.client.ui.Button)14 Label (com.google.gwt.user.client.ui.Label)12 Grid (com.google.gwt.user.client.ui.Grid)10 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)8 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)7 SmallHeading (com.google.gerrit.client.ui.SmallHeading)6 Element (com.google.gwt.dom.client.Element)6 CheckBox (com.google.gwt.user.client.ui.CheckBox)6 CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)6 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)6 Widget (com.google.gwt.user.client.ui.Widget)6 Test (org.junit.Test)6 ComplexPanel (com.google.gwt.user.client.ui.ComplexPanel)5 HTML (com.google.gwt.user.client.ui.HTML)5 Image (com.google.gwt.user.client.ui.Image)5 IsWidget (com.google.gwt.user.client.ui.IsWidget)5 List (java.util.List)4