List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellWidth
public void setCellWidth(IsWidget w, String width)
From source file:com.ikon.frontend.client.widget.wizard.TemplateWizardPopup.java
License:Open Source License
/** * getProperties()/*from w ww .jav a 2s . c om*/ */ private void getProperties() { HorizontalPanel hPanel = new HorizontalPanel(); HTML space = new HTML(""); hPanel.add(actualButton); hPanel.add(space); hPanel.setCellWidth(space, "3"); propertyGroupWidget = new PropertyGroupWidget(docPath, groupsList.get(groupIndex), new HTML(groupsList.get(groupIndex).getLabel()), vPanelFired); vPanelFired.clear(); vPanelFired.add(propertyGroupWidget); vPanelFired.add(hPanel); HTML space2 = new HTML(""); vPanelFired.add(space2); vPanelFired.setCellVerticalAlignment(propertyGroupWidget, HasAlignment.ALIGN_TOP); vPanelFired.setCellHorizontalAlignment(hPanel, HasAlignment.ALIGN_RIGHT); vPanelFired.setCellHeight(space2, "5"); propertyGroupWidget.getProperties(); }
From source file:com.ikon.frontend.client.widget.wizard.WizardPopup.java
License:Open Source License
/** * getWorkflows/*from w w w .ja va 2 s . c o m*/ */ public void getWorkflows() { HorizontalPanel hPanel = new HorizontalPanel(); HTML space = new HTML(""); hPanel.add(actualButton); hPanel.add(space); hPanel.setCellWidth(space, "3"); workflowWidget = new WorkflowWidget(workflowsList.get(workflowIndex), uuid, vPanelFired, new HashMap<String, Object>()); vPanelFired.clear(); vPanelFired.add(workflowWidget); vPanelFired.add(hPanel); HTML space2 = new HTML(""); vPanelFired.add(space2); vPanelFired.setCellVerticalAlignment(workflowWidget, HasAlignment.ALIGN_TOP); vPanelFired.setCellHorizontalAlignment(hPanel, HasAlignment.ALIGN_RIGHT); vPanelFired.setCellHeight(space2, "5"); workflowWidget.runProcessDefinition(); }
From source file:com.ikon.frontend.client.widget.wizard.WizardPopup.java
License:Open Source License
/** * setCategories/*from w ww . jav a 2 s . co m*/ */ private void setCategories() { categoriesWidget = new CategoriesWidget(docPath, new HTML(Main.i18n("document.categories"))); HorizontalPanel hPanel = new HorizontalPanel(); HTML space = new HTML(""); hPanel.add(actualButton); hPanel.add(space); hPanel.setCellWidth(space, "3"); vPanelFired.clear(); vPanelFired.add(categoriesWidget); vPanelFired.add(hPanel); HTML space2 = new HTML(""); vPanelFired.add(space2); vPanelFired.setCellVerticalAlignment(categoriesWidget, HasAlignment.ALIGN_TOP); vPanelFired.setCellHorizontalAlignment(hPanel, HasAlignment.ALIGN_RIGHT); vPanelFired.setCellHeight(space2, "5"); actualButton.setEnabled(true); changeView(); }
From source file:com.ikon.frontend.client.widget.wizard.WizardPopup.java
License:Open Source License
/** * setKeywords// ww w.j a va2 s .co m */ private void setKeywords() { // To be implemented keywordsWidget = new KeywordsWidget(docPath, new HTML(Main.i18n("document.keywords"))); HorizontalPanel hPanel = new HorizontalPanel(); HTML space = new HTML(""); hPanel.add(actualButton); hPanel.add(space); hPanel.setCellWidth(space, "3"); vPanelFired.clear(); vPanelFired.add(keywordsWidget); vPanelFired.add(hPanel); HTML space2 = new HTML(""); vPanelFired.add(space2); vPanelFired.setCellVerticalAlignment(keywordsWidget, HasAlignment.ALIGN_TOP); vPanelFired.setCellHorizontalAlignment(hPanel, HasAlignment.ALIGN_RIGHT); vPanelFired.setCellHeight(space2, "5"); actualButton.setEnabled(true); changeView(); }
From source file:com.mallentechinc.smartwire.client.SmartWireWeb.java
License:Open Source License
public void onModuleLoad() { RootPanel rootPanel = RootPanel.get(); dockLayoutPanel = new DockLayoutPanel(Unit.EM); rootPanel.add(dockLayoutPanel, 10, 10); dockLayoutPanel.setSize("1100px", "900px"); HorizontalPanel headerPanel = new HorizontalPanel(); dockLayoutPanel.addNorth(headerPanel, 6); headerPanel.setWidth("1200px"); headerPanel.setBorderWidth(0);//from www . j a v a 2 s .co m Image logo = new Image("images/smartwire_logo.jpg"); headerPanel.setCellWidth(logo, "400px"); headerPanel.add(logo); headerPanel.add(new HTML("jxu")); Image logoff = new Image("images/doorlogoff.jpg"); logoff.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { boolean confirm = Window.confirm("You are about to logoff"); if (confirm) { //redirect("j_spring_security_logout"); logoff(); } } }); headerPanel.add(logoff); HTML htmlCopyRight = new HTML("Copy Right 2012 mallentechinc.com", true); dockLayoutPanel.addSouth(htmlCopyRight, 7.7); tabPanel = new TabLayoutPanel(2.5, Unit.EM); tabPanel.setAnimationDuration(1000); tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX); dockLayoutPanel.add(tabPanel); tabPanel.addSelectionHandler(new SelectionHandler() { public void onSelection(SelectionEvent event) { // Let the user know what they just did. // Window.alert("You clicked tab " + event.getSelectedItem().toString()); if (event.getSelectedItem().toString().equals("0")) { getAllUsers(); deckPanel.showWidget(1); } else if (event.getSelectedItem().toString().equals("3")) { getAllCircuitsByUser("jxu"); subsysContentDeckPanel.showWidget(1); } } }); //user admin DockLayoutPanel userdockLayoutPanel = new DockLayoutPanel(Unit.EM); VerticalPanel userAdminMenuPanel = new VerticalPanel(); userAdminMenuPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); userdockLayoutPanel.addWest(userAdminMenuPanel, 11); Button getAllUsersButton = new Button("Get All Users"); getAllUsersButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { getAllUsers(); deckPanel.showWidget(1); } }); userAdminMenuPanel.setSpacing(2); userAdminMenuPanel.add(getAllUsersButton); Button addNewUserButton = new Button("Add New User"); addNewUserButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { deckPanel.showWidget(2); } }); userAdminMenuPanel.setSpacing(2); userAdminMenuPanel.add(addNewUserButton); userAdminMenuPanel.setSize("130px", "150px"); //search user Button searchUserButton = new Button("Search User"); searchUserButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); userAdminMenuPanel.setSpacing(2); userAdminMenuPanel.add(searchUserButton); //user content area deckPanel = new DeckPanel(); deckPanel.setAnimationEnabled(true); userdockLayoutPanel.add(deckPanel); //add default page for this HTML htmlNewHtml = new HTML("This is admin page", true); deckPanel.add(htmlNewHtml); //add flex table flexTable = new FlexTable(); flexTable.setCellSpacing(2); flexTable.setCellPadding(2); deckPanel.add(flexTable); flexTable.setSize("700px", ""); //add user input page userformPanel = new FormPanel(); deckPanel.add(userformPanel); final VerticalPanel addUserFormContentPanel = new VerticalPanel(); addUserFormContentPanel.setSpacing(3); addUserFormContentPanel.add(new Label("User Name")); userName = new TextBox(); userName.setName("userName"); addUserFormContentPanel.add(userName); addUserFormContentPanel.add(new Label("Password")); passWord = new PasswordTextBox(); userName.setName("password"); addUserFormContentPanel.add(passWord); addUserFormContentPanel.add(new Label("First Name")); firstName = new TextBox(); firstName.setName("firstName"); addUserFormContentPanel.add(firstName); addUserFormContentPanel.add(new Label("Last Name")); lastName = new TextBox(); lastName.setName("lastName"); addUserFormContentPanel.add(lastName); addUserFormContentPanel.add(new Label("Email")); email = new TextBox(); email.setName("email"); addUserFormContentPanel.add(email); addUserFormContentPanel.add(new Label("User Role")); userRole = new ListBox(); userRole.addStyleName("demo-ListBox"); userRole.addItem("ADMIN"); userRole.addItem("USER"); userRole.setName("userRole"); addUserFormContentPanel.add(userRole); addUserFormContentPanel.add(new Label("Position")); position = new ListBox(); position.addStyleName("demo-ListBox"); position.addItem("EMPLOYEE"); position.addItem("MANAGER"); position.setName("position"); addUserFormContentPanel.add(position); Button insertUserButton = new Button("Add New User"); insertUserButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { //get user input String requestData = getAddUserInput(); //add user saveUpdateUser(requestData); } }); addUserFormContentPanel.add(insertUserButton); userformPanel.add(addUserFormContentPanel); tabPanel.add(userdockLayoutPanel, "User Admin"); //end of user admin //arch DockLayoutPanel archdockLayoutPanel = new DockLayoutPanel(Unit.EM); tabPanel.add(archdockLayoutPanel, "Planning & Architecture"); VerticalPanel archMenuPanel = new VerticalPanel(); archMenuPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); archMenuPanel.setSize("160px", "140px"); Button getAllOption = new Button("All Option Code"); getAllOption.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); archMenuPanel.setSpacing(2); archMenuPanel.add(getAllOption); Button addNewOptionButton = new Button("New Option Code"); addNewOptionButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); archMenuPanel.setSpacing(2); archMenuPanel.add(addNewOptionButton); //search user Button searchOptionCodeButton = new Button("Search Option Code"); searchOptionCodeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); archMenuPanel.setSpacing(2); archMenuPanel.add(searchOptionCodeButton); //search user Button functionCodeButton = new Button("Fuction Code"); functionCodeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); archMenuPanel.setSpacing(2); archMenuPanel.add(functionCodeButton); archdockLayoutPanel.addWest(archMenuPanel, 11); //end of arch //ee components DockLayoutPanel eeCompdockLayoutPanel = new DockLayoutPanel(Unit.EM); VerticalPanel eeCompMenuPanel = new VerticalPanel(); eeCompMenuPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); eeCompMenuPanel.setSize("160px", "120px"); Button device = new Button("Device"); device.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); eeCompMenuPanel.setSpacing(2); eeCompMenuPanel.add(device); eeCompdockLayoutPanel.addWest(eeCompMenuPanel, 11); tabPanel.add(eeCompdockLayoutPanel, "EE Components"); //end of ee components //sub system DockLayoutPanel subSystemdockLayoutPanel = new DockLayoutPanel(Unit.EM); VerticalPanel subsysMenuPanel = new VerticalPanel(); subsysMenuPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); subsysMenuPanel.setSize("160px", "120px"); Button myCircuits = new Button("My Sub Systems"); myCircuits.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { getAllCircuitsByUser("jxu"); subsysContentDeckPanel.showWidget(1); } }); subsysMenuPanel.setSpacing(2); subsysMenuPanel.add(myCircuits); //all sub system Button allSubSystems = new Button("Sub Systems"); allSubSystems.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); subsysMenuPanel.setSpacing(2); subsysMenuPanel.add(allSubSystems); //sub system family Button allSubSystemFamily = new Button("Sub System Family"); allSubSystemFamily.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); subsysMenuPanel.setSpacing(2); subsysMenuPanel.add(allSubSystemFamily); subSystemdockLayoutPanel.addWest(subsysMenuPanel, 11); //sub system content subsysContentDeckPanel = new DeckPanel(); subsysContentDeckPanel.setAnimationEnabled(true); //html HTML subsystemHtml = new HTML("This is place you can manager your Sub System", true); subsysContentDeckPanel.add(subsystemHtml); //add circuit page circuitsFlexTable = new FlexTable(); circuitsFlexTable.setSize("500px", "100px"); circuitsFlexTable.setCellPadding(2); circuitsFlexTable.setCellSpacing(2); subsysContentDeckPanel.add(this.circuitsFlexTable); subSystemdockLayoutPanel.add(subsysContentDeckPanel); //end of sub system content tabPanel.add(subSystemdockLayoutPanel, "Sub System Design"); //end of system //config vechile DockLayoutPanel vehicledockLayoutPanel = new DockLayoutPanel(Unit.EM); VerticalPanel vehicleMenuPanel = new VerticalPanel(); vehicleMenuPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); vehicleMenuPanel.setSize("160px", "120px"); Button addVehcile = new Button("Add Vehicle"); addVehcile.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); vehicleMenuPanel.setSpacing(2); vehicleMenuPanel.add(addVehcile); //all sub system Button addTrim = new Button("Add Trim"); addTrim.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Working on it, stay tune..."); } }); vehicleMenuPanel.setSpacing(2); vehicleMenuPanel.add(addTrim); vehicledockLayoutPanel.addWest(vehicleMenuPanel, 11); tabPanel.add(vehicledockLayoutPanel, "Vehicle Configurations"); //end of //config vechile DockLayoutPanel qadockLayoutPanel = new DockLayoutPanel(Unit.EM); tabPanel.add(qadockLayoutPanel, "Quality Assurance"); DockLayoutPanel midockLayoutPanel = new DockLayoutPanel(Unit.EM); tabPanel.add(midockLayoutPanel, "Manufacture Interface"); tabPanel.selectTab(0); getAllUsers(); deckPanel.showWidget(1); }
From source file:com.mecatran.otp.gwt.client.view.AddressProposalBox.java
License:Open Source License
public AddressProposalBox() { geocodeTimer = new Timer() { @Override//from w w w .j a v a 2s . c o m public void run() { if (!modifiedSinceGeocoding) return; modifiedSinceGeocoding = false; if (!textBox.getText().isEmpty() && location.getLocation() == null) { geocode(); } } }; location = new LocationBean(); VerticalPanel rootPanel = new VerticalPanel(); HorizontalPanel inputPanel = new HorizontalPanel(); rootPanel.add(inputPanel); inputPanel.setCellWidth(inputPanel, "100%"); textBox = new TextBox(); textBox.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { location.setAddress(textBox.getText()); location.setLocation(null); if (textBox.getText().isEmpty()) listener.onLocationSelected(location); } }); textBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { modifiedSinceGeocoding = true; location.setLocation(null); geocodeTimer.cancel(); if (textBox.getText().length() > 10) { geocodeTimer.schedule(3000); } } }); textBox.addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent event) { listener.onFocus(); } }); textBox.addBlurHandler(new BlurHandler() { @Override public void onBlur(BlurEvent event) { geocodeTimer.cancel(); geocodeTimer.schedule(100); } }); inputPanel.add(textBox); clearButton = new Button("X"); inputPanel.setCellWidth(inputPanel, "auto"); clearButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { geocodeTimer.cancel(); textBox.setText(""); location.setAddress(""); location.setLocation(null); listener.onLocationSelected(location); } }); inputPanel.add(clearButton); proposalPanel = new VerticalPanel(); initWidget(rootPanel); }
From source file:com.mecatran.otp.gwt.client.view.ItinerarySummaryWidget.java
License:Open Source License
public ItinerarySummaryWidget(ItineraryBean itinerary, ClickHandler closeHandler, ClickHandler pinHandler) { VerticalPanel rootPanel = new VerticalPanel(); // Addresses and close button top line HorizontalPanel departureAndButtonsPanel = new HorizontalPanel(); departureAndButtonsPanel.addStyleName("itinerary-topbar-panel"); rootPanel.add(departureAndButtonsPanel); // Departure and arrival time and addresses Grid departureAndArrivalPanel = new Grid(2, 2); departureAndArrivalPanel.addStyleName("itinerary-addresses-panel"); departureAndButtonsPanel.add(departureAndArrivalPanel); departureAndButtonsPanel.setCellWidth(departureAndArrivalPanel, "100%"); Label departureTimeLabel = new Label(FormatUtils.formatTime(itinerary.getDepartureTime())); departureTimeLabel.addStyleName("itinerary-departure-time"); Label arrivalTimeLabel = new Label(FormatUtils.formatTime(itinerary.getArrivalTime())); arrivalTimeLabel.addStyleName("itinerary-arrival-time"); String[] formattedAddresses = FormatUtils.formatAddresses(itinerary.getStartAddress(), itinerary.getEndAddress());/*from w w w .j ava 2s. c o m*/ // TODO Use HTML::setStyleName() ? HTML departureAddressLabel = new HTML( "<div class='itinerary-address-inner'>" + formattedAddresses[0] + "</div>"); departureAddressLabel.addStyleName("itinerary-address"); HTML arrivalAddressLabel = new HTML( "<div class='itinerary-address-inner'>" + formattedAddresses[1] + "</div>"); arrivalAddressLabel.addStyleName("itinerary-address"); departureAndArrivalPanel.setWidget(0, 0, departureTimeLabel); departureAndArrivalPanel.setWidget(0, 1, departureAddressLabel); departureAndArrivalPanel.setWidget(1, 0, arrivalTimeLabel); departureAndArrivalPanel.setWidget(1, 1, arrivalAddressLabel); departureAndArrivalPanel.getColumnFormatter().setWidth(1, "100%"); departureAndArrivalPanel.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP); departureAndArrivalPanel.getCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_TOP); // Buttons panel VerticalPanel buttonsPanel = new VerticalPanel(); departureAndButtonsPanel.add(buttonsPanel); buttonsPanel.setCellHorizontalAlignment(buttonsPanel, HasHorizontalAlignment.ALIGN_RIGHT); // Close button PushButton closeButton = new PushButton(new Image(PlannerResources.INSTANCE.closeButtonPng())); closeButton.addStyleName("itinerary-close-button"); closeButton.addClickHandler(closeHandler); buttonsPanel.add(closeButton); // Pin button pinButton = new ToggleButton(new Image(PlannerResources.INSTANCE.noFavoritePng()), new Image(PlannerResources.INSTANCE.favoritePng())); pinButton.addStyleName("itinerary-pin-button"); pinButton.addClickHandler(pinHandler); buttonsPanel.add(pinButton); // Date, duration and travel mode summary HorizontalPanel timesAndSummaryPanel = new HorizontalPanel(); timesAndSummaryPanel.setWidth("100%"); timesAndSummaryPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); rootPanel.add(timesAndSummaryPanel); // Date and duration VerticalPanel dateAndDurationPanel = new VerticalPanel(); dateAndDurationPanel.addStyleName("itinerary-date-duration-panel"); timesAndSummaryPanel.add(dateAndDurationPanel); String departureDate = FormatUtils.formatDate(itinerary.getDepartureTime()); String duration = FormatUtils.formatDuration(itinerary.getDurationSeconds()); Label departureDateLabel = new Label(departureDate); departureDateLabel.addStyleName("itinerary-departure-date"); dateAndDurationPanel.add(departureDateLabel); HTML durationLabel = new HTML(duration); durationLabel.addStyleName("itinerary-duration"); dateAndDurationPanel.add(durationLabel); // Travel modes Panel modesAndLinksPanel = new VerticalPanel(); timesAndSummaryPanel.add(modesAndLinksPanel); timesAndSummaryPanel.setCellWidth(modesAndLinksPanel, "100%"); ItineraryModeLineWidget modeLine = new ItineraryModeLineWidget(itinerary); modeLine.addStyleName("itinerary-modeline-panel"); modesAndLinksPanel.add(modeLine); // Links (show details, print) HorizontalPanel linksPanel = new HorizontalPanel(); showHideDetailsLink = new Anchor(I18nUtils.tr("show.itinerary.details")); showHideDetailsLink.addStyleName("itinerary-details-show-hide"); linksPanel.add(showHideDetailsLink); printLink = new Anchor(I18nUtils.tr("print.itinerary")); printLink.addStyleName("itinerary-details-print-link"); linksPanel.add(printLink); modesAndLinksPanel.add(linksPanel); initWidget(rootPanel); }
From source file:com.novartis.pcs.ontology.webapp.client.OntoBrowser.java
License:Apache License
private void layoutViews() { TermDetailsView termView = new TermDetailsView(eventBus, service); TermSynonymsView synonymsView = new TermSynonymsView(eventBus, service); RelatedTermsView relationshipsView = new RelatedTermsView(eventBus, service); SearchInputView searchInputView = new SearchInputView(eventBus, service); SearchOptionsView searchOptionsView = new SearchOptionsView(eventBus, service); SearchResultsView searchResultsView = new SearchResultsView(eventBus, service, searchOptionsView); SVGView svgView = new SVGView(eventBus, service); //CodeListView codelistView = new CodeListView(eventBus, service); DockLayoutPanel layoutPanel = new DockLayoutPanel(Unit.PX); HorizontalPanel southPanel = new HorizontalPanel(); southPanel.add(termView);//from w w w . j a v a 2 s . c om southPanel.add(synonymsView); southPanel.add(relationshipsView); southPanel.setCellWidth(termView, "33.33%"); southPanel.setCellWidth(synonymsView, "33.33%"); southPanel.setCellWidth(relationshipsView, "33.33%"); southPanel.setWidth("100%"); FlowPanel eastPanel = new FlowPanel(); eastPanel.add(searchInputView); eastPanel.add(searchOptionsView); eastPanel.add(searchResultsView); layoutPanel.addNorth(menuBar, 30); layoutPanel.addSouth(southPanel, 197); layoutPanel.addEast(eastPanel, 300); layoutPanel.add(svgView); RootLayoutPanel.get().add(layoutPanel); }
From source file:com.openkm.extension.frontend.client.widget.workflow.TabToolbarWorkflow.java
License:Open Source License
/** * TabToolbarWorkflow//ww w . ja v a 2s . co m */ public TabToolbarWorkflow(final WorkflowController controller) { HorizontalPanel buttonsPanel = new HorizontalPanel(); hPanel = new HorizontalPanel(); // Left Space HTML space = Util.hSpace("5"); hPanel.add(space); hPanel.setCellWidth(space, "5"); // Navigator navigator = new HorizontalPanel(); // Create home = new Button(GeneralComunicator.i18nExtension("button.home")); home.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { controller.goHome(); } }); home.setStyleName("okm-HomeButton"); navigator.add(home); navigator.add(new HTML(" ")); navigator.setCellVerticalAlignment(home, HasAlignment.ALIGN_MIDDLE); // adding navigator buttonsPanel.add(navigator); buttonsPanel.setCellVerticalAlignment(navigator, HasAlignment.ALIGN_MIDDLE); // Vertical line HorizontalPanel verticalLine = new HorizontalPanel(); HTML vertical = new HTML(" "); vertical.setHeight("24"); vertical.setStyleName("okm-Border-Right"); verticalLine.add(vertical); navigator.add(verticalLine); // Action HorizontalPanel actions = new HorizontalPanel(); HTML space2 = Util.hSpace("5"); actions.add(space2); actions.setCellWidth(space2, "5"); showList = new HTML(GeneralComunicator.i18nExtension("workflow.show.list").toUpperCase()); showDetail = new HTML(GeneralComunicator.i18nExtension("workflow.show.detail").toUpperCase()); showGraph = new HTML(GeneralComunicator.i18nExtension("workflow.show.graphs").toUpperCase()); showList.setVisible(false); showDetail.setVisible(false); showGraph.setVisible(false); actions.add(showList); actions.add(showDetail); actions.add(showGraph); buttonsPanel.add(actions); buttonsPanel.setCellVerticalAlignment(actions, HasAlignment.ALIGN_MIDDLE); // Vertical line HorizontalPanel verticalLine2 = new HorizontalPanel(); HTML vertical2 = new HTML(" "); vertical2.setHeight("24"); vertical2.setStyleName("okm-Border-Right"); verticalLine2.add(vertical2); buttonsPanel.add(verticalLine2); // Adding buttons panel hPanel.add(buttonsPanel); hPanel.setCellHorizontalAlignment(buttonsPanel, HasAlignment.ALIGN_LEFT); hPanel.setCellVerticalAlignment(buttonsPanel, HasAlignment.ALIGN_MIDDLE); hPanel.setStyleName("okm-Mail"); hPanel.addStyleName("okm-Border-Bottom"); // First time must be in topic mode switchViewMode(MODE_WORKFLOW_LIST); initWidget(hPanel); }
From source file:com.openkm.extension.frontend.client.widget.workflow.WorkflowTable.java
License:Open Source License
/** * addRow/*from www .ja v a2s . c o m*/ * * @param processInstance */ public void addRow(final GWTProcessInstance processInstance) { int rows = dataTable.getRowCount(); dataTable.insertRow(rows); dataTable.setHTML(rows, 0, String.valueOf(processInstance.getId())); dataTable.setHTML(rows, 1, String.valueOf(processInstance.getVersion())); dataTable.setHTML(rows, 2, processInstance.getProcessDefinition().getName()); DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18n("general.date.pattern")); dataTable.setHTML(rows, 3, dtf.format(processInstance.getStart())); if (processInstance.getEnd() != null) { dataTable.setHTML(rows, 4, dtf.format(processInstance.getEnd())); } else { dataTable.setHTML(rows, 4, ""); } HorizontalPanel hPanel = new HorizontalPanel(); Image showImage = new Image(OKMBundleResources.INSTANCE.search()); showImage.setStyleName("okm-Mail-Link"); showImage.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { controller.findLogsByProcessInstance(new Double(processInstance.getId()).intValue()); } }); hPanel.add(showImage); hPanel.setCellWidth(showImage, "20"); hPanel.setCellHorizontalAlignment(showImage, HasAlignment.ALIGN_CENTER); Image showDiagram = new Image(OKMBundleResources.INSTANCE.chartOrganisation()); showDiagram.setStyleName("okm-Mail-Link"); showDiagram.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { controller.showGraph(new Double(processInstance.getProcessDefinition().getId()).intValue(), processInstance.getRootToken().getNode()); } }); hPanel.add(showDiagram); hPanel.setCellWidth(showDiagram, "20"); hPanel.setCellHorizontalAlignment(showDiagram, HasAlignment.ALIGN_CENTER); dataTable.setWidget(rows, 5, hPanel); dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasAlignment.ALIGN_CENTER); dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasAlignment.ALIGN_CENTER); dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasAlignment.ALIGN_CENTER); dataTable.getCellFormatter().setHorizontalAlignment(rows, 5, HasAlignment.ALIGN_LEFT); }