use of com.google.gwt.event.dom.client.ClickHandler in project zxing by zxing.
the class CalendarEventGenerator method getWidget.
@Override
public Grid getWidget() {
if (table != null) {
return table;
}
datePicker1.setValue(new Date());
datePicker2.setValue(new Date());
table = new Grid(10, 2);
table.setText(0, 0, "All day event");
table.setWidget(0, 1, fullDay);
table.setText(1, 0, "Event title");
table.setWidget(1, 1, eventName);
table.setText(2, 0, "Start date");
table.setWidget(2, 1, datePicker1);
table.setText(3, 0, "Time");
table.setWidget(3, 1, timePicker1);
table.setText(4, 0, "End date");
table.setWidget(4, 1, datePicker2);
table.setText(5, 0, "Time");
table.setWidget(5, 1, timePicker2);
table.setText(6, 0, "Time zone");
table.setWidget(6, 1, timeZones);
table.setText(7, 0, "Daylight savings");
table.setWidget(7, 1, summerTime);
table.setText(8, 0, "Location");
table.setWidget(8, 1, location);
table.setText(9, 0, "Description");
table.setWidget(9, 1, description);
table.getRowFormatter().getElement(3).setId(FULL_DAY_ONLY_IDS[0]);
table.getRowFormatter().getElement(5).setId(FULL_DAY_ONLY_IDS[1]);
table.getRowFormatter().getElement(6).setId(FULL_DAY_ONLY_IDS[2]);
table.getRowFormatter().getElement(7).setId(FULL_DAY_ONLY_IDS[3]);
fullDay.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
CheckBox cb = (CheckBox) event.getSource();
for (String s : FULL_DAY_ONLY_IDS) {
Element element = DOM.getElementById(s);
String style = cb.getValue() ? "none" : "";
element.getStyle().setProperty("display", style);
}
}
});
return table;
}
use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.
the class PermissionRuleEditor method setValue.
@Override
public void setValue(PermissionRule value) {
if (clickHandler != null) {
clickHandler.removeHandler();
clickHandler = null;
}
GroupReference ref = value.getGroup();
GroupInfo info = groupInfo != null && ref.getUUID() != null ? groupInfo.get(ref.getUUID()) : null;
boolean link;
if (ref.getUUID() != null && AccountGroup.isInternalGroup(ref.getUUID())) {
final String token = Dispatcher.toGroup(ref.getUUID());
groupNameLink.setText(ref.getName());
groupNameLink.setHref("#" + token);
groupNameLink.setTitle(info != null ? info.getDescription() : null);
groupNameLink.setTarget(null);
clickHandler = groupNameLink.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.preventDefault();
event.stopPropagation();
Gerrit.display(token);
}
});
link = true;
} else if (info != null && info.getUrl() != null) {
groupNameLink.setText(ref.getName());
groupNameLink.setHref(info.getUrl());
groupNameLink.setTitle(info.getDescription());
groupNameLink.setTarget("_blank");
link = true;
} else {
groupNameSpan.setInnerText(ref.getName());
groupNameSpan.setTitle(ref.getUUID() != null ? ref.getUUID().get() : "");
link = false;
}
deletedGroupName.setInnerText(ref.getName());
groupNameLink.setVisible(link);
UIObject.setVisible(groupNameSpan, !link);
}
use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.
the class ProjectTagsScreen method onInitUI.
@Override
protected void onInitUI() {
super.onInitUI();
initPageHeader();
prev = PagingHyperlink.createPrev();
prev.setVisible(false);
next = PagingHyperlink.createNext();
next.setVisible(false);
addPanel = new FlowPanel();
Grid addGrid = new Grid(2, 2);
addGrid.setStyleName(Gerrit.RESOURCES.css().addBranch());
int texBoxLength = 50;
nameTxtBox = new HintTextBox();
nameTxtBox.setVisibleLength(texBoxLength);
nameTxtBox.setHintText(AdminConstants.I.defaultTagName());
nameTxtBox.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNewTag();
}
}
});
addGrid.setText(0, 0, AdminConstants.I.columnTagName() + ":");
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) {
doAddNewTag();
}
}
});
addGrid.setText(1, 0, AdminConstants.I.initialRevision() + ":");
addGrid.setWidget(1, 1, irevTxtBox);
addTag = new Button(AdminConstants.I.buttonAddTag());
addTag.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
doAddNewTag();
}
});
addPanel.add(addGrid);
addPanel.add(addTag);
tagTable = new TagsTable();
delTag = new Button(AdminConstants.I.buttonDeleteTag());
delTag.setStyleName(Gerrit.RESOURCES.css().branchTableDeleteButton());
delTag.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
tagTable.deleteChecked();
}
});
HorizontalPanel buttons = new HorizontalPanel();
buttons.setStyleName(Gerrit.RESOURCES.css().branchTablePrevNextLinks());
buttons.add(delTag);
buttons.add(prev);
buttons.add(next);
add(tagTable);
add(buttons);
add(addPanel);
}
use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.
the class PatchSetSelectBox method setUpBlame.
void setUpBlame(final CodeMirror cm, final boolean isBase, final PatchSet.Id rev, final String path) {
if (!Patch.isMagic(path) && Gerrit.isSignedIn() && Gerrit.info().change().allowBlame()) {
Anchor blameIcon = createBlameIcon();
blameIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
if (cm.extras().getBlameInfo() != null) {
cm.extras().toggleAnnotation();
} else {
ChangeApi.blame(rev, path, isBase).get(new GerritCallback<JsArray<BlameInfo>>() {
@Override
public void onSuccess(JsArray<BlameInfo> lines) {
cm.extras().toggleAnnotation(lines);
}
});
}
}
});
linkPanel.add(blameIcon);
}
}
use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.
the class MyWatchedProjectsScreen method createWidgets.
protected void createWidgets() {
nameBox = new RemoteSuggestBox(new ProjectNameSuggestOracle());
nameBox.setVisibleLength(50);
nameBox.setHintText(Util.C.defaultProjectName());
nameBox.addSelectionHandler(new SelectionHandler<String>() {
@Override
public void onSelection(SelectionEvent<String> event) {
doAddNew();
}
});
filterTxt = new HintTextBox();
filterTxt.setVisibleLength(50);
filterTxt.setHintText(Util.C.defaultFilter());
filterTxt.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ENTER) {
doAddNew();
}
}
});
addNew = new Button(Util.C.buttonWatchProject());
addNew.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
doAddNew();
}
});
browse = new Button(Util.C.buttonBrowseProjects());
browse.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
// under page header
int top = grid.getAbsoluteTop() - 50;
// Try to place it to the right of everything else, but not
// right justified
int left = 5 + Math.max(grid.getAbsoluteLeft() + grid.getOffsetWidth(), watchesTab.getAbsoluteLeft() + watchesTab.getOffsetWidth());
projectsPopup.setPreferredCoordinates(top, left);
projectsPopup.displayPopup();
}
});
watchesTab = new MyWatchesTable();
delSel = new Button(Util.C.buttonDeleteSshKey());
delSel.addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
watchesTab.deleteChecked();
}
});
}
Aggregations