public Widget asWidget() { if (widget == null) { widget = uiBinder.createAndBindUi(this); } return widget; }
public CustomizeAlertPanel( TenantIdentifier tenant, JobIdentifier job, AlertDefinition alert, JobMetrics result) { super(); _alert = alert; metricAnchor = new MetricAnchor(tenant); metricAnchor.setJobMetrics(result); metricAnchor.setMetric(_alert.getMetricIdentifier()); initWidget(uiBinder.createAndBindUi(this)); _severityIntelligenceRadio = createRadioButton("alert_severity", "Intelligence", AlertSeverity.INTELLIGENCE); _severitySurveillanceRadio = createRadioButton("alert_severity", "Surveillance", AlertSeverity.SURVEILLANCE); _severityWarningRadio = createRadioButton("alert_severity", "Warning", AlertSeverity.WARNING); _severityFatalRadio = createRadioButton("alert_severity", "Fatal", AlertSeverity.FATAL); if (getSelectedSeverity() == null) { // set default severity _severityIntelligenceRadio.setValue(true); } descriptionTextBox.setText(_alert.getDescription()); minimumValueTextBox.setNumberValue(_alert.getMinimumValue()); maximumValueTextBox.setNumberValue(_alert.getMaximumValue()); }
@Override public void init() { initWidget(uiBinder.createAndBindUi(this)); boundWidgets = new Widget[] { starsListBox, extraTextBox, extraListBox, number, name, length, grade, text, fa }; starsListBox.addItem(""); starsListBox.addItem("*"); starsListBox.addItem("**"); starsListBox.addItem("***"); type = ((XmlSimpleModel) this.getModel()).getXml().getNodeName(); if (type.equals("climb")) extraListBox.setVisible(false); else { WidgetUtil.setVisible(lengthSpan, false); extraTextBox.setVisible(false); extraListBox.addItem(""); extraListBox.addItem("(SDS)"); extraListBox.addItem("(Stand)"); extraListBox.addItem("(Hang)"); extraListBox.addItem("(Highball)"); extraListBox.addItem("(Highball, Stand)"); extraListBox.addItem("(Highball, SDS)"); } super.init(); }
public AppointmentFormPage() { popupPanel = new PopupPanel(true); popupPanel.add(uiBinder.createAndBindUi(this)); close.addClickHandler(closeHandler()); cancel.addClickHandler(closeHandler()); submit.addClickHandler(createSaveHandler()); }
public SecurityModule() { new ModulesLyfecycleListenerHandler(Modules.SECURITY_MODULE, this); MessageBus.registerListener(UserAddedMessage.class, this); MessageBus.registerListener(UserEditedMessage.class, this); MessageBus.registerListener(UserDeletedMessage.class, this); usersList = new ListBoxWithAddEditDelete<Dtos.UserDto>( "Users", new IdProvider(), new LabelProvider(), new UserAddingComponent(), new UserEditingComponent(), new UserDeletingComponent(), new Refresher()) { @Override protected boolean isDeleteEnabled(Dtos.UserDto selectedDto) { return super.isEnabled(selectedDto) && selectedDto.getUnlogged() != null && !selectedDto.getUnlogged(); } }; initWidget(uiBinder.createAndBindUi(this)); }
@Override public void init() { // realNode = getModel().getNode(); // tempNode = realNode.cloneNode(true); // getModel().setNode(tempNode); /* cellTable = GpsReadNode.setupTable(getModel(), dataProvider); GpsReadNode.initTableCols(cellTable, true); IdentityColumn<XmlSimpleModel> removeColumn = new IdentityColumn<XmlSimpleModel>( new ActionCell<XmlSimpleModel>("Remove", new ActionCell.Delegate<XmlSimpleModel>() { @Override public void execute(XmlSimpleModel model) { // Window.alert("You clicked " + // model.getNode()); if (Window .confirm("Are you sure you want to remove this?\n You wont be able to undo")) { Node node = model.getNode(); node.getParentNode().removeChild(node); updateAllWidgets(); } } })); cellTable.setColumnWidth(removeColumn, 5, Unit.PCT); cellTable.addColumn(removeColumn, ""); */ initWidget(uiBinder.createAndBindUi(this)); super.init(); /* addButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Element point = ((XmlSimpleModel) getModel()).createElement("point", ""); mapPanel.addNewPointAndSetToCentre(point); updateAllWidgets(); } }); */ if (!mapInited) { mapInited = true; mapPanel.setDelegate(GpsEditNode.this); mapPanel.setEditable(true); mapPanel.init(mapDrawingObjects); } }
public void initialize() { initWidget(uiBinder.createAndBindUi(this)); storeCellWidgets(); addClickHandlersForCells(); resetView(); }
public ShellImpl(EventBus eventBus) { this.eventBus = eventBus; initWidget(uiBinder.createAndBindUi(this)); logOutBtn.setText(constants.logOut()); userBtn.setText(constants.user()); initializeActBtns(7); }
public PropertyEditorColorPicker() { initWidget(uiBinder.createAndBindUi(this)); editIcon.addDomHandler( new ClickHandler() { public void onClick(ClickEvent event) { openColorPickerDialog(); } }, ClickEvent.getType()); colorAddOn.addAppendWidget(editIcon); }
public WelcomePanel() { super(); initWidget(uiBinder.createAndBindUi(this)); toggleWelcomeTextButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { welcomeTextPanel.setVisible(!welcomeTextPanel.isVisible()); updateToggleButtonStyle(); } }); updateToggleButtonStyle(); }
public MenuAndPresenterView(RootPanel rootPanel, Integer menuHeightDecreaser) { super(); this.menuHeightDecreaser = menuHeightDecreaser; rootPanel.clear(); rootPanel.add(uiBinder.createAndBindUi(this)); workAreaPanel.add(getPresenterHolderPanel()); Window.addResizeHandler( new ResizeHandler() { @Override public void onResize(ResizeEvent event) { resizeMenuPanel(); } }); resizeMenuPanel(); }
public Widget asWidget() { if (widget == null) { northData.setMargins(new Margins(5)); westData.setMargins(new Margins(0, 5, 0, 5)); westData.setCollapsible(true); westData.setSplit(true); eastData.setMargins(new Margins(0, 5, 0, 5)); southData.setMargins(new Margins(5)); widget = uiBinder.createAndBindUi(this); for (int i = 0; i < LayoutRegion.values().length; i++) { final LayoutRegion r = LayoutRegion.values()[i]; if (r == LayoutRegion.CENTER) { continue; } SelectHandler handler = new SelectHandler() { @Override public void onSelect(SelectEvent event) { TextButton btn = (TextButton) event.getSource(); String txt = btn.getText(); if (txt.equals("Expand")) { con.expand(r); } else if (txt.equals("Collapse")) { con.collapse(r); } else if (txt.equals("Show")) { con.show(r); } else { con.hide(r); } } }; table.setHTML(i, 0, "<div style='font-size: 12px; width: 100px'>" + r.name() + ":</span>"); table.setWidget(i, 1, new TextButton("Expand", handler)); table.setWidget(i, 2, new TextButton("Collapse", handler)); table.setWidget(i, 3, new TextButton("Show", handler)); table.setWidget(i, 4, new TextButton("Hide", handler)); } } return widget; }
public FilterComponent() { fullTextFilter = new FullTextMatcherFilterComponent("Contains Text"); initWidget(uiBinder.createAndBindUi(this)); try { com.google.gwt.dom.client.Element tr = disclosurePanel.getHeader().getElement().getFirstChildElement().getFirstChildElement(); com.google.gwt.dom.client.Element labelTd = tr.getFirstChildElement().getNextSiblingElement(); labelTd.getStyle().setColor("#f4faff"); } catch (Exception e) { // quite risky operation only for changing the color of a label - if it will fail // than it is better to ignore it and leave the black there and continue than fail the whole // app } activateFilter.setText(FILTERS_ACTIVE); new ModulesLyfecycleListenerHandler(Modules.BOARDS, this); }
public Widget asWidget() { Widget layout = UI_BINDER.createAndBindUi(this); // Create the MapPresenter and add an InitializationHandler: mapPresenter = GeomajasImpl.getInstance().createMapPresenter(); mapPresenter.setSize(480, 480); mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler()); // Define the whole layout: DecoratorPanel mapDecorator = new DecoratorPanel(); mapDecorator.add(mapPresenter.asWidget()); mapPanel.add(mapDecorator); // Initialize the map, and return the layout: GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm"); label.setVisible(false); for (int option : options) { countBox.addItem(option + ""); } countBox.setSelectedIndex(2); return layout; }
public ListBoxWithAddEditDelete( String label, IdProvider<T> idProvider, LabelProvider<T> labelProvider, Component<T> creatingComponent, Component<T> editingComponent, Component<T> deletingComponent, Refresher<T> refresher) { this.idProvider = idProvider; this.labelProvider = labelProvider; this.creatingComponent = creatingComponent; this.editingComponent = editingComponent; this.deletingComponent = deletingComponent; this.refresher = refresher; listBox = new ListBoxWithAddEditDeleteListBox(this); initWidget(uiBinder.createAndBindUi(this)); subjectLabel.setText(label); deleteButton.setEnabled(false); editButton.setEnabled(false); editButton.setEnabled(true); addButton.getUpFace().setImage(new Image(KanbanikResources.INSTANCE.addButtonImage())); editButton .getUpFace() .setImage(new Image(KanbanikResources.INSTANCE.editButtonDisabledImage())); deleteButton .getUpFace() .setImage(new Image(KanbanikResources.INSTANCE.deleteButtonDisabledImage())); this.creatingComponent.setup(addButton, "Add"); this.editingComponent.setup(editButton, "Edit"); this.deletingComponent.setup(deleteButton, "Delete"); }
public GroupFormComposite( TextBox groupNameTextBox, TextArea descriptionTextArea, TextBox groupCodeTextBox, TextArea groupCodeDescriptionTextArea, SimpleCheckBox visibleToMembersCheckbox, SimpleCheckBox manageByMembersCheckbox, SimpleCheckBox openEnrollmentCheckbox, SimpleCheckBox authoritativeCSVCheckbox, SimpleCheckBox optinRequiredCheckbox, Button saveGroupButton) { this.groupNameTextBox = groupNameTextBox; this.descriptionTextArea = descriptionTextArea; this.groupCodeTextBox = groupCodeTextBox; this.groupCodeDescriptionTextArea = groupCodeDescriptionTextArea; this.visibleToMembersCheckbox = visibleToMembersCheckbox; this.manageByMembersCheckbox = manageByMembersCheckbox; this.openEnrollmentCheckbox = openEnrollmentCheckbox; this.authoritativeCSVCheckbox = authoritativeCSVCheckbox; // this.memberCountLabel = memberCountLabel; this.optinRequiredCheckbox = optinRequiredCheckbox; this.saveGroupButton = saveGroupButton; initWidget(uiBinder.createAndBindUi(this)); }
@Override public Widget asWidget() { if (component == null) { final ExampleServiceAsync service = GWT.create(ExampleService.class); RpcProxy<PagingLoadConfig, PagingLoadResult<Post>> proxy = new RpcProxy<PagingLoadConfig, PagingLoadResult<Post>>() { @Override public void load( PagingLoadConfig loadConfig, AsyncCallback<PagingLoadResult<Post>> callback) { service.getPosts(loadConfig, callback); } }; PostProperties props = GWT.create(PostProperties.class); store = new ListStore<Post>( new ModelKeyProvider<Post>() { @Override public String getKey(Post item) { return "" + item.getId(); } }); loader = new PagingLoader<PagingLoadConfig, PagingLoadResult<Post>>(proxy); loader.setRemoteSort(true); loader.addLoadHandler( new LoadResultListStoreBinding<PagingLoadConfig, Post, PagingLoadResult<Post>>(store)); loader.addBeforeLoadHandler( new BeforeLoadHandler<PagingLoadConfig>() { boolean initialLoad = true; @Override public void onBeforeLoad(BeforeLoadEvent<PagingLoadConfig> event) { if (!initialLoad && warnLoad.getValue()) { event.setCancelled(!Window.confirm("Are you sure you want to do that?")); } initialLoad = false; } }); IdentityValueProvider<Post> identity = new IdentityValueProvider<Post>(); sm = new CheckBoxSelectionModel<Post>(identity) { @Override protected void onRefresh(RefreshEvent event) { // this code selects all rows when paging if the header checkbox is selected if (isSelectAllChecked()) { selectAll(); } super.onRefresh(event); } }; ColumnConfig<Post, String> forumColumn = new ColumnConfig<Post, String>(props.forum(), 150, "Forum"); ColumnConfig<Post, String> usernameColumn = new ColumnConfig<Post, String>(props.username(), 150, "Username"); ColumnConfig<Post, String> subjectColumn = new ColumnConfig<Post, String>(props.subject(), 150, "Subject"); ColumnConfig<Post, Date> dateColumn = new ColumnConfig<Post, Date>(props.date(), 150, "Date"); dateColumn.setCell(new DateCell(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT))); List<ColumnConfig<Post, ?>> l = new ArrayList<ColumnConfig<Post, ?>>(); l.add(sm.getColumn()); l.add(forumColumn); l.add(usernameColumn); l.add(subjectColumn); l.add(dateColumn); cm = new ColumnModel<Post>(l); component = uiBinder.createAndBindUi(this); Timer t = new Timer() { @Override public void run() { loader.load(); } }; t.schedule(100); toolBar.getElement().getStyle().setProperty("borderBottom", "none"); toolBar.bind(loader); } return component; }
public TopNav(SimplePanel profilePicPanel) { this.profilePicPanel = profilePicPanel; initWidget(uiBinder.createAndBindUi(this)); }
public VariablePropertiesUI() { initWidget(uiBinder.createAndBindUi(this)); }
public Header() { initWidget(uiBinder.createAndBindUi(this)); }
public BoardsBox(final ConfigureWorkflowModule configureWorkflowModule) { class IdProvider implements ListBoxWithAddEditDelete.IdProvider<Dtos.BoardWithProjectsDto> { @Override public String getId(Dtos.BoardWithProjectsDto dto) { return dto.getBoard().getId(); } } class LabelProvider implements ListBoxWithAddEditDelete.LabelProvider<Dtos.BoardWithProjectsDto> { @Override public String getLabel(Dtos.BoardWithProjectsDto dto) { return dto.getBoard().getName(); } } class Refresher implements ListBoxWithAddEditDelete.Refresher<Dtos.BoardWithProjectsDto> { @Override public void refrehs( List<Dtos.BoardWithProjectsDto> items, Dtos.BoardWithProjectsDto newItem, int index) { items.get(index).setBoard(newItem.getBoard()); } } class OnChangeListener implements ListBoxWithAddEditDelete.OnChangeListener<Dtos.BoardWithProjectsDto> { @Override public void onChanged( List<Dtos.BoardWithProjectsDto> items, Dtos.BoardWithProjectsDto selectedItem) { if (items.isEmpty()) { if (projectToBoardAdding != null) { projectToBoardAdding.disable(); } } else { configureWorkflowModule.selectedBoardChanged(selectedItem); } classOfServicesListManager.selectedBoardChanged( selectedItem == null ? null : selectedItem.getBoard()); } } boardsList = new ListBoxWithAddEditDelete<>( "Boards", new IdProvider(), new LabelProvider(), new BoardCreatingComponent(), new BoardEditingComponent(), new BoardDeletingComponent(), new Refresher()); classOfServiceList = classOfServicesListManager.create(); boardsList.setOnChangeListener(new OnChangeListener()); new MessageListeners(); initWidget(uiBinder.createAndBindUi(this)); addProjectButton.setEnabled(true); addProjectButton.getUpFace().setImage(new Image(KanbanikResources.INSTANCE.addButtonImage())); new ProjectCreatingComponent(addProjectButton); }