List of usage examples for com.google.gwt.user.client.ui HorizontalPanel HorizontalPanel
public HorizontalPanel()
From source file:com.ephesoft.gxt.admin.client.view.plugin.PluginDetailView.java
License:Open Source License
public void addWidget(String labelText, Widget widget, boolean isMandatory) { HorizontalPanel cont = new HorizontalPanel(); cont.addStyleName("pluginPanel"); if (isMandatory) { MandatoryLabel label = new MandatoryLabel(); label.setLabelText(labelText);//from w w w. j av a2s . c o m label.addStyleName("pluginLabel"); cont.add(label); } else { labelText = StringUtil.concatenate(labelText, AdminConstants.COLON); Label label = new Label(); label.setText(labelText); label.addStyleName("pluginLabel"); cont.add(label); } widget.addStyleName("widgetPluginLabel"); cont.add(widget); vlayoutContainer.add(cont); }
From source file:com.ephesoft.gxt.core.client.ui.widget.PagingToolbar.java
License:Open Source License
public PagingToolbar(final int rowsInPage, final Grid<?> bindedGrid) { super(getPageSize(rowsInPage, bindedGrid)); pagingField = new IntegerField(); this.bindedGrid = bindedGrid; resetLabel = new Label(); resetLabel.setTitle(LocaleConstants.RESET); this.insert(resetLabel, 13); this.addStyleName("toolbarTextAlign"); resetLabel.addStyleName("resetImage"); prev.addStyleName("previousToolbarButton"); next.addStyleName("nextToolbarButton"); last.addStyleName("lastToolbarButton"); first.addStyleName("firstToolbarButton"); refresh.addStyleName("refreshToolbarButton"); prev.addStyleName("toolbarButton"); next.addStyleName("toolbarButton"); last.addStyleName("toolbarButton"); first.addStyleName("toolbarButton"); refresh.addStyleName("toolbarButton"); addEnableHandler(first);// www .ja va2s.c om addEnableHandler(prev); addEnableHandler(last); addEnableHandler(next); pagingField.setText(String.valueOf(pageSize)); pagingField.setValue(pageSize); pagingField.setTitle(LocaleConstants.ACCEPT_VALUES_BETWEEN_10_TO_50); pageSizePrefixLabel = new Label(LocaleConstants.SHOWING); pageSizePrefixLabel.addStyleName("pagingPrefixLabel"); HorizontalPanel pagingPanel = new HorizontalPanel(); pagingPanel.addStyleName("pagingPanel"); pagingPanel.add(pageSizePrefixLabel); pagingPanel.add(pagingField); pageSizeSuffixLabel = new Label(LocaleConstants.RECORDS_PER_PAGE); pagingField.setWidth(30); pagingPanel.add(pageSizeSuffixLabel); this.add(pagingPanel); pagingField.addStyleName("pagingTextBox"); //displayText.setLabel(getMessages().displayMessage(0, 0, 0)); beforePage.setLabel(LocaleConstants.PAGE); pagingField.addValueChangeHandler(new ValueChangeHandler<Integer>() { @Override public void onValueChange(ValueChangeEvent<Integer> event) { Integer changedValue = event.getValue(); if (changedValue != null && changedValue >= 10 && changedValue <= 50) { pageSize = changedValue; String cookieName = getCookieName(bindedGrid); if (!StringUtil.isNullOrEmpty(cookieName)) { CookieUtil.storeCookie(cookieName, String.valueOf(pageSize)); } refresh(); loader.setLimit(pageSize); } else { pagingField.setText(String.valueOf(pageSize)); } } }); pagingField.addBlurHandler(new BlurHandler() { @Override public void onBlur(BlurEvent event) { pagingField.setText(String.valueOf(pageSize)); } }); resetLabel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { PagingToolbar.this.bindedGrid.clearFilter(); } }); resetLabel.addMouseOverHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { resetLabel.addStyleName("labelHover"); } }); resetLabel.addMouseOutHandler(new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { resetLabel.removeStyleName("labelHover"); } }); pageText.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { String text = pageText.getText(); int totalPages = PagingToolbar.this.getTotalPages(); boolean isValid = ValidationUtil.isValidNumericalValue(text, Integer.class); if (isValid) { int value = Integer.parseInt(text); isValid = ValidationUtil.isValueInRange(value, Math.min(1, totalPages), totalPages); } if (isValid) { pageText.removeStyleName("invalidField"); } else { pageText.addStyleName("invalidField"); } } }); setToolTipSize(); setWidgetIDs(); }
From source file:com.ephesoft.gxt.core.client.ui.widget.ScreenNavigatorWidget.java
License:Open Source License
private HorizontalPanel getInnerHorizontalPanel(Widget firstWidget, final Widget secondWidget) { final HorizontalPanel widgetHorizontalPanel = new HorizontalPanel(); widgetHorizontalPanel.add(firstWidget); widgetHorizontalPanel.getElement().setAttribute("cellPadding", "2"); widgetHorizontalPanel.setSpacing(1); widgetHorizontalPanel.setWidth("100px"); secondWidget.setVisible(true);// w w w .java 2s . c o m secondWidget.addStyleName("panelLabelStyle"); final MenuBar menuBar = (MenuBar) secondWidget; final MenuBarWidget menuBarWidget = new MenuBarWidget(true); menuBarWidget.addItem(new MenuItem(menuBar.getTitle(), menuBar)); widgetHorizontalPanel.add(menuBarWidget); menuBarWidget.setVisible(false); widgetHorizontalPanel.addDomHandler(new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { widgetHorizontalPanel.addStyleName("horizontalPanelMouseHover"); menuBarWidget.setAutoOpen(true); menuBarWidget.setSelectedMenu(false); if (null != previosMenuBar) { previosMenuBar.closeAllChildren(false); } } }, MouseOverEvent.getType()); widgetHorizontalPanel.addDomHandler(new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { widgetHorizontalPanel.removeStyleName("horizontalPanelMouseHover"); menuBarWidget.setSelectedMenu(true); previosMenuBar = menuBarWidget; } }, MouseOutEvent.getType()); return widgetHorizontalPanel; }
From source file:com.ephesoft.gxt.core.client.ui.widget.ScreenNavigatorWidget.java
License:Open Source License
private void initialize() { subHorizontalPanel = new HorizontalPanel(); innerVerticalPanel = new VerticalPanel(); toolBarMenuVerticalPanel = new VerticalPanel(); pageMenuVerticalPanel = new VerticalPanel(); userMenuVerticalPanel = new VerticalPanel(); bottomMenuVerticalPanel = new VerticalPanel(); topContainerPanel = new VerticalPanel(); bottomContainerPanel = new VerticalPanel(); innerVerticalPanel.addStyleName("panelWidth"); topContainerPanel.addStyleName("panelWidth"); bottomContainerPanel.addStyleName("panelWidth"); subHorizontalPanel.addStyleName("panelWidth"); bottomMenuVerticalPanel.addStyleName("panelWidth"); subHorizontalPanel.addStyleName("panelHeight"); innerVerticalPanel.addStyleName("panelHeight"); innerVerticalPanel.getElement().setId("innerVerticalPanel"); bottomMenuVerticalPanel.getElement().setId("bottomMenuVerticalPanel"); bottomContainerPanel.getElement().setId("bottomContainerPanel"); }
From source file:com.ephesoft.gxt.core.client.ui.widget.ScreenNavigatorWidget.java
License:Open Source License
private HorizontalPanel getPageMenuInnerHorizontalPanel(Widget firstWidget, final Widget secondWidget, final String url) { final HorizontalPanel widgetHorizontalPanel = new HorizontalPanel(); widgetHorizontalPanel.add(firstWidget); widgetHorizontalPanel.add(secondWidget); widgetHorizontalPanel.getElement().setAttribute("cellPadding", "2"); widgetHorizontalPanel.setSpacing(1); widgetHorizontalPanel.addStyleName("panelWidth"); secondWidget.setVisible(false);/*from w w w . j a v a2 s.co m*/ secondWidget.setWidth("100px"); secondWidget.addStyleName("panelLabelStyle"); if (!url.equalsIgnoreCase(CoreCommonConstant.EMPTY_STRING)) { String currentURL = Window.Location.getHref(); String baseUrl = currentURL.substring(0, currentURL.lastIndexOf('/')); StringBuffer newUrl = new StringBuffer(); newUrl.append(baseUrl).append(url); if (currentURL.equalsIgnoreCase(newUrl.toString())) { widgetHorizontalPanel.addStyleName("setSelectedPageStyle"); } } widgetHorizontalPanel.addDomHandler(new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { widgetHorizontalPanel.addStyleName("horizontalPanelMouseHover"); if (null != previosMenuBar) { previosMenuBar.closeAllChildren(false); } } }, MouseOverEvent.getType()); widgetHorizontalPanel.addDomHandler(new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { widgetHorizontalPanel.removeStyleName("horizontalPanelMouseHover"); } }, MouseOutEvent.getType()); widgetHorizontalPanel.addDomHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (!url.equalsIgnoreCase(CoreCommonConstant.EMPTY_STRING)) { String href = Window.Location.getHref(); String baseUrl = href.substring(0, href.lastIndexOf('/')); StringBuffer newUrl = new StringBuffer(); newUrl.append(baseUrl).append(url); Window.Location.assign(newUrl.toString()); } } }, ClickEvent.getType()); return widgetHorizontalPanel; }
From source file:com.ephesoft.gxt.login.client.LoginEntryPoint.java
License:Open Source License
@Override public void onLoad() { Window.setTitle(LocaleDictionary.getConstantValue(LoginConstants.LOGIN_TITLE)); Label userName = new Label(LocaleDictionary.getConstantValue(LoginConstants.login_username)); Label password = new Label(LocaleDictionary.getConstantValue(LoginConstants.login_password)); RootPanel.get("loginHeader").getElement() .setInnerText(LocaleDictionary.getConstantValue(LoginConstants.login_button_text)); RootPanel.get("j_username").getElement().setAttribute("placeholder", userName.getText()); RootPanel.get("j_username").getElement().focus(); RootPanel.get("j_password").getElement().setAttribute("placeholder", password.getText()); final Label versionNumber = new Label(); ((LoginRemoteServiceAsync) createRpcService()).getProductVersion(new AsyncCallback<String>() { @Override/*from ww w .ja v a2 s .c om*/ public void onSuccess(String version) { versionNumber.setText(version); RootPanel.get("versionLabel").getElement().setInnerText(versionNumber.getText()); } @Override public void onFailure(Throwable arg0) { DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(LocaleCommonConstants.ERROR_TITLE), LocaleDictionary.getConstantValue(LoginConstants.UNABLE_TO_RETRIVE_VERSION_INFO), DialogIcon.ERROR); } }); final Label expiryMsg = new Label(); final Label failOverMsg = new Label(); ((LoginRemoteServiceAsync) createRpcService()).getLicenseExpiryMsg(new AsyncCallback<Void>() { @Override public void onFailure(Throwable arg0) { String alertMsg = arg0.getLocalizedMessage(); int indexOfDelimiter = alertMsg.indexOf('@'); String days = alertMsg.substring(0, indexOfDelimiter); int remainingDays = Integer.parseInt(days); String dateString = alertMsg.substring(indexOfDelimiter + 1); if (remainingDays != 0) { expiryMsg.setText( LocaleDictionary.getMessageValue(LoginMessages.LICENSE_EXPIRY_MSG, days, dateString)); } else { expiryMsg.setText(LocaleDictionary.getMessageValue(LoginMessages.LICENSE_EXPIRY_MSG_TODAY)); } expiryMsg.addStyleName(FONT_RED_CSS); expiryMsg.addStyleName(BOLD_TEXT_CSS); RootPanel.get(EXPIRY_MSG_LEBEL).getElement().setInnerText(expiryMsg.getText()); RootPanel.get(EXPIRY_MSG_LEBEL).addStyleName(expiryMsg.getStyleName()); } @Override public void onSuccess(Void arg0) { } }); ((LoginRemoteServiceAsync) createRpcService()).getFailOverMessage(new AsyncCallback<Boolean>() { @Override public void onSuccess(Boolean result) { if (true == result) { // failOverMsg.setText(""); } else { failOverMsg.setText(LocaleDictionary.getMessageValue(LoginMessages.FAILOVER_MSG)); failOverMsg.addStyleName(FONT_RED_CSS); failOverMsg.addStyleName(BOLD_TEXT_CSS); RootPanel.get(FAIL_OVER_LABEL).getElement().setInnerText(failOverMsg.getText()); RootPanel.get(FAIL_OVER_LABEL).addStyleName(failOverMsg.getStyleName()); } } @Override public void onFailure(Throwable arg0) { } }); final HorizontalPanel horPanel = new HorizontalPanel(); horPanel.addStyleName("horizontalPanel"); RootPanel.get().add(horPanel); ScreenMaskUtility.maskScreen(LocaleDictionary.getMessageValue(LoginMessages.LOADING)); rpcService.getFooterProperties(new AsyncCallback<Map<String, String>>() { @Override public void onSuccess(Map<String, String> footerProperties) { footerText = footerProperties.get(CoreCommonConstants.FOOTER_TEXT_KEY); footerLink = footerProperties.get(CoreCommonConstants.FOOTER_LINK_KEY); final Anchor footerInfo = new Anchor(footerText, footerLink); horPanel.addStyleName("loginFooter"); horPanel.add(footerInfo); horPanel.setCellHorizontalAlignment(footerInfo, HasHorizontalAlignment.ALIGN_CENTER); ScreenMaskUtility.unmaskScreen(); } @Override public void onFailure(Throwable arg0) { ScreenMaskUtility.unmaskScreen(); DialogUtil.showMessageDialog(LocaleDictionary.getConstantValue(LocaleCommonConstants.ERROR_TITLE), LocaleDictionary.getMessageValue(LoginMessages.APPLICATION_NOT_AUTHORIZED), DialogIcon.ERROR); } }); RootPanel.get("error").getElement() .setInnerText(LocaleDictionary.getConstantValue(LoginConstants.INVALID_CREDENTIALS)); RootPanel.get("error").addStyleName(FONT_RED_CSS); SubmitButton submitButton = new SubmitButton(); // (SubmitButton) SubmitButton.wrap(RootPanel.get("button").getElement()); // submitButton.setFocus(true); submitButton.getElement().setTitle(LocaleDictionary.getConstantValue(LoginConstants.login_button_text)); submitButton.getElement().setInnerHTML("<i class=\"icon-arrow-right icon-large\"></i>"); submitButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { login(); } }); submitButton.setStyleName("gwt-Button"); RootPanel.get("button").getElement().addClassName("submit"); RootPanel.get("button").add(submitButton); }
From source file:com.ephesoft.gxt.rv.client.widget.ThumbnailWidgetPanel.java
License:Open Source License
@Override protected Widget createWidget() { if (null != document) { final List<String> thumbnailNamesList = BatchSchemaUtil.getThumbnails(document); List<Image> thumbnailImages = null; Image thumbnailImage = new Image(); if (!CollectionUtil.isEmpty(thumbnailNamesList)) { thumbnailImages = new ArrayList<Image>(); for (final String thumbnailName : thumbnailNamesList) { thumbnailImage = new Image(ReviewValidateNavigator.getAbsoluteURL(thumbnailName)); thumbnailImages.add(thumbnailImage); }/*ww w.ja v a2 s. c o m*/ } panel = new VerticalPanel(); panel.addStyleName("documentStack"); documentNameLabel = new Label(getDocumentTypeDisplayText(document)); documentNameLabel = new Label(document.getType()); final HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(5); documentNameLabel.addStyleName("highlightedLabel"); horizontalPanel.add(new Label(docIdentifier)); horizontalPanel.add(documentNameLabel); final ThumbnailStack thumbnailStack = new ThumbnailStack(thumbnailImages); panel.add(horizontalPanel); panel.add(thumbnailStack); } return panel; }
From source file:com.feller.picup.client.PickUp.java
License:Open Source License
public void onModuleLoad() { RootPanel rootPanel = RootPanel.get(); tabPanel.setVisible(true);//from w w w . ja v a 2 s. c o m tabPanel.setAnimationEnabled(true); rootPanel.add(tabPanel, 0, 85); tabPanel.setSize("561px", "343px"); tabPanel.add(Uploadpanel, "Upload Pics", false); Uploadpanel.setSize("296px", "290px"); Uploadpanel.add(uploadLabel); Uploadpanel.add(fileUpload); fileUpload.setName("files[]"); VerticalPanel generateQRPanel = new VerticalPanel(); tabPanel.add(generateQRPanel, "Generate QR Code", false); tabPanel.selectTab(0); generateQRPanel.setSize("5cm", "3cm"); HorizontalPanel ButtonslPanel = new HorizontalPanel(); generateQRPanel.add(ButtonslPanel); ButtonslPanel.setSize("218px", "36px"); Button getQRButton = new Button("get QR"); getQRButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { getBucketURL(); } }); ButtonslPanel.add(getQRButton); Button btnSendToBucket = new Button("send to Bucket"); btnSendToBucket.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { generateUploadFrame(); } }); ButtonslPanel.add(btnSendToBucket); ButtonslPanel.add(errorLabel); generateQRPanel.add(QRImagePanel); QRImagePanel.setWidth("197px"); Image picupImage = new Image("images/picUp.png"); rootPanel.add(picupImage, 7, 10); fileUpload.getElement().setId("files"); if (!initQRcodeDecoderComponenets()) { uploadLabel.setText("your browser does not support html5 capabilities.\n " + "QR decoding won't work \n" + "try using FireFox or chrome browser"); } else { uploadLabel.setText("html5 capabilites are supported"); } initFileReaderCallbacks(this); }
From source file:com.fujitsu.gwt.bewebapp.client.content.text.RichTextToolbar.java
License:Open Source License
/** Constructor of the Toolbar **/ public RichTextToolbar(RichTextArea richtext) { if (HTTP_STATIC_ICONS_GIF == null) { HTTP_STATIC_ICONS_GIF = BeWebApp.imgroot + "icons.gif"; }//from ww w .j a va 2s . co m //Initialize the main-panel outer = new VerticalPanel(); //Initialize the two inner panels topPanel = new HorizontalPanel(); bottomPanel = new HorizontalPanel(); topPanel.setStyleName(CSS_ROOT_NAME); bottomPanel.setStyleName(CSS_ROOT_NAME); //Save the reference to the RichText area we refer to and get the interfaces to the stylings styleText = richtext; styleTextFormatter = styleText.getFormatter(); //Set some graphical options, so this toolbar looks how we like it. topPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT); bottomPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT); //Add the two inner panels to the main panel outer.add(topPanel); outer.add(bottomPanel); //Some graphical stuff to the main panel and the initialisation of the new widget outer.setWidth("100%"); outer.setStyleName(CSS_ROOT_NAME); initWidget(outer); // evHandler = new EventHandler(); //Add KeyUp and Click-Handler to the RichText, so that we can actualize the toolbar if neccessary styleText.addKeyUpHandler(evHandler); styleText.addClickHandler(evHandler); //Now lets fill the new toolbar with life buildTools(); }
From source file:com.fullmetalgalaxy.client.AppMain.java
License:Open Source License
/** * /*from w w w .j a v a 2s . co m*/ */ public AppMain() { super(); s_instance = this; loadAccountInfoFromPage(); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(new Image(Icons.s_instance.takeOff32())); hPanel.add(new Label(MAppBoard.s_messages.unconnected())); m_pnlChannelDisconnected = new FocusPanel(hPanel); // disconnect if leaving this page Window.addWindowClosingHandler(this); }