List of usage examples for com.google.gwt.user.client.ui DockPanel DockPanel
public DockPanel()
From source file:org.jboss.bpm.console.client.task.AssignedTasksView.java
License:Open Source License
public Widget asWidget() { panel = new DockPanel(); initialize();//from w ww.j av a 2s . c om panel.add(detailsView, DockPanel.SOUTH); panel.add(taskList, DockPanel.CENTER); controller.addView(AssignedTasksView.ID, this); return panel; }
From source file:org.jboss.bpm.console.client.task.OpenTasksView.java
License:Open Source License
public Widget asWidget() { panel = new DockPanel(); initialize();/*from w w w.j a v a 2s . c o m*/ registerCommonActions(appContext, controller); // ---- /*TaskDetailView assignedDetailView = new TaskDetailView(false); controller.addView("AssignedDetailView", assignedDetailView); assignedDetailView.initialize(); registerView(controller, tabPanel, AssignedTasksView.ID, new AssignedTasksView(appContext, assignedDetailView));*/ controller.addView(OpenTasksView.ID, this); // ---- panel.add(detailsView, DockPanel.SOUTH); panel.add(taskList, DockPanel.CENTER); return panel; }
From source file:org.jboss.errai.widgets.client.layout.WSDropShadowLayout.java
License:Apache License
public WSDropShadowLayout(Widget wrappedWidget) { DockPanel dockPanel = new DockPanel(); /**//from ww w . ja va2 s . c om * Bad hack to avoid rendering shadow when IE is present. */ if (getUserAgent().indexOf("msie") == -1) { HorizontalPanel top = new HorizontalPanel(); top.setWidth("100%"); dockPanel.add(top, DockPanel.NORTH); dockPanel.setCellWidth(top, "100%"); SimplePanel topLeftCorner = new SimplePanel(); topLeftCorner.setStyleName("WSDropShadow-topLeftCorner"); top.add(topLeftCorner); SimplePanel topLeft = new SimplePanel(); topLeft.setStyleName("WSDropShadow-topLeft"); top.add(topLeft); SimplePanel topMiddle = new SimplePanel(); topMiddle.setStyleName("WSDropShadow-topMiddle"); top.add(topMiddle); top.setCellWidth(topMiddle, "100%"); SimplePanel topRight = new SimplePanel(); topRight.setStyleName("WSDropShadow-topRight"); top.add(topRight); SimplePanel topRightCorner = new SimplePanel(); topRightCorner.setStyleName("WSDropShadow-topRightCorner"); top.add(topRightCorner); HorizontalPanel bottom = new HorizontalPanel(); bottom.setWidth("100%"); dockPanel.add(bottom, DockPanel.SOUTH); dockPanel.setCellWidth(bottom, "100%"); SimplePanel bottomLeftCorner = new SimplePanel(); bottomLeftCorner.setStyleName("WSDropShadow-bottomLeftCorner"); bottom.add(bottomLeftCorner); SimplePanel bottomLeft = new SimplePanel(); bottomLeft.setStyleName("WSDropShadow-bottomLeft"); bottom.add(bottomLeft); SimplePanel bottomMiddle = new SimplePanel(); bottomMiddle.setStyleName("WSDropShadow-bottomMiddle"); bottom.add(bottomMiddle); bottom.setCellWidth(bottomMiddle, "100%"); SimplePanel bottomRight = new SimplePanel(); bottomRight.setStyleName("WSDropShadow-bottomRight"); bottom.add(bottomRight); SimplePanel bottomRightCorner = new SimplePanel(); bottomRightCorner.setStyleName("WSDropShadow-bottomRightCorner"); bottom.add(bottomRightCorner); VerticalPanel left = new VerticalPanel(); left.setHeight("100%"); dockPanel.add(left, DockPanel.WEST); dockPanel.setCellHeight(left, "100%"); SimplePanel leftTop = new SimplePanel(); leftTop.setStyleName("WSDropShadow-leftTop"); left.add(leftTop); SimplePanel leftMiddle = new SimplePanel(); leftMiddle.setHeight("100%"); leftMiddle.setStyleName("WSDropShadow-leftMiddle"); left.add(leftMiddle); left.setCellHeight(leftMiddle, "100%"); SimplePanel leftBottom = new SimplePanel(); leftBottom.setStyleName("WSDropShadow-leftBottom"); left.add(leftBottom); VerticalPanel right = new VerticalPanel(); right.setHeight("100%"); dockPanel.add(right, DockPanel.EAST); dockPanel.setCellHeight(right, "100%"); SimplePanel rightTop = new SimplePanel(); rightTop.setStyleName("WSDropShadow-rightTop"); right.add(rightTop); SimplePanel rightMiddle = new SimplePanel(); rightMiddle.setHeight("100%"); rightMiddle.setStyleName("WSDropShadow-rightMiddle"); right.add(rightMiddle); right.setCellHeight(rightMiddle, "100%"); SimplePanel rightBottom = new SimplePanel(); rightBottom.setStyleName("WSDropShadow-rightBottom"); right.add(rightBottom); } dockPanel.add(wrappedWidget, DockPanel.CENTER); dockPanel.setCellWidth(wrappedWidget, "100%"); dockPanel.setCellHeight(wrappedWidget, "100%"); initWidget(dockPanel); }
From source file:org.jboss.errai.widgets.client.WSModalDialog.java
License:Apache License
public WSModalDialog(String title) { window = new WSWindowPanel(title); dockPanel = new DockPanel(); dockPanel.setWidth("400px"); dockPanel.add(new Image(imageBundle.redFlag()), DockPanel.WEST); dockPanel.add(message, DockPanel.CENTER); message.getElement().getStyle().setProperty("padding", "0px"); HorizontalPanel buttonPanel = new HorizontalPanel(); okButton = new Button("OK"); okListener = new ClickCallbackListener(this, AcceptsCallback.MESSAGE_OK); okButton.addClickHandler(okListener); buttonPanel.add(okButton);/*from w w w . j a v a2 s . co m*/ cancelButton = new Button("Cancel"); cancelListener = new ClickCallbackListener(this, AcceptsCallback.MESSAGE_CANCEL); cancelButton.addClickHandler(cancelListener); dockPanel.add(cancelButton, DockPanel.SOUTH); buttonPanel.add(cancelButton); dockPanel.add(buttonPanel, DockPanel.SOUTH); dockPanel.setCellHorizontalAlignment(buttonPanel, DockPanel.ALIGN_RIGHT); dockPanel.setCellHeight(buttonPanel, "45px"); window.add(dockPanel); }
From source file:org.jboss.errai.workspaces.client.widgets.WSTabPanel.java
License:Apache License
public WSTabPanel() { layoutPanel = new DockPanel(); layoutPanel.setSize("98%", "100%"); tabBar = new TabBar(); deckPanel = new DeckPanel(); deckPanel.setWidth("100%"); deckPanel.addStyleName("gwt-TabPanelBottom"); layoutPanel.add(tabBar, DockPanel.NORTH); layoutPanel.add(deckPanel, DockPanel.CENTER); tabBar.addSelectionHandler(new SelectionHandler<Integer>() { public void onSelection(SelectionEvent<Integer> integerSelectionEvent) { deckPanel.showWidget(integerSelectionEvent.getSelectedItem()); }//from www . j a v a 2 s. co m }); initWidget(layoutPanel); }
From source file:org.openempi.webapp.client.ui.mainpane.HeaderPane.java
License:Open Source License
/** * Constructs a new HeaderPane that displays the given text. * /* w w w . ja v a2s .co m*/ * @param titleText * The text this header should show as a title. */ public HeaderPane(String titleText, ClientState clientState, ServiceRegistry serviceRegistry) { super(clientState, serviceRegistry); main = new DockPanel(); main.add(new Label("Brodkin's GWT Sample App"), DockPanel.CENTER); reset(); initWidget(main); setStyleName("HeaderPane"); }
From source file:org.openempi.webapp.client.ui.widget.CenterPanel.java
License:Open Source License
/** * Constructs a new CenterPanel with a given content. * * @param content The content of this panel. *//* w ww. j av a 2s.c om*/ public CenterPanel(Widget content) { container = new DockPanel(); if (content != null) { setContent(content); } initWidget(container); setStyleName("CenterPanel"); }
From source file:org.openempi.webapp.client.ui.widget.TitledPanel.java
License:Open Source License
public TitledPanel(String titleText, Widget content) { titleLabel = new Label(titleText); titleLabel.setStyleName(TITLE_STYLE_NAME); toolbar = new HorizontalPanel(); toolbar.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); toolbar.setSpacing(0);/*from w ww .ja v a2 s. c o m*/ toolbar.setBorderWidth(0); toolbar.setStyleName(TOOLBAR_STYLE_NAME); title = new DockPanel(); title.setStyleName(TITLE_STYLE_NAME); title.add(titleLabel, DockPanel.CENTER); title.setCellVerticalAlignment(titleLabel, DockPanel.ALIGN_MIDDLE); title.setCellWidth(titleLabel, "100%"); title.add(toolbar, DockPanel.EAST); title.setWidth("100%"); grid = new Grid(2, 1); grid.setBorderWidth(0); grid.setCellPadding(0); grid.setCellSpacing(0); grid.setWidget(TITLE_ROW, 0, title); grid.getCellFormatter().setWidth(TITLE_ROW, 0, "100%"); if (content != null) { grid.setWidget(CONTENT_ROW, 0, content); } grid.getCellFormatter().setWidth(CONTENT_ROW, 0, "100%"); grid.getCellFormatter().setHeight(CONTENT_ROW, 0, "100%"); grid.getCellFormatter().setStyleName(CONTENT_ROW, 0, CONTENT_STYLE_NAME); initWidget(grid); setStyleName(STYLE_NAME); }
From source file:org.otalo.ao.client.MessageDetail.java
License:Apache License
public MessageDetail() { outer = new HorizontalPanel(); outer.setSize("100%", "100%"); detailsForm = new FormPanel(); detailsForm.setWidget(outer);/*from w ww . j ava 2s . co m*/ detailsForm.setMethod(FormPanel.METHOD_POST); detailsForm.setEncoding(FormPanel.ENCODING_MULTIPART); // TODO if needed //detailsForm.addSubmitHandler(new CallerDetailsUpdate()); detailsForm.addSubmitCompleteHandler(new MessageDetailsUpdate()); threadPanel = new DockPanel(); controls = new VerticalPanel(); detailsTable = new FlexTable(); metadata = new VerticalPanel(); metadata.setHeight("100%"); tags = new AutoCompleteTagWidget(true, true); tags.setWidth("300px"); routing = new AORoutingWidget(); metadata.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); metadata.add(tags); metadata.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); metadata.add(routing); outer.setSpacing(3); outer.add(detailsTable); outer.add(threadPanel); outer.add(metadata); outer.add(controls); controls.setSize("100%", "100%"); Label detailsTitle = new Label("Caller Details"); detailsTitle.setStyleName("gwt-Label"); detailsTable.setWidget(0, 0, detailsTitle); detailsTable.getFlexCellFormatter().setColSpan(0, 0, 2); addCallerDetailsField(detailsTable, "Number", "number"); addCallerDetailsField(detailsTable, "Name", "name"); addCallerDetailsField(detailsTable, "District", "district"); addCallerDetailsField(detailsTable, "Taluka", "taluka"); addCallerDetailsField(detailsTable, "Village", "village"); userId = new Hidden("userid"); detailsTable.setWidget(detailsTable.getRowCount(), 0, userId); messageForumId = new Hidden("messageforumid"); detailsTable.setWidget(detailsTable.getRowCount(), 0, messageForumId); threadPanel.setSize("100%", "100%"); Label threadTitle = new Label("Thread"); threadTitle.setStyleName("gwt-Label"); threadPanel.add(threadTitle, DockPanel.NORTH); threadPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); uploadDlg = new UploadDialog(); uploadDlg.setCompleteHandler(new UploadComplete()); Button uploadResponse = new Button("Record/Upload Response", new ClickHandler() { public void onClick(ClickEvent event) { uploadDlg.reset(); uploadDlg.center(); } }); threadPanel.add(uploadResponse, DockPanel.SOUTH); thread = new VerticalPanel(); thread.setSize("100%", "100%"); thread.setSpacing(3); threadPanel.add(thread, DockPanel.NORTH); saveButton = new Button("Save", new ClickHandler() { public void onClick(ClickEvent event) { //calling setSelectedTagData so that selected tags can be collected and set as value to selectedTags input. tags.setSelectedTagData(); setClickedButton(saveButton); detailsForm.setAction(JSONRequest.BASE_URL + AoAPI.UPDATE_MESSAGE); detailsForm.submit(); } }); moveDirection = new Hidden("direction"); detailsTable.setWidget(detailsTable.getRowCount(), 0, moveDirection); moveUpButton = new Button("Move Up", new ClickHandler() { public void onClick(ClickEvent event) { setClickedButton(moveUpButton); moveDirection.setValue("up"); detailsForm.setAction(JSONRequest.BASE_URL + AoAPI.MOVE); detailsForm.submit(); } }); moveDownButton = new Button("Move Down", new ClickHandler() { public void onClick(ClickEvent event) { setClickedButton(moveDownButton); moveDirection.setValue("down"); detailsForm.setAction(JSONRequest.BASE_URL + AoAPI.MOVE); detailsForm.submit(); } }); controls.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT); controls.setSpacing(5); // to snap the button to the bottom of the panel controls.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM); VerticalPanel buttons = new VerticalPanel(); buttons.setSize("100%", "100%"); buttons.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); buttons.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); moveButtons = new VerticalPanel(); moveButtons.setSize("100%", "100%"); moveButtons.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); // To center the movebuttons in the panel when no moderation moveButtons.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); moveButtons.add(moveUpButton); moveButtons.add(moveDownButton); moveButtons.setSpacing(5); VerticalPanel linksPanel = new VerticalPanel(); if (Messages.get().getLine().bcastingAllowed()) { broadcastLink = new Anchor("Broadcast"); linksPanel.add(broadcastLink); } downloadLink = new Anchor("Download", AoAPI.DOWNLOAD); linksPanel.add(downloadLink); buttons.add(linksPanel); buttons.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); buttons.add(moveButtons); buttons.add(saveButton); controls.add(buttons); outer.setStyleName("mail-Detail"); initWidget(detailsForm); }
From source file:org.otalo.ao.client.Messages.java
License:Apache License
public void loadRest() { topPanel = new TopPanel(line, moderator, images); topPanel.setWidth("100%"); fora = new Fora(images); messageList = new MessageList(images); messageList.setWidth("100%"); // Create the right panel, containing the email list & details. rightPanel.add(messageList);/*from ww w.j a va 2 s . co m*/ if (!canManage()) { searchResultMsgList = new SearchResultMsgList(); searchResultMsgList.setWidth("100%"); searchResultMsgList.setVisible(false); rightPanel.add(searchResultMsgList); } if (line.bcastingAllowed()) { broadcastIface = new BroadcastInterface(images); bcasts = new Broadcasts(images); rightPanel.add(broadcastIface); } if (line.hasSMSConfig()) { smsList = new SMSList(images); smsList.setWidth("100%"); smsIface = new SMSInterface(images); smss = new SMSs(images); rightPanel.add(smsIface); rightPanel.add(smsList); } shortcuts = new Shortcuts(images, fora, bcasts, smss, search); shortcuts.setWidth("100%"); rightPanel.setWidth("100%"); if (canManage()) { groupsIface = new ManageGroups(images); rightPanel.add(groupsIface); //showing help if its stream String helpHtmlStr = "<div id='help_tab' class='help-tab-right'>" + "<a href='http://awaaz.de/blog/2013/09/awaaz-de-streams-start-up-guide-and-glossary/' target=_blank id='help-link'>" + "<span>H</span>" + "<span>E</span>" + "<span>L</span>" + "<span>P</span></a></div>"; HTML helpHtml = new HTML(helpHtmlStr); RootPanel.get().add(helpHtml); } else { messageDetail = new MessageDetail(); messageDetail.setWidth("100%"); rightPanel.add(messageDetail); search = new SearchFilterPanel(searchResultMsgList); searchShortCut = new Shortcuts(images, null, null, null, search); searchShortCut.setWidth("100%"); searchShortCut.setVisible(false); } displayForumPanel(); // creating a loader loaderImage = new HTML(AbstractImagePrototype.create(images.loader()).getHTML()); loaderImage.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); loaderImage.addStyleName("loader-img"); showLoader(false); rightPanel.add(loaderImage); // Create a dock panel that will contain the menu bar at the top, // the shortcuts to the left, and the mail list & details taking the rest. DockPanel outer = new DockPanel(); //DockLayoutPanel outer = new DockLayoutPanel(Unit.PCT); outer.add(topPanel, DockPanel.NORTH); outer.add(shortcuts, DockPanel.WEST); if (!canManage()) { if (searchShortCut.isVisible()) searchShortCut.setVisible(false); outer.add(searchShortCut, DockPanel.WEST); } //outer.addWest(shortcuts, 100); outer.add(rightPanel, DockPanel.CENTER); //outer.add(rightPanel); outer.setWidth("100%"); outer.setSpacing(4); outer.setCellWidth(rightPanel, "100%"); // Hook the window resize event, so that we can adjust the UI. Window.addResizeHandler(this); // Get rid of scrollbars, and clear out the window's built-in margin, // because we want to take advantage of the entire client area. //Window.enableScrolling(false); Window.setMargin("0px"); // Finally, add the outer panel to the RootPanel, so that it will be // displayed. RootPanel.get().add(outer); // Call the window resized handler to get the initial sizes setup. Doing // this in a deferred command causes it to occur after all widgets' sizes // have been computed by the browser. Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { public void execute() { onWindowResized(Window.getClientWidth(), Window.getClientHeight()); } }); onWindowResized(Window.getClientWidth(), Window.getClientHeight()); }