List of usage examples for com.google.gwt.event.logical.shared ValueChangeEvent getValue
public T getValue()
From source file:edu.caltech.ipac.firefly.ui.searchui.ImageSelectUI.java
public Widget makeUI() { final FlowPanel panel = new FlowPanel(); UserServices.App.getInstance().getMissionConfig(dsInfo.getId().toLowerCase(), new BaseCallback<MissionTag>() { @Override/*from www. j a va 2 s .c o m*/ public void doSuccess(MissionTag result) { if (result != null) { final List<ImageSetTag> iltag = result.getImagesetList(); if (iltag.size() > 0) { panel.clear(); EnumFieldDef fd = new EnumFieldDef("imageSets"); fd.setOrientation(EnumFieldDef.Orientation.Vertical); final List<EnumFieldDef.Item> items = new ArrayList<EnumFieldDef.Item>( iltag.size()); for (final ImageSetTag aTag : iltag) { items.add(new EnumFieldDef.Item(aTag.getName(), aTag.getTitle())); } fd.addItems(items); final RadioGroupInputField rgFld = new RadioGroupInputField(fd); GwtUtil.setStyles(rgFld, "padding", "5px", "display", "inline-block", "verticalAlign", "top", "width", "25%", "height", "200px", "overflow", "auto"); rgFld.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> event) { String newVal = event.getValue(); for (int i = 0; i < items.size(); i++) { if (items.get(i).getName().equals(newVal)) { currentImageSet = iltag.get(i); FormTag ftag = currentImageSet.getForm(); if (form != null) panel.remove(1); form = GwtUtil.createSearchForm(ftag, null, null); GwtUtil.setStyles(form, "backgroundColor", "white", "border", "1px solid black", "display", "inline-block", "verticalAlign", "top", "width", "70%", "height", "200px", "overflow", "auto"); panel.add(form); break; } } } }); panel.add(rgFld); rgFld.setValue(items.get(0).getName()); if (rgFld.isVisible()) { ValueChangeEvent.fire(rgFld, items.get(0).getName()); } } } else { Label label = new Label("Image View is not ready yet for " + dsInfo.getUserDesc()); panel.add(label); form = null; currentImageSet = null; } } }); panel.addStyleName("expand-fully"); return GwtUtil.wrap(panel, 20, 20, 20, 20); }
From source file:edu.caltech.ipac.firefly.ui.table.TableOptions.java
private SimpleInputField makePageSizeField() { final SimpleInputField pageSize = SimpleInputField.createByProp("TablePanel.pagesize"); pageSize.setValue(table.getDataModel().getPageSize() + ""); ValidationInputField tbif = (ValidationInputField) pageSize.getField(); tbif.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> vce) { int newPS = StringUtils.getInt(vce.getValue()); if (newPS != table.getDataModel().getPageSize()) { table.getPagingBar().reloadPageSize(newPS); return; }/*from w w w . j a v a2 s .c o m*/ } }); return pageSize; }
From source file:edu.caltech.ipac.firefly.visualize.FloatingVisBar.java
public FloatingVisBar(PlotWidgetGroup group, Widget alignWidget) { _group = group;/* w w w .j av a 2s . com*/ IconCreator _ic = IconCreator.Creator.getInstance(); VerticalPanel panel = new VerticalPanel(); _popup = new PopupPane("", panel, PopupType.LOW_PROFILE, false, false, false, PopupPane.HeaderType.NONE); updateAlignWidget(alignWidget); _popup.setDoRegionChangeHide(false); Widget popoutButton = GwtUtil.makeImageButton(new Image(_ic.getExpandIcon()), "Expand this panel to take up a larger area", new ClickHandler() { public void onClick(ClickEvent event) { expand(); } }); // Image im = new Image(IconCreator.Creator.getInstance().getToolsIcon()); // Widget toolsButton = GwtUtil.makeImageButton(im, "Show tools for more image operations", new ClickHandler() { // public void onClick(ClickEvent event) { // ensureSelected(); // AllPlots ap = AllPlots.getInstance(); // ap.setSelectedWidget(ap.getMiniPlotWidget(), true); // } // }); Widget pdfButton = GwtUtil.makeImageButton(new Image(_ic.getPdf()), "Download PDF", new ClickHandler() { public void onClick(ClickEvent event) { downloadPDF(); } }); // Widget layerButton = GwtUtil.makeImageButton( // new Image(_ic.getPlotLayers()), // "Plot Layers", // new ClickHandler() { // public void onClick(ClickEvent event) { // doPlotLayers(); // } // } // ); ValueChangeHandler<Boolean> vc = new ValueChangeHandler<Boolean>() { public void onValueChange(ValueChangeEvent<Boolean> ev) { if (_enableAllCheckEvent) _group.setAllChecked(ev.getValue(), false); } }; SimplePanel sp = new SimplePanel(); _allCheckCB.addValueChangeHandler(vc); GwtUtil.setStyle(sp, "padding", "5px 0 3px 0"); sp.setWidget(_allCheckCB); panel.setSpacing(3); // panel.add(toolsButton); panel.add(popoutButton); boolean showAllCB = true; boolean showPdfDownload = false; boolean showDrawingLayers = false; //only "hide" _allCheckCB if getEnableChecking()==false if (_group != null && _group.getAllActive() != null && !_group.getAllActive().isEmpty()) { showAllCB = _group.getEnableChecking(); showPdfDownload = _group.getEnablePdfDownload(); // showDrawingLayers = _group.getShowDrawingLayers(); } // if (showDrawingLayers) { // panel.add(layerButton); // } if (showPdfDownload) { panel.add(pdfButton); } if (showAllCB) panel.add(sp); WebEventManager.getAppEvManager().addListener(Name.DROPDOWN_CLOSE, new WebEventListener() { public void eventNotify(WebEvent ev) { DeferredCommand.add(new Command() { public void execute() { _dropClosed = true; if (_showing) _popup.show(); } }); } }); WebEventManager.getAppEvManager().addListener(Name.DROPDOWN_OPEN, new WebEventListener() { public void eventNotify(WebEvent ev) { DeferredCommand.add(new Command() { public void execute() { _dropClosed = false; if (_showing) _popup.hide(); } }); } }); AllPlots.getInstance().addListener(Name.CHECKED_PLOT_CHANGE, new WebEventListener<Boolean>() { public void eventNotify(WebEvent<Boolean> ev) { MiniPlotWidget mpw = (MiniPlotWidget) ev.getSource(); if (!mpw.isChecked()) { if (_allCheckCB.getValue()) { _enableAllCheckEvent = false; _allCheckCB.setValue(false); _enableAllCheckEvent = true; } } } }); }
From source file:edu.caltech.ipac.firefly.visualize.ui.ImageSelectPanel.java
private void createContents(final PlotWidgetOps ops) { createTargetPanel();/*from w ww . jav a 2 s . co m*/ ImageSelectDialogTypes sdt = new ImageSelectDialogTypes(this, _prop); PlotRelatedPanel ppAry[] = (ops != null) ? ops.getGroup().getExtraPanels() : null; if (ppAry != null) { for (PlotRelatedPanel pp : ppAry) { if (pp instanceof PlotTypeUI) { _plotType.add(((PlotTypeUI) pp)); } } } _plotType.addAll(sdt.getPlotTypes()); VerticalPanel vp = new VerticalPanel(); createTabs(ops); int cardIdx = 0; _boundryCards.add(_radiusPanel); _cardIdxMap.put(STANDARD_RADIUS, cardIdx++); _boundryCards.add(_blankLabel); _cardIdxMap.put(BLANK, cardIdx++); for (PlotTypeUI ptype : _plotType) { if (!ptype.usesRadius()) { Widget w = ptype.getAlternateRadiusWidget(); if (w != null) { _boundryCards.add(w); _cardIdxMap.put(ptype, cardIdx++); } } } _bandRemoveList.setSpacing(10); // _tcPanel.setSpacing(5); _tcPanel.add(_use3Color); _tcPanel.add(_threeColorBand); _tcPanel.add(_bandRemoveList); GwtUtil.setStyle(_threeColorBand, "paddingTop", "5px"); GwtUtil.setStyle(_tcPanel, "padding", "8px 0 0 70px"); _tcPanel.setWidth("250px"); // _tcPanel.setHeight("70px"); updatePlotType(ops); _use3Color.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { _threeColorBand.setVisible(_use3Color.getValue()); } }); HorizontalPanel bottom = new HorizontalPanel(); bottom.add(_boundryCards); bottom.add(_tcPanel); bottom.addStyleName("image-select-range-panel"); if (plotFactory != null) { createNew = SimpleInputField.createByProp(_prop.makeBase("plotWhere")); RadioGroupInputField radio = (RadioGroupInputField) createNew.getField(); radio.setPaddingBetween(10); radio.getRadioButton("inNew").setHTML(" " + plotFactory.getCreateDesc()); // createNew= GwtUtil.makeCheckBox(plotFactory.getCreateDesc(), plotFactory.getCreateDesc(),true); if (ops == null) createNew.setVisible(false); createNew.getField().addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> ev) { PlotWidgetOps ops = ev.getValue().equals("inNew") ? null : _ops; updatePlotType(ops); populateBandRemove(ops); } }); SimplePanel boxPanel = new SimplePanel(); boxPanel.setWidget(createNew); vp.add(boxPanel); GwtUtil.setStyle(boxPanel, "padding", "6px 0 9px 200px"); } vp.add(_targetCards); vp.add(_tabs); // vp.add(_boundryCards); vp.add(GwtUtil.centerAlign(bottom)); _tabs.setWidth(575 + "px"); _tabs.setHeight(75 + "px"); _rangesLabel.addStyleName("on-dialog-help"); _tabs.selectTab(0); PlotTypeUI ptype = getActivePlotType(); _tabs.setHeight((ptype.getHeight() + 5) + "px"); _tabs.addSelectionHandler(new SelectionHandler<Integer>() { public void onSelection(SelectionEvent selectionEvent) { PlotTypeUI ptype = getActivePlotType(); _tabs.setHeight((ptype.getHeight() + 5) + "px"); } }); computeRanges(); //todo change if (ops != null) { ops.getPlotView().addListener(Name.REPLOT, new WebEventListener() { public void eventNotify(WebEvent ev) { if (GwtUtil.isOnDisplay(mainPanel)) { populateBandRemove(ops); } } }); } mainPanel = vp; }
From source file:edu.caltech.ipac.firefly.visualize.ui.WebLayerControlPopup.java
private void addLayer(final WebLayerItem item) { if (lastBottomWidget != null) { GwtUtil.setStyles(lastBottomWidget, "borderBottom", "1px solid rgba(0,0,0,.3)", "marginBottom", "7px"); }/*from w w w . j a v a2s . c o m*/ int activeRow = _layerTable.getRowCount(); _panel.showWidget(LAYERS); String name = _prop.getName("on") + " " + item.getTitle(); String tip = _prop.getTip("on") + " " + item.getTitle(); final CheckBox cb = GwtUtil.makeCheckBox(name, tip, true); DOM.setStyleAttribute(cb.getElement(), "paddingRight", "15px"); cb.setValue(item.isVisible()); cb.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(ValueChangeEvent<Boolean> ev) { item.setVisible(cb.getValue()); } }); item.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> ev) { cb.setHTML(_prop.getName("on") + " " + item.getTitle()); } }); item.getPlotView().addListener(Name.LAYER_ITEM_VISIBLE, new WebEventListener() { public void eventNotify(WebEvent ev) { if (ev.getSource() == item) { boolean v = (Boolean) ev.getData(); if (v != cb.getValue()) cb.setValue(v); } } }); Label colorFeedback = new Label(); _layerTable.setWidget(activeRow, ON_COL, cb); if (item.getHasColorSetting()) { _layerTable.setWidget(activeRow, COLOR_FEEDBACK, colorFeedback); _layerTable.setWidget(activeRow, COLOR_COL, makeChangeColorLink(colorFeedback, item)); } Widget userDefined = item.makeUserDefinedColUI(); if (userDefined != null) { _layerTable.setWidget(activeRow, USER_DEFINED_COL, userDefined); } if (item.getHasDelete()) { // int column= item.getHasColorSetting() ? DELETE_COL : COLOR_COL; _layerTable.setWidget(activeRow, DELETE_COL, makeDeleteLink(item)); } if (item.getHasDetails()) { _layerTable.setWidget(activeRow, DETAILS_COL, makeDetailsLink(item)); } // _layerTable.setWidget(rowCnt,HELP_COL,makeHelpLink(item)); activeRow++; Widget extra = item.makeExtraUI(); if (extra != null) { SimplePanel panel = new SimplePanel(); panel.setWidget(extra); DOM.setStyleAttribute(panel.getElement(), "padding", "0 0 0 25px"); _layerTable.setWidget(activeRow, 0, panel); _layerTable.getFlexCellFormatter().setColSpan(activeRow, 0, 4); activeRow++; } if (item.isUsingSubgroups()) { SimplePanel panel = new SimplePanel(); DOM.setStyleAttribute(panel.getElement(), "padding", "0 0 0 25px"); _layerTable.setWidget(activeRow, 0, panel); SimpleInputField field = GwtUtil.createRadioBox("Overlay", sgOps, getCheckBoxValue(item.getSubgroupVisibility()), true); panel.setWidget(field); _layerTable.getFlexCellFormatter().setColSpan(activeRow, 0, 4); activeRow++; field.getField().addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> ev) { item.setVisible(getLevel(ev.getValue())); } }); } String helpStr = item.getHelp(); if (helpStr == null) helpStr = ""; // Label help= new Label(); HTML help = new HTML(); help.setHTML(helpStr); DOM.setStyleAttribute(help.getElement(), "padding", "2px 0 2px 25px"); DOM.setStyleAttribute(help.getElement(), "fontSize", "90%"); help.addStyleName(_ffCss.fadedText()); _layerTable.setWidget(activeRow, 0, help); _layerTable.getFlexCellFormatter().setColSpan(activeRow, 0, 3); lastBottomWidget = help; _layerMap.put(cb, item); }
From source file:edu.caltech.ipac.firefly.visualize.WebMouseReadout.java
public WebMouseReadout(boolean wide) { super();//from w w w . j av a 2 s.co m this.wide = wide; HorizontalPanel hp = new HorizontalPanel(); _popupPanel = new PopupPane(null, hp, PopupType.STANDARD, false, false, false, PopupPane.HeaderType.NONE); _popupPanel.alignTo(null, PopupPane.Align.DISABLE); _popupPanel.setRolldownAnimation(true); _popupPanel.setAnimateDown(true); _popupPanel.setAnimationEnabled(true); _lockIcon = new Image(VisIconCreator.Creator.getInstance().getLocked()); _unlockIcon = new Image(VisIconCreator.Creator.getInstance().getUnlocked()); hp.addDomHandler(new TouchStartHandler() { public void onTouchStart(TouchStartEvent event) { lockDialogOnce(); } }, TouchStartEvent.getType()); _lockButton = GwtUtil.makeImageButton(_unlockIcon, "Lock readout area to stay showing", new ClickHandler() { public void onClick(ClickEvent event) { if (_dialogLockedUp) unlockDialog(); else lockDialog(); } }); _lockButton.setSize("20px", "20px"); _lockMouCheckBox.setTitle("Click on an image to lock the display at that point."); _lockMouCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(ValueChangeEvent<Boolean> lock) { setClickLock(lock.getValue()); } }); VerticalPanel fixedDisplay = new VerticalPanel(); fixedDisplay.setSpacing(2); GwtUtil.setStyle(titleLabel, "whiteSpace", "nowrap"); VerticalPanel wideControlArea = null; addMouseHandlers(_popupPanel.getPopupPanel(), true); addMouseHandlers(hp, true); addMouseHandlers(_grid, true); addMouseHandlers(gridWide, true); addMouseHandlers(fixedDisplay, true); if (wide) { wideControlArea = new VerticalPanel(); wideControlArea.add(_lockButton); wideControlArea.add(titleLabel); GwtUtil.setStyles(titleLabel, "padding", "13px 0 10px 0", "width", "160px"); if (!BrowserUtil.isTouchInput()) { wideControlArea.add(_lockMouCheckBox); GwtUtil.setStyles(_lockMouCheckBox, "paddingTop", "15px"); } fixedDisplay.add(_filePix); fixedDisplay.add(_screenPix); fixedDisplay.add(_zoomLevel); GwtUtil.setStyles(fixedDisplay, "width", "100px"); } else { fixedDisplay.add(_lockButton); fixedDisplay.add(_filePix); fixedDisplay.add(_screenPix); fixedDisplay.add(_zoomLevel); if (!BrowserUtil.isTouchInput()) fixedDisplay.add(_lockMouCheckBox); GwtUtil.setStyles(_lockMouCheckBox, "paddingRight", "10px"); } if (wide) { GwtUtil.setStyles(_filePix, "marginTop", "3px", "paddingLeft", "1px", "fontSize", "10px", "textAlign", "left"); GwtUtil.setStyles(_screenPix, "padding", "1px 12px 0px 1px", "fontSize", "10px", "textAlign", "left"); GwtUtil.setStyles(_zoomLevel, "padding", "12px 0 3px 0", "textAlign", "center", "color", "green", "fontSize", "9pt"); } else { GwtUtil.setStyles(_filePix, "marginTop", "-7px", "fontSize", "10px", "textAlign", "center"); GwtUtil.setStyles(_screenPix, "paddingTop", "5px", "fontSize", "10px", "textAlign", "center"); GwtUtil.setStyles(_zoomLevel, "padding", "2px 0 3px 0", "textAlign", "center", "color", "green", "fontSize", "9pt"); } _lockMouCheckBox.addStyleName("lock-click"); _filePix.addStyleName("title-font-family"); _screenPix.addStyleName("title-font-family"); _zoomLevel.addStyleName("title-font-family"); GwtUtil.setStyles(_grid, "lineHeight", "1", "marginLeft", "-8px"); if (wide) { GwtUtil.setStyles(gridWide, "lineHeight", "1"); } VerticalPanel imagePanel = new VerticalPanel(); if (wide) hp.add(wideControlArea); hp.add(fixedDisplay); hp.add(_grid); hp.add(imagePanel); HorizontalPanel decPanel = new HorizontalPanel(); decPanel.add(_thumbDeck); decPanel.setSpacing(2); decPanel.add(_magDeck); imagePanel.add(decPanel); if (wide) { hp.add(gridWide); } else { arrowDesc.addStyleName("title-font-family"); GwtUtil.setStyles(arrowDesc, "fontSize", "10px", "padding", "0 0 0 35px"); imagePanel.add(arrowDesc); } GwtUtil.setStyle(_magDeck, "paddingLeft", "5px"); if (wide) { _magDeck.setSize("70px", "70px"); } else { _magDeck.setSize("100px", "100px"); } WebEventManager.getAppEvManager().addListener(Name.REGION_CHANGE, new WebEventListener() { public void eventNotify(WebEvent ev) { hideMouseReadout(); } }); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { if (BrowserUtil.isTouchInput()) hideMouseReadout(); // tablet resizing only } }); }
From source file:edu.caltech.ipac.firefly.visualize.WebMouseReadoutPerm.java
public WebMouseReadoutPerm() { super();//from ww w . j a va 2s . com HorizontalPanel hp = new HorizontalPanel(); _lockMouCheckBox.setTitle("Click on an image to lock the display at that point."); _lockMouCheckBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() { public void onValueChange(ValueChangeEvent<Boolean> lock) { setClickLock(lock.getValue()); } }); GwtUtil.setStyle(titleLabel, "whiteSpace", "nowrap"); VerticalPanel titleArea = new VerticalPanel(); titleArea.add(titleLabel); GwtUtil.setStyles(titleLabel, "padding", "0 0 3px 10px", "width", "120px", "height", "1em", "textOverflow", "ellipsis", "overflow", "hidden", "color", "white"); if (!BrowserUtil.isTouchInput()) { titleArea.add(_lockMouCheckBox); GwtUtil.setStyles(_lockMouCheckBox, "padding", "15px 0 0 10px", "color", "white"); } _lockMouCheckBox.setVisible(false); _lockMouCheckBox.addStyleName("lock-click"); if (ALIGN_RIGHT) { hp.add(gridPanel); hp.add(titleArea); } else { hp.add(titleArea); hp.add(gridPanel); } GwtUtil.setStyles(hp, "whiteSpace", "nowrap"); readoutWrapper = new SimplePanel(hp); GwtUtil.setStyles(readoutWrapper, "paddingTop", "4px"); GwtUtil.setStyles(hp, "marginLeft", "140px"); if (ALIGN_RIGHT) { hp.addStyleName("right-floating"); } GwtUtil.setStyle(imagePanel, "paddingTop", "1px"); FlowPanel decPanel = new FlowPanel(); decPanel.add(_thumbDeck); imagePanel.add(decPanel); decPanel.add(_magDeck); GwtUtil.setStyles(_thumbDeck, "display", "inline-block", "border", "1px solid #BBBBBB"); GwtUtil.setStyles(_magDeck, "border", "1px solid #BBBBBB", "display", "inline-block", "marginLeft", "2px"); _magDeck.setSize("70px", "70px"); Window.addResizeHandler(new ResizeHandler() { public void onResize(ResizeEvent event) { // todo } }); WebEventManager.getAppEvManager().addListener(Name.REGION_CHANGE, new WebEventListener() { public void eventNotify(WebEvent ev) { hideMouseReadout(); } }); WebEventManager.getAppEvManager().addListener(Name.DROPDOWN_OPEN, new WebEventListener() { public void eventNotify(WebEvent ev) { hideMouseReadout(); } }); }
From source file:edu.nrao.dss.client.Schedule.java
License:Open Source License
protected void initLayout() { setHeaderVisible(true);//from w ww . j ava 2 s. com setLayout(new BorderLayout()); setCollapsible(false); setBodyBorder(false); setFrame(false); setHeaderVisible(false); setBodyStyle("backgroundColor: white;"); setHeight(920); //setAutoHeight(true); getHeader().addTool(new ToolButton("x-tool-gear")); getHeader().addTool(new ToolButton("x-tool-close")); // basic layout: controls to the west, calendar in the center BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 760); westData.setMinSize(50); westData.setMaxSize(1000); westData.setMargins(new Margins(5)); westData.setSplit(true); westData.setCollapsible(true); BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER); ; centerData.setMargins(new Margins(5, 0, 5, 0)); // now for the child panels: // to the side, control widgets // ======================== Controls =================================== final ContentPanel controlsContainer = new ContentPanel(); controlsContainer.setFrame(true); controlsContainer.setBorders(true); controlsContainer.setHeading("Controls"); controlsContainer.setScrollMode(Scroll.AUTO); calendarControl = new CalendarControl(this); calendarControl.setCollapsible(true); controlsContainer.add(calendarControl); scheduleControl = new ScheduleControl(this); scheduleControl.setCollapsible(true); controlsContainer.add(scheduleControl); scheduleExplorer = new ScheduleCalendar(); scheduleExplorer.addButtonsListener(this); scheduleExplorer.setDefaultDate(startCalendarDay); scheduleExplorer.setCollapsible(true); scheduleExplorer.setAutoHeight(true); controlsContainer.add(scheduleExplorer); vacancyControl = new VacancyControl(this); vacancyControl.setCollapsible(true); vacancyControl.collapse(); controlsContainer.add(vacancyControl); nomineePanel = new NomineePanel(this); nomineePanel.setCollapsible(true); nomineePanel.collapse(); controlsContainer.add(nomineePanel); reservations = new Reservations(startCalendarDay, numCalendarDays); reservations.setCollapsible(true); reservations.collapse(); controlsContainer.add(reservations); // in the middle, the calendar calendar = new ContentPanel(); setCalendarHeader(null); calendar.setScrollMode(Scroll.NONE); // calendar dayView = new DayView(); dayView.setDate(startCalendarDay); //calendar date, not required dayView.setDays((int) numCalendarDays); //number of days displayed at a time, not required dayView.setWidth("100%"); dayView.setHeight("96%"); dayView.setTitle("Schedule Calendar"); CalendarSettings settings = new CalendarSettings(); // this fixes offset issue with time labels settings.setOffsetHourLabels(false); // 15-min. boundaries! settings.setIntervalsPerHour(4); settings.setEnableDragDrop(true); settings.setPixelsPerInterval(12); // shrink the calendar! dayView.setSettings(settings); // when a period is clicked, a user can insert a different session // but we need all those session names getSessionOptions(); dayView.addValueChangeHandler(new ValueChangeHandler<Appointment>() { public void onValueChange(ValueChangeEvent<Appointment> event) { // seed the PeriodDialog w/ details from the period that just got clicked String periodUrl = "/scheduler/periods/UTC/" + event.getValue().getEventId(); JSONRequest.get(periodUrl, new JSONCallbackAdapter() { @Override public void onSuccess(JSONObject json) { // JSON period -> JAVA period Period period = Period.parseJSON(json.get("period").isObject()); // display info about this period, and give options to change it PeriodSummaryDlg dlg = new PeriodSummaryDlg(period, sess_handles, (Schedule) controlsContainer.getParent()); dlg.show(); } }); } }); // Wouldn't it be nice if the user could click on a gap in the calendar and find // Nominees, rather then just use Vacancy Control? // Story: https://www.pivotaltracker.com/story/show/14364047 //dayView.addSelectionHandler(handler); calendar.add(dayView); // add all the components to this parent panel add(controlsContainer, westData); add(calendar, centerData); //updateCalendar(); }
From source file:egovframework.eam.admin.main.client.Main.java
License:Open Source License
public void onValueChange(ValueChangeEvent<String> event) { if (event.getValue().equals("main")) { onHistoryChanged(""); } else {/* w ww . jav a2 s . co m*/ onHistoryChanged(event.getValue()); } }
From source file:eml.studio.client.mvp.AppController.java
License:Open Source License
@Override public void onValueChange(ValueChangeEvent<String> event) { final String token = event.getValue(); logger.info("value change:" + token); loginController.go(token);// www . j av a2 s. c om }