List of usage examples for com.google.gwt.user.client.ui DockPanel EAST
DockLayoutConstant EAST
To view the source code for com.google.gwt.user.client.ui DockPanel EAST.
Click Source Link
From source file:bwbv.rlt.client.ui.HeaderPane.java
License:Apache License
public void reset() { //TODO: call isLoggedIn() ? boolean isLoggedIn = clientState.getUserName() != null; HorizontalPanel panel = buildHeaderPanel(isLoggedIn); main.remove(0);// ww w.java2 s . c om main.add(panel, DockPanel.EAST); }
From source file:cc.alcina.framework.gwt.client.stdlayout.MainTabPanel.java
License:Apache License
public MainTabPanel(ArrayList<IsWidget> buttons) { super();/*from w w w. ja v a2 s . co m*/ this.buttons = buttons; VerticalPanel vp = (VerticalPanel) getWidget(); dockPanel = new DockPanel(); dockPanel.setStyleName("alcina-MainMenu"); dockPanel.setWidth("100%"); mainMenuContainer = new FlowPanel(); mainMenuContainer.setStyleName("alcina-MainMenuContainer"); mainMenuContainer.add(dockPanel); tabBarProt = (TabBar) vp.getWidget(0); vp.remove(tabBarProt); if (isWrapCenterContainer()) { centerContainer = new SpanPanel(); centerContainer.add(tabBarProt); dockPanel.add(centerContainer, DockPanel.CENTER); } else { dockPanel.add(tabBarProt, DockPanel.CENTER); } bp = createButtonsPanel(); refreshButtonPanelVis(); dockPanel.add(bp, DockPanel.EAST); dockPanel.setCellHorizontalAlignment(bp, DockPanel.ALIGN_RIGHT); vp.insert(mainMenuContainer, 0); customizeDock(); vp.insert(toolbarHolder, 1); vp.getWidget(1).setWidth("100%"); noTabContentHolder.setVisible(false); noTabContentHolder.setStyleName("content alcina-ContentFrame alcina-MainContent"); vp.add(noTabContentHolder); vp.setWidth("100%"); addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { public void onBeforeSelection(BeforeSelectionEvent<Integer> event) { int tabIndex = event.getItem(); getDeckPanel().setVisible(tabIndex >= 0); if (tabIndex != -1) { noTabContentHolder.clear(); } noTabContentHolder.setVisible(tabIndex == -1); } }); }
From source file:co.fxl.gui.gwt.GWTDockPanel.java
License:Open Source License
@Override public void add(Widget widget) { // if (!(widget instanceof ScrollPanel)) // widget.getElement().getStyle().setOverflow(Overflow.HIDDEN); DockLayoutConstant location = positions.remove(0); container.widget.add(widget, location); if (widget instanceof HasHorizontalAlignment) { ((HasHorizontalAlignment) widget).setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT); }/* w w w .j av a 2 s . c om*/ if (widget instanceof HasVerticalAlignment) { ((HasVerticalAlignment) widget).setVerticalAlignment(VerticalPanel.ALIGN_TOP); } if (location.equals(DockPanel.SOUTH) || location.equals(DockPanel.NORTH) || location.equals(DockPanel.CENTER)) { container.widget.setCellWidth(widget, "100%"); widget.setWidth("100%"); } if (location.equals(DockPanel.EAST) || location.equals(DockPanel.WEST) || location.equals(DockPanel.CENTER)) { container.widget.setCellHeight(widget, height != -1 ? height + "px" : "100%"); widget.setHeight(height != -1 ? height + "px" : "100%"); } }
From source file:co.fxl.gui.gwt.GWTDockPanel.java
License:Open Source License
@Override public IContainer right() { setPosition(DockPanel.EAST); return add(); }
From source file:com.apress.progwt.client.calculator.Calculator.java
License:Apache License
public Calculator() { DockPanel dockPanel = new DockPanel(); Grid controls = new Grid(5, 2); Grid numbersP = new Grid(4, 3); // initialize the 1-9 buttons for (int row = 0; row < 3; row++) { for (int col = 0; col < 3; col++) { numbersP.setWidget(row, col, new NumberButton(this, row * 3 + col + 1)); }//w w w .ja va 2 s .c om } numbersP.setWidget(3, 0, new NumberButton(this, 0)); numbersP.setWidget(3, 1, new NumberButton(this, ".")); numbersP.setWidget(3, 2, new ControlButton(this, new ControlAction(this, "+/-") { @Override public boolean isMultiArg() { return false; } @Override public double performAction(ControlAction lastAction, double previous, double current) { return -1 * current; } })); controls.setWidget(0, 0, new ControlButton(this, new ControlAction(this, "/") { @Override public double performAction(ControlAction lastAction, double previous, double current) { return previous / current; } })); controls.setWidget(0, 1, new ControlButton(this, new ControlAction(this, "sqrt") { @Override public boolean isMultiArg() { return false; } @Override public double performAction(ControlAction lastAction, double previous, double current) { return Math.sqrt(current); } })); controls.setWidget(1, 0, new ControlButton(this, new ControlAction(this, "*") { @Override public double performAction(ControlAction lastAction, double previous, double current) { return previous * current; } })); controls.setWidget(1, 1, new ControlButton(this, new ControlAction(this, "%") { @Override public double performAction(ControlAction lastAction, double previous, double current) { return previous % current; } })); controls.setWidget(2, 0, new ControlButton(this, new ControlAction(this, "-") { @Override public double performAction(ControlAction lastAction, double previous, double current) { return previous - current; } })); controls.setWidget(2, 1, new ControlButton(this, new ControlAction(this, "1/x") { @Override public boolean isMultiArg() { return false; } @Override public double performAction(ControlAction lastAction, double previous, double current) { return 1 / current; } })); controls.setWidget(3, 0, new ControlButton(this, new ControlAction(this, "+") { @Override public double performAction(ControlAction lastAction, double previous, double current) { return previous + current; } })); controls.setWidget(3, 1, new ControlButton(this, new ControlAction(this, "=") { @Override public boolean isMultiArg() { return false; } @Override public double performAction(ControlAction lastAction, double previous, double current) { if (lastAction == null) { return current; } return lastAction.performAction(null, previous, current); } })); controls.setWidget(4, 0, new ControlButton(this, new ControlAction(this, "bksp") { @Override public boolean isMultiArg() { return false; } @Override public double performAction(ControlAction lastAction, double previous, double current) { String cStr = current + ""; if (cStr.endsWith(".0")) { cStr = cStr.substring(0, cStr.length() - 3); } else { cStr = cStr.substring(0, cStr.length() - 1); } if (cStr.equals("")) { cStr = "0"; } return Double.parseDouble(cStr); } })); controls.setWidget(4, 1, new ControlButton(this, new ControlAction(this, "clear") { @Override public boolean isMultiArg() { return false; } @Override public double performAction(ControlAction lastAction, double previous, double current) { return 0; } })); dockPanel.add(numbersP, DockPanel.CENTER); dockPanel.add(controls, DockPanel.EAST); inputBox = new TextBox(); inputBox.addStyleName("ResultBox"); dockPanel.add(inputBox, DockPanel.NORTH); ticker = new TextArea(); ticker.setSize("7em", "140px"); MultiWordSuggestOracle oracle = new MultiWordSuggestOracle(); oracle.add("Jill"); oracle.add("Jeff"); oracle.add("James"); oracle.add("Jennifer"); SuggestBox box = new SuggestBox(oracle); box.addEventHandler(new SuggestionHandler() { public void onSuggestionSelected(SuggestionEvent suggE) { String selected = suggE.getSelectedSuggestion().getReplacementString(); // do something with selected suggestion } }); dockPanel.add(box, DockPanel.SOUTH); HorizontalPanel mainP = new HorizontalPanel(); mainP.add(dockPanel); mainP.add(ticker); initWidget(mainP); setResult(0); }
From source file:com.apress.progwt.client.widget.datepicker.CalendarTraversalPanel.java
License:Apache License
private void init() { this.setHeight(18 + "px"); drawTitle();/*from w w w .jav a 2 s . c o m*/ this.prevMonth.setWidth(23 + "px"); this.nextMonth.setWidth(23 + "px"); DOM.setAttribute(prevMonth.getElement(), "title", "Previous Month"); DOM.setAttribute(prevYear.getElement(), "title", "Previous Year"); DOM.setAttribute(nextMonth.getElement(), "title", "Next Month"); DOM.setAttribute(nextYear.getElement(), "title", "Next Year"); HorizontalPanel prevButtons = new HorizontalPanel(); prevMonth.setStyleName("monthYearTraversorBtn"); prevYear.setStyleName("monthYearTraversorBtn"); prevButtons.add(prevYear); prevButtons.add(prevMonth); HorizontalPanel nextButtons = new HorizontalPanel(); nextMonth.setStyleName("monthYearTraversorBtn"); nextYear.setStyleName("monthYearTraversorBtn"); nextButtons.add(nextMonth); nextButtons.add(nextYear); this.add(prevButtons, DockPanel.WEST); this.setCellHorizontalAlignment(prevButtons, DockPanel.ALIGN_LEFT); this.add(nextButtons, DockPanel.EAST); this.setCellHorizontalAlignment(nextButtons, DockPanel.ALIGN_RIGHT); this.add(monthYearDesc, DockPanel.CENTER); this.setVerticalAlignment(DockPanel.ALIGN_MIDDLE); this.setCellHorizontalAlignment(this.monthYearDesc, HasAlignment.ALIGN_CENTER); this.setCellVerticalAlignment(this.monthYearDesc, HasAlignment.ALIGN_MIDDLE); this.setCellWidth(monthYearDesc, "100%"); monthYearDesc.setStyleName("monthYearTraversor"); this.setStyleName("monthYearTraversor"); }
From source file:com.audata.client.feedback.SimpleDialog.java
License:Open Source License
private SimpleDialog(int type, String title, String message, ResponseListener listener) { this.listener = listener; this.type = type; this.setText(title); this.addStyleName("audoc-simpleDialog"); DockPanel main = new DockPanel(); main.setSpacing(4);/*w ww . j av a2 s . c o m*/ HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT); butPanel.setSpacing(4); switch (type) { case SimpleDialog.TYPE_ERROR: main.add(new Image("images/48x48/error.gif"), DockPanel.WEST); this.close = new Button("Close"); this.close.addClickListener(this); butPanel.add(this.close); break; case SimpleDialog.TYPE_MESSAGE: main.add(new Image("images/48x48/udf.gif"), DockPanel.WEST); this.close = new Button("Close"); this.close.addClickListener(this); butPanel.add(this.close); break; case SimpleDialog.TYPE_QUERY: main.add(new Image("images/48x48/help.gif"), DockPanel.WEST); this.ok = new Button("Ok"); this.ok.addClickListener(this); this.cancel = new Button("Cancel"); this.cancel.addClickListener(this); butPanel.add(this.ok); butPanel.add(this.cancel); break; } VerticalPanel p = new VerticalPanel(); p.setSpacing(15); p.add(new Label(message)); p.add(butPanel); p.setCellHorizontalAlignment(butPanel, HasAlignment.ALIGN_RIGHT); main.add(p, DockPanel.EAST); this.setWidget(main); this.setPopupPosition(0, 0); }
From source file:com.audata.client.widgets.CaptionButton.java
License:Open Source License
public CaptionButton() { main = new DockPanel(); initWidget(main);/*from www. jav a 2 s . c om*/ main.setSpacing(4); main.setStyleName("captionButton"); image = new Image(); main.add(image, DockPanel.WEST); main.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_LEFT); main.setCellVerticalAlignment(image, HasVerticalAlignment.ALIGN_MIDDLE); image.setStyleName("captionButton-Icon"); image.setUrl("images/48x48/admin.gif"); caption = new HTML("New Label"); main.add(caption, DockPanel.EAST); main.setCellHorizontalAlignment(caption, HasHorizontalAlignment.ALIGN_LEFT); main.setCellVerticalAlignment(caption, HasVerticalAlignment.ALIGN_MIDDLE); caption.setStyleName("captionButton-caption"); //setWidth("100%"); }
From source file:com.audata.client.widgets.CaptionButton.java
License:Open Source License
public void setOrientation(DockLayoutConstant layout) { DockLayoutConstant capPos = layout;//from w ww .j a v a 2s . c o m DockLayoutConstant imgPos = DockPanel.WEST; HorizontalAlignmentConstant capHorizAlign = HasHorizontalAlignment.ALIGN_CENTER; VerticalAlignmentConstant capVertAlign = HasVerticalAlignment.ALIGN_MIDDLE; HorizontalAlignmentConstant imgHorizAlign = HasHorizontalAlignment.ALIGN_CENTER; VerticalAlignmentConstant imgVertAlign = HasVerticalAlignment.ALIGN_MIDDLE; if (layout == DockPanel.EAST) { imgPos = DockPanel.WEST; capHorizAlign = HasHorizontalAlignment.ALIGN_LEFT; imgHorizAlign = HasHorizontalAlignment.ALIGN_LEFT; } if (layout == DockPanel.NORTH) { imgPos = DockPanel.SOUTH; capVertAlign = HasVerticalAlignment.ALIGN_BOTTOM; imgVertAlign = HasVerticalAlignment.ALIGN_BOTTOM; } if (layout == DockPanel.WEST) { imgPos = DockPanel.EAST; capHorizAlign = HasHorizontalAlignment.ALIGN_LEFT; imgHorizAlign = HasHorizontalAlignment.ALIGN_LEFT; } if (layout == DockPanel.SOUTH) { imgPos = DockPanel.NORTH; capVertAlign = HasVerticalAlignment.ALIGN_BOTTOM; imgVertAlign = HasVerticalAlignment.ALIGN_BOTTOM; } main.clear(); main.add(caption, capPos); main.setCellHorizontalAlignment(caption, capHorizAlign); main.setCellVerticalAlignment(caption, capVertAlign); main.add(image, imgPos); main.setCellHorizontalAlignment(image, imgHorizAlign); main.setCellVerticalAlignment(image, imgVertAlign); }
From source file:com.bramosystems.oss.player.core.client.skin.CustomPlayerControl.java
License:Apache License
private Widget getPlayerWidget(final UIStyleResource imgPack) { imgPack.ensureInjected();/*www .ja v a2s .c o m*/ seekbar = new CSSSeekBar(5); seekbar.setStylePrimaryName(STYLE_NAME); seekbar.addStyleDependentName("seekbar"); seekbar.setWidth("95%"); seekbar.addSeekChangeHandler(new SeekChangeHandler() { @Override public void onSeekChanged(SeekChangeEvent event) { player.setPlayPosition(event.getSeekPosition() * player.getMediaDuration()); } }); playTimer = new Timer() { @Override public void run() { updateSeekState(); } }; play = new CPCButton(imgPack.playDisabled(), new ClickHandler() { @Override public void onClick(ClickEvent event) { switch (playState) { case Stop: case Pause: try { // play media... play.setEnabled(false); // avoid multiple clicks player.playMedia(); } catch (PlayException ex) { DebugEvent.fire(player, DebugEvent.MessageType.Error, ex.getMessage()); } break; case Playing: player.pauseMedia(); } } }); play.setStyleName(imgPack.play()); play.setEnabled(false); stop = new CPCButton(imgPack.stopDisabled(), new ClickHandler() { @Override public void onClick(ClickEvent event) { player.stopMedia(); } }); stop.setStyleName(imgPack.stop()); stop.setEnabled(false); prev = new CPCButton(imgPack.prevDisabled(), new ClickHandler() { @Override public void onClick(ClickEvent event) { if (player instanceof PlaylistSupport) { try { ((PlaylistSupport) player).playPrevious(); } catch (PlayException ex) { next.setEnabled(false); DebugEvent.fire(player, DebugEvent.MessageType.Info, ex.getMessage()); } } } }); prev.setStyleName(imgPack.prev()); prev.setEnabled(false); next = new CPCButton(imgPack.nextDisabled(), new ClickHandler() { @Override public void onClick(ClickEvent event) { if (player instanceof PlaylistSupport) { try { ((PlaylistSupport) player).playNext(); } catch (PlayException ex) { next.setEnabled(false); DebugEvent.fire(player, DebugEvent.MessageType.Info, ex.getMessage()); } } } }); next.setStyleName(imgPack.next()); next.setEnabled(false); vc = new VolumeControl(5); vc.setStyleName(imgPack.volume()); vc.setPopupStyleName(STYLE_NAME + "-volumeControl"); vc.addVolumeChangeHandler(new VolumeChangeHandler() { @Override public void onVolumeChanged(VolumeChangeEvent event) { player.setVolume(event.getNewVolume()); } }); player.addLoadingProgressHandler(new LoadingProgressHandler() { @Override public void onLoadingProgress(LoadingProgressEvent event) { seekbar.setLoadingProgress(event.getProgress()); vc.setVolume(player.getVolume()); updateSeekState(); } }); player.addPlayStateHandler(new PlayStateHandler() { @Override public void onPlayStateChanged(PlayStateEvent event) { int index = event.getItemIndex(); switch (event.getPlayState()) { case Paused: toPlayState(PlayState.Pause, imgPack); next.setEnabled(index < (((PlaylistSupport) player).getPlaylistSize() - 1)); prev.setEnabled(index > 0); break; case Started: toPlayState(PlayState.Playing, imgPack); next.setEnabled(index < (((PlaylistSupport) player).getPlaylistSize() - 1)); prev.setEnabled(index > 0); break; case Stopped: case Finished: toPlayState(PlayState.Stop, imgPack); next.setEnabled(false); prev.setEnabled(false); break; } } }); player.addPlayerStateHandler(new PlayerStateHandler() { @Override public void onPlayerStateChanged(PlayerStateEvent event) { switch (event.getPlayerState()) { case Ready: play.setEnabled(true); vc.setVolume(player.getVolume()); } } }); // Time label.. timeLabel = new Label("--:-- / --:--"); timeLabel.setWordWrap(false); timeLabel.setHorizontalAlignment(Label.ALIGN_CENTER); // build the UI... DockPanel face = new DockPanel(); face.setStyleName(""); face.setVerticalAlignment(DockPanel.ALIGN_MIDDLE); face.setSpacing(3); face.add(vc, DockPanel.WEST); face.add(play, DockPanel.WEST); face.add(stop, DockPanel.WEST); face.add(prev, DockPanel.WEST); face.add(next, DockPanel.WEST); face.add(timeLabel, DockPanel.EAST); face.add(seekbar, DockPanel.CENTER); face.setCellWidth(seekbar, "100%"); face.setCellHorizontalAlignment(seekbar, DockPanel.ALIGN_CENTER); return face; }