Search in sources :

Example 1 with RootPanel

use of com.google.gwt.user.client.ui.RootPanel in project goldenorb by jzachr.

the class OrbTrackerStatus method onModuleLoad.

@Override
public void onModuleLoad() {
    RootPanel rootPanel = RootPanel.get();
    mainPanel = new VerticalPanel();
    rootPanel.add(mainPanel);
    Image image = new Image("images/logo-full.jpg");
    mainPanel.add(image);
    // Label titleLabel = new Label("GoldenOrb");
    // mainPanel.add(titleLabel);
    lastUpdatedLabel = new Label("Last Updated : ");
    mainPanel.add(lastUpdatedLabel);
    Label lblOrbtrackermembers = new Label("OrbTrackerMembers");
    mainPanel.add(lblOrbtrackermembers);
    orbTrackerFlexTable = new FlexTable();
    mainPanel.add(orbTrackerFlexTable);
    orbTrackerFlexTable.setSize("761px", "116px");
    orbTrackerFlexTable.setText(0, 0, "Node Name");
    orbTrackerFlexTable.setText(0, 1, "Partition Capacity");
    orbTrackerFlexTable.setText(0, 2, "Available Partitions");
    orbTrackerFlexTable.setText(0, 3, "Reserved Partitions");
    orbTrackerFlexTable.setText(0, 4, "In Use Partitions");
    orbTrackerFlexTable.setText(0, 5, "Host Name");
    orbTrackerFlexTable.setText(0, 6, "Leader");
    orbTrackerFlexTable.setText(0, 7, "Port");
    jobsGroupedPanel = new HorizontalPanel();
    mainPanel.add(jobsGroupedPanel);
    jobsGroupedPanel.setSize("258px", "100px");
    jobsInProgressPanel = new FlexTable();
    jobsInProgressPanel.setText(0, 0, "Jobs In Progress");
    jobsGroupedPanel.add(jobsInProgressPanel);
    jobsInQueuePanel = new FlexTable();
    jobsInQueuePanel.setText(0, 0, "Jobs In Queue");
    jobsGroupedPanel.add(jobsInQueuePanel);
    jobsInProgressPanel.setTitle("Jobs In Progress");
    jobsInQueuePanel.setTitle("Jobs in Queue");
    errorLabelOTM = new Label("");
    mainPanel.add(errorLabelOTM);
    errorLabelJIP = new Label("");
    mainPanel.add(errorLabelJIP);
    errorLabelJQ = new Label("");
    mainPanel.add(errorLabelJQ);
    Timer refreshTimer = new Timer() {

        public void run() {
            refreshWatchDataList();
            refreshJobsInProgress();
            refreshJobsInQueue();
        }
    };
    refreshTimer.scheduleRepeating(REFRESH_INTERVAL);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Timer(com.google.gwt.user.client.Timer) Label(com.google.gwt.user.client.ui.Label) FlexTable(com.google.gwt.user.client.ui.FlexTable) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) RootPanel(com.google.gwt.user.client.ui.RootPanel) Image(com.google.gwt.user.client.ui.Image)

Example 2 with RootPanel

use of com.google.gwt.user.client.ui.RootPanel in project gerrit by GerritCodeReview.

the class Gerrit method onModuleLoad2.

private void onModuleLoad2(HostPageData hpd) {
    RESOURCES.gwt_override().ensureInjected();
    RESOURCES.css().ensureInjected();
    topMenu = RootPanel.get("gerrit_topmenu");
    final RootPanel gStarting = RootPanel.get("gerrit_startinggerrit");
    final RootPanel gBody = RootPanel.get("gerrit_body");
    bottomMenu = RootPanel.get("gerrit_btmmenu");
    topMenu.setStyleName(RESOURCES.css().gerritTopMenu());
    gBody.setStyleName(RESOURCES.css().gerritBody());
    final Grid menuLine = new Grid(1, 3);
    menuLeft = new MorphingTabPanel();
    menuRight = new LinkMenuBar();
    searchPanel = new SearchPanel();
    menuLeft.setStyleName(RESOURCES.css().topmenuMenuLeft());
    menuLine.setStyleName(RESOURCES.css().topmenu());
    topMenu.add(menuLine);
    final FlowPanel menuRightPanel = new FlowPanel();
    menuRightPanel.setStyleName(RESOURCES.css().topmenuMenuRight());
    menuRightPanel.add(searchPanel);
    menuRightPanel.add(menuRight);
    menuLine.setWidget(0, 0, menuLeft);
    menuLine.setWidget(0, 1, new FlowPanel());
    menuLine.setWidget(0, 2, menuRightPanel);
    final CellFormatter fmt = menuLine.getCellFormatter();
    fmt.setStyleName(0, 0, RESOURCES.css().topmenuTDmenu());
    fmt.setStyleName(0, 1, RESOURCES.css().topmenuTDglue());
    fmt.setStyleName(0, 2, RESOURCES.css().topmenuTDmenu());
    siteHeader = RootPanel.get("gerrit_header");
    siteFooter = RootPanel.get("gerrit_footer");
    body = new ViewSite<Screen>() {

        @Override
        protected void onShowView(Screen view) {
            String token = view.getToken();
            History.newItem(token, false);
            dispatchHistoryHooks(token);
            if (view instanceof ChangeListScreen) {
                lastChangeListToken = token;
            }
            super.onShowView(view);
            view.onShowView();
            lastViewToken = token;
        }
    };
    gBody.add(body);
    JsonUtil.addRpcStartHandler(RpcStatus.INSTANCE);
    JsonUtil.addRpcCompleteHandler(RpcStatus.INSTANCE);
    gStarting.getElement().getParentElement().removeChild(gStarting.getElement());
    RootPanel.detachNow(gStarting);
    ApiGlue.init();
    applyUserPreferences();
    populateBottomMenu(bottomMenu, hpd);
    refreshMenuBar();
    History.addValueChangeHandler(new ValueChangeHandler<String>() {

        @Override
        public void onValueChange(ValueChangeEvent<String> event) {
            display(event.getValue());
        }
    });
    JumpKeys.register(body);
    saveDefaultTheme();
    if (hpd.messages != null) {
        new MessageOfTheDayBar(hpd.messages).show();
    }
    PluginLoader.load(hpd.plugins, hpd.pluginsLoadTimeout, new GerritCallback<VoidResult>() {

        @Override
        public void onSuccess(VoidResult result) {
            String token = History.getToken();
            if (token.isEmpty()) {
                token = isSignedIn() ? PageLinks.MINE : PageLinks.toChangeQuery("status:open");
            }
            display(token);
        }
    });
}
Also used : ChangeListScreen(com.google.gerrit.client.changes.ChangeListScreen) ProjectScreen(com.google.gerrit.client.admin.ProjectScreen) ChangeListScreen(com.google.gerrit.client.changes.ChangeListScreen) Screen(com.google.gerrit.client.ui.Screen) Grid(com.google.gwt.user.client.ui.Grid) RootPanel(com.google.gwt.user.client.ui.RootPanel) CellFormatter(com.google.gwt.user.client.ui.HTMLTable.CellFormatter) MorphingTabPanel(com.google.gerrit.client.ui.MorphingTabPanel) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) LinkMenuBar(com.google.gerrit.client.ui.LinkMenuBar)

Aggregations

RootPanel (com.google.gwt.user.client.ui.RootPanel)2 ProjectScreen (com.google.gerrit.client.admin.ProjectScreen)1 ChangeListScreen (com.google.gerrit.client.changes.ChangeListScreen)1 LinkMenuBar (com.google.gerrit.client.ui.LinkMenuBar)1 MorphingTabPanel (com.google.gerrit.client.ui.MorphingTabPanel)1 Screen (com.google.gerrit.client.ui.Screen)1 Timer (com.google.gwt.user.client.Timer)1 FlexTable (com.google.gwt.user.client.ui.FlexTable)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1 Grid (com.google.gwt.user.client.ui.Grid)1 CellFormatter (com.google.gwt.user.client.ui.HTMLTable.CellFormatter)1 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1 Image (com.google.gwt.user.client.ui.Image)1 Label (com.google.gwt.user.client.ui.Label)1 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)1