List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setVerticalAlignment
public void setVerticalAlignment(VerticalAlignmentConstant align)
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
public ExperimentRow(Images resources, ExperimentDAO experiment, ExperimentListener listener, boolean joined, boolean findView) { this.images = resources; this.myConstants = GWT.create(MyConstants.class); this.experiment = experiment; this.joined = joined; this.findView = findView; this.listeners = new ArrayList<ExperimentListener>(); if (listener != null) { listeners.add(listener);//from w ww . j a v a 2 s . c om } HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setStyleName("paco-experimentRow"); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setSpacing(1); horizontalPanel.setHeight("42px"); initWidget(horizontalPanel); Image experimentIcon = new Image(resources.question()); experimentIcon.setAltText(myConstants.experimentIcon()); horizontalPanel.add(experimentIcon); horizontalPanel.setCellHeight(experimentIcon, "42"); horizontalPanel.setCellWidth(experimentIcon, "42"); horizontalPanel.setCellHorizontalAlignment(experimentIcon, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(experimentIcon, HasVerticalAlignment.ALIGN_BOTTOM); experimentIcon.setSize("42px", "42px"); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHeight("39px"); horizontalPanel.add(verticalPanel); HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setHeight("19px"); verticalPanel.add(horizontalPanel_2); Label experimentTitleLabel = new Label(experiment.getTitle()); if (experiment.getDeleted() != null && experiment.getDeleted()) { experimentTitleLabel.setStyleName("gwt-Link-underline-strikethrough"); } else { experimentTitleLabel.setStyleName("gwt-Link-underline"); } horizontalPanel_2.add(experimentTitleLabel); horizontalPanel_2.setCellWidth(experimentTitleLabel, "22px"); horizontalPanel_2.setCellHeight(experimentTitleLabel, "18px"); experimentTitleLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel.setCellVerticalAlignment(experimentTitleLabel, HasVerticalAlignment.ALIGN_MIDDLE); experimentTitleLabel.setWidth("180px"); ClickHandler titleHandler = new ClickHandler() { public void onClick(ClickEvent event) { showExperimentDetails(); } }; if (!isExperimentPurged()) { experimentTitleLabel.addClickHandler(titleHandler); experimentIcon.addClickHandler(titleHandler); } HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setSpacing(1); verticalPanel.add(horizontalPanel_1); createButtonPanel(experiment, joined, horizontalPanel, horizontalPanel_1, findView); }
From source file:com.google.sampling.experiential.client.Main.java
License:Open Source License
private void createHomePage() { RootPanel rootPanel = RootPanel.get(); mainPanel = new VerticalPanel(); mainPanel.setSpacing(2);//w ww . jav a 2 s . co m rootPanel.add(mainPanel); HorizontalPanel menuPanel = createMenuBar(); createStatusPanelOnMenubar(menuPanel); listTitle = new HTML(""); mainPanel.add(listTitle); listTitle.setStyleName("paco-HTML-Large"); listTitle.setWordWrap(false); listTitle.setSize("270px", "22"); mainPanel.setCellHorizontalAlignment(listTitle, HasHorizontalAlignment.ALIGN_CENTER); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(2); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); mainPanel.add(horizontalPanel); experimentPanel = new VerticalPanel(); leftSidePanel = new ScrollPanel(experimentPanel); horizontalPanel.add(leftSidePanel); experimentPanel.setStyleName("paco-experimentPanel"); experimentPanel.setSpacing(2); experimentPanel.setVisible(false); experimentPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); flexTable = new FlexTable(); String height = (Window.getClientHeight() - 200) + "px"; ScrollPanel sp = new ScrollPanel(flexTable); //flexTable.setSize("400px", height); experimentPanel.add(flexTable); contentPanel = new VerticalPanel(); contentPanel.setSpacing(2); horizontalPanel.add(contentPanel); //contentPanel.setSize("550px", "325px"); rootPanel.add(new HTML( "<div style=\"text-align:center;\"><a href=\"/privacypolicy.html\">Privacy Policy</a></div>")); loadJoinedExperiments(); createCallbackForGviz(); }
From source file:com.google.sampling.experiential.client.MonthlyPanel.java
License:Open Source License
public MonthlyPanel(final SignalScheduleDAO schedule) { myConstants = GWT.create(MyConstants.class); this.schedule = schedule; VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setSpacing(2);//w w w.j av a2 s .c o m verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setSize("290px", "43px"); initWidget(verticalPanel); RepeatEveryNPanel repeatPanel = new RepeatEveryNPanel(myConstants.repeatTypeMonths(), schedule); verticalPanel.add(repeatPanel); repeatPanel.setWidth("239px"); VerticalPanel byWhatPanel = new VerticalPanel(); byWhatPanel.setSpacing(2); verticalPanel.add(byWhatPanel); HorizontalPanel domPanel = new HorizontalPanel(); domPanel.setSpacing(2); domPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); byWhatPanel.add(domPanel); domPanel.setWidth("184px"); Label by = new Label("By: "); by.setStyleName("gwt-Label-Header"); domPanel.add(by); by.setWidth("30px"); RadioButton domRadio = new RadioButton(myConstants.byGroup(), myConstants.dayOfMonth()); domRadio.setHTML(myConstants.dayOfMonth()); domPanel.add(domRadio); final ListBox listBox = createDayOfMonthListBox(); listBox.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { schedule.setDayOfMonth(listBox.getSelectedIndex()); } }); domPanel.add(listBox); if (Boolean.TRUE == schedule.getByDayOfMonth()) { listBox.setSelectedIndex(schedule.getDayOfMonth()); } HorizontalPanel dowPanel = new HorizontalPanel(); dowPanel.setSpacing(2); dowPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); byWhatPanel.add(dowPanel); Label label = new Label(myConstants.by() + ": "); label.setStyleName("gwt-Label-Header"); dowPanel.add(label); label.setWidth("30px"); RadioButton dowRadio = new RadioButton(myConstants.byGroup(), myConstants.dayOfWeek()); dowRadio.setHTML(myConstants.dayOfWeek()); dowPanel.add(dowRadio); HorizontalPanel weekdayPanel = new HorizontalPanel(); weekdayPanel.setSpacing(2); weekdayPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); weekdayPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); byWhatPanel.add(weekdayPanel); byWhatPanel.setCellHorizontalAlignment(weekdayPanel, HasHorizontalAlignment.ALIGN_RIGHT); final ListBox nth = createNthDayListBox(schedule, weekdayPanel); weekdayPanel.add(nth); nth.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { schedule.setNthOfMonth(nth.getSelectedIndex()); } }); final WeekDayPanel weekDayPanel = new WeekDayPanel(false, schedule); weekdayPanel.add(weekDayPanel); weekdayPanel.setCellHorizontalAlignment(weekDayPanel, HasHorizontalAlignment.ALIGN_RIGHT); dowRadio.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { toggleDayOfMonthDayOfWeekPanels(schedule, listBox, nth, weekDayPanel, true); } }); domRadio.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { toggleDayOfMonthDayOfWeekPanels(schedule, listBox, nth, weekDayPanel, false); } }); TimeListPanel timeListPanel = new TimeListPanel(schedule); verticalPanel.add(timeListPanel); timeListPanel.setWidth("286px"); if (schedule.getByDayOfMonth()) { domRadio.setValue(Boolean.TRUE); toggleDayOfMonthDayOfWeekPanels(schedule, listBox, nth, weekDayPanel, false); } else { dowRadio.setValue(Boolean.TRUE); toggleDayOfMonthDayOfWeekPanels(schedule, listBox, nth, weekDayPanel, true); } TimeoutPanel timeoutPanel = new TimeoutPanel(schedule); verticalPanel.add(timeoutPanel); timeoutPanel.setWidth("286px"); SnoozePanel snoozePanel = new SnoozePanel(schedule); verticalPanel.add(snoozePanel); snoozePanel.setWidth("286px"); }
From source file:com.google.sampling.experiential.client.RepeatEveryNPanel.java
License:Open Source License
public RepeatEveryNPanel(String period, final SignalScheduleDAO schedule) { MyConstants myConstants = GWT.create(MyConstants.class); this.schedule = schedule; this.periodLabel = period; HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setSpacing(2);// w ww . j a v a 2 s . c o m horizontalPanel.setSize("265px", "25px"); initWidget(horizontalPanel); Label lblRepeatEvery = new Label(myConstants.repeatEvery() + ":"); lblRepeatEvery.setStyleName("gwt-Label-Header"); horizontalPanel.add(lblRepeatEvery); horizontalPanel.setCellVerticalAlignment(lblRepeatEvery, HasVerticalAlignment.ALIGN_MIDDLE); lblRepeatEvery.setSize("93px", "16px"); final ListBox listBox = new ListBox(); listBox.addItem("1"); listBox.addItem("2"); listBox.addItem("3"); listBox.addItem("4"); listBox.addItem("5"); listBox.addItem("6"); listBox.addItem("7"); listBox.addItem("8"); listBox.addItem("9"); listBox.addItem("10"); listBox.addItem("11"); listBox.addItem("12"); listBox.addItem("13"); listBox.addItem("14"); listBox.addItem("15"); listBox.addItem("16"); listBox.addItem("17"); listBox.addItem("18"); listBox.addItem("19"); listBox.addItem("20"); listBox.addItem("21"); listBox.addItem("22"); listBox.addItem("23"); listBox.addItem("24"); listBox.addItem("25"); listBox.addItem("26"); listBox.addItem("27"); listBox.addItem("28"); listBox.addItem("29"); listBox.addItem("30"); horizontalPanel.add(listBox); listBox.setVisibleItemCount(1); listBox.setSelectedIndex(schedule.getRepeatRate() - 1); listBox.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { schedule.setRepeatRate(listBox.getSelectedIndex() + 1); } }); if (periodLabel == null) { periodLabel = "Days"; } Label lblDays = new Label(periodLabel); lblDays.setStyleName("gwt-Label-Header"); horizontalPanel.add(lblDays); }
From source file:com.google.sampling.experiential.client.SchedulePanel.java
License:Open Source License
private Widget createUserEditable(SignalScheduleDAO schedule2) { HorizontalPanel userEditablePanel = new HorizontalPanel(); userEditablePanel.setSpacing(2);/*from w ww . ja va 2 s. co m*/ userEditablePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); userEditablePanel.setWidth(""); Label lblUserEditable = new Label("User Editable: "); lblUserEditable.setStyleName("gwt-Label-Header"); userEditablePanel.add(lblUserEditable); final CheckBox userEditableCheckBox = new CheckBox(""); userEditablePanel.add(userEditableCheckBox); userEditableCheckBox .setValue(schedule.getUserEditable() != null ? schedule.getUserEditable() : Boolean.TRUE); userEditableCheckBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { schedule.setUserEditable(userEditableCheckBox.getValue()); } }); return userEditablePanel; }
From source file:com.google.sampling.experiential.client.SchedulePanel.java
License:Open Source License
private Widget createUserEditableOnce(SignalScheduleDAO schedule2) { HorizontalPanel userEditablePanel = new HorizontalPanel(); userEditablePanel.setSpacing(2);//from w w w .ja v a 2s .co m userEditablePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); userEditablePanel.setWidth(""); Label lblUserEditable = new Label("Only Editable on Join: "); lblUserEditable.setStyleName("gwt-Label-Header"); userEditablePanel.add(lblUserEditable); final CheckBox userEditableCheckBox = new CheckBox(""); userEditablePanel.add(userEditableCheckBox); userEditableCheckBox.setValue( schedule.getOnlyEditableOnJoin() != null ? schedule.getOnlyEditableOnJoin() : Boolean.FALSE); userEditableCheckBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { schedule.setOnlyEditableOnJoin(userEditableCheckBox.getValue()); } }); return userEditablePanel; }
From source file:com.google.testing.testify.risk.frontend.client.view.widgets.ConstrainedParameterWidget.java
License:Apache License
public ConstrainedParameterWidget(List<String> keyValues, String key, String value) { keyListBox.clear();/* www . j a v a2 s . co m*/ for (String keyValue : keyValues) { keyListBox.addItem(keyValue); } int startingKeyIndex = -1; if (keyValues.contains(key)) { startingKeyIndex = keyValues.indexOf(key); } else { // Initialized with a key not in the key values? Likely a bug somewhere... startingKeyIndex = 0; } keyListBox.setSelectedIndex(startingKeyIndex); valueTextBox.setText(value); final HasHandlers self = this; removeParameterImage.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { isDeleted = true; fireChangeEvent(); } }); HorizontalPanel panel = new HorizontalPanel(); panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); panel.addStyleName("tty-DataRequestParameter"); panel.add(keyListBox); panel.add(valueTextBox); panel.add(removeParameterImage); initWidget(panel); }
From source file:com.google.testing.testify.risk.frontend.client.view.widgets.CustomParameterWidget.java
License:Apache License
public CustomParameterWidget(String key, String value) { HorizontalPanel panel = new HorizontalPanel(); panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); panel.addStyleName("tty-DataRequestParameter"); panel.add(keyTextBox);/* w w w .j a v a2 s . c o m*/ panel.add(valueTextBox); panel.add(removeParameterImage); removeParameterImage.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { isDeleted = true; fireChangeEvent(); } }); initWidget(panel); }
From source file:com.google.testing.testify.risk.frontend.client.view.widgets.RiskCapabilityWidget.java
License:Apache License
@UiFactory @Override//from w ww . j ava2s .c o m public EasyDisclosurePanel createDisclosurePanel() { HorizontalPanel header = new HorizontalPanel(); header.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); header.setStyleName("tty-CapabilityRiskHeader"); header.add(capabilityLabel); riskLabel = new Label(); riskLabel.setStyleName("tty-CapabilityRiskValueHeader"); updateRiskLabel(); header.add(riskLabel); EasyDisclosurePanel panel = new EasyDisclosurePanel(header); panel.setOpen(false); return panel; }
From source file:com.italianasoftware.echoes.client.Echoes.java
License:Open Source License
private void createAboutDialog() { aboutDialog = new DialogBox(); VerticalPanel vPanel = new VerticalPanel(); vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); aboutDialog.add(vPanel);//w ww .j av a2 s. c om vPanel.add(new HTML("<strong>Echoes</strong>")); VerticalPanel cPanel = new VerticalPanel(); vPanel.add(cPanel); cPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); cPanel.addStyleName("margintop-2em"); cPanel.add(new HTML("(C) 2008, <a href=\"mailto:fmontesi@italianasoftware.com\">Fabrizio Montesi</a>")); HTML oxygenTeam = new HTML( "Echoes logo by <a href=\"http://www.oxygen-icons.org/\" target=\"_new\">the Oxygen team</a>"); oxygenTeam.addStyleName("margintop-1em"); cPanel.add(oxygenTeam); HTML license = new HTML( "License: <a href=\"http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\" target=\"_new\">GPLv2</a>"); license.addStyleName("margintop-1em"); cPanel.add(license); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); hPanel.addStyleName("margintop-1em"); HTML poweredBy = new HTML("Powered by: "); hPanel.add(poweredBy); Image jolieImage = new Image("images/jolie.png"); jolieImage.addClickListener(new ClickListener() { public void onClick(Widget arg0) { Window.open("http://jolie.sourceforge.net/", "_blank", ""); } }); hPanel.add(jolieImage); cPanel.add(hPanel); Button closeButton = new NativeButton("Close"); closeButton.addStyleName("margintop-1em"); closeButton.addClickListener(new ClickListener() { public void onClick(Widget arg0) { aboutDialog.hide(); } }); vPanel.add(closeButton); }