public ColumnInformationsDialog() { FormLayout layout = new FormLayout(); layout.setLabelWidth(90); layout.setDefaultWidth(155); setLayout(layout); setButtons(Dialog.CLOSE); setHideOnButtonClick(true); setButtonAlign(HorizontalAlignment.LEFT); setIcon(IconHelper.create("images/folder_go.png")); setHeading("Column Informations"); setModal(true); setBlinkModal(true); setBodyBorder(true); setBodyStyle("padding: 8px;background: none"); setWidth(1000); setResizable(true); setMaximizable(true); ColumnConfig fieldNameColumn = new ColumnConfig(ColumnInformationWeb.FIELD_NAME, "Column Name", 130); ColumnConfig fieldTypeColumn = new ColumnConfig(ColumnInformationWeb.FIELD_TYPE, "Column Type", 70); ColumnConfig fieldTypeModifierColumn = new ColumnConfig(ColumnInformationWeb.FIELD_TYPE_MODIFIER, "Typ.Modif.", 70); ColumnConfig fieldMeaningColumn = new ColumnConfig(ColumnInformationWeb.FIELD_MEANING, "Column Meaning", 130); ColumnConfig fieldTransformationColumn = new ColumnConfig(ColumnInformationWeb.FIELD_TRANSFORMATION, "Column Transformation", 230); ColumnConfig bloomFilterMParameterColumn = new ColumnConfig(ColumnInformationWeb.BLOOM_FILTER_M_PARAMETER, "BloomF M", 60); ColumnConfig bloomFilterKParameterColumn = new ColumnConfig(ColumnInformationWeb.BLOOM_FILTER_K_PARAMETER, "BloomF K", 60); ColumnConfig averageFieldLengthColumn = new ColumnConfig(ColumnInformationWeb.AVERAGE_FIELD_LENGTH, "Avg.Col.Len.", 80); ColumnConfig numberOfMissingColumn = new ColumnConfig(ColumnInformationWeb.NUMBER_OF_MISSING, "No.Of.Missing", 80); List<ColumnConfig> config = new ArrayList<ColumnConfig>(); config.add(fieldNameColumn); config.add(fieldTypeColumn); config.add(fieldTypeModifierColumn); config.add(fieldMeaningColumn); config.add(fieldTransformationColumn); config.add(bloomFilterMParameterColumn); config.add(bloomFilterKParameterColumn); config.add(averageFieldLengthColumn); config.add(numberOfMissingColumn); final ColumnModel cm = new ColumnModel(config); grid = new Grid<ColumnInformationWeb>(store, cm); grid.setBorders(true); grid.setAutoWidth(true); grid.setHeight(500); add(grid); }
private void init() { FormLayout formLayout = new FormLayout(); formLayout.setLabelAlign(LabelAlign.TOP); formLayout.setLabelWidth(200); formLayout.setDefaultWidth(340); setLayout(formLayout); AdapterField contentField = new AdapterField(createContentContainer()); contentField.setFieldLabel("Commands,sensors,switches and sliders"); add(contentField); onSubmit(); getAccount(); }
private FieldSet setupIdentifierfieldSet(int widthPanel, int tabIndex) { FieldSet identifierfieldSet = new FieldSet(); identifierfieldSet.setHeading("Identifiers"); identifierfieldSet.setCollapsible(true); identifierfieldSet.setBorders(false); FormLayout identifierlayout = new FormLayout(); identifierlayout.setLabelWidth(150); identifierlayout.setDefaultWidth(390); // It is the real function to set the textField width identifierfieldSet.setLayout(identifierlayout); ContentPanel cp = new ContentPanel(); cp.setHeaderVisible(false); cp.setWidth(widthPanel); cp.add(setupIdentifierGrid(identifierStore, widthPanel - 33, tabIndex)); identifierfieldSet.add(cp); return identifierfieldSet; }
private void initUI() { long time = new java.util.Date().getTime(); GWT.log("Initializing the UI ", null); container = new LayoutContainer(); container.setLayout(new CenterLayout()); // Rpc Proxy setup pagingToolBar = setupRpcProxy(); // Audit event grid setup grid = setupGrid(); // Panel ContentPanel cp = new ContentPanel(); cp.setHeading("Entity Event Viewer"); cp.setFrame(true); cp.setIcon(IconHelper.create("images/search_icon_16x16.png")); cp.setLayout(new FormLayout()); cp.setSize(1100, 630); // Search Container ContentPanel searchContainer = new ContentPanel(); searchContainer.setHeaderVisible(false); FormLayout searchFormLayout = new FormLayout(); searchFormLayout.setLabelWidth(130); searchFormLayout.setDefaultWidth(770); searchContainer.setLayout(searchFormLayout); selectedEvenyTypes = new TextField<String>(); selectedEvenyTypes.setFieldLabel("Selected Event Types"); selectedEvenyTypes.setReadOnly(true); evenyTypes = new ListView<AuditEventTypeWeb>(); evenyTypes.setDisplayProperty("auditEventTypeName"); evenyTypes.setWidth(220); evenyTypes.setHeight(110); evenyTypes.setStore(eventTypesStore); evenyTypes .getSelectionModel() .addListener( Events.SelectionChange, new Listener<SelectionChangedEvent<AuditEventTypeWeb>>() { public void handleEvent(SelectionChangedEvent<AuditEventTypeWeb> be) { List<AuditEventTypeWeb> selections = be.getSelection(); String selectedTypes = ""; for (AuditEventTypeWeb type : selections) { if (selectedTypes.isEmpty()) { selectedTypes = type.getAuditEventTypeName(); } else { selectedTypes = selectedTypes + ", " + type.getAuditEventTypeName(); } } selectedEvenyTypes.setValue(selectedTypes); if (selectedTypes.isEmpty()) { searchButton.disable(); } else { searchButton.enable(); } } }); DateTimePropertyEditor dateFormat = new DateTimePropertyEditor("yyyy-MM-dd HH:mm"); startDate = new DateField(); startDate.setFieldLabel("Start Date Time"); startDate.setToolTip("yyyy-MM-dd HH:mm"); startDate.setPropertyEditor(dateFormat); endDate = new DateField(); endDate.setFieldLabel("End Date Time"); endDate.setToolTip("yyyy-MM-dd HH:mm"); endDate.setPropertyEditor(dateFormat); LayoutContainer main = new LayoutContainer(); main.setLayout(new ColumnLayout()); LayoutContainer left = new LayoutContainer(); left.setStyleAttribute("paddingRight", "10px"); FormLayout layout = new FormLayout(); layout.setLabelWidth(130); layout.setDefaultWidth(220); // layout.setLabelAlign(LabelAlign.TOP); left.setLayout(layout); left.add(startDate); LayoutContainer right = new LayoutContainer(); right.setStyleAttribute("paddingLeft", "10px"); layout = new FormLayout(); // layout.setLabelAlign(LabelAlign.TOP); layout.setLabelWidth(130); layout.setDefaultWidth(220); right.setLayout(layout); right.add(endDate); main.add(left, new ColumnData(.5)); main.add(right, new ColumnData(.5)); HBoxLayoutData dataSelectedTypes = new HBoxLayoutData(new Margins(5, 0, 0, 0)); searchContainer.add(selectedEvenyTypes, dataSelectedTypes); HBoxLayoutData dataTypes = new HBoxLayoutData(new Margins(5, 0, 5, 135)); searchContainer.add(evenyTypes, dataTypes); searchContainer.add(main); HBoxLayoutData dataButtons = new HBoxLayoutData(new Margins(0, 0, 5, 0)); searchContainer.add(setupButtonPanel(3), dataButtons); cp.add(searchContainer); cp.add(grid); cp.setBottomComponent(pagingToolBar); container.add(cp); LayoutContainer wrapper = (LayoutContainer) Registry.get(Constants.CENTER_PANEL); wrapper.removeAll(); wrapper.add(container); wrapper.layout(); GWT.log("Done Initializing the UI in " + (new java.util.Date().getTime() - time), null); }