List of usage examples for com.google.gwt.user.client.ui DockPanel setCellHeight
@Override public void setCellHeight(Widget w, String height)
From source file:com.dimdim.conference.ui.common.client.list.ListEntryHoverPopupPanel.java
License:Open Source License
public ListEntryHoverPopupPanel() { super(false); this.setStyleName("dm-hover-popup"); //pane.setSize("100%","100%"); // pane.addMouseListener(this); // pane.addFocusListener(this); DockPanel outer = new DockPanel(); // outer.setSize("100%","100%"); outer.setStyleName("dm-hover-popup-body"); // pane.add(outer); headerPanel.setStyleName("dm-hover-popup-header"); outer.add(headerPanel, DockPanel.NORTH); outer.setCellWidth(headerPanel, "100%"); this.contentPanel.setStyleName("dm-hover-popup-content"); outer.add(contentPanel, DockPanel.NORTH); // outer.setCellWidth(contentPanel,"100%"); outer.setCellHeight(contentPanel, "100%"); this.linksPanel.setStyleName("dm-hover-popup-links-panel"); outer.add(linksPanel, DockPanel.SOUTH); // outer.setCellWidth(contentPanel,"100%"); outer.setCellHeight(linksPanel, "100%"); // this.add(pane); this.add(outer); this.addPopupListener(this); }
From source file:com.dimdim.conference.ui.resources.client.ResourceTypeListEntryPopupPanel.java
License:Open Source License
public void paintPanel(String typeName) { this.typeName = typeName; ClickListener headerClickListener = rtpcp.getTypePopupHeaderClickListener(typeName); ClickListener footerClickListener = rtpcp.getTypePopupFooterClickListener(this.typeName); /*if(UIResourceObject.RESOURCE_TYPE_COBROWSE.equalsIgnoreCase(typeName)) {/*from w w w .ja v a2 s. com*/ headerClickListener = rtpcp.getShareCobClickListener(); }*/ pane.addMouseListener(this); pane.addFocusListener(this); DockPanel outer = new DockPanel(); outer.setStyleName("dm-hover-popup-body"); pane.add(outer); if (headerClickListener != null) { // headerPanel.setStyleName("dm-hover-popup-header"); outer.add(headerPanel, DockPanel.NORTH); outer.setCellWidth(headerPanel, "100%"); String selectLabel = ConferenceGlobals.getDisplayString(typeName + ".select.label", "Upload Document"); Label headerLink = new Label(selectLabel); // headerLink.setStyleName("tool-entry"); headerLink.setStyleName("resource-popup-header-entry"); headerLink.addStyleName("anchor-cursor"); headerPanel.add(headerLink); headerPanel.setCellWidth(headerLink, "100%"); headerPanel.setStyleName("resource-popup-header-panel"); headerPanel.setCellHorizontalAlignment(headerLink, HorizontalPanel.ALIGN_LEFT); headerPanel.setCellVerticalAlignment(headerLink, VerticalPanel.ALIGN_MIDDLE); headerLink.addClickListener(headerClickListener); headerLink.addClickListener(this); } else { // Window.alert("No header listener"); } this.writeListPanel(outer); // this.contentPanel.setStyleName("dm-hover-popup-content"); // outer.add(contentPanel,DockPanel.NORTH); // outer.setCellHeight(contentPanel,"100%"); // outer.setCellWidth(contentPanel,"100%"); if (footerClickListener != null) { // this.linksPanel.setStyleName("dm-hover-popup-header"); outer.add(linksPanel, DockPanel.SOUTH); outer.setCellHeight(linksPanel, "100%"); String manageLabel = ConferenceGlobals.getDisplayString(typeName + ".manage.label", "Manage Document"); Label footerLink = new Label(manageLabel); // footerLink.setStyleName("tool-entry"); footerLink.setStyleName("resource-popup-footer-entry"); footerLink.addStyleName("anchor-cursor"); linksPanel.add(footerLink); linksPanel.setCellHorizontalAlignment(footerLink, HorizontalPanel.ALIGN_LEFT); linksPanel.setCellVerticalAlignment(footerLink, VerticalPanel.ALIGN_MIDDLE); footerLink.addClickListener(footerClickListener); footerLink.addClickListener(this); } else { // Window.alert("No footer listener"); } // if (panel != null) // { // this.contentPanel.add(panel); // this.contentPanel.setCellWidth(panel, "100%"); // this.contentPanel.setCellHeight(panel, "100%"); // } this.add(pane); this.addPopupListener(this); }
From source file:com.google.appinventor.client.Ode.java
License:Open Source License
private void initializeUi() { BlocklyPanel.initUi();/*w ww .ja v a2 s.c o m*/ rpcStatusPopup = new RpcStatusPopup(); // Register services with RPC status popup rpcStatusPopup.register((ExtendedServiceProxy<?>) helpService); rpcStatusPopup.register((ExtendedServiceProxy<?>) projectService); rpcStatusPopup.register((ExtendedServiceProxy<?>) galleryService); rpcStatusPopup.register((ExtendedServiceProxy<?>) userInfoService); Window.setTitle(MESSAGES.titleYoungAndroid()); Window.enableScrolling(true); topPanel = new TopPanel(); statusPanel = new StatusPanel(); DockPanel mainPanel = new DockPanel(); mainPanel.add(topPanel, DockPanel.NORTH); // Create tab panel for subsequent tabs deckPanel = new DeckPanel() { @Override public final void onBrowserEvent(Event event) { switch (event.getTypeInt()) { case Event.ONCONTEXTMENU: event.preventDefault(); break; } } }; deckPanel.setAnimationEnabled(true); deckPanel.sinkEvents(Event.ONCONTEXTMENU); deckPanel.setStyleName("ode-DeckPanel"); // Projects tab VerticalPanel pVertPanel = new VerticalPanel(); pVertPanel.setWidth("100%"); pVertPanel.setSpacing(0); HorizontalPanel projectListPanel = new HorizontalPanel(); projectListPanel.setWidth("100%"); projectToolbar = new ProjectToolbar(); projectListPanel.add(ProjectListBox.getProjectListBox()); pVertPanel.add(projectToolbar); pVertPanel.add(projectListPanel); projectsTabIndex = deckPanel.getWidgetCount(); deckPanel.add(pVertPanel); // Design tab VerticalPanel dVertPanel = new VerticalPanel(); dVertPanel.setWidth("100%"); dVertPanel.setHeight("100%"); // Add the Code Navigation arrow // switchToBlocksButton = new VerticalPanel(); // switchToBlocksButton.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE); // switchToBlocksButton.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); // switchToBlocksButton.setStyleName("ode-NavArrow"); // switchToBlocksButton.add(new Image(RIGHT_ARROW_IMAGE_URL)); // switchToBlocksButton.setWidth("25px"); // switchToBlocksButton.setHeight("100%"); // Add the Code Navigation arrow // switchToDesignerButton = new VerticalPanel(); // switchToDesignerButton.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE); // switchToDesignerButton.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); // switchToDesignerButton.setStyleName("ode-NavArrow"); // switchToDesignerButton.add(new Image(LEFT_ARROW_IMAGE_URL)); // switchToDesignerButton.setWidth("25px"); // switchToDesignerButton.setHeight("100%"); designToolbar = new DesignToolbar(); dVertPanel.add(designToolbar); workColumns = new HorizontalPanel(); workColumns.setWidth("100%"); //workColumns.add(switchToDesignerButton); Box palletebox = PaletteBox.getPaletteBox(); palletebox.setWidth("222px"); workColumns.add(palletebox); Box viewerbox = ViewerBox.getViewerBox(); workColumns.add(viewerbox); workColumns.setCellWidth(viewerbox, "97%"); workColumns.setCellHeight(viewerbox, "97%"); structureAndAssets = new VerticalPanel(); structureAndAssets.setVerticalAlignment(VerticalPanel.ALIGN_TOP); // Only one of the SourceStructureBox and the BlockSelectorBox is visible // at any given time, according to whether we are showing the form editor // or the blocks editor. They share the same screen real estate. structureAndAssets.add(SourceStructureBox.getSourceStructureBox()); structureAndAssets.add(BlockSelectorBox.getBlockSelectorBox()); // initially not visible structureAndAssets.add(AssetListBox.getAssetListBox()); workColumns.add(structureAndAssets); Box propertiesbox = PropertiesBox.getPropertiesBox(); propertiesbox.setWidth("222px"); workColumns.add(propertiesbox); //switchToBlocksButton.setHeight("650px"); //workColumns.add(switchToBlocksButton); dVertPanel.add(workColumns); designTabIndex = deckPanel.getWidgetCount(); deckPanel.add(dVertPanel); // Gallery list tab VerticalPanel gVertPanel = new VerticalPanel(); gVertPanel.setWidth("100%"); gVertPanel.setSpacing(0); galleryListToolbar = new GalleryToolbar(); gVertPanel.add(galleryListToolbar); HorizontalPanel appListPanel = new HorizontalPanel(); appListPanel.setWidth("100%"); appListPanel.add(GalleryListBox.getGalleryListBox()); gVertPanel.add(appListPanel); galleryTabIndex = deckPanel.getWidgetCount(); deckPanel.add(gVertPanel); // Gallery app tab VerticalPanel aVertPanel = new VerticalPanel(); aVertPanel.setWidth("100%"); aVertPanel.setSpacing(0); galleryPageToolbar = new GalleryToolbar(); aVertPanel.add(galleryPageToolbar); HorizontalPanel appPanel = new HorizontalPanel(); appPanel.setWidth("100%"); appPanel.add(GalleryAppBox.getGalleryAppBox()); aVertPanel.add(appPanel); galleryAppTabIndex = deckPanel.getWidgetCount(); deckPanel.add(aVertPanel); // User Admin Panel VerticalPanel uaVertPanel = new VerticalPanel(); uaVertPanel.setWidth("100%"); uaVertPanel.setSpacing(0); HorizontalPanel adminUserListPanel = new HorizontalPanel(); adminUserListPanel.setWidth("100%"); adminUserListPanel.add(AdminUserListBox.getAdminUserListBox()); uaVertPanel.add(adminUserListPanel); userAdminTabIndex = deckPanel.getWidgetCount(); deckPanel.add(uaVertPanel); // KM: DEBUGGING BEGIN // User profile tab VerticalPanel uVertPanel = new VerticalPanel(); uVertPanel.setWidth("100%"); uVertPanel.setSpacing(0); HorizontalPanel userProfilePanel = new HorizontalPanel(); userProfilePanel.setWidth("100%"); userProfilePanel.add(ProfileBox.getUserProfileBox()); uVertPanel.add(userProfilePanel); userProfileTabIndex = deckPanel.getWidgetCount(); deckPanel.add(uVertPanel); // KM: DEBUGGING END // Private User Profile TabPanel VerticalPanel ppVertPanel = new VerticalPanel(); ppVertPanel.setWidth("100%"); ppVertPanel.setSpacing(0); HorizontalPanel privateUserProfileTabPanel = new HorizontalPanel(); privateUserProfileTabPanel.setWidth("100%"); privateUserProfileTabPanel.add(PrivateUserProfileTabPanel.getPrivateUserProfileTabPanel()); ppVertPanel.add(privateUserProfileTabPanel); privateUserProfileIndex = deckPanel.getWidgetCount(); deckPanel.add(ppVertPanel); // Moderation Page tab VerticalPanel mPVertPanel = new VerticalPanel(); mPVertPanel.setWidth("100%"); mPVertPanel.setSpacing(0); HorizontalPanel moderationPagePanel = new HorizontalPanel(); moderationPagePanel.setWidth("100%"); moderationPagePanel.add(ModerationPageBox.getModerationPageBox()); mPVertPanel.add(moderationPagePanel); moderationPageTabIndex = deckPanel.getWidgetCount(); deckPanel.add(mPVertPanel); // Debugging tab if (AppInventorFeatures.hasDebuggingView()) { Button dismissButton = new Button(MESSAGES.dismissButton()); dismissButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (currentView == DESIGNER) switchToDesignView(); else switchToProjectsView(); } }); ColumnLayout defaultLayout = new ColumnLayout("Default"); Column column = defaultLayout.addColumn(100); column.add(MessagesOutputBox.class, 300, false); column.add(OdeLogBox.class, 300, false); final WorkAreaPanel debuggingTab = new WorkAreaPanel(new OdeBoxRegistry(), defaultLayout); debuggingTab.add(dismissButton); debuggingTabIndex = deckPanel.getWidgetCount(); deckPanel.add(debuggingTab); // Hook the window resize event, so that we can adjust the UI. Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { resizeWorkArea(debuggingTab); } }); // 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. DeferredCommand.addCommand(new Command() { @Override public void execute() { resizeWorkArea(debuggingTab); } }); resizeWorkArea(debuggingTab); } // We do not select the designer tab here because at this point there is no current project. // Instead, we select the projects tab. If the user has a previously opened project, we will // open it and switch to the designer after the user settings are loaded. // Remember, the user may not have any projects at all yet. // Or, the user may have deleted their previously opened project. // ***** THE DESIGNER TAB DOES NOT DISPLAY CORRECTLY IF THERE IS NO CURRENT PROJECT. ***** deckPanel.showWidget(projectsTabIndex); mainPanel.add(deckPanel, DockPanel.CENTER); mainPanel.setCellHeight(deckPanel, "100%"); mainPanel.setCellWidth(deckPanel, "100%"); // mainPanel.add(switchToDesignerButton, DockPanel.WEST); // mainPanel.add(switchToBlocksButton, DockPanel.EAST); //Commenting out for now to gain more space for the blocks editor mainPanel.add(statusPanel, DockPanel.SOUTH); mainPanel.setSize("100%", "100%"); RootPanel.get().add(mainPanel); // Add a handler to the RootPanel to keep track of Google Chrome Pinch Zooming and // handle relevant bugs. Chrome maps a Pinch Zoom to a MouseWheelEvent with the // control key pressed. RootPanel.get().addDomHandler(new MouseWheelHandler() { @Override public void onMouseWheel(MouseWheelEvent event) { if (event.isControlKeyDown()) { // Trip the appropriate flag in PZAwarePositionCallback when the page // is Pinch Zoomed. Note that this flag does not need to be removed when // the browser is un-zoomed because the patched function for determining // absolute position works in all circumstances. PZAwarePositionCallback.setPinchZoomed(true); } } }, MouseWheelEvent.getType()); // There is no sure-fire way of preventing people from accidentally navigating away from ODE // (e.g. by hitting the Backspace key). What we do need though is to make sure that people will // not lose any work because of this. We hook into the window closing event to detect the // situation. Window.addWindowClosingHandler(new Window.ClosingHandler() { @Override public void onWindowClosing(Window.ClosingEvent event) { onClosing(); } }); setupMotd(); }
From source file:com.square.client.gwt.client.controller.AppControllerViewImpl.java
License:Open Source License
/** * Constructeur.// w ww.j a va2s .co m * @param onglets la liste des onglets. * @param appCoHandlerManager handler manager. * @param constants les constantes * @param eventBus eventBus */ public AppControllerViewImpl(List<OngletModel> onglets, HandlerManager appCoHandlerManager, AppControllerConstants constants, HandlerManager eventBus) { this.appControllerHandlerManager = appCoHandlerManager; listeLabelsOnglets = new HashMap<String, HTML>(); // CONTAINER ACTIONS CONTEXT rootContextMenu = new SimplePanel(); nbreDefaultTabs = onglets.size(); // TITRE final HTML titreAppli = new HTML("<span class=\"partie1\">" + constants.titrePartie1() + "</span> " + "<span class=\"partie2\">" + constants.titrePartie2() + "</span>"); final SimplePanel conteneurTitre = new SimplePanel(); conteneurTitre.setStylePrimaryName(SquareResources.INSTANCE.css().conteneurTitre()); conteneurTitre.add(titreAppli); // ONGLET MENU gestionOnglets = new HashMap<String, ContainerTabPanel>(); ongletsParent = new HashMap<String, String>(); final int largeurScrollPanel = AppControllerConstants.LARGEUR_TABPANEL - onglets.size() * AppControllerConstants.LARGEUR_ONGLET; tabPanel = new DecoratedDoubleTabPanelScroll(onglets.size(), largeurScrollPanel); tabPanel.setSize(AppControllerConstants.LARGEUR_TABPANEL_STRING, AppControllerConstants.POURCENT_100); tabPanel.addStyleName(SquareResources.INSTANCE.css().tabPanel()); for (OngletModel onglet : onglets) { final ContainerTabPanel panel = new ContainerTabPanel(this.rootContextMenu); gestionOnglets.put(onglet.getId(), panel); if (onglet.getImage() != null) { final Image imageOnglet = new Image(onglet.getImage()); imageOnglet.setTitle(onglet.getLibelle()); tabPanel.add(panel, imageOnglet); } else { final HTML libelleOnglet = new HTML(onglet.getLibelle()); tabPanel.add(panel, libelleOnglet); } } // PANEL DROITE final VerticalPanel conteneurGlobalPanelDroite = new VerticalPanel(); conteneurGlobalPanelDroite.addStyleName(SquareResources.INSTANCE.css().conteneurGlobalPanelDroite()); conteneurGlobalPanelDroite.setSize("260px", AppControllerConstants.POURCENT_100); final VerticalPanel conteneurPanelDroite = new VerticalPanel(); conteneurPanelDroite.addStyleName(SquareResources.INSTANCE.css().conteneurPanelDroite()); conteneurPanelDroite.setSize("260px", AppControllerConstants.POURCENT_100); final VerticalPanel panelDroite = new VerticalPanel(); panelDroite.addStyleName(SquareResources.INSTANCE.css().panelDroite()); panelDroite.setWidth(AppControllerConstants.POURCENT_100); panelDroite.setSpacing(10); this.containerAcp = new SimplePanel(); panelDroite.add(containerAcp); // CONTAINER ACTIONS this.containerActions = new SimplePanel(); panelDroite.add(containerActions); panelDroite.add(rootContextMenu); deskBar = new DeskBar(AppControllerConstants.NB_MINIMIZE_POPUP_MAX, eventBus); panelDroite.add(deskBar); conteneurPanelDroite.add(panelDroite); conteneurGlobalPanelDroite.add(conteneurPanelDroite); // PANEL PRINCIPAL final DockPanel dockPanel = new DockPanel(); dockPanel.add(conteneurTitre, DockPanel.NORTH); dockPanel.setCellHeight(conteneurTitre, "40px"); dockPanel.add(tabPanel, DockPanel.CENTER); dockPanel.setCellVerticalAlignment(tabPanel, HasVerticalAlignment.ALIGN_TOP); dockPanel.add(conteneurGlobalPanelDroite, DockPanel.EAST); dockPanel.addStyleName(SquareResources.INSTANCE.css().panelPrincipal()); dockPanel.setSize("1190px", AppControllerConstants.POURCENT_100); initWidget(dockPanel); }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Widget makeCenter() { final DockPanel resultsView = new DockPanel(); resultsView.setSize("100%", "100%"); final BaseRegion content = new BaseRegion(CONTENT_REGION); Widget w = content.getDisplay();/*from w w w .j a va2 s.c om*/ w.setWidth("100%"); addRegion(content); final Region query = getForm(); final Region results = getResult(); final Region title = getSearchTitle(); final Region desc = getSearchDesc(); GwtUtil.ImageButton img = GwtUtil.makeImageButton("images/disclosurePanelClosed.png", "Return to search", new ClickHandler() { public void onClick(ClickEvent event) { Application.getInstance().processRequest(new Request(SearchCmd.COMMAND_NAME)); } }); boolean backToArrow = Application.getInstance().getProperties() .getBooleanProperty("BackToSearch.arrow.show", true); boolean searchDescLine = Application.getInstance().getProperties().getBooleanProperty("BackToSearch.show", true); final HorizontalPanel ttdesc = new HorizontalPanel(); if (title != null && searchDescLine) { ttdesc.setWidth("100%"); if (backToArrow) { ttdesc.add(img); } ttdesc.add(title.getDisplay()); ttdesc.add(desc.getDisplay()); ttdesc.setCellWidth(desc.getDisplay(), "100%"); ttdesc.add(layoutSelector); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { ttdesc.setVisible(Application.getInstance().hasSearchResult()); } }); } // final Region download = getDownload(); VerticalPanel vp = new VerticalPanel(); vp.setWidth("100%"); if (query.getDisplay() != null) { vp.add(query.getDisplay()); } if (searchDescLine) vp.add(ttdesc); resultsView.add(vp, DockPanel.NORTH); resultsView.setCellHeight(vp, "10px"); resultsView.add(results.getDisplay(), DockPanel.CENTER); resultsView.add(content.getDisplay(), DockPanel.SOUTH); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (DROPDOWN_REGION.equals(source.getId()) || RESULT_REGION.equals(source.getId())) { content.hide(); resultsView.setCellHeight(results.getDisplay(), "100%"); resultsView.setCellHeight(content.getDisplay(), ""); } else if (CONTENT_REGION.equals(source.getId())) { query.hide(); results.hide(); resultsView.setCellHeight(content.getDisplay(), "100%"); resultsView.setCellHeight(results.getDisplay(), ""); } } }); Region popoutRegion = getRegion(POPOUT_REGION); // SimplePanel popoutView = new SimplePanel(); // popoutView.add(popoutRegion.getDisplay()); final DeckPanel center = new DeckPanel(); center.add(resultsView); center.add(popoutRegion.getDisplay()); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (POPOUT_REGION.equals(source.getId())) { center.showWidget(1); } else if (RESULT_REGION.equals(source.getId())) { center.showWidget(0); } } }); WebEventManager.getAppEvManager().addListener(Name.REGION_HIDE, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (POPOUT_REGION.equals(source.getId())) { center.showWidget(0); } } }); center.showWidget(0); return center; }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Widget makeNorth() { AbsolutePanel l = new AbsolutePanel(); DockPanel dlp = new DockPanel(); // final Image sep = new Image("images/glow_bottom_center.gif"); // dlp.add(sep, DockPanel.SOUTH); // GwtUtil.setStyles(sep, "width", "100%", "height", "5px"); // dlp.add(getSmallIcon().getDisplay(), DockPanel.EAST); // dlp.add(getSmallIcon2().getDisplay(), DockPanel.WEST); dlp.add(l, DockPanel.CENTER);/* w ww .j a v a 2 s. c om*/ dlp.setCellWidth(l, "100%"); dlp.setCellHeight(l, "37px"); dlp.setWidth("100%"); // dlp.setCellWidth(getSmallIcon().getDisplay(), "160px"); dlp.setStyleName("menu-bar"); getMenu().getDisplay().addStyleName("menu-bar"); GwtUtil.setStyles(l, "width", "100%", "height", "5px", "overflow", "visible"); l.add(getMenu().getDisplay(), 0, 10); // DeferredCommand.addCommand(new Command(){ // public void execute() { // int offset = BrowserUtil.isBrowser(Browser.FIREFOX) ? 8 : 11; // RootPanel.get().add(getMenu().getDisplay(), l.getAbsoluteLeft(), l.getAbsoluteTop()+offset); // } // }); return dlp; }
From source file:edu.caltech.ipac.firefly.ui.panels.SearchPanel.java
private SearchPanel() { navPanel = new VerticalPanel(); formPanel.addStyleName("content-panel"); setFormAreaMinWidth("500px"); //li//from w w w . ja v a 2 s . c o m DockPanel mainPanel = new DockPanel(); mainPanel.addStyleName("component-background"); mainPanel.add(navPanel, DockPanel.WEST); mainPanel.add(formPanel, DockPanel.CENTER); Element el = (Element) navPanel.getElement().getParentElement(); if (el != null) { DOM.setStyleAttribute(el, "background", "#E5E5E5"); DOM.setStyleAttribute(el, "padding", "10px 10px 10px 30px"); DOM.setStyleAttribute(el, "borderRight", "2px outset #e8e8e8"); } else { navPanel.addStyleName("search-panel-list"); } // mainPanel.setWidth("100%"); mainPanel.setCellWidth(navPanel, "200px"); mainPanel.setCellHeight(navPanel, "100%"); initWidget(mainPanel); }
From source file:org.freemedsoftware.gwt.client.screen.MainScreen.java
License:Open Source License
public MainScreen() { final DockPanel mainPanel = new DockPanel(); initWidget(mainPanel);//from ww w . j av a2 s . co m mainPanel.setSize("100%", "100%"); // CurrentState.retrieveUserConfiguration(true); CurrentState.retrieveSystemConfiguration(true); // populateLeftNavigationPanel(); JsonUtil.debug("MainScreen: call populateDefaultProvider"); populateDefaultProvider(); JsonUtil.debug("MainScreen: call populateDefaultFacility"); JsonUtil.debug("MainScreen: assign object to CurrentState static object"); CurrentState.assignMainScreen(this); /* * Top Header panel to use top header shortcuts e.g logoff,add patient * etc */ VerticalPanel topHeaderPanel = new VerticalPanel(); topHeaderPanel.ensureDebugId("topHeaderPanel"); topHeaderPanel.setStyleName(AppConstants.STYLE_HEADER_PANEL); topHeaderPanel.setWidth("100%"); Image logoImage = new Image(); logoImage.setUrl("resources/images/FreemedHeader.jpg"); logoImage.setSize("100%", "55px"); topHeaderPanel.add(logoImage); topHeaderPanel.setCellHorizontalAlignment(logoImage, HasHorizontalAlignment.ALIGN_CENTER); topHeaderPanel.setCellWidth(logoImage, "100%"); HorizontalPanel topHeaderHorPanel = new HorizontalPanel(); topHeaderHorPanel.setWidth("100%"); HorizontalPanel facilityInfoPanel = new HorizontalPanel(); facilityInfoPanel.setStyleName(AppConstants.STYLE_HEADER_PANEL); // adding userInfoPanel at top left HorizontalPanel userInfoPanel = new HorizontalPanel(); userInfoPanel.setStyleName(AppConstants.STYLE_HEADER_PANEL); Image userImage = new Image(); userImage.setUrl("resources/images/user-icon.png"); userImage.setSize("13px", "100%"); userInfoPanel.add(userImage); userInfoPanel.add(loginUserInfo);// Adding loginuserinfo link setLoginUserInfo(); // Adding UserInfoPanel into top headerhorpanel HorizontalPanel hp = new HorizontalPanel(); Image homeImage = new Image(); homeImage.setUrl("resources/images/home-icon.png"); homeImage.setSize("15px", "100%"); facilityInfoPanel.add(homeImage); facilityInfoPanel.add(facilityInfo); HTML separator = new HTML("|"); separator.setWidth("8px"); separator.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); hp.add(userInfoPanel); hp.add(separator); hp.add(facilityInfoPanel); // Adding UserInfoPanel into top headerhorpanel topHeaderHorPanel.add(hp); topHeaderHorPanel.setCellHorizontalAlignment(hp, HasHorizontalAlignment.ALIGN_LEFT); topHeaderHorPanel.setCellHorizontalAlignment(facilityInfoPanel, HasHorizontalAlignment.ALIGN_LEFT); // topHeaderHorPanel.setCellWidth(facilityInfoPanel, "20%"); // adding shortcuts panel at top right corder shortCutsPanel = new HorizontalPanel(); // Adding shortCutsPanel into top header topHeaderHorPanel.add(shortCutsPanel); topHeaderHorPanel.setCellHorizontalAlignment(shortCutsPanel, HasHorizontalAlignment.ALIGN_RIGHT); // Adding tophorpanel into top topheaderpanel topHeaderPanel.add(topHeaderHorPanel); topHeaderPanel.setCellWidth(topHeaderHorPanel, "100%"); // Adding top header to main panel mainPanel.add(topHeaderPanel, DockPanel.NORTH); mainPanel.setCellWidth(topHeaderPanel, "100%"); mainPanel.setCellHeight(topHeaderPanel, "3%"); /* * SimplePanel to hold (hopefully) a horizontal sub menu, going to try * to use the Menu Bar items to call each sub-menu -JA */ JsonUtil.debug("MainScreen: create accordion panel"); // Creating Left Navigation area with decorated stack panel stackPanel = new AccordionPanel(); stackPanel.setWidth("100%"); // stackPanel.setHeight("100%"); { JsonUtil.debug("MainScreen: add main pane"); mainAccPanel = new VerticalPanel(); mainAccPanel.setStyleName("accordion-panel"); mainAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // adding Main Panel(System) into stack panel // stackPanel.add(mainAccPanel, // getHeaderString(AppConstants.SYSTEM_CATEGORY, null), true); JsonUtil.debug("MainScreen: add patient pane"); patientAccPanel = new VerticalPanel(); patientAccPanel.setStyleName("accordion-panel"); patientAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // adding Patient Panel into stack panel // stackPanel.add(patientAccPanel, // getHeaderString(AppConstants.PATIENT_CATEGORY, null), true); JsonUtil.debug("MainScreen: add document pane"); documentAccPanel = new VerticalPanel(); documentAccPanel.setStyleName("accordion-panel"); documentAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // adding Documents Panel into stack panel // stackPanel.add(documentAccPanel, // getHeaderString(AppConstants.DOCUMENTS_CATEGORY, null), true); JsonUtil.debug("MainScreen: add Billing pane"); billingAccPanel = new VerticalPanel(); billingAccPanel.setStyleName("accordion-panel"); billingAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // adding Billing Panel into stack panel // stackPanel.add(billingAccPanel, // getHeaderString(AppConstants.BILLING_CATEGORY, null), true); JsonUtil.debug("MainScreen: add Reporting pane"); reportingAccPanel = new VerticalPanel(); reportingAccPanel.setStyleName("accordion-panel"); reportingAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // adding Reporting Panel into stack panel // stackPanel.add(reportingAccPanel, // getHeaderString(AppConstants.REPORTING_CATEGORY, null), true); JsonUtil.debug("MainScreen: add utilities pane"); utilitiesAccPanel = new VerticalPanel(); utilitiesAccPanel.setStyleName("accordion-panel"); utilitiesAccPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // adding Utilities Panel into stack panel // stackPanel.add(utilitiesAccPanel, // getHeaderString(AppConstants.UTILITIES_CATEGORY, null), true); // Disable for now // accordionPanel.selectPanel("Main"); } JsonUtil.debug("MainScreen: create container hpanel for accordion and tabs"); HorizontalPanel menuAndContent = new HorizontalPanel(); menuAndContent.setSize("100%", "100%"); // Jam them together, no space. menuAndContent.setSpacing(0); // menuAndContent.setCellWidth(accordionPanel, "250px"); JsonUtil.debug("MainScreen: add accordion and tab panel to container"); menuAndContent.add(stackPanel); stackPanel.ensureDebugId("cwStackPanel"); // defining left navigation area width menuAndContent.setCellWidth(stackPanel, "12%"); JsonUtil.debug("MainScreen: create tabPanel"); tabPanel = new DecoratedTabPanel(); tabPanel.setSize("100%", "100%"); tabPanel.setAnimationEnabled(true); menuAndContent.add(tabPanel); // defining content area width menuAndContent.setCellWidth(tabPanel, "88%"); menuAndContent.setCellHorizontalAlignment(tabPanel, HasHorizontalAlignment.ALIGN_LEFT); JsonUtil.debug("MainScreen: add container to dock panel"); mainPanel.add(menuAndContent, DockPanel.CENTER); JsonUtil.debug("MainScreen: add dashboard panel to tabs and select"); // tabPanel.add(dashboard, "Dashboard"); tabPanel.add(dashboardScreenNew, "Dashboard"); tabPanel.selectTab(0); JsonUtil.debug("MainScreen: pass tabPanel to static CurrentState"); CurrentState.assignTabPanel(tabPanel); // Get configuration CurrentState.retrieveUserConfiguration(true, new Command() { public void execute() { JsonUtil.debug("MainScreen: Set State of dashboard"); dashboardScreenNew.loadWidgets(); dashboardScreenNew.reloadDashboard(); } }); // Expand out main tabpanel to take up all extra room JsonUtil.debug("MainScreen: expand tabpanel"); // mainPanel.setCellWidth(tabPanel, "100%"); // mainPanel.setCellHeight(tabPanel, "100%"); final HTML poweredByLabel = new HTML(_("Powered By FreeMED™")); poweredByLabel.setStyleName(AppConstants.STYLE_LABEL_SMALL); mainPanel.add(poweredByLabel, DockPanel.SOUTH); mainPanel.setCellHorizontalAlignment(poweredByLabel, HasHorizontalAlignment.ALIGN_CENTER); JsonUtil.debug("MainScreen: split panel"); statusBarContainer = new HorizontalSplitPanel(); mainPanel.add(statusBarContainer, DockPanel.SOUTH); statusBarContainer.setSize("100%", "30px"); statusBarContainer.setSplitPosition("50%"); JsonUtil.debug("MainScreen: status bar"); statusBar1 = new Label(_("Ready")); statusBar1.setStyleName("statusBar"); statusBarContainer.add(statusBar1); CurrentState.assignStatusBar(statusBar1); statusBar2 = new Label("-"); statusBar2.setStyleName("statusBar"); statusBarContainer.add(statusBar2); if (Util.isStubbedMode()) { statusBar2.setText("STUBBED / TEST MODE"); } populateDefaultFacility(); // Create notification toaster JsonUtil.debug("MainScreen: create toaster"); if (CurrentState.getToaster() == null) { Toaster toaster = new Toaster(); CurrentState.assignToaster(toaster); toaster.setTimeout(7); } // Handle system notifications // notifications.setState(getCurrentState()); JsonUtil.debug("MainScreen: start notifications"); notifications.start(); if (Util.getProgramMode() == ProgramMode.STUBBED) initNavigations(); tabPanel.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> arg0) { if (tabPanel.getWidget(arg0.getSelectedItem()) instanceof ScreenInterface) { ScreenInterface screenInterface = ((ScreenInterface) tabPanel .getWidget(arg0.getSelectedItem())); String className = screenInterface.getClass().getName(); className = className.substring(className.lastIndexOf('.') + 1); CurrentState.assignCurrentPageHelp(className); } } }); // Force showing the screen // show(); }
From source file:org.jboss.errai.widgets.client.layout.WSDropShadowLayout.java
License:Apache License
public WSDropShadowLayout(Widget wrappedWidget) { DockPanel dockPanel = new DockPanel(); /**//ww w . j a va 2 s .com * 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.pentaho.gwt.widgets.client.wizards.AbstractWizardDialog.java
License:Open Source License
/** * layout()/*from w ww.j a v a2 s . c o m*/ * * Lays out the GUI elements. Should only be called ONCE during the objects lifecycle */ protected void layout() { // Create the overall container to be displayed in the dialog SimplePanel deckWrapper = new SimplePanel(); deckWrapper.setHeight("100%"); deckWrapper.setWidth("100%"); deckWrapper.setStyleName("dialog-content"); DockPanel content = new DockPanel(); // Create the Steps and add it to the content stepsList = new VerticalPanel(); stepsList.add(new Label(Messages.getString("dialog.steps"))); steps.setVisibleItemCount(STEPS_COUNT); stepsList.add(steps); // steps.setSize("30%", "100%"); content.add(stepsList, DockPanel.WEST); // Add the wizardPanels to the Deck and add the deck to the content // wizardDeckPanel.setSize("70%", "100%"); deckWrapper.setWidget(wizardDeckPanel); content.add(deckWrapper, DockPanel.CENTER); wizardDeckPanel.addStyleName(WIZARD_DECK_PANEL); // Add the control buttons HorizontalPanel wizardButtonPanel = new HorizontalPanel(); wizardButtonPanel.setSpacing(2); // If we have only one button then we dont need to show the back and next button. wizardButtonPanel.add(backButton); wizardButtonPanel.add(nextButton); wizardButtonPanel.add(finishButton); wizardButtonPanel.add(cancelButton); wizardButtonPanel.addStyleName(WIZARD_BUTTON_PANEL); HorizontalPanel wizardButtonPanelWrapper = new HorizontalPanel(); wizardButtonPanelWrapper.setWidth("100%"); //$NON-NLS-1$ wizardButtonPanelWrapper.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); wizardButtonPanelWrapper.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); wizardButtonPanelWrapper.add(wizardButtonPanel); content.add(wizardButtonPanelWrapper, DockPanel.SOUTH); content.setCellVerticalAlignment(wizardButtonPanelWrapper, HasVerticalAlignment.ALIGN_BOTTOM); // Add the content to the dialog add(content); content.setWidth("100%"); //$NON-NLS-1$ content.setHeight("100%"); //$NON-NLS-1$ content.setCellHeight(deckWrapper, "98%"); }