Search in sources :

Example 1 with ExtensionPanel

use of com.google.gerrit.client.api.ExtensionPanel in project gerrit by GerritCodeReview.

the class MyPasswordScreen method onLoad.

@Override
protected void onLoad() {
    super.onLoad();
    ExtensionPanel extensionPanel = createExtensionPoint(GerritUiExtensionPoint.PASSWORD_SCREEN_BOTTOM);
    extensionPanel.addStyleName(Gerrit.RESOURCES.css().extensionPanel());
    add(extensionPanel);
    if (password == null) {
        display();
        return;
    }
    enableUI(false);
    AccountApi.getUsername("self", new GerritCallback<NativeString>() {

        @Override
        public void onSuccess(NativeString user) {
            Gerrit.getUserAccount().username(user.asString());
            enableUI(true);
            display();
        }

        @Override
        public void onFailure(final Throwable caught) {
            if (RestApi.isNotFound(caught)) {
                Gerrit.getUserAccount().username(null);
                display();
            } else {
                super.onFailure(caught);
            }
        }
    });
}
Also used : NativeString(com.google.gerrit.client.rpc.NativeString) ExtensionPanel(com.google.gerrit.client.api.ExtensionPanel)

Example 2 with ExtensionPanel

use of com.google.gerrit.client.api.ExtensionPanel in project gerrit by GerritCodeReview.

the class MyPreferencesScreen method onLoad.

@Override
protected void onLoad() {
    super.onLoad();
    ExtensionPanel extensionPanel = createExtensionPoint(GerritUiExtensionPoint.PREFERENCES_SCREEN_BOTTOM);
    extensionPanel.addStyleName(Gerrit.RESOURCES.css().extensionPanel());
    add(extensionPanel);
    AccountApi.self().view("preferences").get(new ScreenLoadCallback<GeneralPreferences>(this) {

        @Override
        public void preDisplay(GeneralPreferences prefs) {
            display(prefs);
        }
    });
}
Also used : ExtensionPanel(com.google.gerrit.client.api.ExtensionPanel) GeneralPreferences(com.google.gerrit.client.info.GeneralPreferences)

Example 3 with ExtensionPanel

use of com.google.gerrit.client.api.ExtensionPanel in project gerrit by GerritCodeReview.

the class SettingsScreen method createExtensionPoint.

protected ExtensionPanel createExtensionPoint(GerritUiExtensionPoint extensionPoint) {
    ExtensionPanel extensionPanel = new ExtensionPanel(extensionPoint);
    extensionPanel.putObject(GerritUiExtensionPoint.Key.ACCOUNT_INFO, Gerrit.getUserAccount());
    return extensionPanel;
}
Also used : ExtensionPanel(com.google.gerrit.client.api.ExtensionPanel)

Example 4 with ExtensionPanel

use of com.google.gerrit.client.api.ExtensionPanel in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method onInitUI.

@Override
protected void onInitUI() {
    super.onInitUI();
    Resources.I.style().ensureInjected();
    saveProject = new Button(AdminConstants.I.buttonSaveChanges());
    saveProject.setStyleName("");
    saveProject.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            doSave();
        }
    });
    ExtensionPanel extensionPanelTop = new ExtensionPanel(GerritUiExtensionPoint.PROJECT_INFO_SCREEN_TOP);
    extensionPanelTop.put(GerritUiExtensionPoint.Key.PROJECT_NAME, getProjectKey().get());
    add(extensionPanelTop);
    add(new ProjectDownloadPanel(getProjectKey().get(), true));
    initDescription();
    grid = new LabeledWidgetsGrid();
    pluginOptionsPanel = new FlowPanel();
    actionsGrid = new LabeledWidgetsGrid();
    initProjectOptions();
    initAgreements();
    add(grid);
    add(pluginOptionsPanel);
    add(saveProject);
    add(actionsGrid);
    ExtensionPanel extensionPanelBottom = new ExtensionPanel(GerritUiExtensionPoint.PROJECT_INFO_SCREEN_BOTTOM);
    extensionPanelBottom.put(GerritUiExtensionPoint.Key.PROJECT_NAME, getProjectKey().get());
    add(extensionPanelBottom);
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ExtensionPanel(com.google.gerrit.client.api.ExtensionPanel) ActionButton(com.google.gerrit.client.actions.ActionButton) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 5 with ExtensionPanel

use of com.google.gerrit.client.api.ExtensionPanel in project gerrit by GerritCodeReview.

the class ChangeScreen method addExtensionPoint.

private void addExtensionPoint(GerritUiExtensionPoint extensionPoint, Panel p, ChangeInfo change, RevisionInfo rev, List<String> panelNames) {
    ExtensionPanel extensionPanel = new ExtensionPanel(extensionPoint, panelNames);
    extensionPanel.putObject(GerritUiExtensionPoint.Key.CHANGE_INFO, change);
    extensionPanel.putObject(GerritUiExtensionPoint.Key.REVISION_INFO, rev);
    p.add(extensionPanel);
}
Also used : ExtensionPanel(com.google.gerrit.client.api.ExtensionPanel)

Aggregations

ExtensionPanel (com.google.gerrit.client.api.ExtensionPanel)5 ActionButton (com.google.gerrit.client.actions.ActionButton)1 GeneralPreferences (com.google.gerrit.client.info.GeneralPreferences)1 NativeString (com.google.gerrit.client.rpc.NativeString)1 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)1 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)1 Button (com.google.gwt.user.client.ui.Button)1 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)1