use of com.google.gwt.user.client.ui.HorizontalPanel in project gerrit by GerritCodeReview.
the class MyProfileScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
HorizontalPanel h = new HorizontalPanel();
add(h);
if (Gerrit.info().plugin().hasAvatars()) {
VerticalPanel v = new VerticalPanel();
v.addStyleName(Gerrit.RESOURCES.css().avatarInfoPanel());
h.add(v);
avatar = new AvatarImage();
v.add(avatar);
changeAvatar = new Anchor(Util.C.changeAvatar(), "", "_blank");
changeAvatar.setVisible(false);
v.add(changeAvatar);
}
if (LocaleInfo.getCurrentLocale().isRTL()) {
labelIdx = 1;
fieldIdx = 0;
} else {
labelIdx = 0;
fieldIdx = 1;
}
info = new Grid((Gerrit.info().auth().siteHasUsernames() ? 1 : 0) + 4, 2);
info.setStyleName(Gerrit.RESOURCES.css().infoBlock());
info.addStyleName(Gerrit.RESOURCES.css().accountInfoBlock());
h.add(info);
int row = 0;
if (Gerrit.info().auth().siteHasUsernames()) {
infoRow(row++, Util.C.userName());
}
infoRow(row++, Util.C.fullName());
infoRow(row++, Util.C.preferredEmail());
infoRow(row++, Util.C.registeredOn());
infoRow(row++, Util.C.accountId());
final CellFormatter fmt = info.getCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(row - 1, 0, Gerrit.RESOURCES.css().bottomheader());
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project gerrit by GerritCodeReview.
the class MyWatchedProjectsScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
createWidgets();
/* top table */
grid = new Grid(2, 2);
grid.setStyleName(Gerrit.RESOURCES.css().infoBlock());
grid.setText(0, 0, Util.C.watchedProjectName());
final HorizontalPanel hp = new HorizontalPanel();
hp.add(nameBox);
hp.add(browse);
grid.setWidget(0, 1, hp);
grid.setText(1, 0, Util.C.watchedProjectFilter());
grid.setWidget(1, 1, filterTxt);
final CellFormatter fmt = grid.getCellFormatter();
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 1, Gerrit.RESOURCES.css().topmost());
fmt.addStyleName(0, 0, Gerrit.RESOURCES.css().header());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().header());
fmt.addStyleName(1, 0, Gerrit.RESOURCES.css().bottomheader());
final FlowPanel fp = new FlowPanel();
fp.setStyleName(Gerrit.RESOURCES.css().addWatchPanel());
fp.add(grid);
fp.add(addNew);
add(fp);
/* bottom table */
add(watchesTab);
add(delSel);
/* popup */
projectsPopup = new ProjectListPopup() {
@Override
protected void onMovePointerTo(String projectName) {
// prevent user input from being overwritten by simply poping up
if (!projectsPopup.isPoppingUp() || "".equals(nameBox.getText())) {
nameBox.setText(projectName);
}
}
@Override
protected void openRow(String projectName) {
nameBox.setText(projectName);
doAddNew();
}
};
projectsPopup.initPopup(Util.C.projects(), PageLinks.SETTINGS_PROJECTS);
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.
the class PreferencesDialogPaneBase method checkBoxWithHelp.
protected HorizontalPanel checkBoxWithHelp(CheckBox checkBox, String topic) {
HorizontalPanel panel = new HorizontalPanel();
panel.add(checkBox);
HelpButton helpButton = new HelpButton(topic, false);
Style helpStyle = helpButton.getElement().getStyle();
helpStyle.setMarginTop(1, Unit.PX);
helpStyle.setMarginLeft(6, Unit.PX);
panel.add(helpButton);
return panel;
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.
the class FileBrowserWidget method createTopWidget.
// Private methods ---------------------------------------------------------
private Widget createTopWidget() {
String nameLabel = host_.getFilenameLabel();
if (nameLabel == null)
return null;
HorizontalPanel filenamePanel = new HorizontalPanel();
FileDialogStyles styles = FileDialogResources.INSTANCE.styles();
filenamePanel.setStylePrimaryName(styles.filenamePanel());
filenamePanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
Label filenameLabel = new Label(nameLabel + ":", false);
filenameLabel.setStylePrimaryName(styles.filenameLabel());
filenamePanel.add(filenameLabel);
filename_ = new TextBox();
if (initialFilename_ != null)
filename_.setText(initialFilename_);
filename_.setStylePrimaryName(styles.filename());
filenamePanel.add(filename_);
filenamePanel.setCellWidth(filename_, "100%");
ftm_ = new FocusTransitionManager();
ftm_.add(filename_, directory_);
return filenamePanel;
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.
the class MinimizedModuleTabLayoutPanel method setTabs.
public void setTabs(String[] tabNames) {
HorizontalPanel horiz = (HorizontalPanel) getExtraWidget();
horiz.clear();
ThemeStyles styles = ThemeResources.INSTANCE.themeStyles();
for (int i = 0; i < tabNames.length; i++) {
String tabName = tabNames[i];
if (tabName == null)
continue;
ModuleTabLayoutPanel.ModuleTab tab = new ModuleTabLayoutPanel.ModuleTab(tabName, styles, false);
tab.addStyleName("gwt-TabLayoutPanelTab");
final Integer thisIndex = i;
tab.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
event.preventDefault();
SelectionEvent.fire(MinimizedModuleTabLayoutPanel.this, thisIndex);
}
});
horiz.add(tab);
}
}
Aggregations