Java Code Examples for com.google.gwt.dom.client.Style.setCursor()

The following are Jave code examples for showing how to use setCursor() of the com.google.gwt.dom.client.Style class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: che   File: StatusBarBranchPointer.java   View Source Code Vote up 6 votes
@Override
public void update(ActionEvent e) {
  panel.clear();

  Project project = appContext.getRootProject();
  if (project != null && project.getAttributes().containsKey(GIT_CURRENT_HEAD_NAME)) {
    Label projectNameLabel = new Label(project.getName());
    projectNameLabel.ensureDebugId("statusBarProjectBranchRepositoryName");
    projectNameLabel.getElement().getStyle().setMarginLeft(5., Unit.PX);
    panel.add(projectNameLabel);

    SVGImage branchIcon = new SVGImage(resources.checkoutReference());
    branchIcon.getSvgElement().getStyle().setMarginLeft(5., Unit.PX);
    panel.add(branchIcon);

    Label headLabel = new Label(project.getAttribute(GIT_CURRENT_HEAD_NAME));
    headLabel.ensureDebugId("statusBarProjectBranchName");
    headLabel.setTitle(constant.branchesControlTitle());
    Style headLabelStyle = headLabel.getElement().getStyle();
    headLabelStyle.setCursor(Cursor.POINTER);
    headLabelStyle.setMarginLeft(5., Unit.PX);
    headLabel.addClickHandler(event -> branchPresenter.showBranches(project));
    panel.add(headLabel);
  }
}
 
Example 2
Project: appformer   File: ResizableMovableHeader.java   View Source Code Vote up 6 votes
private SpanElement createSpanElement(final Cursor cursor,
                                      final double left,
                                      final double width) {
    final SpanElement span = document.createSpanElement();
    span.setAttribute("title",
                      title);
    final Style style = span.getStyle();
    style.setCursor(cursor);
    style.setPosition(Position.ABSOLUTE);
    style.setBottom(0,
                    PX);
    style.setHeight(source.getOffsetHeight(),
                    PX);
    style.setTop(source.getOffsetTop(),
                 PX);
    style.setWidth(width,
                   PX);
    style.setLeft(left,
                  PX);
    return span;
}