當前位置: 首頁>>代碼示例>>Java>>正文


Java MouseDownEvent.getSource方法代碼示例

本文整理匯總了Java中com.google.gwt.event.dom.client.MouseDownEvent.getSource方法的典型用法代碼示例。如果您正苦於以下問題:Java MouseDownEvent.getSource方法的具體用法?Java MouseDownEvent.getSource怎麽用?Java MouseDownEvent.getSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.event.dom.client.MouseDownEvent的用法示例。


在下文中一共展示了MouseDownEvent.getSource方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public void onMouseDown(MouseDownEvent event) {
	this.onMouseUp(null);

	Icon dragIcon = (Icon) event.getSource();
	this.selectedRow = (TableRow<T>) dragIcon.getParent().getParent();
	this.body = (TableEditorBody<T>) this.selectedRow.getParent();

	this.overRegistration = new HandlerRegistrationCollection();
	this.upRegistration = RootPanel.get().addDomHandler(this, MouseUpEvent.getType());
	this.rows = Lists.newArrayList(this.body.getRows());
	for (TableRow<T> row : this.rows) {
		this.overRegistration.add(row.addDomHandler(this, MouseOverEvent.getType()));
	}
	TableOrder.this.disableTextSelection(true);
	RootPanel.get().getElement().getStyle().setCursor(Style.Cursor.MOVE);
	StyleUtils.addStyle(this.selectedRow, TableOrder.STYLE_ROW_DRAGING);
}
 
開發者ID:Putnami,項目名稱:putnami-web-toolkit,代碼行數:19,代碼來源:TableOrder.java

示例2: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public void onMouseDown(MouseDownEvent event) {
	// Ensure that items are deselected when selecting
	// from a different source. See #3699 for details.
	if (event.getSource() == optionsListBox) {
		for (int i = 0; i < selectionsListBox.getItemCount(); i++) {
			selectionsListBox.setItemSelected(i, false);
		}
	} else if (event.getSource() == selectionsListBox) {
		for (int i = 0; i < optionsListBox.getItemCount(); i++) {
			optionsListBox.setItemSelected(i, false);
		}
	}

}
 
開發者ID:tepi,項目名稱:ListBuilder,代碼行數:16,代碼來源:VListBuilder.java

示例3: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
@Override
public void onMouseDown(MouseDownEvent event) {
    clickTargetWidget = (Widget) event.getSource();

    event.stopPropagation();
}
 
開發者ID:blackbluegl,項目名稱:calendar-component,代碼行數:7,代碼來源:DateCellContainer.java

示例4: setHeaderRow

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
/**
 * Adds the header row to the table.
 *
 */
private void setHeaderRow() {
  table.getRowFormatter().setStyleName(0, "ode-ProjectHeaderRow");

  HorizontalPanel nameHeader = new HorizontalPanel();
  final Label nameHeaderLabel = new Label(MESSAGES.projectNameHeader());
  nameHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  nameHeader.add(nameHeaderLabel);
  nameSortIndicator.addStyleName("ode-ProjectHeaderLabel");
  nameHeader.add(nameSortIndicator);
  table.setWidget(0, 1, nameHeader);

  HorizontalPanel dateCreatedHeader = new HorizontalPanel();
  final Label dateCreatedHeaderLabel = new Label(MESSAGES.projectDateCreatedHeader());
  dateCreatedHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  dateCreatedHeader.add(dateCreatedHeaderLabel);
  dateCreatedSortIndicator.addStyleName("ode-ProjectHeaderLabel");
  dateCreatedHeader.add(dateCreatedSortIndicator);
  table.setWidget(0, 2, dateCreatedHeader);

  HorizontalPanel dateModifiedHeader = new HorizontalPanel();
  final Label dateModifiedHeaderLabel = new Label(MESSAGES.projectDateModifiedHeader());
  dateModifiedHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  dateModifiedHeader.add(dateModifiedHeaderLabel);
  dateModifiedSortIndicator.addStyleName("ode-ProjectHeaderLabel");
  dateModifiedHeader.add(dateModifiedSortIndicator);
  table.setWidget(0, 3, dateModifiedHeader);

  HorizontalPanel publishedHeader = new HorizontalPanel();
  final Label publishedHeaderLabel = new Label(MESSAGES.projectPublishedHeader());
  publishedHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  publishedHeader.add(publishedHeaderLabel);
  publishedSortIndicator.addStyleName("ode-ProjectHeaderLabel");
  publishedHeader.add(publishedSortIndicator);
  table.setWidget(0, 4, publishedHeader);

  MouseDownHandler mouseDownHandler = new MouseDownHandler() {
    @Override
    public void onMouseDown(MouseDownEvent e) {
      SortField clickedSortField;
      if (e.getSource() == nameHeaderLabel || e.getSource() == nameSortIndicator) {
        clickedSortField = SortField.NAME;
      } else if (e.getSource() == dateCreatedHeaderLabel || e.getSource() == dateCreatedSortIndicator) {
        clickedSortField = SortField.DATE_CREATED;
      } else if (e.getSource() == dateModifiedHeaderLabel || e.getSource() == dateModifiedSortIndicator){
        clickedSortField = SortField.DATE_MODIFIED;
      }else{
        clickedSortField = SortField.PUBLISHED;
      }
      changeSortOrder(clickedSortField);
    }
  };
  nameHeaderLabel.addMouseDownHandler(mouseDownHandler);
  nameSortIndicator.addMouseDownHandler(mouseDownHandler);
  dateCreatedHeaderLabel.addMouseDownHandler(mouseDownHandler);
  dateCreatedSortIndicator.addMouseDownHandler(mouseDownHandler);
  dateModifiedHeaderLabel.addMouseDownHandler(mouseDownHandler);
  dateModifiedSortIndicator.addMouseDownHandler(mouseDownHandler);
  publishedHeaderLabel.addMouseDownHandler(mouseDownHandler);
  publishedSortIndicator.addMouseDownHandler(mouseDownHandler);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:65,代碼來源:ProjectList.java

示例5: setHeaderRow

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
/**
 * Adds the header row to the table.
 *
 */
private void setHeaderRow() {

  if (galleryEnabledHolder.enabled) {
    table.resizeColumns(5); // Number of columns varies based on whether or not
                            // the Gallery is enabled
  } else {
    table.resizeColumns(4);
  }

  table.getRowFormatter().setStyleName(0, "ode-ProjectHeaderRow");

  HorizontalPanel emailHeader = new HorizontalPanel();
  final Label emailHeaderLabel = new Label("User Email");
  int column = 0;
  emailHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  emailHeader.add(emailHeaderLabel);
  emailHeader.add(nameSortIndicator);
  table.setWidget(0, column, emailHeader);
  column += 1;

  HorizontalPanel uidHeader = new HorizontalPanel();
  final Label uidHeaderLabel = new Label("UID");
  uidHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  uidHeader.add(uidHeaderLabel);
  table.setWidget(0, column++, uidHeader);

  HorizontalPanel adminHeader = new HorizontalPanel();
  final Label adminHeaderLabel = new Label("isAdmin?");
  adminHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
  adminHeader.add(adminHeaderLabel);
  table.setWidget(0, column++, adminHeader);

  if (galleryEnabledHolder.enabled) {
    HorizontalPanel moderatorHeader = new HorizontalPanel();
    final Label moderatorHeaderLabel = new Label("isModerator?");
    moderatorHeaderLabel.addStyleName("ode-ProjectHeaderLabel");
    moderatorHeader.add(moderatorHeaderLabel);
    table.setWidget(0, column++, moderatorHeader);
  }

  HorizontalPanel visitedHeader = new HorizontalPanel();
  final Label visitedLabel = new Label("Visited");
  visitedLabel.addStyleName("ode-ProjectHeaderLabel");
  visitedHeader.add(visitedLabel);
  visitedHeader.add(visitedSortIndicator);
  table.setWidget(0, column++, visitedHeader);

  MouseDownHandler mouseDownHandler = new MouseDownHandler() {
    @Override
    public void onMouseDown(MouseDownEvent e) {
      SortField clickedSortField;
      if (e.getSource() == emailHeaderLabel || e.getSource() == nameSortIndicator) {
        clickedSortField = SortField.NAME;
      } else if (e.getSource() == visitedLabel || e.getSource() == visitedSortIndicator) {
        clickedSortField = SortField.VISITED;
      } else {
        return;
      }
      changeSortOrder(clickedSortField);
    }
  };
  emailHeaderLabel.addMouseDownHandler(mouseDownHandler);
  nameSortIndicator.addMouseDownHandler(mouseDownHandler);
  visitedLabel.addMouseDownHandler(mouseDownHandler);
  visitedSortIndicator.addMouseDownHandler(mouseDownHandler);
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:71,代碼來源:AdminUserList.java

示例6: onMouseDown

import com.google.gwt.event.dom.client.MouseDownEvent; //導入方法依賴的package包/類
public void onMouseDown(MouseDownEvent event) {
	if (event.getSource()==nameLabel) {
		selectWidget(MapWidget.this,null);
	}
}
 
開發者ID:Antokolos,項目名稱:iambookmaster,代碼行數:6,代碼來源:MapEditor.java


注:本文中的com.google.gwt.event.dom.client.MouseDownEvent.getSource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。