public void onClick(ClickEvent e) {

    GPoint point = table.getIndexFromPixel(e.getClientX(), e.getClientY());
    if (editor.isEditing()) {
      String text = editor.getEditingValue();
      if (text.startsWith("=")) {
        point = table.getIndexFromPixel(e.getClientX(), e.getClientY());
        if (point != null) {
          int column = point.getX();
          int row = point.getY();
          GeoElement geo = RelativeCopy.getValue(app, column - 1, row - 1);
        }
      }
      selectedCellName = null;
      prefix0 = null;
      table.isDragging2 = false;
      table.repaint();
    } /*? else if (app.getMode() != EuclidianConstants.MODE_SELECTION_LISTENER) {
      	int row = point.y;//?//table.rowAtPoint(e.getPoint());
      	int col = point.x;//?//table.columnAtPoint(e.getPoint());
      	GeoElement geo = (GeoElement) model.getValueAt(row, col);
      	// let euclidianView know about the click
      	AbstractEvent event = geogebra.web.euclidian.event.MouseEvent
      			.wrapEvent(e);
      	app.getActiveEuclidianView().clickedGeo(geo, event);
      	event.release();
      }*/
  }
  @Override
  public void onClick(ClickEvent event) {
    if (event.getSource() == editButton) {
      webApp.setMain(new GroupEditForm(webApp, group));
    } else if (event.getSource() == removeButton) {
      boolean removeContacts =
          Window.confirm(
              "Do you want to remove the contacts in the group " + group.getName() + "?");
      String message =
          removeContacts ? Message.CONFIRM_REMOVE_GROUP_AND_CONTACTS : Message.CONFIRM_REMOVE_GROUP;

      if (Window.confirm(message)) {
        webApp
            .getBusinessService()
            .removeGroup(
                group,
                removeContacts,
                new AsyncCallback<Boolean>() {
                  public void onSuccess(Boolean result) {
                    webApp.showInfo(Message.GROUP, Message.REMOVE_GROUP_SUCCESS);
                    webApp.setMain(new HTML(""));
                  }

                  public void onFailure(Throwable caught) {
                    webApp.showError(Message.ERROR, Message.REMOVE_GROUP_FAILURE);
                  }
                });
      }
    }
  }
 @Override
 public void onClick(ClickEvent event) {
   if (event.getSource().equals(saveBtn)) {
     onSave();
   } else if (event.getSource().equals(cancelBtn)) {
     onCancel();
   }
 }
Exemple #4
0
    /**
     * @see
     *     com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
     */
    public void onClick(ClickEvent event) {

      if (event.getSource() == m_box) {
        onDateBoxClick();
      } else if (event.getSource() == m_time) {
        onTimeClick();
      } else if ((event.getSource() == m_am) || (event.getSource() == m_pm)) {
        onAmPmClick();
      }
    }
Exemple #5
0
  @Override
  public void onClick(final ClickEvent event) {
    final SettingsMenu menu = new SettingsMenu(images);
    final int left = event.getRelativeElement().getAbsoluteLeft();
    final int top =
        event.getRelativeElement().getAbsoluteTop() + event.getRelativeElement().getOffsetHeight();
    menu.setPopupPosition(left, top);

    menu.show();
  }
 /** Popup menu listener */
 public void onClick(ClickEvent event) {
   int x = event.getX();
   int y = event.getY();
   if (screen[x][y] != 0) {
     currentPerson = getPersonById(screen[x][y]);
     popup.showRelativeTo(currentPerson);
     popup.show();
   } else {
     popup.hide();
   }
 }
  @Override
  public void onClick(final ClickEvent event) {
    if (event.getSource() == nextButton) {
      currentPage++;
      loadResponses();
    } else if (event.getSource() == previousButton) {
      currentPage--;
      loadResponses();
    } else if (event.getSource() == clearButton) {
      populateData(currentAnswers);
    } else if (event.getSource() == saveButton) {
      if (changedAnswers != null && changedAnswers.size() > 0) {
        statusLabel.setText(TEXT_CONSTANTS.pleaseWait());
        statusLabel.setVisible(true);
        surveyInstanceSvc.updateQuestions(
            new ArrayList<QuestionAnswerStoreDto>(changedAnswers.values()),
            true,
            new AsyncCallback<List<QuestionAnswerStoreDto>>() {

              @Override
              public void onFailure(Throwable caught) {
                MessageDialog errDia =
                    new MessageDialog(
                        TEXT_CONSTANTS.error(),
                        TEXT_CONSTANTS.errorTracePrefix() + " " + caught.getLocalizedMessage());
                errDia.showCentered();
                statusLabel.setVisible(false);
              }

              @Override
              public void onSuccess(List<QuestionAnswerStoreDto> result) {
                statusLabel.setVisible(false);
                if (result != null) {
                  // update the value in the
                  // questionsList so we can
                  // keep the data consistent
                  // if the user presses clear
                  for (QuestionAnswerStoreDto dto : result) {
                    for (int i = 0; i < currentAnswers.size(); i++) {
                      if (currentAnswers.get(i).getKeyId().equals(dto.getKeyId())) {
                        currentAnswers.get(i).setValue(dto.getValue());
                      }
                    }
                  }
                }
                populateData(currentAnswers);
              }
            });
      }
    } else if (event.getSource() == doneButton) {
      dismissDialog();
    }
  }
 @Override
 public void onClick(ClickEvent event) {
   if (event.getSource() == btnNext) {
     if (slidePanel.getSlidePosition() == 0) {
       slidePanel.next();
     } else {
       addScenario();
     }
   } else if (event.getSource() == btnPrevious) {
     slidePanel.previous();
   }
   updateButtons();
 }
Exemple #9
0
  @Override
  public void onClick(ClickEvent event) {
    double x = -1;
    double y = -1;

    if (this.canvas != null) {
      x = event.getRelativeX(this.canvas.getElement());
      y = event.getRelativeY(this.canvas.getElement());
      y /= this.canvas.getOffsetHeight();
      x /= this.canvas.getOffsetWidth();
    }
    bus.fireEvent(new ExecuteCommandEvent(x, y));
  }
  public void onClick(ClickEvent event) {
    Widget source = (Widget) event.getSource();
    if (source == btnSubmit) {
      if (currentUser != null) {
        txtLogin.setValue(currentUser.getUsername());
        txtProject.setValue(lbProjects.getItemText(lbProjects.getSelectedIndex()));
        form.submit();
      }
    }
    if (source == hlBack) {
      if (currentUser.getUsertype().equalsIgnoreCase("user")) {
        History.newItem("userJobList");
      } else {
        if (tab == 0) {

          History.newItem("adminJobList");
        } else {
          History.newItem("jobList");
        }
        // AdminPage adminPage = new AdminPage(tab);
        // RootPanel.get("content").add(adminPage);
      }
      /*UserHistory userHistory = new UserHistory();
      userHistory.history();*/
    }
  }
 public void onClick(ClickEvent event) {
   // autoCompleteTextField should not loose focus
   this.textField.setFocus(true, false);
   Cell clickCell = ((HTMLTable) event.getSource()).getCellForEvent(event);
   textField.insertString(clickCell.getElement().getInnerText());
   hide();
 }
 public void onClick(ClickEvent e) {
   Element target = e.getNativeEvent().getEventTarget().cast();
   boolean isEditing = assignmentsTable.isVisible();
   if (target == btApply.getElement()) {
     if (isEditing) {
       hide();
       app.getActiveEuclidianView().requestFocusInWindow();
       app.storeUndoInfo();
       app.getKernel().notifyRepaint();
     } else {
       assignmentsTable.setVisible(true);
       checkAssignmentsTable.setVisible(false);
       btTest.setText(app.getPlain("Test"));
       btApply.setText(app.getPlain("OK"));
       hide();
       setGlassEnabled(true);
       center();
     }
   } else if (target == btTest.getElement()) {
     if (isEditing) {
       assignmentsTable.setVisible(false);
       checkAssignmentsTable.setVisible(true);
       check();
       btTest.setText(app.getPlain("Check"));
       btApply.setText(app.getPlain("Back"));
       hide();
       setGlassEnabled(false);
       center();
     } else {
       check();
     }
   }
 }
 @Override
 public void onClick(ClickEvent event) {
   Object source = event.getSource();
   if (source.equals(backToSearchHtml)) {
     AppClientFactory.getPlaceManager().revealPlace(false, searchRequest);
   }
 }
  private ContentPanel buildConfigBloc(ConfigGroup configGroup, ImageResource icon) {
    final ContentPanel cPanel = new ContentPanel(new ColumnLayout());
    cPanel.setHeading(
        "<div class='config-title'>" + I18nUtils.getString(configGroup.key) + "</div>");
    cPanel.getHeader().addStyleName("config-header");
    cPanel.setCollapsible(true);
    cPanel.setAnimCollapse(false);
    cPanel.collapse();
    cPanel.setIcon(AbstractImagePrototype.create(icon));
    cPanel.addListener(
        Events.Expand,
        new Listener<ComponentEvent>() {

          @Override
          public void handleEvent(ComponentEvent be) {
            cPanel.layout(true);
          }
        });

    cPanel.getHeader().addDomHandler(this, ClickEvent.getType());
    mapConfigGroupPanel.put(configGroup, cPanel);
    mapHeaderGroup.put(cPanel.getHeader(), cPanel);

    return cPanel;
  }
Exemple #15
0
  public TabBar(Callback callback) {
    this.callback = callback;

    Element div = DOM.createDiv();

    setElement(div);

    setStylePrimaryName("RibbonTab");

    clear = DOM.createDiv();
    clear.getStyle().setProperty("clear", "both");
    div.appendChild(clear);

    addDomHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            Element tgt = event.getNativeEvent().getEventTarget().cast();
            if (tgt.getParentElement() != getElement()) return;

            int index = DOM.getChildIndex(getElement(), tgt);
            if (index >= getTabCount()) return;

            selectTab(index);
          }
        },
        ClickEvent.getType());
  }
Exemple #16
0
 public ClickableLabel(String text, ClickHandler clickHandler) {
   super(text, true);
   addDomHandler(clickHandler, ClickEvent.getType());
   addMouseOverHandler(this);
   addMouseOutHandler(this);
   setEnabled(true);
 }
  @Override
  protected void extend(ServerConnector target) {
    panel = (VPanel) ((ComponentConnector) target).getWidget();
    panel.addStyleName(CLASSNAME);

    captionToggle.addClassName(CLASSNAME + "-toggle");

    DOM.insertChild(panel.captionNode, captionToggle, 2);

    updateStyleName(panel);

    panel.addDomHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            EventTarget eventTarget = event.getNativeEvent().getEventTarget();

            if (eventTarget.cast() == panel.captionNode
                || eventTarget.cast() == panel.captionNode.getFirstChildElement()
                || eventTarget.cast() == captionToggle.getFirstChildElement()) {
              getState().setOpen(!getState().isOpen());
              refresh();
              rpc.setOpen(getState().isOpen());

              // fire toggle listener
              rpc.toggleClick();
            }
          }
        },
        ClickEvent.getType());
  }
  public PlaceBookEntryPreview(final Entry entry) {
    initWidget(uiBinder.createAndBindUi(this));

    container
        .getElement()
        .getStyle()
        .setBackgroundImage(
            "url(" + Resources.IMAGES.placebook_open().getSafeUri().asString() + ")");

    title.setText(entry.getTitle());
    description.setText(entry.getDescription());
    author.setText(entry.getOwnerName());

    if (entry.getPreviewImage() != null) {
      image.setUrl(
          PlaceBooks.getServer().getHostURL()
              + "media?hash="
              + entry.getPreviewImage()
              + "&type=imageitem");
    } else {
      image.setVisible(false);
    }

    container.addDomHandler(
        new ClickHandler() {
          @Override
          public void onClick(final ClickEvent event) {
            PlaceBooks.goTo(new PlaceBookPage(entry.getKey()));
          }
        },
        ClickEvent.getType());
  }
  private static void init() {
    showProfileSearches();

    searchInfos = RootPanel.get("profileSearches_searchInfos");
    clearSearches = RootPanel.get("profileSearches_clearSearches");
    clearSearches.addDomHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "wait");

            if (clearSearches.getElement().getClassName().contains("disabled")) {
              return;
            }
            userService.clearSavedSearches(
                GWTClient.getCurrentUser().getId(),
                new AsyncCallback<Void>() {
                  @Override
                  public void onFailure(Throwable caught) {
                    DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "default");
                    Window.alert("There was an error while clearing your cart.");
                  }

                  @Override
                  public void onSuccess(Void result) {
                    DOM.setStyleAttribute(RootPanel.getBodyElement(), "cursor", "default");
                    refreshSearches();
                  }
                });
          }
        },
        ClickEvent.getType());
    setSearchInfos();
  }
 /**
  * Called when the dismiss anchor is clicked.
  *
  * @param event the event
  */
 @UiHandler("dismissAnchor")
 void onDismissAnchorClicked(ClickEvent event) {
   event.preventDefault();
   if (getUiHandlers() != null) {
     getUiHandlers().onDismiss();
   }
 }
  public void setAlgebraView(final AlgebraViewW av) {
    if (av != aview) {
      if (aview != null && simplep != null) {
        simplep.remove(aview);
        algebrap.remove(simplep);
      }

      simplep = new SimplePanel(aview = av);
      algebrap.add(simplep);
      simplep.addStyleName("algebraSimpleP");
      algebrap.addStyleName("algebraPanel");
      algebrap.addDomHandler(
          new ClickHandler() {

            public void onClick(ClickEvent event) {
              int bt = simplep.getAbsoluteTop() + simplep.getOffsetHeight();
              if (event.getClientY() > bt) {
                app.getSelectionManager().clearSelectedGeos();
                av.resetItems(true);
              }
              ;
            }
          },
          ClickEvent.getType());
    }
  }
  @Override
  public void onClick(ClickEvent event) {
    Object source = event.getSource();
    App.debug("source is: " + source);

    if (source == btnOK) {
      App.debug("btnOk");
      returnOption = GOptionPane.OK_OPTION;
      close();
    }

    if (source == btnCancel) {
      App.debug("btnCancel");
      returnOption = GOptionPane.CANCEL_OPTION;
      close();
    }

    if (optionButtons == null) {
      return;
    }

    for (int i = 0; i < optionButtons.length; i++) {
      if (source == optionButtons[i]) {
        returnOption = i;
        close();
      }
    }
  }
  /** Handles button clicks for dialog. */
  @Override
  public void onClick(ClickEvent e) {
    Object source = e.getSource();

    try {
      if (source == btOK || source == inputPanel.getTextComponent()) {
        if (!processInput()) {
          wrappedPopup.show();
          inputPanel.getTextComponent().hideTablePopup();
        } else {
          wrappedPopup.hide();
          inputPanel.getTextComponent().hideTablePopup();
          app.getActiveEuclidianView().requestFocusInWindow();
        }
        // setVisibleForTools(!processInput());
        // } else if (source == btApply) {
        //	processInput();
      } else if (source == btCancel) {
        // setVisibleForTools(false);
        wrappedPopup.hide();
        inputPanel.getTextComponent().hideTablePopup();
        app.getActiveEuclidianView().requestFocusInWindow();
      }
    } catch (Exception ex) {
      // do nothing on uninitializedValue
      // setVisibleForTools(false);
      wrappedPopup.hide();
      inputPanel.getTextComponent().hideTablePopup();
      app.getActiveEuclidianView().requestFocusInWindow();
    }
  }
Exemple #24
0
  /**
   * @see
   *     com.google.gwt.event.dom.client.HasClickHandlers#addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
   */
  public HandlerRegistration addClickHandler(ClickHandler handler) {

    HandlerRegistration registration = addDomHandler(handler, ClickEvent.getType());
    m_clickHandlerRegistrations.add(registration);
    m_clickHandlers.add(handler);
    return registration;
  }
Exemple #25
0
 @Override
 public void onClick(ClickEvent event) {
   if (event.getSource() == btnExportXML) {
     String url = GWT.getModuleBaseURL() + EXPORT_XML_URL;
     Window.open(url, "_blank", "");
   }
   hide();
 }
  @Override
  public void onClick(ClickEvent event) {
    Widget sender = (Widget) event.getSource();

    if (sender == submitButton) {
      submitDeleteConfig();
    }
  }
Exemple #27
0
    public void onClick(ClickEvent event) {
      // If clicking on the input panel already, stop propagation.
      if (event.getSource() == input_) {
        event.stopPropagation();
        return;
      }

      // Don't drive focus to the input unless there is no selection.
      // Otherwise it would interfere with the ability to select stuff
      // from the output buffer for copying to the clipboard.
      // (BUG: DomUtils.selectionExists() doesn't work in a timely
      // fashion on IE8.)
      if (!DomUtils.selectionExists() && isInputOnscreen()) {
        input_.setFocus(true);
        DomUtils.collapseSelection(false);
      }
    }
 @Override
 public void onClick(ClickEvent event) {
   if (event.getSource() == delPortalImage) {
     if (Window.confirm(messages.portal_confirm_delete_image())) {
       deleteImage();
     }
   } else if (event.getSource() == delFacebook) {
     if (Window.confirm(messages.portal_confirm_delete_facebook())) {
       delField("facebook");
     }
   } else if (event.getSource() == delHomepage) {
     if (Window.confirm(messages.portal_confirm_delete_hompeage())) {
       delField("homepage");
     }
   } else if (event.getSource() == delLinkedin) {
     if (Window.confirm(messages.portal_confirm_delete_linkedin())) {
       delField("linkedin");
     }
   } else if (event.getSource() == delTwitter) {
     if (Window.confirm(messages.portal_confirm_delete_twitter())) {
       delField("twitter");
     }
   } else if (event.getSource() == blockAccessButton) {
     setBlocked(true);
   } else if (event.getSource() == grantAccessButton) {
     setBlocked(false);
   }
 }
 @Override
 public void onClick(ClickEvent event) {
   Widget sender = (Widget) event.getSource();
   if (sender == cancelButton) {
     hide();
   } else if (sender == saveButton && validateFields()) {
     doSave();
   }
 }
Exemple #30
0
 @Override
 public void onClick(ClickEvent event) {
   if (!popup.isShowing()) {
     if (relativeTo == null) popup.showRelativeTo((Widget) event.getSource());
     else popup.showRelativeTo(relativeTo);
   } else {
     popup.hide();
   }
 }