List of usage examples for com.google.gwt.user.client.ui HorizontalPanel HorizontalPanel
public HorizontalPanel()
From source file:cl.uai.client.rubric.RubricPanel.java
License:Open Source License
/** * Creates the rubric panel//from w w w. j av a 2 s . c o m */ public RubricPanel(boolean isPopup) { this.popupInterface = isPopup; mainPanel = new VerticalPanel(); mainPanel.addStyleName(Resources.INSTANCE.css().rubricpanel()); // Adds the title rubricTitle = new Label(); rubricTitle.addStyleName(Resources.INSTANCE.css().rubrictitle()); // Adds the checkbox rubricFilter = new ListBox(); rubricFilter.addItem(MarkingInterface.messages.ShowAll(), "all"); rubricFilter.addItem(MarkingInterface.messages.ShowMarkingPending(), "unmarked"); rubricFilter.addItem(MarkingInterface.messages.ShowRegradePending(), "regrade"); // rubricFilter.addItem(MarkingInterface.messages.HideRubric(), "hide"); rubricFilter.addStyleName(Resources.INSTANCE.css().rubricfilterselect()); rubricFilter.setSelectedIndex(0); String cookieFilter = Cookies.getCookie("emarking_rubricfilter"); if (cookieFilter != null) { if (cookieFilter.equals("unmarked")) { rubricFilter.setSelectedIndex(1); } else if (cookieFilter.equals("regrade")) { rubricFilter.setSelectedIndex(2); } } rubricFilter.addChangeHandler(new RubricFilterListBoxValueChangeHandler()); // An horizontal panel holds title and checkbox hpanelTitle = new HorizontalPanel(); hpanelTitle.addStyleName(Resources.INSTANCE.css().rubrictitlepanel()); hpanelTitle.add(rubricTitle); hpanelTitle.setCellHorizontalAlignment(rubricTitle, HasHorizontalAlignment.ALIGN_LEFT); hpanelTitle.add(rubricFilter); hpanelTitle.setCellHorizontalAlignment(rubricFilter, HasHorizontalAlignment.ALIGN_RIGHT); hpanelTitle.setCellVerticalAlignment(rubricFilter, HasVerticalAlignment.ALIGN_MIDDLE); mainPanel.add(hpanelTitle); generalFeedbackInterface = new GeneralFeedbackInterface(); // Adds the scroll panel containing the rubric table rubricTable = new VerticalPanel(); rubricTable.addStyleName(Resources.INSTANCE.css().rubrictable()); scrollRubric = new ScrollPanel(); if (isPopupInterface()) { scrollRubric.add(rubricTable); mainPanel.add(scrollRubric); } else { mainPanel.add(rubricTable); } initWidget(mainPanel); }
From source file:cl.uai.client.toolbar.buttons.MarkingButtons.java
License:Open Source License
/** * Creates the rubric buttons interface/* w w w . ja v a 2s. co m*/ */ public MarkingButtons() { // main panel contains all buttons markingButtonsPanel = new HorizontalPanel(); markingButtonsPanel.addStyleName(Resources.INSTANCE.css().toolbarbuttons()); // Initialize the array buttons = new ArrayList<EmarkingToggleButton>(); buttonsStats = new HashMap<Integer, Label>(); customButtonIndex = new HashMap<String, Integer>(); criterionList = new CriterionListBox(); this.initWidget(markingButtonsPanel); }
From source file:cl.uai.client.toolbar.DraftGrade.java
License:Open Source License
/** * Creates the interface */ public DraftGrade() { this.mainPanel = new HorizontalPanel(); this.initWidget(mainPanel); }
From source file:cl.uai.client.toolbar.FinishMarkingDialog.java
License:Open Source License
public FinishMarkingDialog() { this.setHTML(MarkingInterface.messages.GeneralFeedback()); this.addStyleName(Resources.INSTANCE.css().commentdialog()); generalFeedback = new TextArea(); generalFeedback.addStyleName(Resources.INSTANCE.css().generalfeedbacktxt()); this.setModal(true); this.setAutoHideEnabled(false); this.setGlassEnabled(true); vpanel = new VerticalPanel(); vpanel.add(new Label(MarkingInterface.messages.GeneralFeedbackInstructions())); vpanel.add(generalFeedback);//from w ww . j a v a 2 s. c o m HorizontalPanel hpanel = new HorizontalPanel(); Button saveButton = new Button(MarkingInterface.messages.Save()); saveButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { cancelled = false; hide(); } }); Button cancelButton = new Button(MarkingInterface.messages.Cancel()); cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { cancelled = true; hide(); } }); hpanel.add(saveButton); hpanel.add(cancelButton); vpanel.add(hpanel); vpanel.setCellHorizontalAlignment(hpanel, HasHorizontalAlignment.ALIGN_RIGHT); this.setWidget(vpanel); }
From source file:cl.uai.client.toolbar.MarkingStats.java
License:Open Source License
/** * Creates the interface */ public MarkingStats() { this.mainPanel = new HorizontalPanel(); this.initWidget(mainPanel); }
From source file:cl.uai.client.toolbar.MarkingToolBar.java
License:Open Source License
/** * Creates the interface/*from w w w . j av a 2 s .c o m*/ */ public MarkingToolBar() { logger.fine("Entering MarkingToolbar"); grade = new DraftGrade(); markingButtons = new MarkingButtons(); markingButtons.setVisible(false); examButtons = new ExamButtons(true); examButtons.setVisible(true); extraButtons = new ExamButtons(false); extraButtons.setVisible(true); viewButtons = new ViewButtons(); viewButtons.setVisible(false); chatButtons = new ChatButtons(); chatButtons.setVisible(false); helpButtons = new HelpButtons(); helpButtons.setVisible(false); tabButtonsPanel = new TabPanel(); tabButtonsPanel.addStyleName(Resources.INSTANCE.css().tabbuttons()); tabButtonsPanel.add(markingButtons, MarkingInterface.messages.Mark().toUpperCase()); tabButtonsPanel.add(examButtons, MarkingInterface.messages.Exam().toUpperCase()); tabButtonsPanel.add(viewButtons, MarkingInterface.messages.View().toUpperCase()); tabButtonsPanel.add(chatButtons, MarkingInterface.messages.Collaboration().toUpperCase()); tabButtonsPanel.add(helpButtons, MarkingInterface.messages.Help().toUpperCase()); buttonsPanel = new HorizontalPanel(); buttonsPanel.setVisible(false); buttonsPanel.addStyleName(Resources.INSTANCE.css().buttonspanel()); buttonsPanel.add(tabButtonsPanel); buttonsPanel.setCellHorizontalAlignment(markingButtons, HasHorizontalAlignment.ALIGN_LEFT); buttonsPanel.setCellWidth(markingButtons, "50%"); SubmissionGradeData sdata = MarkingInterface.submissionData; if (sdata != null && EMarkingConfiguration.getMarkingType() == EMarkingConfiguration.EMARKING_TYPE_MARKER_TRAINING && EMarkingConfiguration.isChatEnabled()) { buttonsPanel.add(new HTML("Hola, ac habran estadisticas de correccin")); buttonsPanel.setCellWidth(markingButtons, "30%"); } buttonsPanel.add(grade); buttonsPanel.setCellVerticalAlignment(grade, HasVerticalAlignment.ALIGN_MIDDLE); buttonsPanel.setCellHorizontalAlignment(grade, HasHorizontalAlignment.ALIGN_RIGHT); buttonsPanel.setCellWidth(grade, "10%"); extraButtons = new ExamButtons(false); extraButtons.getFinishMarkingButton().setVisible(true); extraButtons.getSaveAndJumpToNextButton().setVisible(true); extraButtons.getSaveChangesButton().setVisible(true); buttonsPanel.add(extraButtons); buttonsPanel.setCellVerticalAlignment(extraButtons, HasVerticalAlignment.ALIGN_MIDDLE); buttonsPanel.setCellHorizontalAlignment(extraButtons, HasHorizontalAlignment.ALIGN_RIGHT); buttonsPanel.setCellWidth(extraButtons, "40%"); this.initWidget(buttonsPanel); }
From source file:cl.uai.client.toolbar.RotatePagesDialog.java
License:Open Source License
public RotatePagesDialog() { this.setHTML(MarkingInterface.messages.SortPages()); this.addStyleName(Resources.INSTANCE.css().commentdialog()); int pages = EMarkingWeb.markingInterface.getMarkingPagesInterface().getNumPages(); this.setPixelSize(300, 300); scrollpanel = new ScrollPanel(); scrollpanel.setPixelSize(300, 300);//from ww w. j a v a 2s.c o m apanel = new VerticalPanel(); for (int i = 0; i < pages; i++) { PushButton btnPage = new PushButton(MarkingInterface.messages.RotatePage(i + 1)); btnPage.setTabIndex(i + 1); btnPage.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { PushButton btn = (PushButton) event.getSource(); selectedPage = btn.getTabIndex(); cancelled = false; hide(); } }); apanel.add(btnPage); } scrollpanel.add(apanel); this.setModal(true); this.setAutoHideEnabled(false); this.setGlassEnabled(true); vpanel = new VerticalPanel(); vpanel.add(new Label(MarkingInterface.messages.RotatePagesInstructions())); vpanel.add(scrollpanel); // Basic save/cancel buttons HorizontalPanel hpanel = new HorizontalPanel(); Button cancelButton = new Button(MarkingInterface.messages.Cancel()); cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { cancelled = true; hide(); } }); hpanel.add(cancelButton); vpanel.add(hpanel); vpanel.setCellHorizontalAlignment(hpanel, HasHorizontalAlignment.ALIGN_RIGHT); this.setWidget(vpanel); }
From source file:cl.uai.client.toolbar.SortPagesDialog.java
License:Open Source License
public SortPagesDialog() { this.setHTML(MarkingInterface.messages.SortPages()); this.addStyleName(Resources.INSTANCE.css().commentdialog()); int pages = EMarkingWeb.markingInterface.getMarkingPagesInterface().getNumPages(); this.setPixelSize(300, 300); scrollpanel = new ScrollPanel(); scrollpanel.setPixelSize(300, 300);//ww w. j a va 2s. com apanel = new AbsolutePanel(); scrollpanel.add(apanel); FlexTableRowDragController drag = new FlexTableRowDragController(apanel); pagesTable = new SortPagesFlexTable(pages, 1, drag); pagesTable.addStyleName(Resources.INSTANCE.css().generalfeedbacktxt()); apanel.add(pagesTable); FlexTableRowDropController drop = new FlexTableRowDropController(pagesTable); drag.registerDropController(drop); this.setModal(true); this.setAutoHideEnabled(false); this.setGlassEnabled(true); vpanel = new VerticalPanel(); vpanel.add(new Label(MarkingInterface.messages.SortPagesInstructions())); vpanel.add(scrollpanel); HorizontalPanel hpanel = new HorizontalPanel(); Button saveButton = new Button(MarkingInterface.messages.SaveChanges()); saveButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { cancelled = false; hide(); } }); Button cancelButton = new Button(MarkingInterface.messages.Cancel()); cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { cancelled = true; hide(); } }); hpanel.add(saveButton); hpanel.add(cancelButton); vpanel.add(hpanel); vpanel.setCellHorizontalAlignment(hpanel, HasHorizontalAlignment.ALIGN_RIGHT); this.setWidget(vpanel); }
From source file:cl.uai.client.toolbar.SubmissionGrade.java
License:Open Source License
/** * Creates the interface */ public SubmissionGrade() { this.mainPanel = new HorizontalPanel(); this.initWidget(mainPanel); }
From source file:client.LogoPanel.java
License:Open Source License
/** * default constructor.// w w w. j a v a 2 s . c o m * * @param images */ private LogoPanel(final Images images) { final VerticalPanel outer = new VerticalPanel(); outer.setWidth("100%"); outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); final Image logo = images.phosphoruslogo2().createImage(); RpcRequest.common().isLoggedIn(new AsyncCallback() { public void onFailure(final Throwable caught) { LogoPanel.this.setSigendOut(); } public void onSuccess(final Object result) { LogoPanel.this.setSigendIn((String) result); } }); RpcRequest.common().isSecure(new AsyncCallback() { public void onFailure(final Throwable caught) { LogoPanel.this.aai.setStyleName("gui-TopPanel-Label"); LogoPanel.this.aai.setText("Unable to determine Security-Status"); } public void onSuccess(final Object result) { boolean res = ((Boolean) result).booleanValue(); if (res) { LogoPanel.this.aai.setStyleName("gui-TopPanel-Sec"); LogoPanel.this.aai.setText("Security Toolkit available!"); } else { LogoPanel.this.aai.setStyleName("gui-TopPanel-UnSec"); LogoPanel.this.aai.setText("Unsecured"); } } }); outer.add(logo); this.label.setStyleName("gui-TopPanel-Label"); this.link.setStyleName("gui-TopPanel-Link"); final HorizontalPanel panel = new HorizontalPanel(); panel.setWidth("100%"); panel.setStyleName("gui-TopPanel-Status"); panel.add(this.label); panel.add(this.aai); panel.add(this.link); outer.add(panel); panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); this.initWidget(outer); this.setStyleName("gui-TopPanel"); }