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;
}
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;
}
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);
}
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();
}
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;
}
Aggregations