use of com.extjs.gxt.ui.client.widget.LayoutContainer in project activityinfo by bedatadriven.
the class LocationForm method addNewLocationButtons.
private void addNewLocationButtons() {
int buttonWidth = (FIELD_WIDTH - BUTTON_SPACE) / 2;
Button saveButton = new Button(I18N.CONSTANTS.useNewLocation(), IconImageBundle.ICONS.save(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
saveNewLocation();
}
});
saveButton.setWidth(buttonWidth);
Button cancelButton = new Button(I18N.CONSTANTS.cancel(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
newLocationPresenter.setActive(false, true);
}
});
cancelButton.setWidth(buttonWidth);
newFormButtonContainer = new LayoutContainer();
newFormButtonContainer.setWidth(FIELD_WIDTH);
newFormButtonContainer.setLayout(new HBoxLayout());
newFormButtonContainer.add(saveButton);
newFormButtonContainer.add(cancelButton, new HBoxLayoutData(0, 0, 0, BUTTON_SPACE));
add(newFormButtonContainer, buttonLayout());
setNewFormActive(false);
}
use of com.extjs.gxt.ui.client.widget.LayoutContainer in project activityinfo by bedatadriven.
the class PivotTableEditor method createGridContainer.
private void createGridContainer() {
center = new LayoutContainer();
center.setLayout(new BorderLayout());
add(center, new BorderLayoutData(Style.LayoutRegion.CENTER));
gridPanel = new PivotGridPanel(service);
gridPanel.setHeaderVisible(true);
gridPanel.setHeadingText(I18N.CONSTANTS.preview());
center.add(gridPanel, new BorderLayoutData(Style.LayoutRegion.CENTER));
viewBinder = new PivotTableBinder(eventBus, service, gridPanel);
}
use of com.extjs.gxt.ui.client.widget.LayoutContainer in project activityinfo by bedatadriven.
the class IndicatorSection method addMixedGroup.
private void addMixedGroup(IndicatorGroup group) {
for (IndicatorDTO indicator : group.getIndicators()) {
if (!indicator.isCalculated() && indicator.isVisible()) {
Text fieldLabel = createLabel(indicator);
fieldLabel.setStyleAttribute("marginTop", "8px");
fieldLabel.setStyleAttribute("marginBottom", "3px");
add(fieldLabel);
TextField field = createField(indicator);
if (indicator.getType() == FieldTypeClass.QUANTITY) {
HBoxLayout rowLayout = new HBoxLayout();
rowLayout.setHBoxLayoutAlign(HBoxLayout.HBoxLayoutAlign.MIDDLE);
Text unitsLabel = new Text(indicator.getUnits());
unitsLabel.setStyleAttribute("paddingLeft", "5px");
LayoutContainer row = new LayoutContainer();
row.setLayout(rowLayout);
row.add(field);
row.add(unitsLabel);
add(row);
} else {
field.setWidth(TEXT_FIELD_WIDTH);
add(field);
}
}
}
}
use of com.extjs.gxt.ui.client.widget.LayoutContainer in project activityinfo by bedatadriven.
the class IndicatorSection method addQuantityTable.
private void addQuantityTable(IndicatorGroup group) {
// Layout in three columns
// Label | Field | Units
TableData fieldLayout = new TableData();
fieldLayout.setWidth(NUMBER_FIELD_WIDTH + "px");
fieldLayout.setVerticalAlign(Style.VerticalAlignment.TOP);
TableData unitLayout = new TableData();
unitLayout.setWidth(UNITS_FIELD_WIDTH + "px");
unitLayout.setVerticalAlign(Style.VerticalAlignment.TOP);
TableLayout layout = new TableLayout();
layout.setWidth("100%");
layout.setColumns(3);
layout.setCellPadding(5);
LayoutContainer table = new LayoutContainer();
table.setLayout(layout);
table.setAutoHeight(true);
for (IndicatorDTO indicator : group.getIndicators()) {
if (!indicator.isCalculated() && indicator.isVisible()) {
Text fieldLabel = createLabel(indicator);
Field field = createField(indicator);
field.setWidth(NUMBER_FIELD_WIDTH);
Text unitLabel = new Text(indicator.getUnits());
unitLabel.setWidth(UNITS_FIELD_WIDTH);
unitLabel.setStyleAttribute("fontSize", "9pt");
table.add(fieldLabel);
table.add(field, fieldLayout);
table.add(unitLabel, unitLayout);
}
}
add(table);
}
use of com.extjs.gxt.ui.client.widget.LayoutContainer in project activityinfo by bedatadriven.
the class LocationDialog method addSearchPanel.
private void addSearchPanel(LocationTypeDTO locationType) {
LayoutContainer container = new LayoutContainer();
container.setLayout(new FlowLayout());
container.setScrollMode(Scroll.AUTOY);
container.addStyleName(SiteFormResources.INSTANCE.style().locationDialogPane());
container.add(newHeader(I18N.CONSTANTS.chooseLocation()));
container.add(newExplanation(I18N.CONSTANTS.chooseLocationDescription()));
container.add(formHeader = newHeader(I18N.CONSTANTS.searchLocations()));
container.add(new LocationForm(dispatcher, locationType, searchPresenter, newLocationPresenter));
container.add(newHeader(I18N.CONSTANTS.searchResults()));
container.add(new SearchListView(searchPresenter));
container.add(new SearchStatusView(searchPresenter));
addLocationHeader = newHeader(I18N.CONSTANTS.addLocation());
addLocationHelp = newExplanation(I18N.CONSTANTS.addLocationDescription());
addLocationButton = new Button(I18N.CONSTANTS.newLocation(), IconImageBundle.ICONS.add(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
newLocationPresenter.setActive(true, true);
}
});
addLocationButton.addStyleName(SiteFormResources.INSTANCE.style().addLocationButton());
if (isAddAllowed()) {
container.add(addLocationHeader);
container.add(addLocationHelp);
container.add(addLocationButton);
}
BorderLayoutData layout = new BorderLayoutData(LayoutRegion.WEST);
layout.setSize(350);
add(container, layout);
}
Aggregations