Example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

List of usage examples for com.google.gwt.user.client.ui HTMLPanel HTMLPanel

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HTMLPanel HTMLPanel.

Prototype

private HTMLPanel(Element elem) 

Source Link

Document

Construct a new HTMLPanel with the specified element.

Usage

From source file:org.jbpm.console.ng.ht.client.editors.taskassignments.TaskAssignmentsPopupPresenter.java

License:Apache License

public void refreshTaskPotentialOwners(final long taskId) {
    List<Long> taskIds = new ArrayList<Long>(1);
    taskIds.add(taskId);/* w ww.  j  a va2 s.c om*/
    view.displayNotification("task ID before: " + taskId);
    taskServices.call(new RemoteCallback<Map<Long, List<String>>>() {
        @Override
        public void callback(Map<Long, List<String>> ids) {
            view.displayNotification("task IDs after: " + ids);
            if (ids.isEmpty()) {
                view.getUsersGroupsControlsPanel().add(new HTMLPanel("no potential owners"));
            } else {
                view.getUsersGroupsControlsPanel().add(new HTMLPanel("" + ids.get(taskId).toString()));
            }
        }
    }).getPotentialOwnersForTaskIds(taskIds);

}

From source file:org.jbpm.console.ng.ht.client.editors.taskassignments.TaskAssignmentsPopupViewImpl.java

License:Apache License

@Override
public void init(TaskAssignmentsPopupPresenter presenter) {
    this.presenter = presenter;

    descriptionAccordionLabel.add(new HTMLPanel(constants.Description()));

    updateTaskButton.setText(constants.Update());
}

From source file:org.jbpm.console.ng.ht.client.editors.taskcomments.popup.TaskCommentsPopupViewImpl.java

License:Apache License

@Override
public void init(TaskCommentsPopupPresenter presenter) {
    this.presenter = presenter;
    listContainer.add(commentsListGrid);
    listContainer.add(pager);/*  w  w w  .ja  v a  2  s.c o m*/
    commentsListGrid.setHeight("100px");

    commentsListGrid.setEmptyTableWidget(new HTMLPanel(constants.No_Comments_For_This_Task()));
    // Attach a column sort handler to the ListDataProvider to sort the list.
    sortHandler = new ListHandler<CommentSummary>(presenter.getDataProvider().getList());
    commentsListGrid.addColumnSortHandler(sortHandler);
    initTableColumns();
    presenter.addDataDisplay(commentsListGrid);
    // Create a Pager to control the table.
    pager.setVisible(false);
    pager.setDisplay(commentsListGrid);
    pager.setPageSize(6);
    newTaskCommentTextArea.setWidth("300px");
    addCommentButton.setText(constants.Add_Comment());
    newTaskCommentLabel.setText(constants.Comment());
}

From source file:org.jbpm.console.ng.ht.client.editors.taskdetails.popup.TaskDetailsPopupViewImpl.java

License:Apache License

@Override
public void init(TaskDetailsPopupPresenter presenter) {
    this.presenter = presenter;

    // Commented out until we add the posibility of adding sub tasks
    // for (String strategy : subTaskStrategies) {
    // subTaskStrategyListBox.addItem(strategy);
    ////from  w  w  w.  j  a v  a 2  s . co m
    // }

    for (String priority : priorities) {
        taskPriorityListBox.addItem(priority);

    }

    dueDate.setHighlightToday(true);
    dueDate.setShowTodayButton(true);
    dueDate.setFormat("dd/mm/yyyy hh:ii");
    dueDate.setAutoClose(true);

    taskStatusLabel.add(new HTMLPanel(constants.Status()));
    userLabel.add(new HTMLPanel(constants.User()));
    dueDateLabel.add(new HTMLPanel(constants.Due_On()));

    taskPriorityLabel.add(new HTMLPanel(constants.Priority()));

    processInstanceIdLabel.add(new HTMLPanel(constants.Process_Instance_Id()));
    processIdLabel.add(new HTMLPanel(constants.Process_Definition_Id()));
    pIDetailsLabel.add(new HTMLPanel(constants.Process_Instance_Details()));
    taskDescriptionLabel.add(new HTMLPanel(constants.Description()));
    detailsAccordionLabel.add(new HTMLPanel(constants.Details()));
    processContextLabel.setText(constants.Process_Context());
    processContextLabel.setStyleName("");
    pIDetailsButton.setText(constants.Process_Instance_Details());
    updateTaskButton.setText(constants.Update());
    processIdText.setReadOnly(true);
}

From source file:org.jbpm.console.ng.ht.client.editors.taskdetails.TaskDetailsPopupViewImpl.java

License:Apache License

@Override
public void init(TaskDetailsPopupPresenter presenter) {
    this.presenter = presenter;

    // Commented out until we add the posibility of adding sub tasks
    // for (String strategy : subTaskStrategies) {
    // subTaskStrategyListBox.addItem(strategy);
    ///*from  w  w w  . j  a  v  a 2s. c o m*/
    // }

    for (String priority : priorities) {
        taskPriorityListBox.addItem(priority);

    }

    taskStatusLabel.add(new HTMLPanel(constants.Status()));
    userLabel.add(new HTMLPanel(constants.User()));
    dueDateLabel.add(new HTMLPanel(constants.Due_On()));
    taskPriorityLabel.add(new HTMLPanel(constants.Priority()));

    processInstanceIdLabel.add(new HTMLPanel(constants.Process_Instance_Id()));
    processIdLabel.add(new HTMLPanel(constants.Process_Definition_Id()));
    pIDetailsLabel.add(new HTMLPanel(constants.Process_Instance_Details()));
    taskDescriptionLabel.add(new HTMLPanel(constants.Description()));
    descriptionAccordionLabel.add(new HTMLPanel(constants.Description()));
    processContextLabel.setText(constants.Process_Context());
    processContextLabel.setStyleName("");
    pIDetailsButton.setText(constants.Process_Instance_Details());
    updateTaskButton.setText(constants.Update());
}

From source file:org.jbpm.console.ng.ht.client.editors.taskform.FormDisplayPopupPresenter.java

License:Apache License

public void renderTaskForm(final long taskId) {
    view.getNavBarUL().clear();// w ww . j  a v  a  2s  . com

    NavLink workLink = new NavLink(constants.Work());
    workLink.setStyleName("active");

    NavLink detailsLink = new NavLink(constants.Details());
    detailsLink.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            close();
            PlaceRequest placeRequestImpl = new DefaultPlaceRequest("Task Details Popup");
            placeRequestImpl.addParameter("taskId", String.valueOf(taskId));
            placeManager.goTo(placeRequestImpl);
        }
    });

    NavLink commentsLink = new NavLink(constants.Comments());
    commentsLink.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            close();
            PlaceRequest placeRequestImpl = new DefaultPlaceRequest("Task Comments Popup");
            placeRequestImpl.addParameter("taskId", String.valueOf(taskId));
            placeManager.goTo(placeRequestImpl);
        }
    });

    view.getNavBarUL().add(workLink);
    view.getNavBarUL().add(detailsLink);
    view.getNavBarUL().add(commentsLink);

    formServices.call(new RemoteCallback<String>() {
        @Override
        public void callback(String form) {

            view.getFormView().clear();
            view.getFormView().add(new HTMLPanel(form));
            taskServices.call(new RemoteCallback<TaskSummary>() {
                @Override
                public void callback(final TaskSummary task) {
                    view.getOptionsDiv().clear();
                    FlowPanel wrapperFlowPanel = new FlowPanel();
                    wrapperFlowPanel.setStyleName("wrapper");
                    view.getOptionsDiv().add(wrapperFlowPanel);
                    view.getNameText().setText(task.getName());
                    view.getTaskIdText().setText(String.valueOf(task.getId()));
                    if (task.getStatus().equals("Reserved")) {
                        FocusPanel startFlowPanel = new FocusPanel();
                        startFlowPanel.setStyleName("option-button start");
                        startFlowPanel.setTitle("Start Task");
                        startFlowPanel.addClickHandler(new ClickHandler() {

                            @Override
                            public native void onClick(ClickEvent event)/*-{
                                                                        $wnd.startTask($wnd.getFormValues($doc.getElementById("form-data")));
                                                                        }-*/;
                        });
                        wrapperFlowPanel.add(startFlowPanel);
                        view.getOptionsDiv().add(wrapperFlowPanel);
                    } else if (task.getStatus().equals("InProgress")) {
                        FocusPanel saveTaskFlowPanel = new FocusPanel();
                        saveTaskFlowPanel.setStyleName("option-button save");
                        saveTaskFlowPanel.setTitle("Save Task");
                        saveTaskFlowPanel.addClickHandler(new ClickHandler() {

                            @Override
                            public native void onClick(ClickEvent event)/*-{
                                                                        $wnd.saveTaskState($wnd.getFormValues($doc.getElementById("form-data")));
                                                                        }-*/;
                        });
                        wrapperFlowPanel.add(saveTaskFlowPanel);
                        FocusPanel completeTaskFlowPanel = new FocusPanel();
                        completeTaskFlowPanel.setStyleName("option-button complete");
                        completeTaskFlowPanel.setTitle("Complete Task");
                        completeTaskFlowPanel.addClickHandler(new ClickHandler() {

                            @Override
                            public native void onClick(ClickEvent event)/*-{
                                                                        $wnd.completeTask($wnd.getFormValues($doc.getElementById("form-data")));
                                                                        }-*/;
                        });
                        wrapperFlowPanel.add(completeTaskFlowPanel);
                        view.getOptionsDiv().add(wrapperFlowPanel);

                    }
                }
            }).getTaskDetails(taskId);
        }
    }).getFormDisplayTask(taskId);

}

From source file:org.jbpm.console.ng.ht.client.editors.taskform.FormDisplayPopupPresenter.java

License:Apache License

public void renderProcessForm(final String processId) {
    view.getNavBarUL().clear();//from   w  w  w . ja v a  2s .c  o  m
    formServices.call(new RemoteCallback<String>() {
        @Override
        public void callback(String form) {
            view.getFormView().clear();
            view.getFormView().add(new HTMLPanel(form));

            dataServices.call(new RemoteCallback<ProcessSummary>() {
                @Override
                public void callback(ProcessSummary summary) {
                    view.getTaskIdText().setText("");
                    view.getNameText().setText(summary.getName());
                    FocusPanel wrapperFlowPanel = new FocusPanel();
                    wrapperFlowPanel.setStyleName("wrapper");
                    FocusPanel startFlowPanel = new FocusPanel();
                    startFlowPanel.setStyleName("option-button start");
                    startFlowPanel.setTitle("Start Process");
                    startFlowPanel.addClickHandler(new ClickHandler() {

                        @Override
                        public native void onClick(ClickEvent event)/*-{
                                                                    $wnd.startProcess($wnd.getFormValues($doc.getElementById("form-data")));
                                                                    }-*/;
                    });
                    wrapperFlowPanel.add(startFlowPanel);
                    view.getOptionsDiv().add(wrapperFlowPanel);

                }
            }).getProcessDesc(processId);

        }
    }).getFormDisplayProcess(processId);

}

From source file:org.jbpm.console.ng.ht.client.editors.taskform.FormDisplayViewImpl.java

License:Apache License

@Override
public void loadForm(String form) {
    formModeler = formRenderer.isValidContextUID(form);
    if (formModeler) {
        loadContext(form);// w w  w  .  jav a  2s .co m
        formView.setVisible(false);
        formRenderer.setVisible(true);
    } else {
        formView.clear();
        formView.add(new HTMLPanel(form));
        formView.setVisible(true);
        formRenderer.setVisible(false);
    }
}

From source file:org.jbpm.console.ng.ht.forms.client.display.displayers.process.FTLStartProcessDisplayerImpl.java

License:Apache License

@Override
protected void initDisplayer() {
    publish(this);
    jsniHelper.publishGetFormValues();//from w w  w.  ja  va  2  s .  co  m
    formContainer.clear();

    Accordion accordion = new Accordion();

    AccordionGroup accordionGroupCorrelation = new AccordionGroup();
    accordionGroupCorrelation.addHiddenHandler(new HiddenHandler() {
        @Override
        public void onHidden(HiddenEvent hiddenEvent) {
            hiddenEvent.stopPropagation();
        }
    });
    accordionGroupCorrelation.setHeading(constants.Correlation_Key());
    accordionGroupCorrelation.setDefaultOpen(false);
    accordionGroupCorrelation.add(correlationKey);
    accordion.add(accordionGroupCorrelation);

    AccordionGroup accordionGroupForm = new AccordionGroup();
    accordionGroupForm.addHiddenHandler(new HiddenHandler() {
        @Override
        public void onHidden(HiddenEvent hiddenEvent) {
            hiddenEvent.stopPropagation();
        }
    });
    accordionGroupForm.setHeading(constants.Form());
    accordionGroupForm.setDefaultOpen(true);
    accordionGroupForm.add(new HTMLPanel(formContent));
    accordion.add(accordionGroupForm);

    jsniHelper.injectFormValidationsScripts(formContent);

    formContainer.add(accordion);

}

From source file:org.jbpm.console.ng.ht.forms.client.display.displayers.task.FTLTaskDisplayerImpl.java

License:Apache License

@Override
protected void initDisplayer() {
    publish(this);
    jsniHelper.publishGetFormValues();/*from   w  w  w  . j  a v  a  2  s.  c  o  m*/

    jsniHelper.injectFormValidationsScripts(formContent);

    formContainer.clear();
    formContainer.add(new HTMLPanel(formContent));
    if (resizeListener != null)
        resizeListener.resize(formContainer.getOffsetWidth(), formContainer.getOffsetHeight());
}