use of com.google.gwt.user.client.ui.FlowPanel in project gerrit by GerritCodeReview.
the class ProjectBranchesScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
initPageHeader();
prev = PagingHyperlink.createPrev();
prev.setVisible(false);
next = PagingHyperlink.createNext();
next.setVisible(false);
addPanel = new FlowPanel();
final Grid addGrid = new Grid(2, 2);
addGrid.setStyleName(Gerrit.RESOURCES.css().addBranch());
final int texBoxLength = 50;
nameTxtBox = new HintTextBox();
nameTxtBox.setVisibleLength(texBoxLength);
nameTxtBox.setHintText(AdminConstants.I.defaultBranchName());
nameTxtBox.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNewBranch();
}
}
});
addGrid.setText(0, 0, AdminConstants.I.columnBranchName() + ":");
addGrid.setWidget(0, 1, nameTxtBox);
irevTxtBox = new HintTextBox();
irevTxtBox.setVisibleLength(texBoxLength);
irevTxtBox.setHintText(AdminConstants.I.defaultRevisionSpec());
irevTxtBox.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNewBranch();
}
}
});
addGrid.setText(1, 0, AdminConstants.I.initialRevision() + ":");
addGrid.setWidget(1, 1, irevTxtBox);
addBranch = new Button(AdminConstants.I.buttonAddBranch());
addBranch.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doAddNewBranch();
}
});
addPanel.add(addGrid);
addPanel.add(addBranch);
branchTable = new BranchesTable();
delBranch = new Button(AdminConstants.I.buttonDeleteBranch());
delBranch.setStyleName(Gerrit.RESOURCES.css().branchTableDeleteButton());
delBranch.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
branchTable.deleteChecked();
}
});
HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName(Gerrit.RESOURCES.css().branchTablePrevNextLinks());
buttons.add(delBranch);
buttons.add(prev);
buttons.add(next);
add(branchTable);
add(buttons);
add(addPanel);
}
use of com.google.gwt.user.client.ui.FlowPanel 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.gwt.user.client.ui.FlowPanel in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method initProjectActions.
private void initProjectActions(ConfigInfo info) {
actionsGrid.clear(true);
actionsGrid.removeAllRows();
boolean showCreateChange = Gerrit.isSignedIn();
NativeMap<ActionInfo> actions = info.actions();
if (actions == null) {
actions = NativeMap.create().cast();
}
if (actions.isEmpty() && !showCreateChange) {
return;
}
actions.copyKeysIntoChildren("id");
actionsGrid.addHeader(new SmallHeading(AdminConstants.I.headingProjectCommands()));
FlowPanel actionsPanel = new FlowPanel();
actionsPanel.setStyleName(Gerrit.RESOURCES.css().projectActions());
actionsPanel.setVisible(true);
actionsGrid.add(AdminConstants.I.headingCommands(), actionsPanel);
for (String id : actions.keySet()) {
actionsPanel.add(new ActionButton(getProjectKey(), actions.get(id)));
}
// HEAD. This would have to happen on the server side.
if (showCreateChange) {
actionsPanel.add(createChangeAction());
}
if (isOwner && configVisible) {
actionsPanel.add(createEditConfigAction());
}
}
use of com.google.gwt.user.client.ui.FlowPanel in project gerrit by GerritCodeReview.
the class ProjectListScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
setPageTitle(AdminConstants.I.projectListTitle());
initPageHeader();
prev = PagingHyperlink.createPrev();
prev.setVisible(false);
next = PagingHyperlink.createNext();
next.setVisible(false);
projects = new ProjectsTable() {
@Override
protected void initColumnHeaders() {
super.initColumnHeaders();
table.setText(0, ProjectsTable.C_REPO_BROWSER, AdminConstants.I.projectRepoBrowser());
table.getFlexCellFormatter().addStyleName(0, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataHeader());
}
@Override
protected void onOpenRow(final int row) {
History.newItem(link(getRowItem(row)));
}
private String link(final ProjectInfo item) {
return Dispatcher.toProject(item.name_key());
}
@Override
protected void insert(int row, ProjectInfo k) {
super.insert(row, k);
table.getFlexCellFormatter().addStyleName(row, ProjectsTable.C_REPO_BROWSER, Gerrit.RESOURCES.css().dataCell());
}
@Override
protected void populate(final int row, final ProjectInfo k) {
Image state = new Image();
switch(k.state()) {
case HIDDEN:
state.setResource(Gerrit.RESOURCES.redNot());
state.setTitle(Util.toLongString(k.state()));
table.setWidget(row, ProjectsTable.C_STATE, state);
break;
case READ_ONLY:
state.setResource(Gerrit.RESOURCES.readOnly());
state.setTitle(Util.toLongString(k.state()));
table.setWidget(row, ProjectsTable.C_STATE, state);
break;
case ACTIVE:
default:
// Intentionally left blank, do not show an icon when active.
break;
}
FlowPanel fp = new FlowPanel();
fp.add(new ProjectSearchLink(k.name_key()));
fp.add(new HighlightingInlineHyperlink(k.name(), link(k), match));
table.setWidget(row, ProjectsTable.C_NAME, fp);
table.setText(row, ProjectsTable.C_DESCRIPTION, k.description());
addWebLinks(row, k);
setRowItem(row, k);
}
private void addWebLinks(int row, ProjectInfo k) {
List<WebLinkInfo> webLinks = Natives.asList(k.webLinks());
if (webLinks != null && !webLinks.isEmpty()) {
FlowPanel p = new FlowPanel();
table.setWidget(row, ProjectsTable.C_REPO_BROWSER, p);
for (WebLinkInfo weblink : webLinks) {
p.add(weblink.toAnchor());
}
}
}
};
projects.setSavePointerId(PageLinks.ADMIN_PROJECTS);
add(projects);
final HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName(Gerrit.RESOURCES.css().changeTablePrevNextLinks());
buttons.add(prev);
buttons.add(next);
add(buttons);
}
use of com.google.gwt.user.client.ui.FlowPanel in project gerrit by GerritCodeReview.
the class AccountGroupMembersScreen method initNoMembersInfo.
private void initNoMembersInfo() {
noMembersInfo = new FlowPanel();
noMembersInfo.setVisible(false);
noMembersInfo.add(new SmallHeading(AdminConstants.I.noMembersInfo()));
add(noMembersInfo);
}
Aggregations