List of usage examples for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE
VerticalAlignmentConstant ALIGN_MIDDLE
To view the source code for com.google.gwt.user.client.ui HasVerticalAlignment ALIGN_MIDDLE.
Click Source Link
From source file:eml.studio.client.ui.panel.Uploader.FileUploader.java
License:Open Source License
private void initFacet() { this.getUploader().setUploadURL(GWT.getModuleBaseURL() + "fileupload").setFileSizeLimit("20 GB") .setButtonAction(Uploader.ButtonAction.SELECT_FILES).setFileQueueLimit(2) .setFileQueuedHandler(new FileQueuedHandler() { @Override//from w ww .j a v a 2 s . c o m public boolean onFileQueued(final FileQueuedEvent fileQueuedEvent) { // Create a Progress Bar for this file if (FileUploader.this.getFileQueuedId() != null) FileUploader.this.getUploader().cancelUpload(FileUploader.this.getFileQueuedId(), false);// delete the last FileUploader.this.getProgressBarPanel().clear(); FileUploader.this.getProgressBarAndButtonPanel().clear(); // choose file FileUploader.this.setIsFileQueued(true); final ProgressBar progressBar = new ProgressBar(0.0, 1.0, 0.0, FileUploader.this.getCancelProgressBarTextFormatter()); progressBar.setTitle(fileQueuedEvent.getFile().getName()); FileUploader.this.setFileQueuedName(fileQueuedEvent.getFile().getName()); FileUploader.this.setFileQueuedId(fileQueuedEvent.getFile().getId()); progressBar.addStyleName("bda-fileupload-progressbar"); progressBar.setTextVisible(true); FileUploader.this.getProgressBars().put(fileQueuedEvent.getFile().getId(), progressBar); // Add Cancel Button Image FileUploader.this.getCancelButton().setStyleName("cancelButton"); FileUploader.this.getCancelButton().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { FileUploader.this.getUploader().cancelUpload(fileQueuedEvent.getFile().getId(), false); FileUploader.this.getProgressBars().get(fileQueuedEvent.getFile().getId()) .setProgress(-1.0d); FileUploader.this.getCancelButton().removeFromParent(); FileUploader.this.setIsFileQueued(false); } }); FileUploader.this.getCancelButtons().put(fileQueuedEvent.getFile().getId(), FileUploader.this.getCancelButton()); // Add the Bar and Button to the interface progressBarAndButtonPanel.setSpacing(5); Label tit = new Label(fileQueuedEvent.getFile().getName()); // tit.setWidth("100px"); progressBarAndButtonPanel.add(tit); progressBarAndButtonPanel.setCellVerticalAlignment(tit, HasVerticalAlignment.ALIGN_MIDDLE); progressBarAndButtonPanel.add(progressBar); progressBarAndButtonPanel.setCellVerticalAlignment(progressBar, HasVerticalAlignment.ALIGN_MIDDLE); progressBarAndButtonPanel.add(FileUploader.this.getCancelButton()); progressBarAndButtonPanel.setCellVerticalAlignment(FileUploader.this.getCancelButton(), HasVerticalAlignment.ALIGN_MIDDLE); progressBarPanel.add(FileUploader.this.getProgressBarAndButtonPanel()); progressBarPanel.setCellVerticalAlignment(progressBarAndButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE); return true; } }).setUploadProgressHandler(new UploadProgressHandler() { @Override public boolean onUploadProgress(UploadProgressEvent uploadProgressEvent) { ProgressBar progressBar = FileUploader.this.getProgressBars() .get(uploadProgressEvent.getFile().getId()); progressBar.setProgress((double) uploadProgressEvent.getBytesComplete() / uploadProgressEvent.getBytesTotal()); return true; } }).setFileDialogStartHandler(new FileDialogStartHandler() { @Override public boolean onFileDialogStartEvent(FileDialogStartEvent fileDialogStartEvent) { if (FileUploader.this.getUploader().getStats().getUploadsInProgress() <= 0) { // Clear the uploads that have completed, if none are in process FileUploader.this.getProgressBarPanel().clear(); FileUploader.this.getProgressBars().clear(); FileUploader.this.getCancelButtons().clear(); } return true; } }).setFileDialogCompleteHandler(new FileDialogCompleteHandler() { @Override public boolean onFileDialogComplete(FileDialogCompleteEvent fileDialogCompleteEvent) { if (fileDialogCompleteEvent.getTotalFilesInQueue() > 0) { if (FileUploader.this.getUploader().getStats().getUploadsInProgress() <= 0) { // uploader.startUpload(); } } return true; } }).setFileQueueErrorHandler(new FileQueueErrorHandler() { @Override public boolean onFileQueueError(FileQueueErrorEvent fileQueueErrorEvent) { Window.alert("Upload of file " + fileQueueErrorEvent.getFile().getName() + " failed due to [" + fileQueueErrorEvent.getErrorCode().toString() + "]: " + fileQueueErrorEvent.getMessage()); return true; } }).setUploadErrorHandler(new UploadErrorHandler() { @Override public boolean onUploadError(UploadErrorEvent uploadErrorEvent) { FileUploader.this.getCancelButtons().get(uploadErrorEvent.getFile().getId()) .removeFromParent(); Window.alert("Upload of file " + uploadErrorEvent.getFile().getName() + " failed due to [" + uploadErrorEvent.getErrorCode().toString() + "]: " + uploadErrorEvent.getMessage()); return true; } }); FileUploader.this.getDropFilesLabel().addDragOverHandler(new DragOverHandler() { @Override public void onDragOver(DragOverEvent event) { if (!FileUploader.this.getUploader().getButtonDisabled()) { //uploader.getDropFilesLabel().addStyleName("dropFilesLabelHover"); } } }); FileUploader.this.getDropFilesLabel().addDragLeaveHandler(new DragLeaveHandler() { @Override public void onDragLeave(DragLeaveEvent event) { //uploader.getDropFilesLabel().removeStyleName("dropFilesLabelHover"); } }); FileUploader.this.getDropFilesLabel().addDropHandler(new DropHandler() { @Override public void onDrop(DropEvent event) { //uploader.getDropFilesLabel().removeStyleName("dropFilesLabelHover"); if (FileUploader.this.getUploader().getStats().getUploadsInProgress() <= 0) { FileUploader.this.getProgressBarPanel().clear(); FileUploader.this.getProgressBars().clear(); FileUploader.this.getCancelButtons().clear(); } FileUploader.this.getUploader().addFilesToQueue(Uploader.getDroppedFiles(event.getNativeEvent())); event.preventDefault(); } }); }
From source file:es.deusto.weblab.client.experiments.logic.ui.LogicExperiment.java
License:Open Source License
/** * This function gets called just when the actual experiment starts, after * the reserve is done and the queue is over. *///w w w . j a v a2 s .c o m @Override public void start(int time, String initialConfiguration) { final JSONValue parsedInitialConfiguration = JSONParser.parseStrict(initialConfiguration); final String webcamUrl = parsedInitialConfiguration.isObject().get("webcam").isString().stringValue(); this.textIntroPanel.setVisible(false); if (this.useWebcam) { this.webcam.setUrl(webcamUrl); this.webcam.setVisible(true); } else { this.light.setVisible(true); turnOffLight(); } this.points = 0; this.widget.setVisible(true); this.timer.start(); // Inputs this.input1Label = new HTML(this.getFormatedInputLabel(this.zeroString, 1)); this.input1Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(0, 0, this.input1Label); this.input2Label = new HTML(this.getFormatedInputLabel(this.zeroString, 2)); this.input2Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(1, 0, this.input2Label); this.input3Label = new HTML(this.getFormatedInputLabel(this.zeroString, 3)); this.input3Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(3, 0, this.input3Label); this.input4Label = new HTML(this.getFormatedInputLabel(this.zeroString, 4)); this.input4Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(4, 0, this.input4Label); // Gates (level A) this.gateA1Image = new Image(this.unknownOperationUrl); this.circuitGrid.setWidget(0, 2, this.gateA1Image); this.gateA2Image = new Image(this.unknownOperationUrl); this.circuitGrid.setWidget(2, 2, this.gateA2Image); this.gateA3Image = new Image(this.unknownOperationUrl); this.circuitGrid.setWidget(4, 2, this.gateA3Image); // Gates (level B) this.gateB1Image = new Image(this.unknownOperationUrl); this.circuitGrid.setWidget(1, 4, this.gateB1Image); this.gateB2Image = new Image(this.unknownOperationUrl); this.circuitGrid.setWidget(3, 4, this.gateB2Image); // Gates (level C) this.gateC1Image = new Image(this.unknownOperationUrl); this.circuitGrid.setWidget(2, 6, this.gateC1Image); // Connections for (final RowColumnPair pair : RowColumnPair.getRowsColumnPairs()) { final Image pairImage = new Image(pair.getImageResourceWeb(this.resources)); this.circuitGrid.setWidget(pair.getRow(), pair.getColumn() + 1, pairImage); } // Setting the Unknown Gate this.unknownGateImage = this.gateA2Image; this.unknownGateImage.addStyleName(Style.LOGIC_MOUSE_POINTER_HAND); this.changeUnknownGateDialogBox = new ChangeUnknownGateDialogBox(this); this.unknownGateImage.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (LogicExperiment.this.solving) //WlDeustoLogicBasedBoard.this.changeUnknownGateDialogBox.show(); LogicExperiment.this.changeUnknownGateDialogBox .showRelativeTo(LogicExperiment.this.referenceToShowBoxesLabel); } }); // Webcam final Widget webcamWidget; if (this.useWebcam) { this.webcam.start(); webcamWidget = this.webcam.getWidget(); } else { webcamWidget = this.light; } this.circuitAndWebcamPanel.add(webcamWidget); this.circuitAndWebcamPanel.setCellHorizontalAlignment(this.circuitGrid, HasHorizontalAlignment.ALIGN_RIGHT); this.circuitAndWebcamPanel.setCellVerticalAlignment(webcamWidget, HasVerticalAlignment.ALIGN_MIDDLE); this.circuitAndWebcamPanel.setCellHorizontalAlignment(webcamWidget, HasHorizontalAlignment.ALIGN_LEFT); // Messages this.messages.setText("Receiving the circuit"); this.messages.start(); this.sendCommand(new GetCircuitCommand()); this.sendSolutionButton.setVisible(true); }
From source file:es.deusto.weblab.client.experiments.logic.ui.MobileLogicExperiment.java
License:Open Source License
@Override public void start(int time, String initialConfiguration) { final JSONValue parsedInitialConfiguration = JSONParser.parseStrict(initialConfiguration); final String webcamUrl = parsedInitialConfiguration.isObject().get("webcam").isString().stringValue(); this.points = 0; this.widget.setVisible(true); while (this.removableWidgetsPanel.getWidgetCount() > 0) this.removableWidgetsPanel.remove(0); // Timer// w w w .ja v a 2 s. c o m this.timer = new WlTimer(); this.timer.setStyleName(GpibExperiment.Style.TIME_REMAINING); this.timer.getWidget().setWidth("30%"); this.timer.setTimerFinishedCallback(new IWlTimerFinishedCallback() { @Override public void onFinished() { MobileLogicExperiment.this.boardController.clean(); } }); this.removableWidgetsPanel.add(this.timer.getWidget()); // Webcam this.webcam = new WlWebcam(this.getWebcamRefreshingTime(), webcamUrl); final Widget webcamWidget; if (this.useWebcam) { webcamWidget = this.webcam.getWidget(); this.webcam.start(); } else { this.light = new Image(); webcamWidget = this.light; turnOffLight(); } this.removableWidgetsPanel.add(webcamWidget); // Horizontal Panel this.circuitPanel = new HorizontalPanel(); this.circuitPanel.setWidth("100%"); this.circuitPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); this.circuitPanel.add(this.referenceToShowBoxesLabel); // Circuit this.circuitGrid = new Grid(5, 8); this.circuitGrid.setBorderWidth(0); this.circuitPanel.add(this.circuitGrid); // Inputs this.input1Label = new HTML(this.getFormatedInputLabel(this.zeroString, 1)); this.input1Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(0, 0, this.input1Label); this.input2Label = new HTML(this.getFormatedInputLabel(this.zeroString, 2)); this.input2Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(1, 0, this.input2Label); this.input3Label = new HTML(this.getFormatedInputLabel(this.zeroString, 3)); this.input3Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(3, 0, this.input3Label); this.input4Label = new HTML(this.getFormatedInputLabel(this.zeroString, 4)); this.input4Label.setStyleName(Style.LOGIC_INPUT_VALUE_LABEL); this.circuitGrid.setWidget(4, 0, this.input4Label); // Gates (level A) this.gateA1Image = new Image(this.resources.smallUNKNOWN()); this.circuitGrid.setWidget(0, 2, this.gateA1Image); this.gateA2Image = new Image(this.resources.smallUNKNOWN()); this.circuitGrid.setWidget(2, 2, this.gateA2Image); this.gateA3Image = new Image(this.resources.smallUNKNOWN()); this.circuitGrid.setWidget(4, 2, this.gateA3Image); // Gates (level B) this.gateB1Image = new Image(this.resources.smallUNKNOWN()); this.circuitGrid.setWidget(1, 4, this.gateB1Image); this.gateB2Image = new Image(this.resources.smallUNKNOWN()); this.circuitGrid.setWidget(3, 4, this.gateB2Image); // Gates (level C) this.gateC1Image = new Image(this.resources.smallUNKNOWN()); this.circuitGrid.setWidget(2, 6, this.gateC1Image); // Connections for (final RowColumnPair pair : RowColumnPair.getRowsColumnPairs()) { final Image pairImage = new Image(pair.getImageResourceMobile(this.resources)); this.circuitGrid.setWidget(pair.getRow(), pair.getColumn() + 1, pairImage); } // Setting the Unknown Gate this.unknownGateImage = this.gateA2Image; this.unknownGateImage.addStyleName(Style.LOGIC_MOUSE_POINTER_HAND); this.changeUnknownGateDialogBox = new MobileChangeUnknownGateDialogBox(this); this.circuitPanel.setCellHorizontalAlignment(this.circuitGrid, HasHorizontalAlignment.ALIGN_RIGHT); this.circuitPanel.setCellVerticalAlignment(webcamWidget, HasVerticalAlignment.ALIGN_MIDDLE); this.circuitPanel.setCellHorizontalAlignment(webcamWidget, HasHorizontalAlignment.ALIGN_LEFT); this.removableWidgetsPanel.add(this.circuitPanel); // Messages this.messages = new WlWaitingLabel("Receiving the circuit"); this.messages.start(); this.removableWidgetsPanel.add(this.messages.getWidget()); // Send Solution button this.sendSolutionButton = new Button(i18n.sendSolution()); this.sendSolutionButton.setEnabled(false); this.sendSolutionButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { MobileLogicExperiment.this.sendCommand(new SolveCircuitCommand(MobileLogicExperiment.this.circuit)); MobileLogicExperiment.this.messages.setText("Sending solution"); MobileLogicExperiment.this.messages.start(); } }); this.removableWidgetsPanel.add(this.sendSolutionButton); this.sendCommand(new GetCircuitCommand()); }
From source file:es.upm.fi.dia.oeg.map4rdf.client.view.FiltersView.java
License:Open Source License
private void addFilter(FlowPanel filters, DateFilter dateFilter) { if (dateFilters.contains(dateFilter)) { widgetFactory.getDialogBox().showError(messages.existsOtherDateFilterEqual()); } else {//ww w .ja va2 s .c o m HorizontalPanel dateFilterPanel = new HorizontalPanel(); dateFilterPanel.setSpacing(5); dateFilterPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); dateFilterPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); dateFilterPanel.setStyleName(resources.css().dateFilterBox()); String message = getDateFilterTypeMessage(dateFilter.getFilter()); if (message != null) { dateFilters.add(dateFilter); dateFilterPanel.add(new Label(message)); dateFilterPanel.add(new Label(dateTimeFormater(dateFilter.getDate()))); Image removeImage = new Image(resources.eraserIcon()); removeImage.getElement().getStyle().setCursor(Cursor.POINTER); dateFilterPanel.add(removeImage); addRemoveFilterEvent(removeImage, filters, dateFilterPanel, dateFilter); filters.add(dateFilterPanel); fireDateFilterChangeEvent(); } else { widgetFactory.getDialogBox().showError(messages.errorFilterType()); } } }
From source file:fi.jasoft.simplecalendar.client.SimpleCalendarWidget.java
License:Apache License
/** * Default constructor//w w w . ja va 2 s . c o m */ public SimpleCalendarWidget() { // Set default date to today day = today.getDate(); month = today.getMonth(); year = today.getYear() + 1900; setStyleName(STYLENAME); // Add keyboard handlers addFocusHandler(this); addBlurHandler(this); addKeyDownHandler(this); // Create the header controls = new HorizontalPanel(); controls.setStyleName(getStyleName() + "-controls"); controls.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); add(controls); prevYear = new Button("", new ClickHandler() { public void onClick(ClickEvent event) { previousYear(); } }); prevYear.setTabIndex(-1); prevYear.addMouseDownHandler(new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { // Prevent focus from moving to button event.preventDefault(); } }); prevYear.setStyleName(controls.getStyleName() + "-prev-year"); controls.add(prevYear); controls.setCellHorizontalAlignment(prevYear, HasHorizontalAlignment.ALIGN_LEFT); controls.setCellWidth(prevYear, "35px"); prevMonth = new Button("", new ClickHandler() { public void onClick(ClickEvent event) { previousMonth(); } }); prevMonth.setTabIndex(-1); prevMonth.addMouseDownHandler(new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { // Prevent focus from moving to button event.preventDefault(); } }); prevMonth.setStyleName(controls.getStyleName() + "-prev-month"); controls.add(prevMonth); controls.setCellHorizontalAlignment(prevMonth, HasHorizontalAlignment.ALIGN_LEFT); controls.setCellWidth(prevMonth, "35px"); monthAndYear = new HTML(""); monthAndYear.setStyleName(controls.getStyleName() + "-caption"); controls.add(monthAndYear); controls.setCellHorizontalAlignment(monthAndYear, HasHorizontalAlignment.ALIGN_CENTER); nextMonth = new Button("", new ClickHandler() { public void onClick(ClickEvent event) { nextMonth(); } }); nextMonth.setTabIndex(-1); nextMonth.addMouseDownHandler(new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { // Prevent focus from moving to button event.preventDefault(); } }); nextMonth.setStyleName(controls.getStyleName() + "-next-month"); controls.add(nextMonth); controls.setCellHorizontalAlignment(nextMonth, HasHorizontalAlignment.ALIGN_RIGHT); controls.setCellWidth(nextMonth, "35px"); nextYear = new Button("", new ClickHandler() { public void onClick(ClickEvent event) { nextYear(); } }); nextYear.setTabIndex(-1); nextYear.addMouseDownHandler(new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { // Prevent focus from moving to button event.preventDefault(); } }); nextYear.setStyleName(controls.getStyleName() + "-next-year"); controls.add(nextYear); controls.setCellHorizontalAlignment(nextYear, HasHorizontalAlignment.ALIGN_RIGHT); controls.setCellWidth(nextYear, "35px"); // Create day grid grid = new Grid(ROWS, COLUMNS); grid.setStyleName(getStyleName() + "-grid"); grid.setCellSpacing(0); grid.setCellPadding(0); grid.addClickHandler(this); grid.addDomHandler(this, MouseDownEvent.getType()); grid.setWidth("100%"); add(grid); // Format first row grid.getRowFormatter().setStyleName(0, grid.getStyleName() + "-days"); // Populate grid with cells for (int r = 1; r < ROWS; r++) { for (int c = 0; c < COLUMNS; c++) { grid.setHTML(r, c, ""); grid.getCellFormatter().setStyleName(r, c, grid.getStyleName() + "-day"); grid.getCellFormatter().setHeight(r, c, "39px"); } grid.getRowFormatter().setStyleName(r, grid.getStyleName() + "-week"); } displayedMonth = month; displayedYear = year; }
From source file:fr.aliasource.webmail.client.composer.MailComposer.java
License:GNU General Public License
public MailComposer(View ui) { this.ui = ui; setWidth("100%"); northActions = new ComposerActions(ui, this); add(northActions, DockPanel.NORTH);//from ww w .j ava 2 s. com setCellHorizontalAlignment(northActions, DockPanel.ALIGN_LEFT); enveloppe = new VerticalPanel(); enveloppeActions = new HorizontalPanel(); to = new RecipientsPanel(ui, I18N.strings.to() + ": "); cc = new RecipientsPanel(ui, I18N.strings.cc() + ": "); bcc = new RecipientsPanel(ui, I18N.strings.bcc() + ": "); subject = new SubjectField(ui); if (WebmailController.get().getSetting("identities/nb_identities") != null) { if (identities == null && WebmailController.get().hasIdentities()) { identities = new IdentitiesPanel(); enveloppe.add(identities); } } attach = new AttachmentsPanel(); // crp = new CannedResponsePanel(ui, this); enveloppe.add(to); enveloppe.add(cc); cc.setVisible(false); enveloppe.add(bcc); bcc.setVisible(false); enveloppe.add(enveloppeActions); enveloppe.add(subject); // enveloppe.add(crp); enveloppe.add(attach); HorizontalPanel sendParams = new HorizontalPanel(); sendParams.add(new Label()); highPriority = new CheckBox(I18N.strings.importantMessage()); sendParams.add(highPriority); askForDispositionNotification = new CheckBox(I18N.strings.askForDispositionNotification()); sendParams.add(askForDispositionNotification); enveloppe.add(sendParams); sendParams.setCellVerticalAlignment(highPriority, HasVerticalAlignment.ALIGN_MIDDLE); highPriority.setStyleName("enveloppeField"); enveloppe.setStyleName("enveloppe"); createEnveloppeActions(); add(enveloppe, DockPanel.NORTH); VerticalPanel vp = createBodyEditor(ui); add(vp, DockPanel.CENTER); southActions = new ComposerActions(ui, this); add(southActions, DockPanel.SOUTH); setCellHorizontalAlignment(southActions, DockPanel.ALIGN_LEFT); attach.registerUploadListener(northActions); attach.registerUploadListener(southActions); addTabPanelListener(); focusTo(); setTimerStarted(false); setEnableSaveButtons(false); addWindowResizeHandler(); }
From source file:fr.aliasource.webmail.client.conversations.ConversationListActionsPanel.java
License:GNU General Public License
private void initConvToolbar(DockPanel convToolbar, final ConversationListPanel clp) { DockPanel leftActions = new DockPanel(); actions = new HorizontalPanel(); delete = new Button(I18N.strings.delete()); delete.addStyleName("deleteButton"); delete.setEnabled(false);/*w w w .j ava 2 s.c o m*/ actions.add(delete); actions.setCellVerticalAlignment(delete, HorizontalPanel.ALIGN_MIDDLE); delete.addClickHandler(new ClickHandler() { public void onClick(ClickEvent ev) { clp.deleteConversation(); } }); // FIXME: merge reportSpam and notSpam in spamActions reportSpam = new Button(I18N.strings.markAsSpam()); reportSpam.addStyleName("noWrap"); reportSpam.setEnabled(false); actions.add(reportSpam); actions.setCellVerticalAlignment(reportSpam, HorizontalPanel.ALIGN_MIDDLE); reportSpam.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { clp.moveConversation(WebmailController.get().getSelector().getCurrent(), new Folder(WebmailController.get().getSetting(GetSettings.SPAM_FOLDER)), true, null); } }); notSpam = new Button(I18N.strings.notSpam()); notSpam.addStyleName("noWrap"); notSpam.setEnabled(false); notSpam.setVisible(false); actions.add(notSpam); actions.setCellVerticalAlignment(notSpam, HorizontalPanel.ALIGN_MIDDLE); notSpam.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { clp.moveConversation(WebmailController.get().getSelector().getCurrent(), new Folder("INBOX"), true, null); } }); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(0); moveToButton = new MoveConversationsMenu(I18N.strings.moveTo(), clp, true, position); hp.add(moveToButton); copyToButton = new MoveConversationsMenu(I18N.strings.copyTo(), clp, false, position); hp.add(copyToButton); actions.add(hp); actions.setCellVerticalAlignment(hp, HasVerticalAlignment.ALIGN_MIDDLE); moreActions = new MoreActionMenu(I18N.strings.moreActions(), clp, position); actions.add(moreActions); actions.setCellVerticalAlignment(moreActions, HorizontalPanel.ALIGN_MIDDLE); actions.setSpacing(3); actions.addStyleName("actionBox"); leftActions.add(actions, DockPanel.NORTH); HorizontalPanel selection = new HorizontalPanel(); selection.addStyleName("panelActions"); selection.add(new Label(I18N.strings.select() + ": ")); createSelectors(clp, selection); selection.addStyleName("selectionBox"); leftActions.add(selection, DockPanel.SOUTH); convToolbar.add(leftActions, DockPanel.WEST); newest = new Button(" " + I18N.strings.newest()); newest.addStyleName("noWrap"); newest.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { clp.showPage(1); } }); newer = new Button(" " + I18N.strings.newer()); newer.addStyleName("noWrap"); newer.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { clp.showPage(clp.getCurrentPage() - 1); } }); countLabel = new Label(); countLabel.addStyleName("noWrap"); older = new Button(I18N.strings.older() + " "); older.addStyleName("noWrap"); older.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { clp.showPage(clp.getCurrentPage() + 1); } }); oldest = new Button(I18N.strings.oldest() + " "); oldest.addStyleName("noWrap"); oldest.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { clp.showPage(clp.getLastPage()); } }); VerticalPanel rightVrt = new VerticalPanel(); HorizontalPanel right = new HorizontalPanel(); right.add(newest); right.add(newer); right.add(countLabel); right.setCellVerticalAlignment(countLabel, HorizontalPanel.ALIGN_MIDDLE); right.add(older); right.add(oldest); right.setSpacing(3); rightVrt.add(right); convFolderQuota = new ConversationFolderQuota(this.ui); rightVrt.add(convFolderQuota); rightVrt.setHorizontalAlignment(ALIGN_RIGHT); rightVrt.setCellHorizontalAlignment(convFolderQuota, VerticalPanel.ALIGN_RIGHT); right.setCellVerticalAlignment(right, VerticalPanel.ALIGN_MIDDLE); convToolbar.add(rightVrt, DockPanel.EAST); convToolbar.setCellHorizontalAlignment(rightVrt, DockPanel.ALIGN_RIGHT); newest.setVisible(false); newer.setVisible(false); older.setVisible(false); oldest.setVisible(false); }
From source file:fr.aliasource.webmail.client.Heading.java
License:GNU General Public License
public Heading(final View ui) { this.ui = ui; Image logo = new Image("minig/images/logo_minig.png"); logo.setStyleName("obmLogo"); add(logo, DockPanel.WEST);// w ww. ja v a 2 s. c o m final String extUrl = WebmailController.get().getSetting("obm/external_url"); if (extUrl != null) { logo.addStyleName("addressBookItem"); // cursor:pointer... logo.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { Window.Location.assign(extUrl); } }); } // add heading with obm links if (Features.OBM_SECTIONS) { OBMLinks ol = new OBMLinks(); add(ol, DockPanel.CENTER); setCellVerticalAlignment(ol, HasVerticalAlignment.ALIGN_MIDDLE); } HorizontalPanel links = new HorizontalPanel(); links.addStyleName("headingStdLinks"); add(links, DockPanel.EAST); links.setSpacing(4); setCellHorizontalAlignment(links, DockPanel.ALIGN_RIGHT); setWidth("100%"); spinner = new Image("minig/images/spinner_moz.gif"); links.add(spinner); links.setCellVerticalAlignment(spinner, DockPanel.ALIGN_MIDDLE); spinner.setVisible(false); if (RootPanel.get("mainPanel") != null) { return; } String userLbl = ui.getUserName(); if (userLbl.contains("@")) { userLbl = userLbl.replace("@", " (") + ")"; } Label user = new Label(userLbl); user.addStyleName("userNameLabel"); links.add(user); settings = new Anchor(I18N.strings.settings()); settings.addStyleName("settingsLabel"); links.add(settings); logout = new Anchor(I18N.strings.signOut()); logout.addStyleName("logoutLabel"); links.add(logout); setStyleName("heading"); logout.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { ui.log("logging out..."); logout(); } }); settings.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { ui.log("Show settings"); ui.showGlobalSettings(); } }); }
From source file:fr.aliasource.webmail.client.settings.ForwardSetting.java
License:GNU General Public License
public ForwardSetting(View ui) { // this.ui = ui; // setWidth("100%"); setStyleName("settingsTable"); listeners = new ArrayList<ISettingChangeListener>(); disabled = new RadioButton("enabled", I18N.strings.forwardDisable()); setWidget(0, 0, disabled);/*from w ww .j a v a 2s .c o m*/ disabled.addStyleName("noWrap"); disabled.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { notifyChange(); } }); enabled = new RadioButton("enabled", I18N.strings.forwardEnable()); enabled.addStyleName("noWrap"); setWidget(1, 0, enabled); enabled.addValueChangeHandler(new ValueChangeHandler<Boolean>() { @Override public void onValueChange(ValueChangeEvent<Boolean> event) { notifyChange(); } }); email = new TextBox(); email.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { notifyChange(); } }); setWidget(1, 1, email); setWidget(1, 2, new Label(I18N.strings.forwardAnd())); localCopy = new ListBox(false); localCopy.addItem(I18N.strings.forwardKeep(), "true"); localCopy.addItem(I18N.strings.forwardDelete(), "false"); localCopy.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { notifyChange(); } }); setWidget(1, 3, localCopy); getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_MIDDLE); getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_MIDDLE); }
From source file:fr.aliasource.webmail.client.settings.MaxPageSizeSetting.java
License:GNU General Public License
public Widget getFormWidged() { HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); hPanel.add(new HTML("<b>" + I18N.strings.show() + "</b> ")); hPanel.add(list);/* w w w . j ava 2 s .c o m*/ hPanel.add(new HTML(" <b>" + I18N.strings.convPerPage() + "</b>")); return hPanel; }