List of usage examples for com.google.gwt.user.client.ui DockPanel SOUTH
DockLayoutConstant SOUTH
To view the source code for com.google.gwt.user.client.ui DockPanel SOUTH.
Click Source Link
From source file:client.template.page.RouterAdminPage.java
License:Open Source License
public RouterAdminPage(final ListPanel list) { this.table = list; this.top = new RefreshRouterPanel(this, list); this.bottom = new ExecuteRouterPanel(list); this.dockPanel.add(this.top, DockPanel.NORTH); this.dockPanel.add(this.table, DockPanel.CENTER); this.dockPanel.add(this.bottom, DockPanel.SOUTH); this.dockPanel.setWidth("100%"); this.dockPanel.setSpacing(0); this.dockPanel.setStyleName("res-Dock"); this.initWidget(this.dockPanel); this.setStyleName("mail-List"); }
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 ww.jav a 2 s. co m*/ 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 bottom() { setPosition(DockPanel.SOUTH); return add(); }
From source file:com.allen_sauer.gwt.log.client.DivLogger.java
License:Apache License
/** * Default constructor.// w ww. j a v a2 s. c om */ public DivLogger() { logDockPanel.addStyleName(LogClientBundle.INSTANCE.css().logPanel()); logTextArea.addStyleName(LogClientBundle.INSTANCE.css().logTextArea()); scrollPanel.addStyleName(LogClientBundle.INSTANCE.css().logScrollPanel()); // scrollPanel.setAlwaysShowScrollBars(true); final FocusPanel headerPanel = makeHeader(); Widget resizePanel = new Image(GWT.getModuleBaseURL() + "gwt-log-triangle-10x10.png"); resizePanel.addStyleName(LogClientBundle.INSTANCE.css().logResizeSe()); new MouseResizeHandler(resizePanel); logDockPanel.add(headerPanel, DockPanel.NORTH); logDockPanel.add(scrollPanel, DockPanel.CENTER); logDockPanel.add(resizePanel, DockPanel.SOUTH); resizePanel.getElement().getStyle().setLineHeight(1, Unit.PX); logDockPanel.setCellHorizontalAlignment(resizePanel, HasHorizontalAlignment.ALIGN_RIGHT); scrollPanel.setWidget(logTextArea); timer = new Timer() { @Override public void run() { dirty = false; logTextArea.setHTML(logTextArea.getHTML() + logText); logText = ""; Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { scrollPanel.setVerticalScrollPosition(MAX_VERTICAL_SCROLL); } }); } }; }
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)); }/*from w w w . j a va 2 s .com*/ } 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.audata.client.admin.SetPasswordDialog.java
License:Open Source License
public SetPasswordDialog(UserPanel parent) { this.setText(LANG.set_password_Text()); DockPanel outer = new DockPanel(); outer.setSpacing(4);// ww w .j a va2 s .c o m outer.add(new Image("images/48x48/security.gif"), DockPanel.WEST); VerticalPanel formPanel = new VerticalPanel(); HorizontalPanel pass1Panel = new HorizontalPanel(); Label l1 = new Label(LANG.password_Text()); l1.addStyleName("audoc-label"); l1.setWidth("120px"); pass1Panel.add(l1); this.pass1 = new PasswordTextBox(); pass1Panel.add(this.pass1); formPanel.add(pass1Panel); HorizontalPanel pass2Panel = new HorizontalPanel(); Label l2 = new Label(LANG.password_reenter_Text()); l2.addStyleName("audoc-label"); l2.setWidth("120px"); pass2Panel.add(l2); this.pass2 = new PasswordTextBox(); pass2Panel.add(this.pass2); formPanel.add(pass2Panel); HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setSpacing(5); this.setButton = new Button(LANG.set_password_Text()); this.setButton.addClickListener(this); buttonPanel.add(this.setButton); this.cancelButton = new Button(LANG.cancel_Text()); this.cancelButton.addClickListener(this); buttonPanel.add(this.cancelButton); formPanel.add(buttonPanel); formPanel.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT); outer.add(formPanel, DockPanel.SOUTH); formPanel.setSpacing(4); outer.setSpacing(8); setWidget(outer); }
From source file:com.audata.client.AuDoc.java
License:Open Source License
/** * Builds the menu bar panel/*ww w . j av a 2 s. c o m*/ * @return HorizontalPanel containing the menu bar */ private HorizontalPanel buildMenu() { HorizontalPanel menu = new HorizontalPanel(); menu.addStyleName("menu"); menu.setWidth("100%"); menu.setHorizontalAlignment(HasAlignment.ALIGN_LEFT); menu.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM); menu.setSpacing(4); CaptionButton cb = new CaptionButton(); cb.setImageUrl("images/48x48/home.gif"); cb.setCaptionText(LANG.home_Text()); cb.setOrientation(DockPanel.SOUTH); cb.addClickListener(new MenuClickListener(this, AuDoc.SECTION_HOME)); cb.setTitle(LANG.home_title_Text()); menu.add(cb); CaptionButton cb_1 = new CaptionButton(); cb_1.setImageUrl("images/48x48/search.gif"); cb_1.setCaptionText(LANG.search_Text()); cb_1.setOrientation(DockPanel.SOUTH); cb_1.addClickListener(new MenuClickListener(this, AuDoc.SECTION_SEARCH)); cb_1.setTitle(LANG.search_title_Text()); menu.add(cb_1); CaptionButton cb_2 = new CaptionButton(); cb_2.addCaptionStyleName("nowrap"); cb_2.setOrientation(DockPanel.SOUTH); cb_2.setImageUrl("images/48x48/newrec.gif"); cb_2.setCaptionText(LANG.newrec_Text()); cb_2.addClickListener(new MenuClickListener(this, AuDoc.SECTION_NEW)); cb_2.setTitle(LANG.newrec_title_Text()); menu.add(cb_2); CaptionButton cb_3 = new CaptionButton(); cb_3.setImageUrl("images/48x48/reports.gif"); cb_3.setCaptionText(LANG.report_Text()); cb_3.setOrientation(DockPanel.SOUTH); cb_3.addClickListener(new MenuClickListener(this, AuDoc.SECTION_REPORT)); cb_3.setTitle(LANG.report_title_Text()); menu.add(cb_3); CaptionButton cb_4 = new CaptionButton(); cb_4.setImageUrl("images/48x48/checkout.gif"); cb_4.setCaptionText(LANG.rapid_title_Text()); cb_4.setOrientation(DockPanel.SOUTH); cb_4.addClickListener(new MenuClickListener(this, AuDoc.SECTION_RAPID)); cb_4.setTitle(LANG.rapid_title_Text()); menu.add(cb_4); this.adminButton = new CaptionButton(); this.adminButton.setImageUrl("images/48x48/admin.gif"); this.adminButton.setCaptionText(LANG.admin_Text()); this.adminButton.setOrientation(DockPanel.SOUTH); this.adminButton.setVisible(false); this.adminButton.addClickListener(new MenuClickListener(this, AuDoc.SECTION_ADMIN)); this.adminButton.setTitle(LANG.admin_title_Text()); menu.add(this.adminButton); menu.setCellWidth(this.adminButton, "100%"); menu.setCellHorizontalAlignment(this.adminButton, HasAlignment.ALIGN_RIGHT); return menu; }
From source file:com.audata.client.authentication.LoginDialog.java
License:Open Source License
public LoginDialog(AuDoc parent) { this.parent = parent; setText(CONSTANTS.welcome_Text()); // Create a DockPanel to contain the 'about' label and the 'OK' button. DockPanel outer = new DockPanel(); outer.setSpacing(4);/*from ww w . ja v a 2 s . co m*/ outer.add(new Image("images/48x48/security.gif"), DockPanel.WEST); VerticalPanel formPanel = new VerticalPanel(); formPanel.setSpacing(1); HorizontalPanel userPanel = new HorizontalPanel(); this.username = new TextBox(); Label l = new Label(CONSTANTS.username_Text()); l.addStyleName("audoc-label"); l.setWidth("85px"); userPanel.add(l); userPanel.add(this.username); formPanel.add(userPanel); HorizontalPanel passPanel = new HorizontalPanel(); this.password = new PasswordTextBox(); l = new Label(CONSTANTS.password_Text()); l.addStyleName("audoc-label"); l.setWidth("85px"); passPanel.add(l); passPanel.add(this.password); formPanel.add(passPanel); HorizontalPanel langPanel = new HorizontalPanel(); l = new Label(CONSTANTS.lang_Text()); l.addStyleName("audoc-label"); l.setWidth("85px"); langPanel.add(l); formPanel.add(langPanel); this.languages = new ListBox(); this.populateLocales(); this.languages.setWidth("146px"); langPanel.add(this.languages); this.languages.addChangeListener(new ChangeListener() { public void onChange(Widget sender) { //refreshes the browser in the selected locale Location loc = WindowUtils.getLocation(); String path = loc.getProtocol() + "//" + loc.getHost() + loc.getPath(); String locale = languages.getValue(languages.getSelectedIndex()); Window.open(path + "?locale=" + locale, "_self", ""); } }); this.loginButton = new Button(CONSTANTS.login_Text(), this); formPanel.add(loginButton); formPanel.setCellHorizontalAlignment(this.loginButton, HasAlignment.ALIGN_RIGHT); outer.add(formPanel, DockPanel.SOUTH); HTML text = new HTML(CONSTANTS.message_Text()); text.setStyleName("audoc-LoginDialogText"); outer.add(text, DockPanel.CENTER); // Add a bit of spacing and margin to the dock to keep the components from // being placed too closely together. outer.setSpacing(8); this.setWidget(outer); }
From source file:com.audata.client.widgets.CaptionButton.java
License:Open Source License
public void setOrientation(DockLayoutConstant layout) { DockLayoutConstant capPos = layout;//from www. j a v a 2 s .c om 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.calclab.emite.widgets.client.chat.GWTAbstractChatWidget.java
License:Open Source License
public GWTAbstractChatWidget() { this.onSendMessage = new Event<String>("widgets:room:sendMessage"); this.area = new TextArea(); this.input = new TextBox(); input.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(final KeyPressEvent event) { if (event.getNativeEvent().getKeyCode() == 13) { sendMessage();/*from www. j a v a 2s. c om*/ } } }); this.send = new Button("send", new ClickHandler() { public void onClick(final ClickEvent event) { sendMessage(); } }); final HorizontalPanel inputBar = new HorizontalPanel(); inputBar.add(input); inputBar.add(send); add(area, DockPanel.CENTER); add(inputBar, DockPanel.SOUTH); }