use of com.google.gwt.user.client.ui.HorizontalPanel in project rstudio by rstudio.
the class CppCompletionSignatureTip method addPagingWidget.
private void addPagingWidget() {
HorizontalPanel panel = new HorizontalPanel();
panel.setStyleName(RES.styles().pagingWidget());
Image upImage = new Image(new ImageResource2x(RES.upArrow2x()));
upImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
setTextIndex(currentTextIndex_ - 1);
docDisplay_.setFocus(true);
}
});
panel.add(upImage);
pagingLabel_ = new Label();
panel.add(pagingLabel_);
Image downImage = new Image(new ImageResource2x(RES.downArrow2x()));
downImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
setTextIndex(currentTextIndex_ + 1);
docDisplay_.setFocus(true);
}
});
panel.add(downImage);
panel.add(downImage);
addLeftWidget(panel);
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project zxing by zxing.
the class Generator method onModuleLoad.
@Override
public void onModuleLoad() {
loadGenerators();
setupLeftPanel();
topPanel.getElement().setId("leftpanel");
Widget leftPanel = topPanel;
HorizontalPanel mainPanel = new HorizontalPanel();
mainPanel.add(leftPanel);
SimplePanel div2 = new SimplePanel();
div2.add(result);
div2.getElement().setId("innerresult");
SimplePanel div = new SimplePanel();
div.add(div2);
div.getElement().setId("imageresult");
urlResult.getElement().setId("urlresult");
rawTextResult.getElement().setId("rawtextresult");
rawTextResult.setCharacterWidth(50);
rawTextResult.setVisibleLines(8);
downloadText.getElement().setId("downloadText");
rightPanel.add(div);
rightPanel.add(downloadText);
rightPanel.add(urlResult);
rightPanel.add(rawTextResult);
mainPanel.add(rightPanel);
mainPanel.getElement().setId("mainpanel");
RootPanel.get("ui").add(mainPanel);
setWidget(1);
invalidateBarcode();
}
use of com.google.gwt.user.client.ui.HorizontalPanel 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.HorizontalPanel in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method renderListBox.
private ListBox renderListBox(LabeledWidgetsGrid g, ConfigParameterInfo param) {
if (param.permittedValues() == null) {
return null;
}
ListBox listBox = new ListBox();
if (param.inheritable()) {
listBox.addItem(AdminMessages.I.pluginProjectInheritedListValue(param.inheritedValue()));
if (param.configuredValue() == null) {
listBox.setSelectedIndex(0);
}
for (int i = 0; i < param.permittedValues().length(); i++) {
String pv = param.permittedValues().get(i);
listBox.addItem(pv);
if (pv.equals(param.configuredValue())) {
listBox.setSelectedIndex(i + 1);
}
}
} else {
for (int i = 0; i < param.permittedValues().length(); i++) {
String pv = param.permittedValues().get(i);
listBox.addItem(pv);
if (pv.equals(param.value())) {
listBox.setSelectedIndex(i);
}
}
}
if (param.editable()) {
saveEnabler.listenTo(listBox);
addWidget(g, listBox, param);
} else {
listBox.setEnabled(false);
if (param.inheritable() && listBox.getSelectedIndex() != 0) {
// the inherited value is not selected,
// since the listBox is disabled the inherited value cannot be
// seen and we have to display it explicitly
Label inheritedLabel = new Label(AdminMessages.I.pluginProjectInheritedValue(param.inheritedValue()));
inheritedLabel.setStyleName(Gerrit.RESOURCES.css().pluginProjectConfigInheritedValue());
HorizontalPanel p = new HorizontalPanel();
p.add(listBox);
p.add(inheritedLabel);
addWidget(g, p, param);
} else {
addWidget(g, listBox, param);
}
}
return listBox;
}
use of com.google.gwt.user.client.ui.HorizontalPanel in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method initProjectOptions.
private void initProjectOptions() {
grid.addHeader(new SmallHeading(AdminConstants.I.headingProjectOptions()));
state = new ListBox();
for (ProjectState stateValue : ProjectState.values()) {
state.addItem(Util.toLongString(stateValue), stateValue.name());
}
saveEnabler.listenTo(state);
grid.add(AdminConstants.I.headingProjectState(), state);
submitType = new ListBox();
for (final SubmitType type : SubmitType.values()) {
submitType.addItem(Util.toLongString(type), type.name());
}
submitType.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
setEnabledForUseContentMerge();
}
});
saveEnabler.listenTo(submitType);
grid.add(AdminConstants.I.headingProjectSubmitType(), submitType);
contentMerge = newInheritedBooleanBox();
saveEnabler.listenTo(contentMerge);
grid.add(AdminConstants.I.useContentMerge(), contentMerge);
newChangeForAllNotInTarget = newInheritedBooleanBox();
saveEnabler.listenTo(newChangeForAllNotInTarget);
grid.add(AdminConstants.I.createNewChangeForAllNotInTarget(), newChangeForAllNotInTarget);
requireChangeID = newInheritedBooleanBox();
saveEnabler.listenTo(requireChangeID);
grid.addHtml(AdminConstants.I.requireChangeID(), requireChangeID);
if (Gerrit.info().receive().enableSignedPush()) {
enableSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(enableSignedPush);
grid.add(AdminConstants.I.enableSignedPush(), enableSignedPush);
requireSignedPush = newInheritedBooleanBox();
saveEnabler.listenTo(requireSignedPush);
grid.add(AdminConstants.I.requireSignedPush(), requireSignedPush);
}
rejectImplicitMerges = newInheritedBooleanBox();
saveEnabler.listenTo(rejectImplicitMerges);
grid.addHtml(AdminConstants.I.rejectImplicitMerges(), rejectImplicitMerges);
enableReviewerByEmail = newInheritedBooleanBox();
saveEnabler.listenTo(enableReviewerByEmail);
grid.addHtml(AdminConstants.I.enableReviewerByEmail(), enableReviewerByEmail);
maxObjectSizeLimit = new NpTextBox();
saveEnabler.listenTo(maxObjectSizeLimit);
effectiveMaxObjectSizeLimit = new Label();
effectiveMaxObjectSizeLimit.setStyleName(Gerrit.RESOURCES.css().maxObjectSizeLimitEffectiveLabel());
HorizontalPanel p = new HorizontalPanel();
p.add(maxObjectSizeLimit);
p.add(effectiveMaxObjectSizeLimit);
grid.addHtml(AdminConstants.I.headingMaxObjectSizeLimit(), p);
}
Aggregations