use of com.google.gwt.event.dom.client.ClickHandler in project che by eclipse.
the class ExpandEditorAction method createCustomComponent.
@Override
public Widget createCustomComponent(Presentation presentation) {
if (buttonPanel != null) {
return buttonPanel;
}
final Element tooltip = DOM.createSpan();
tooltip.setInnerHTML(constant.actionExpandEditorTitle());
buttonPanel = new FlowPanel();
buttonPanel.addStyleName(resources.coreCss().editorFullScreen());
button = new FlowPanel();
button.getElement().setInnerHTML(FontAwesome.EXPAND);
button.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
toggleExpand();
}
}, ClickEvent.getType());
buttonPanel.add(button);
buttonPanel.getElement().appendChild(tooltip);
buttonPanel.addDomHandler(new MouseOverHandler() {
@Override
public void onMouseOver(MouseOverEvent event) {
final Element panel = event.getRelativeElement();
tooltip.getStyle().setProperty("top", (panel.getAbsoluteTop() + panel.getOffsetHeight() + 9) + "px");
tooltip.getStyle().setProperty("right", (Document.get().getClientWidth() - panel.getAbsoluteRight() - 2) + "px");
}
}, MouseOverEvent.getType());
return buttonPanel;
}
use of com.google.gwt.event.dom.client.ClickHandler in project che by eclipse.
the class BaseView method addMenuButton.
/**
* Adds part menu button.
*/
private void addMenuButton() {
final ToolButton menuButton = new ToolButton(FontAwesome.COG + " " + FontAwesome.CARET_DOWN);
menuButton.getElement().setAttribute("name", "workBenchIconMenu");
menuButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
int left = getAbsoluteLeft(menuButton.getElement());
int top = getAbsoluteTop(menuButton.getElement());
delegate.onPartMenu(left, top + 21);
}
});
toolbarHeader.addEast(menuButton, 25);
if (menuButton.getElement() instanceof elemental.dom.Element) {
Tooltip.create((elemental.dom.Element) menuButton.getElement(), PositionController.VerticalAlign.BOTTOM, PositionController.HorizontalAlign.MIDDLE, "Panel options");
}
}
use of com.google.gwt.event.dom.client.ClickHandler in project che by eclipse.
the class ChangedListViewImpl method createButtons.
private void createButtons() {
changeViewModeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
delegate.onChangeViewModeButtonClicked();
}
});
expandButton.setTitle(locale.changeListExpandCollapseAllButtonTitle());
expandButton.getElement().setInnerHTML(FontAwesome.EXPAND);
expandButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
delegate.onExpandButtonClicked();
}
});
collapseButton.setTitle(locale.changeListCollapseAllButtonTitle());
collapseButton.getElement().setInnerHTML(FontAwesome.COMPRESS);
collapseButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
delegate.onCollapseButtonClicked();
}
});
Button btnClose = createButton(locale.buttonClose(), "git-compare-btn-close", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
delegate.onCloseClicked();
}
});
addButtonToFooter(btnClose);
btnCompare = createButton(locale.buttonCompare(), "git-compare-btn-compare", new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
delegate.onCompareClicked();
}
});
addButtonToFooter(btnCompare);
}
use of com.google.gwt.event.dom.client.ClickHandler in project perun by CESNET.
the class UsersApplicationsPage method refresh.
/**
* Refresh the page
*/
private void refresh() {
bodyContents.clear();
String user = "";
if (session.getUser() != null) {
user = this.session.getUser().getFullNameWithTitles().trim();
} else {
PerunPrincipal pp = session.getPerunPrincipal();
if (!pp.getAdditionInformations("displayName").equals("")) {
user = pp.getAdditionInformations("displayName");
} else if (!pp.getAdditionInformations("cn").equals("")) {
user = pp.getAdditionInformations("cn");
} else {
if (pp.getExtSourceType().equals("cz.metacentrum.perun.core.impl.ExtSourceX509")) {
user = Utils.convertCertCN(pp.getActor());
} else {
user = pp.getActor();
}
}
}
bodyContents.add(new HTML("<h1>" + ApplicationMessages.INSTANCE.applicationsForUser(user) + "</h1>"));
// callback
int userId = 0;
if (session.getUser() != null) {
userId = session.getUser().getId();
}
final GetApplicationsForUserForAppFormGui req = new GetApplicationsForUserForAppFormGui(userId);
final ListBox listBox = new ListBox();
req.setEvents(new JsonCallbackEvents() {
@Override
public void onFinished(JavaScriptObject jso) {
ArrayList<Application> appls = JsonUtils.jsoAsList(jso);
ArrayList<String> vos = new ArrayList<String>();
for (Application app : appls) {
if (!vos.contains(app.getVo().getName())) {
vos.add(app.getVo().getName());
}
}
Collections.sort(vos);
for (String s : vos) {
listBox.addItem(s);
}
if (listBox.getItemCount() > 0) {
listBox.insertItem(WidgetTranslation.INSTANCE.listboxAll(), 0);
}
for (int i = 0; i < listBox.getItemCount(); i++) {
if (listBox.getItemText(i).equals(ApplicationFormGui.getVo().getName())) {
listBox.setSelectedIndex(i);
req.filterTable(ApplicationFormGui.getVo().getName());
break;
}
}
}
@Override
public void onError(PerunError error) {
}
@Override
public void onLoadingStart() {
listBox.clear();
}
});
req.setCheckable(false);
listBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent changeEvent) {
if (listBox.getSelectedIndex() > 0) {
req.filterTable(listBox.getItemText(listBox.getSelectedIndex()));
} else {
// show all
req.filterTable("");
}
}
});
final TabMenu tabMenu = new TabMenu();
tabMenu.addWidget(new HTML("<strong>" + ApplicationMessages.INSTANCE.filterByVo() + ":</strong>"));
tabMenu.addWidget(listBox);
tabMenu.addWidget(new Image(SmallIcons.INSTANCE.helpIcon()));
tabMenu.addWidget(new HTML("<strong>" + ApplicationMessages.INSTANCE.clickOnApplicationToSee() + "</strong>"));
tabMenu.addStyleName("tabMenu");
final VerticalPanel applicationsWrapper = new VerticalPanel();
applicationsWrapper.setSize("100%", "100%");
applicationsWrapper.add(tabMenu);
final CellTable<Application> appsTable = req.getTable(new FieldUpdater<Application, String>() {
public void update(int index, Application object, String value) {
applicationsWrapper.clear();
applicationsWrapper.add(backButton);
applicationsWrapper.add(getApplicationDetailWidget(object));
}
});
appsTable.addStyleName("perun-table");
applicationsWrapper.add(appsTable);
backButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
applicationsWrapper.clear();
applicationsWrapper.add(tabMenu);
applicationsWrapper.add(appsTable);
}
});
bodyContents.add(applicationsWrapper);
}
use of com.google.gwt.event.dom.client.ClickHandler in project perun by CESNET.
the class ApplicationFormLeftMenu method addLogoutItem.
public void addLogoutItem() {
// if not anonymous identity
if (!PerunWebSession.getInstance().getRpcUrl().startsWith("/non/rpc")) {
int i = menuContents.getRowCount();
menuContents.setWidget(i, 0, new Image(SmallIcons.INSTANCE.doorOutIcon()));
Anchor a = new Anchor(ApplicationMessages.INSTANCE.logout());
a.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Logout call = new Logout(new JsonCallbackEvents() {
@Override
public void onFinished(JavaScriptObject jso) {
Utils.clearFederationCookies();
History.newItem("logout");
RootLayoutPanel.get().clear();
RootLayoutPanel.get().add(new LogoutWidget());
}
});
call.retrieveData();
}
});
menuContents.setWidget(i, 1, a);
}
}
Aggregations