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);
}
}
});
}
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);
}
});
}
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;
}
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);
}
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);
}
Aggregations