@Override public void init(QuickNewJobPresenter p) { this.presenter = p; newParametersButton.setText(constants.Add_Parameter()); createButton.setText(constants.Create()); jobNameLabel.setText(constants.Name()); jobDueLabel.setText(constants.Due_On()); jobTypeLabel.setText(constants.Type()); dataTriesLabel.setText(constants.Retries()); myParametersGrid.setHeight("200px"); // Set the message to display when the table is empty. myParametersGrid.setEmptyTableWidget(new Label(constants.No_Parameters_added_yet())); initGridColumns(); long now = System.currentTimeMillis(); jobDueDate.setEnabled(true); jobDueDate.setValue(now); jobDueDateTime.setValue(UTCDateBox.date2utc(new Date())); }
public void enableFinishButton(final boolean enabled) { btnFinish.setEnabled(enabled); if (enabled) { btnFinish.setType(ButtonType.PRIMARY); } else { btnFinish.setType(ButtonType.DEFAULT); } }
private void createButtons( final String identifier, final ParameterizedCommand<String> deselectCommand) { collapse = GWT.create(Button.class); collapse.setSize(ButtonSize.MINI); collapse.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { deselectCommand.execute(identifier); } }); }
@Inject public ImportarTextoViewImpl() { // w = ourUiBinder.createAndBindUi(this); btBuscarSrid.setType(ButtonType.PRIMARY); }
private void showSelectRefreshIntervalPopup( final int left, final int top, final Button refreshIntervalSelector) { VerticalPanel popupContent = new VerticalPanel(); // int configuredSeconds = presenter.getAutoRefreshSeconds(); int configuredSeconds = view.getRefreshValue(); if (configuredSeconds > 0) { updateRefreshInterval(true, configuredSeconds); } else { updateRefreshInterval(false, 0); } RadioButton oneMinuteRadioButton = createTimeSelectorRadioButton( 60, "1 Minute", configuredSeconds, refreshIntervalSelector, popupContent); RadioButton fiveMinuteRadioButton = createTimeSelectorRadioButton( 300, "5 Minutes", configuredSeconds, refreshIntervalSelector, popupContent); RadioButton tenMinuteRadioButton = createTimeSelectorRadioButton( 600, "10 Minutes", configuredSeconds, refreshIntervalSelector, popupContent); popupContent.add(oneMinuteRadioButton); popupContent.add(fiveMinuteRadioButton); popupContent.add(tenMinuteRadioButton); Button resetButton = new Button("Disable Autorefresh"); resetButton.setSize(ButtonSize.MINI); resetButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { updateRefreshInterval(false, 0); view.saveRefreshValue(0); refreshIntervalSelector.setActive(false); popup.hide(); } }); popupContent.add(resetButton); popup.setWidget(popupContent); popup.show(); int finalLeft = left - popup.getOffsetWidth(); popup.setPopupPosition(finalLeft, top); }
private boolean handleModalFooter(final ModalFooter footer) { final Iterator<Widget> iterator = footer.iterator(); while (iterator.hasNext()) { final Widget fw = iterator.next(); // Many of our standard ModalFooters embed a ModalFooter within a ModalFooter if (fw instanceof ModalFooter) { return handleModalFooter(((ModalFooter) fw)); } else if (fw instanceof Button) { final Button b = (Button) fw; if (b.getType().equals(ButtonType.PRIMARY)) { b.fireEvent(new ClickEvent() {}); return true; } } } return false; }
@Override public void addSalvarHandler(ClickEnterUpHandler handler) { salvar.addClickHandler(handler); nome.addKeyUpHandler(handler); sobrenome.addKeyUpHandler(handler); telefone.addKeyUpHandler(handler); email.addKeyUpHandler(handler); // dataNascimento.add }
@Override public void afterRenderRows() { dataProvider.refresh(); boolean enableItem = table.getRowCount() > 0; pager.setVisible(table.getRowCount() > Table.DEFAULT_PAGESIZE); downloadDictionary.setEnabled(enableItem); exportData.setDisabled(!enableItem); copyData.setDisabled(!enableItem); table.hideLoadingIndicator(); }
public void createRefreshToggleButton(final Button refreshIntervalSelector) { refreshIntervalSelector.setToggle(true); refreshIntervalSelector.setIcon(IconType.COG); refreshIntervalSelector.setTitle(Constants.INSTANCE.AutoRefresh()); refreshIntervalSelector.setSize(ButtonSize.MINI); popup.getElement().getStyle().setZIndex(Integer.MAX_VALUE); popup.addAutoHidePartner(refreshIntervalSelector.getElement()); popup.addCloseHandler( new CloseHandler<PopupPanel>() { public void onClose(CloseEvent<PopupPanel> popupPanelCloseEvent) { if (popupPanelCloseEvent.isAutoClosed()) { refreshIntervalSelector.setActive(false); } } }); refreshIntervalSelector.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { if (!refreshIntervalSelector.isActive()) { showSelectRefreshIntervalPopup( refreshIntervalSelector.getAbsoluteLeft() + refreshIntervalSelector.getOffsetWidth(), refreshIntervalSelector.getAbsoluteTop() + refreshIntervalSelector.getOffsetHeight(), refreshIntervalSelector); } else { popup.hide(false); } } }); }
@Override public void init(final GridBasePresenter presenter) { this.presenter = presenter; listContainer.clear(); listGrid = new ExtendedPagedTable<DataMockSummary>(10, null); presenter.addDataDisplay(listGrid); listContainer.add(listGrid); this.initGridColumns(); Button refreshButton = new Button(); refreshButton.setIcon(IconType.REFRESH); refreshButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { presenter.refreshList(); } }); listGrid.getToolbar().add(refreshButton); Button createServerDataButton = new Button(); createServerDataButton.setText("Create Server Side Data"); createServerDataButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { presenter.createData(); } }); listGrid.getToolbar().add(createServerDataButton); }
public void setupButtons() { menuActionsButton = new Button(); createRefreshToggleButton(menuActionsButton); menuRefreshButton.setIcon(IconType.REFRESH); menuRefreshButton.setSize(ButtonSize.MINI); menuRefreshButton.setTitle(Constants.INSTANCE.Refresh()); menuResetTabsButton.setIcon(IconType.TH_LIST); menuResetTabsButton.setSize(ButtonSize.MINI); menuResetTabsButton.setTitle(Constants.INSTANCE.RestoreDefaultFilters()); }
@Override public void init(TaskCommentsPresenter presenter) { this.presenter = presenter; listContainer.add(commentsListGrid); listContainer.add(pager); commentsAccordionLabel.add(new HTMLPanel(constants.Add_Comment())); commentsListGrid.setHeight("350px"); commentsListGrid.setEmptyTableWidget(new HTMLPanel(constants.No_Comments_For_This_Task())); // Attach a column sort handler to the ListDataProvider to sort the list. sortHandler = new ListHandler<CommentSummary>(presenter.getDataProvider().getList()); commentsListGrid.addColumnSortHandler(sortHandler); initTableColumns(); presenter.addDataDisplay(commentsListGrid); // Create a Pager to control the table. pager.setDisplay(commentsListGrid); pager.setPageSize(COMMENTS_PER_PAGE); adjustDisplayForListOfSize(1); newTaskCommentTextArea.setWidth("300px"); addCommentButton.setText(constants.Add_Comment()); newTaskCommentLabel.setText(constants.Comment()); }
private void setupCSS() { if (position == UberfireDockPosition.SOUTH) { titlePanel.addStyleName(CSS.CSS().dockExpandedContentPanelSouth()); title.addStyleName(CSS.CSS().dockExpandedLabelSouth()); collapse.setIcon(IconType.CHEVRON_DOWN); collapse.addStyleName(CSS.CSS().dockExpandedButtonSouth()); } else if (position == UberfireDockPosition.WEST) { title.addStyleName(CSS.CSS().dockExpandedLabelWest()); collapse.setIcon(IconType.CHEVRON_LEFT); collapse.addStyleName(CSS.CSS().dockExpandedButtonWest()); } else if (position == UberfireDockPosition.EAST) { title.addStyleName(CSS.CSS().dockExpandedLabelEast()); collapse.setIcon(IconType.CHEVRON_RIGHT); collapse.addStyleName(CSS.CSS().dockExpandedButtonEast()); } setupDockContentSize(); }
private void initFiltersBar() { HorizontalPanel filtersBar = new HorizontalPanel(); parentLink = new Button(); parentLink.setIcon(IconType.BACKWARD); parentLink.setSize(ButtonSize.SMALL); parentLink.setText(constants.Parent()); parentLink.setEnabled(true); parentLink.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { if (BrowserEvents.CLICK.equalsIgnoreCase(event.getNativeEvent().getType())) { parentDocEvent.fire(new DocumentsParentSearchEvent()); pathLink.setText(presenter.currentCMSContentSummary.getParent().getPath()); } } }); homeLink = new Button(); homeLink.setIcon(IconType.HOME); homeLink.setSize(ButtonSize.SMALL); homeLink.setText(constants.Home()); homeLink.setEnabled(true); homeLink.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { if (BrowserEvents.CLICK.equalsIgnoreCase(event.getNativeEvent().getType())) { homeDocEvent.fire(new DocumentsHomeSearchEvent()); pathLink.setText("/"); } } }); newLink = new Button(); newLink.setIcon(IconType.PLUS); newLink.setSize(ButtonSize.SMALL); newLink.setText(constants.New()); newLink.setEnabled(true); newLink.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { DefaultPlaceRequest req = new DefaultPlaceRequest("New Document"); String folder = (presenter.currentCMSContentSummary == null) ? "/" : presenter.currentCMSContentSummary.getPath(); req.addParameter("folder", folder); placeManager.goTo(req); } }); filtersButtonGroup = new ButtonGroup(parentLink, homeLink, newLink); filtersBar.add(filtersButtonGroup); listGrid.getCenterToolbar().add(filtersBar); }
public void setPreviousButtonFocus(final boolean focused) { btnPrevious.setFocus(focused); }
@Override public void addBuscarSridHandler(ClickHandler handler) { modal_btBuscar.addClickHandler(handler); }
public CopyPopup( final Path path, final Validator validator, final CommandWithFileNameAndCommitMessage command) { super(CommonImages.INSTANCE.edit(), CommonConstants.INSTANCE.CopyPopupTitle()); checkNotNull("validator", validator); checkNotNull("path", path); checkNotNull("command", command); // Make sure it appears on top of other popups getElement().getStyle().setZIndex(Integer.MAX_VALUE); setGlassEnabled(true); nameTextBox.setTitle(CommonConstants.INSTANCE.NewName()); nameTextBox.setWidth("200px"); addAttribute(CommonConstants.INSTANCE.NewNameColon(), nameTextBox); checkInCommentTextBox.setTitle(CommonConstants.INSTANCE.CheckInComment()); checkInCommentTextBox.setWidth("200px"); addAttribute(CommonConstants.INSTANCE.CheckInCommentColon(), checkInCommentTextBox); final HorizontalPanel hp = new HorizontalPanel(); final Button create = new Button(CommonConstants.INSTANCE.CopyPopupCreateACopy()); create.addClickHandler( new ClickHandler() { public void onClick(final ClickEvent arg0) { final String baseFileName = nameTextBox.getText(); final String originalFileName = path.getFileName(); final String extension = (originalFileName.lastIndexOf(".") > 0 ? originalFileName.substring(originalFileName.lastIndexOf(".")) : ""); final String fileName = baseFileName + extension; validator.validate( fileName, new ValidatorCallback() { @Override public void onSuccess() { hide(); command.execute( new FileNameAndCommitMessage( baseFileName, checkInCommentTextBox.getText())); } @Override public void onFailure() { Window.alert(CommonConstants.INSTANCE.InvalidFileName0(baseFileName)); } }); } }); hp.add(create); final Button cancel = new Button(CommonConstants.INSTANCE.Cancel()); cancel.addClickHandler( new ClickHandler() { public void onClick(final ClickEvent arg0) { hide(); } }); hp.add(new HTML(" ")); hp.add(cancel); addAttribute("", hp); }
public void enableNextButton(final boolean enabled) { btnNext.setEnabled(enabled); }
public void setNextButtonFocus(final boolean focused) { btnNext.setFocus(focused); }
@Override public void setCancelEnabled(final boolean enabled) { cancel.setEnabled(enabled); }
@Override public void setCloneEnabled(final boolean enabled) { clone.setEnabled(enabled); }
@Override public void init(final DocumentListPresenter presenter) { List<String> bannedColumns = new ArrayList<String>(); bannedColumns.add(constants.DocumentID()); bannedColumns.add(constants.DocumentName()); bannedColumns.add(constants.Actions()); List<String> initColumns = new ArrayList<String>(); initColumns.add(constants.DocumentID()); initColumns.add(constants.DocumentName()); initColumns.add(constants.Actions()); super.init( presenter, new GridGlobalPreferences("DocumentListGrid", initColumns, bannedColumns)); initFiltersBar(); initPathLink(); selectionModel = new NoSelectionModel<CMSContentSummary>(); selectionModel.addSelectionChangeHandler( new SelectionChangeEvent.Handler() { @Override public void onSelectionChange(SelectionChangeEvent event) { boolean close = false; if (selectedRow == -1) { listGrid.setRowStyles(selectedStyles); selectedRow = listGrid.getKeyboardSelectedRow(); listGrid.redraw(); } else if (listGrid.getKeyboardSelectedRow() != selectedRow) { listGrid.setRowStyles(selectedStyles); selectedRow = listGrid.getKeyboardSelectedRow(); listGrid.redraw(); } else { close = true; } selectedItem = selectionModel.getLastSelectedObject(); } }); noActionColumnManager = DefaultSelectionEventManager.createCustomManager( new DefaultSelectionEventManager.EventTranslator<CMSContentSummary>() { @Override public boolean clearCurrentSelection(CellPreviewEvent<CMSContentSummary> event) { return false; } @Override public DefaultSelectionEventManager.SelectAction translateSelectionEvent( CellPreviewEvent<CMSContentSummary> event) { NativeEvent nativeEvent = event.getNativeEvent(); if (BrowserEvents.CLICK.equals(nativeEvent.getType())) { // Ignore if the event didn't occur in the correct // column. if (listGrid.getColumnIndex(actionsColumn) == event.getColumn()) { return DefaultSelectionEventManager.SelectAction.IGNORE; } } return DefaultSelectionEventManager.SelectAction.DEFAULT; } }); listGrid.setSelectionModel(selectionModel, noActionColumnManager); Button configRepoButton = new Button(); configRepoButton.setIcon(IconType.COG); configRepoButton.setTitle(Constants.INSTANCE.ConfigurationPanel()); configRepoButton.addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { PlaceStatus instanceDetailsStatus = placeManager.getStatus(new DefaultPlaceRequest("CMIS Configuration")); if (instanceDetailsStatus == PlaceStatus.OPEN) { placeManager.closePlace("CMIS Configuration"); } placeManager.goTo("CMIS Configuration"); } }); listGrid.getRightToolbar().add(configRepoButton); listGrid.setEmptyTableCaption(constants.No_Documents_Available()); listGrid.setRowStyles(selectedStyles); }
public SplashModalFooter(final ParameterizedCommand<Boolean> closeCommand) { this.closeCommand = checkNotNull("okCommand", closeCommand); add(uiBinder.createAndBindUi(this)); closeButton.ensureDebugId("SplashModalFooter-close"); dontShowAgain.ensureDebugId("SplashModalFooter-dontShowAgain"); }
@Override public void addCancelarHandler(ClickHandler handler) { cancelar.addClickHandler(handler); }
@Override public void addAcionarModalHandler(ClickHandler handler) { btBuscarSrid.addClickHandler(handler); }
@Override public void addNovoHandler(ClickHandler handler) { novo.addClickHandler(handler); }
public void enablePreviousButton(final boolean enabled) { btnPrevious.setEnabled(enabled); }
@Override public void addExcluirHandler(ClickHandler handler) { excluir.addClickHandler(handler); }