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

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

Introduction

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

Prototype

public DialogBox(Caption captionWidget) 

Source Link

Document

Creates an empty dialog box specifying its Caption .

Usage

From source file:com.vaadin.tests.widgetset.client.gwtrpc.GwtRpcButtonConnector.java

License:Apache License

private void doRPC() {
    log("GwtRpcButtonTestConnector onClick");

    GwtRpcServiceTestAsync service = GWT.create(GwtRpcServiceTest.class);

    service.giveMeThat("honey", "sugar", new AsyncCallback<String>() {

        @Override// ww  w  . j a v  a2 s  .com
        public void onSuccess(String result) {
            showResult(result, SUCCESS_LABEL_ID);
        }

        @Override
        public void onFailure(Throwable caught) {
            showResult(caught.getMessage(), FAIL_LABEL_ID);
        }

        /*
         * Show the result box.
         */
        private void showResult(String result, String labelID) {
            DialogBox box = new DialogBox(true);
            Label label = new Label(result);
            label.getElement().setId(labelID);
            box.add(label);
            box.center();
            box.show();
        }

    });
}

From source file:eu.riscoss.client.report.RiskAnalysisReport.java

License:Apache License

public void showResults(JsonRiskAnalysis summary, JSONArray response, JSONValue jsonArgumentation) {
    initializeParameters();//www.  j a v  a2s  .  c  om
    /*if( panel.getWidget() != null ) {
       panel.getWidget().removeFromParent();
    }*/
    this.summary = summary;
    panel.clear();
    mainChartPanel.clear();
    descriptions.clear();
    mainChartPanel.setStyleName("margin-top");
    this.response = response;
    evidence = false;

    Codec codec = GWT.create(Codec.class);

    if (jsonArgumentation != null) {
        argumentation = codec.decode(jsonArgumentation);
    }

    generateMainChart();
    getSessionsInformation();

    Grid grid = new Grid();
    grid.setStyleName("margin-grid");
    grid.setCellPadding(0);
    grid.setCellSpacing(0);
    for (int i = 0; i < response.isArray().size(); i++) {
        JSONObject v = response.isArray().get(i).isObject();
        JsonRiskResult result = new JsonRiskResult(v);
        //         grid.insertRow( grid.getRowCount() );
        switch (result.getDataType()) {
        case DISTRIBUTION: {
            grid.resize(grid.getRowCount() + 1, 3);

            VerticalPanel panel = new VerticalPanel();

            String label = v.get("id").isString().stringValue();
            if (v.get("name") != null) {
                if (v.get("name").isString() != null) {
                    label = v.get("name").isString().stringValue();
                }
            }
            Label l = new Label(label);
            l.setStyleName("bold");
            panel.add(l);
            panel.setStyleName("headerTable");
            grid.setWidget(i, 0, panel);

            GaugeImage img = new GaugeImage();
            img.setDistribution(result.getDistributionString());
            grid.setWidget(i, 1, img);

            HorizontalPanel hp = new HorizontalPanel();

            hp.add(new Label(result.getDescription()));

            JArgument arg = argumentation.arguments.get(result.getChunkId());
            if (arg != null) {
                Button b = new Button("Why?");
                b.setStyleName("button");

                b.addClickHandler(new ClickWrapper<JArgument>(arg) {
                    @Override
                    public void onClick(ClickEvent event) {
                        DialogBox d = new DialogBox(true);
                        JArgument arg = getValue();
                        TreeWidget w = load(arg);
                        d.add(w);
                        d.center();
                    }

                    private TreeWidget load(JArgument arg) {
                        TreeWidget w = new TreeWidget(new Label(arg.summary));
                        for (JArgument subArg : arg.subArgs) {
                            w.addChild(load(subArg));
                        }
                        return w;
                    }
                });

                hp.add(b);
            }

            grid.setWidget(i, 2, hp);
        }
            break;
        case EVIDENCE: {
            evidence = true;
            grid.resize(grid.getRowCount() + 1, 3);
            VerticalPanel panel = new VerticalPanel();
            Label l = new Label(v.get("id").isString().stringValue());
            l.setStyleName("bold");
            panel.add(l);
            panel.add(new HTML("Exposure: <font color='red'>"
                    + v.get("e").isObject().get("e").isNumber().doubleValue() + "</font>"));
            panel.setStyleName("headerTable");
            panel.setHeight("100%");

            JArgument arg = argumentation.arguments.get(result.getChunkId());
            if (arg != null) {
                Button b = new Button("Why?");
                b.setStyleName("button");

                b.addClickHandler(new ClickWrapper<JArgument>(arg) {
                    @Override
                    public void onClick(ClickEvent event) {
                        DialogBox d = new DialogBox(true);
                        JArgument arg = getValue();
                        TreeWidget w = load(arg);
                        d.add(w);
                        d.center();
                    }

                    private TreeWidget load(JArgument arg) {
                        TreeWidget w = new TreeWidget(new Label(arg.summary));
                        for (JArgument subArg : arg.subArgs) {
                            w.addChild(load(subArg));
                        }
                        return w;
                    }
                });

                panel.add(b);
            }

            grid.setWidget(i, 0, panel);

            if ("evidence".equals(v.get("datatype").isString().stringValue())) {
                GaugeImage img = new GaugeImage();
                img.setEvidence(v.get("p").isString().stringValue(), v.get("m").isString().stringValue());
                SimplePanel p = new SimplePanel();
                p.setWidget(img);
                p.setStyleName("contentResultsTable");
                grid.setWidget(i, 1, p);
            }
            SimplePanel s = new SimplePanel();
            s.setStyleName("chart");
            panels.add(s);
            grid.setWidget(i, 2, s);

        }
            break;
        case INTEGER:
        case NaN:
        case REAL:
        case STRING:
        default:
            break;
        }
    }
    if (evidence)
        panel.add(mainChartPanel);
    panel.add(grid);
}

From source file:org.C2C.client.Task.java

License:Open Source License

public static void INIT() {
    CallManager.INIT();// w ww . jav  a  2 s.com
    TASK_WAIT = new TaskWait();
    TASK_WAIT.run();
    DialogBox dialogbox = new DialogBox(false);
    dialogbox.setStyleName("demo-DialogBox");
    dialogbox.show();
    ClassRegistry.INIT_CLASSES();
}

From source file:org.C2C.client.TaskManager.java

License:Open Source License

public static void RUN() {
    DialogBox dialogbox = new DialogBox(false);
    dialogbox.setStyleName("demo-DialogBox");
    dialogbox.setText("RUNX " + ACTIVE_COUNT + ", ");
    dialogbox.show();/*from ww w  .  j  a v a 2 s.co  m*/
    if (ACTIVE_COUNT <= 0 /*|| !CallManager.IS_LOGGEDIN*/) {
        return;
    }
    dialogbox.setText("RUNY");
    dialogbox.show();
    String toServer = "";
    Task prev = null;
    Map<Integer, Task> tasks = GET_TASKS();
    Set<Integer> keySet = tasks.keySet();
    for (Integer key : keySet) {
        final Task tsk = tasks.get(key);
        if (!tsk.isCompleted()) {
            if (tsk instanceof TaskEmpty) {
                if (tsk.isActiveTaskChild()) {
                    if (!toServer.isEmpty()) {
                        prev.addListener(new TaskCompletedListener() {
                            public void completed(Task task) {

                                String s = tsk.run();

                            }
                        });
                    } else {
                        tsk.run();
                    }
                }
            } else {
                String runRes = "";
                runRes = tsk.run();
                toServer = toServer.concat(runRes);

                prev = tsk;

            }
        }
    }
    if (!toServer.isEmpty()) {
        //WindowManager.getInstance().setStatusBarText(toServer.length()+"");
        CallManager.SEND_TO_SERVER(toServer);
    }
}

From source file:org.C2C.client.TaskWait.java

License:Open Source License

/**
 * The default constructor for class TaskWait
 *///from w  w w .  j ava 2 s  . c o m
public TaskWait() {
    super();
    setCompleted(true);
    m_listener = new TaskCompletedListener() {
        public void completed(Task task) {
            if (!TaskManager.TRANSFERING) {
                //TaskManager.RUN();
                DialogBox dialogbox = new DialogBox(false);
                dialogbox.setStyleName("demo-DialogBox");
                dialogbox.setText("TaskWait callback");
                dialogbox.show();

            }
            //((TaskWait) task).run();
        }
    };
    //        DialogBox dialogbox = new DialogBox(false);
    //        dialogbox.setStyleName("demo-DialogBox");
    //        dialogbox.setText("TaskWait");
    //        dialogbox.show();
    addListener(m_listener);
    TaskManager.ADD_TASK(this);
}

From source file:org.codehaus.enunciate.samples.petclinic.app.client.Owners.java

License:Apache License

public Owners() {
    final ClinicAsync clinic = ClinicAsync.Util.getInstance();
    FlowPanel searchPanel = new FlowPanel();
    final Grid grid = new Grid();
    final VerticalPanel layout = new VerticalPanel();
    final TextBox searchBox = new TextBox();
    searchPanel.add(searchBox);/* w w  w  .  j a va2s . c o  m*/
    searchPanel.add(new Button("find", new ClickListener() {
        public void onClick(Widget widget) {
            if (searchBox.getText().length() > 0) {
                clinic.findOwners(searchBox.getText(), new AsyncCallback<Collection<Owner>>() {
                    public void onSuccess(Collection<Owner> collection) {
                        if (collection.size() == 0) {
                            grid.resize(1, 1);
                            grid.setWidget(0, 0, new Label(
                                    "No owners of last name '" + searchBox.getText() + "' were found."));
                        } else {
                            grid.resize(collection.size() + 1, 4);
                            grid.setWidget(0, 0, new Label("name"));
                            grid.setWidget(0, 1, new Label("phone"));
                            grid.setWidget(0, 2, new Label("address"));
                            grid.setWidget(0, 3, new Label("city"));
                            grid.getCellFormatter().setWidth(0, 1, "12em");
                            grid.getCellFormatter().setHorizontalAlignment(0, 0, HasAlignment.ALIGN_CENTER);
                            grid.getCellFormatter().setHorizontalAlignment(0, 1, HasAlignment.ALIGN_CENTER);
                            grid.getCellFormatter().setHorizontalAlignment(0, 2, HasAlignment.ALIGN_CENTER);
                            grid.getCellFormatter().setHorizontalAlignment(0, 3, HasAlignment.ALIGN_CENTER);
                            grid.getRowFormatter().setStyleName(0, "clinic-tables-header");
                            int row = 1;
                            Iterator<Owner> it = collection.iterator();
                            while (it.hasNext()) {
                                final Owner owner = it.next();
                                final Label nameLabel = new Label(
                                        owner.getFirstName() + " " + owner.getLastName());
                                nameLabel.addStyleName("clinic-clickable");
                                nameLabel.addClickListener(new ClickListener() {
                                    public void onClick(Widget widget) {
                                        final DialogBox detailsPanel = new DialogBox(true);
                                        final VerticalPanel petList = new VerticalPanel();
                                        petList.add(new Label("Pets of " + nameLabel.getText() + ":"));
                                        detailsPanel.setWidget(petList);
                                        detailsPanel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                                            public void setPosition(int offsetWidth, int offsetHeight) {
                                                detailsPanel.setPopupPosition(nameLabel.getAbsoluteLeft(),
                                                        nameLabel.getAbsoluteTop());
                                            }
                                        });
                                        Iterator petsIt = owner.getPetIds().iterator();
                                        while (petsIt.hasNext()) {
                                            final Integer petId = (Integer) petsIt.next();
                                            clinic.loadPet(petId.intValue(), new AsyncCallback<Pet>() {
                                                public void onSuccess(Pet response) {
                                                    petList.add(new Label("A " + response.getType().getName()
                                                            + " named " + response.getName() + "."));
                                                }

                                                public void onFailure(Throwable throwable) {
                                                    petList.add(new Label("Error loading pet " + petId + ": "
                                                            + throwable.getMessage()));
                                                }
                                            });
                                        }
                                    }
                                });
                                grid.setWidget(row, 0, nameLabel);
                                grid.setWidget(row, 1, new Label(owner.getTelephone()));
                                grid.setWidget(row, 2, new Label(owner.getAddress()));
                                grid.setWidget(row, 3, new Label(owner.getCity()));
                                row++;
                            }
                        }
                    }

                    public void onFailure(Throwable throwable) {
                        grid.resize(1, 1);
                        grid.setWidget(0, 0, new Label("ERROR: " + throwable.getMessage()));
                    }
                });
            }
        }
    }));
    layout.add(searchPanel);
    layout.add(grid);
    initWidget(layout);
}

From source file:org.codehaus.enunciate.samples.petclinic.app.client.Vets.java

License:Apache License

public Vets() {
    grid = new Grid();
    final ClinicAsync clinic = ClinicAsync.Util.getInstance();
    clinic.getVets(new AsyncCallback<Collection<Vet>>() {
        public void onSuccess(Collection<Vet> collection) {
            grid.resize(collection.size() + 1, 2);
            grid.setWidget(0, 0, new Label("name"));
            grid.setWidget(0, 1, new Label("action"));
            grid.getCellFormatter().setWidth(0, 1, "12em");
            grid.getCellFormatter().setHorizontalAlignment(0, 0, HasAlignment.ALIGN_CENTER);
            grid.getCellFormatter().setHorizontalAlignment(0, 1, HasAlignment.ALIGN_CENTER);
            grid.getRowFormatter().setStyleName(0, "clinic-tables-header");
            int row = 1;
            Iterator<Vet> vetsIt = collection.iterator();
            while (vetsIt.hasNext()) {
                final Vet vet = vetsIt.next();
                final Label details = new Label(vet.getFirstName() + " " + vet.getLastName());
                details.addClickListener(new ClickListener() {
                    public void onClick(Widget widget) {
                        final DialogBox detailsPanel = new DialogBox(true);
                        String html = "Id: " + vet.getId() + "<br/>First Name: " + vet.getFirstName()
                                + "<br/>Last Name: " + vet.getLastName() + "<br/>Phone: " + vet.getTelephone()
                                + "<br/>Specialties: ";
                        Iterator specialtiesIt = vet.getSpecialties().iterator();
                        while (specialtiesIt.hasNext()) {
                            Specialty specialty = (Specialty) specialtiesIt.next();
                            html = html + specialty.getName();
                            if (specialtiesIt.hasNext()) {
                                html += ",";
                            }//from   www.  ja  v  a2s .co  m
                        }
                        HTML htmlValue = new HTML(html);
                        htmlValue.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
                        detailsPanel.setWidget(htmlValue);
                        detailsPanel.setTitle(vet.getFirstName() + " " + vet.getLastName());
                        detailsPanel.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
                            public void setPosition(int offsetWidth, int offsetHeight) {
                                detailsPanel.setPopupPosition(details.getAbsoluteLeft(),
                                        details.getAbsoluteTop());
                            }
                        });
                    }
                });
                details.addStyleName("clinic-clickable");
                grid.setWidget(row, 0, details);
                grid.setWidget(row, 1, new Button("delete", new ClickListener() {
                    public void onClick(Widget widget) {
                        Window.alert("You don't have permission to delete a vet");
                    }
                }));
                row++;
            }
        }

        public void onFailure(Throwable throwable) {
            grid.resize(1, 1);
            grid.setWidget(0, 0, new Label("ERROR: " + throwable.getMessage()));
        }
    });
    initWidget(grid);
}

From source file:org.ebayopensource.turmeric.monitoring.client.view.ConsumerView.java

License:Open Source License

/**
 * Instantiates a new consumer view.//w  ww.  ja v a2 s.c  o m
 * 
 * @param dashboard
 *            the dashboard
 */
public ConsumerView(Dashboard dashboard) {
    // make the panel for the contents of the tab
    DockLayoutPanel contentPanel = new DockLayoutPanel(Unit.EM);
    initWidget(contentPanel);

    // heading
    Panel topPanel = new FlowPanel();
    topPanel.addStyleName("summary-heading-panel");
    Grid g = new Grid(1, 2);
    g.setHeight("100%");
    g.setWidth("100%");
    summaryHeading = new Label("&nbsp");
    summaryHeading.setWidth("50em");
    g.setWidget(0, 0, summaryHeading);
    g.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
    topPanel.add(g);

    // filters: dates, times and metrics
    filterWidget = new FilterWidget();
    filterWidget.setDateFormat("dd MMM yyyy");

    filterButton = new Button("Filter Criteria >>");
    filterButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            pickFilter();
        }
    });

    g.setWidget(0, 1, filterButton);
    g.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    filterDialog = new DialogBox(true);
    filterDialog.setText("Select Filter Criteria");
    FlowPanel contents = new FlowPanel();
    filterDialog.setWidget(contents);
    contents.add(filterWidget);

    filterWidget.getApplyButton().addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            filterDialog.hide(true);
        }
    });

    filterWidget.getCancelButton().addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            filterDialog.hide(true);
        }
    });

    splitPanel = new SplitLayoutPanel();
    contentPanel.addNorth(topPanel, 2.5);
    contentPanel.add(splitPanel);

    // scrolling panel for right hand side
    ScrollPanel rhs = new ScrollPanel();
    rhs.setAlwaysShowScrollBars(true);
    rhs.addStyleName("summary-panel");

    FlowPanel panel = new FlowPanel();

    // Tables (which will be graphs in future releases) for when no Consumer
    // is selected:
    // Call Volume (isn't this just the same as Consumer Traffic from
    // service tab? CallCount for Service(/Operation)
    // by Consumer?)
    callVolumeTable = makeTable();
    callVolumePanel = makePanel(ConsoleUtil.constants.callVolume(), callVolumeTable);
    panel.add(callVolumePanel);
    hide(callVolumePanel);

    // Performance (analogous to Least Performance for Service tab, but
    // grouped by Consumer)
    performanceTable = makeTable();
    performancePanel = makePanel(ConsoleUtil.constants.performance(), performanceTable);
    panel.add(performancePanel);
    hide(performancePanel);

    // Errors (isn't this the same as Consumer Errors from service tab?
    // Errors for Service(/Operation) by Consumer?
    errorsTable = makeTable();
    errorsPanel = makePanel(ConsoleUtil.constants.errors(), errorsTable);
    panel.add(errorsPanel);
    hide(errorsPanel);

    // Tables for when a Consumer has been selected:
    // Top Volume (CallCount for Consumer by Service)
    topVolumeTable = makeTable();
    topVolumePanel = makePanel(ConsoleUtil.constants.topVolume(), topVolumeTable);
    panel.add(topVolumePanel);
    hide(topVolumePanel);

    // Least Performance (ResponseTime for Consumer by Service)
    leastPerformanceTable = makeTable();
    leastPerformancePanel = makePanel(ConsoleUtil.constants.leastPerformance(), leastPerformanceTable);
    panel.add(leastPerformancePanel);
    hide(leastPerformancePanel);

    // Top Errors (Errors for Consumer by Service(NOTE: 5 columns: service +
    // error is returned!)
    topServiceErrorsTable = makeTable();
    topServiceErrorsPanel = makePanel(ConsoleUtil.constants.topServiceErrors(), topServiceErrorsTable);
    panel.add(topServiceErrorsPanel);
    hide(topServiceErrorsPanel);

    // Consumer Errors (Errors for Consumer by ...?)
    topConsumerErrorsTable = makeTable();
    topConsumerErrorsPanel = makePanel(ConsoleUtil.constants.topConsumerErrors(), topConsumerErrorsTable);
    panel.add(topConsumerErrorsPanel);
    hide(topConsumerErrorsPanel);

    rhs.add(panel);

    serviceListWidget = new ServiceListWidget();

    splitPanel.addWest(serviceListWidget, 200);
    splitPanel.add(rhs);

    this.dashboard = dashboard;
    this.dashboard.addView(this, ConsoleUtil.constants.consumers());
}

From source file:org.ebayopensource.turmeric.monitoring.client.view.ErrorView.java

License:Open Source License

/**
 * Instantiates a new error view./*w  w  w.j a  v  a2s . co m*/
 * 
 * @param dashboard
 *            the dashboard
 */
public ErrorView(Dashboard dashboard) {
    // make the panel for the contents of the tab
    DockLayoutPanel contentPanel = new DockLayoutPanel(Unit.EM);

    // heading
    Panel topPanel = new FlowPanel();
    topPanel.addStyleName("summary-heading-panel");
    Grid g = new Grid(1, 2);
    summaryHeading = new Label(ConsoleUtil.constants.summary());
    summaryHeading.setWidth("50em");
    g.setWidget(0, 0, summaryHeading);
    g.setHeight("100%");
    g.setWidth("100%");
    g.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);

    topPanel.add(g);

    // filters: dates, times and metrics
    filterWidget = new ErrorFilterWidget();
    filterWidget.setDateFormat(dateFormat);

    filterButton = new Button("Filter Criteria >>");
    filterButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            pickFilter();
        }
    });

    g.setWidget(0, 1, filterButton);
    g.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    filterDialog = new DialogBox(true);
    filterDialog.setText(ConsoleUtil.constants.selectFilterCriteria());
    FlowPanel contents = new FlowPanel();
    filterDialog.setWidget(contents);
    contents.add(filterWidget);

    filterWidget.getApplyButton().addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            filterDialog.hide(true);
        }
    });

    filterWidget.getCancelButton().addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            filterDialog.hide(true);
        }
    });

    splitPanel = new SplitLayoutPanel();
    contentPanel.addNorth(topPanel, 2.5);
    contentPanel.add(splitPanel);

    // scrolling panel for right hand side
    ScrollPanel rhs = new ScrollPanel();
    rhs.setAlwaysShowScrollBars(true);
    rhs.addStyleName("summary-panel");

    // panel to contain each table/graph
    tablesPanel = new FlowPanel();

    topApplicationErrorsTable = makeTable();
    topApplicationErrorsPanel = makePanel(ConsoleUtil.constants.topApplicationErrors(),
            topApplicationErrorsTable);
    topRequestErrorsTable = makeTable();
    topRequestErrorsPanel = makePanel(ConsoleUtil.constants.topRequestErrors(), topRequestErrorsTable);
    topSystemErrorsTable = makeTable();
    topSystemErrorsPanel = makePanel(ConsoleUtil.constants.topSystemErrors(), topSystemErrorsTable);
    topCriticalsTable = makeTable();
    topCriticalsPanel = makePanel(ConsoleUtil.constants.topCriticals(), topCriticalsTable);
    topErrorsTable = makeTable();
    topErrorsPanel = makePanel(ConsoleUtil.constants.topErrors(), topErrorsTable);
    topWarningsTable = makeTable();
    topWarningsPanel = makePanel(ConsoleUtil.constants.topWarnings(), topWarningsTable);
    errorDetailTable = makeTable();
    errorDetailPanel = makePanel("", errorDetailTable);
    consumerErrorsTable = makeTable();
    consumerErrorsPanel = makePanel(ConsoleUtil.constants.consumerError(), consumerErrorsTable);
    topSeverityErrorsTable = makeTable();
    topSeverityErrorsPanel = makePanel(ConsoleUtil.constants.topSeverityErrors(), topSeverityErrorsTable);
    topCategoryErrorsTable = makeTable();
    topCategoryErrorsPanel = makePanel(ConsoleUtil.constants.topCategoryErrors(), topCategoryErrorsTable);
    tablesPanel.add(topApplicationErrorsPanel);
    tablesPanel.add(topRequestErrorsPanel);
    tablesPanel.add(topSystemErrorsPanel);
    tablesPanel.add(topCriticalsPanel);
    tablesPanel.add(topErrorsPanel);
    tablesPanel.add(topWarningsPanel);
    tablesPanel.add(topSeverityErrorsPanel);
    tablesPanel.add(topCategoryErrorsPanel);
    tablesPanel.add(errorDetailPanel);
    tablesPanel.add(consumerErrorsPanel);
    hide(topApplicationErrorsPanel);
    hide(topRequestErrorsPanel);
    hide(topSeverityErrorsPanel);
    hide(topCriticalsPanel);
    hide(topErrorsPanel);
    hide(topWarningsPanel);
    hide(topSeverityErrorsPanel);
    hide(topCategoryErrorsPanel);
    hide(consumerErrorsPanel);
    hide(errorDetailPanel);

    rhs.add(tablesPanel);

    serviceListWidget = new ServiceListWidget();

    splitPanel.addWest(serviceListWidget, 250);
    splitPanel.add(rhs);

    initWidget(contentPanel);

    this.dashboard = dashboard;
    this.dashboard.addView(this, ConsoleUtil.constants.errors());
}

From source file:org.ebayopensource.turmeric.monitoring.client.view.ServiceView.java

License:Open Source License

/**
 * Instantiates a new service view.//  w ww.j a v a2s.co  m
 * 
 * @param dashboard
 *            the dashboard
 */
public ServiceView(Dashboard dashboard) {
    customLogArea = new VerticalPanel();

    // make the panel
    DockLayoutPanel contentPanel = new DockLayoutPanel(Unit.EM);
    initWidget(contentPanel);

    // heading
    Panel topPanel = new FlowPanel();
    topPanel.addStyleName("summary-heading-panel");
    Grid g = new Grid(1, 2);
    g.setHeight("100%");
    g.setWidth("100%");
    summaryHeading = new Label(ConsoleUtil.constants.summary());
    summaryHeading.setWidth("50em");
    g.setWidget(0, 0, summaryHeading);
    g.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
    topPanel.add(g);

    // filters: dates, times and metrics
    filterWidget = new FilterWidget();
    filterWidget.setDateFormat("dd MMM yyyy");

    filterButton = new Button("Filter Criteria >>");
    filterButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            pickFilter();
        }
    });

    g.setWidget(0, 1, filterButton);
    g.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE);

    filterDialog = new DialogBox(true);
    filterDialog.setText("Select Filter Criteria");
    FlowPanel contents = new FlowPanel();
    filterDialog.setWidget(contents);
    contents.add(filterWidget);

    filterWidget.getApplyButton().addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            filterDialog.hide(true);
        }
    });

    filterWidget.getCancelButton().addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            filterDialog.hide(true);
        }
    });

    splitPanel = new SplitLayoutPanel();
    // scrolling panel for right hand side
    ScrollPanel rhs = new ScrollPanel();
    rhs.setAlwaysShowScrollBars(true);
    rhs.addStyleName("summary-panel");

    FlowPanel panel = new FlowPanel();

    configureTopVolume();
    panel.add(topVolumePanel);

    configureLeastPerformance();
    panel.add(leastPerformancePanel);

    configureTopErrors();
    panel.add(topErrorsPanel);

    configureConsumerTraffic();
    panel.add(consumerTrafficPanel);

    configureConsumerErrors();
    panel.add(consumerErrorsPanel);

    rhs.add(panel);

    serviceListWidget = new ServiceListWidget();
    splitPanel.addWest(serviceListWidget, 200);
    splitPanel.add(rhs);

    // this sucks - I want to make the size of the north element
    // just big enough to contain its contents, but I cannot
    // obtain the size of them until they are actually added to their
    // container, which is too late!
    contentPanel.addNorth(topPanel, 2.5);
    contentPanel.add(splitPanel);

    disable();
    hide(topVolumePanel);
    hide(leastPerformancePanel);
    hide(topErrorsPanel);
    hide(consumerTrafficPanel);
    hide(consumerErrorsPanel);

    this.dashboard = dashboard;
    this.dashboard.addView(this, ConsoleUtil.constants.services());
}