当前位置: 首页>>代码示例>>Java>>正文


Java ClickEvent类代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.ClickEvent的典型用法代码示例。如果您正苦于以下问题:Java ClickEvent类的具体用法?Java ClickEvent怎么用?Java ClickEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClickEvent类属于com.google.gwt.event.dom.client包,在下文中一共展示了ClickEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UniTimeDialogBox

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
public UniTimeDialogBox(boolean autoHide, boolean modal) {
      super(autoHide, modal);
      
setAnimationEnabled(true);
setGlassEnabled(true);
	
      iContainer = new FlowPanel();
      iContainer.addStyleName("dialogContainer");
      
      iClose = new Anchor();
  	iClose.setTitle(MESSAGES.hintCloseDialog());
      iClose.setStyleName("close");
      iClose.addClickHandler(new ClickHandler() {
      	@Override
          public void onClick(ClickEvent event) {
              onCloseClick(event);
          }
      });
      iClose.setVisible(autoHide);

      iControls = new FlowPanel();
      iControls.setStyleName("dialogControls");        
      iControls.add(iClose);
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:25,代码来源:UniTimeDialogBox.java

示例2: addButton

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
/**
 * Adds a button to the toolbar
 *
 * @param item button to add
 * @param rightAlign {@code true} if the button should be right-aligned,
 *                   {@code false} if left-aligned
 */
protected void addButton(final ToolbarItem item, boolean rightAlign) {
  TextButton button = new TextButton(item.caption);
  button.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      item.command.execute();
    }
  });
  if (rightAlign) {
    rightButtons.add(button);
  } else {
    leftButtons.add(button);
  }
  buttonMap.put(item.widgetName, button);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:23,代码来源:Toolbar.java

示例3: initEdititButton

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
/**
 * Helper method called by constructor to initialize the edit it button
 * Only seen by app owner.
 */
private void initEdititButton() {
  final User currentUser = Ode.getInstance().getUser();
  if(app.getDeveloperId().equals(currentUser.getUserId())){
    editButton = new Button(MESSAGES.galleryEditText());
    editButton.addClickHandler(new ClickHandler() {
      // Open up source file if clicked the action button
      public void onClick(ClickEvent event) {
        editButton.setEnabled(false);
        Ode.getInstance().switchToGalleryAppView(app, GalleryPage.UPDATEAPP);
      }
    });
    editButton.addStyleName("app-action-button");
    appAction.add(editButton);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:20,代码来源:GalleryPage.java

示例4: getView

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
@Override
public Widget getView() {
    if (button == null) {
        button = new CustomPushButton();
        button.setStyleName(getStyleName());
        button.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                if (isEnabled() && !isEnd()) {
                    flowRequestInvoker.invokeRequest(direction.getRequest());
                }
            }
        });
    }

    return button;
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:19,代码来源:NavigationButtonModule.java

示例5: DropDownButton

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
public DropDownButton(String widgetName, String caption, List<DropDownItem> toolbarItems,
                      boolean rightAlign) {
  super(caption + " \u25BE ");  // drop down triangle

  this.menu = new ContextMenu();
  this.items = new ArrayList<MenuItem>();
  this.rightAlign = rightAlign;

  for (DropDownItem item : toolbarItems) {
    if (item != null) {
      this.items.add(menu.addItem(item.caption, true, item.command));
    } else {
      menu.addSeparator();
    }
  }

  addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      menu.setPopupPositionAndShow(new DropDownPositionCallback(getElement()));
    }
  });
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:24,代码来源:DropDownButton.java

示例6: TwoStateButton

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
public TwoStateButton(String upStyleName, String downStyleName) {
    super();

    this.upStyleName = upStyleName;
    this.downStyleName = downStyleName;
    updateStyleName();

    addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            stateDown = !stateDown;
            updateStyleName();
        }
    });
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:TwoStateButton.java

示例7: shouldHideFeedback

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
@Test
public void shouldHideFeedback() {
    //given
    Element element = mock(Element.class);
    testObj.initModule(element);
    verify(feedbackPresenter).addCloseButtonClickHandler(clickHandlerCaptor.capture());
    ClickHandler clickHandler = clickHandlerCaptor.getValue();
    ClickEvent clickEvent = mock(ClickEvent.class);

    //when
    clickHandler.onClick(clickEvent);

    //then
    verify(feedbackPresenter, times(2)).hideFeedback();
    verify(feedbackBlend, times(2)).hide();
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:TextActionProcessorTest.java

示例8: shouldOpenURl

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
@Test
public void shouldOpenURl() {
    // given
    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            clickHandler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(view).addAnchorClickHandler(any(ClickHandler.class));

    instance.setBean(bean);
    instance.init();

    ClickEvent clickEvent = mock(ClickEvent.class);

    // when
    clickHandler.onClick(clickEvent);

    // then
    verify(assetOpenDelegatorService).open(URL);
    verify(clickEvent).preventDefault();
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:24,代码来源:ButtonModulePresenterTest.java

示例9: initCancelButton

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
/**
 * Helper method called by constructor to initialize the cancel button
 */
private void initCancelButton() {
  cancelButton = new Button(MESSAGES.galleryCancelText());
  cancelButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      if (editStatus==NEWAPP) {
        Ode.getInstance().switchToProjectsView();
      }else if(editStatus==UPDATEAPP){
        Ode.getInstance().switchToGalleryAppView(app, GalleryPage.VIEWAPP);
      }
    }
  });
  cancelButton.addStyleName("app-action-button");
  appAction.add(cancelButton);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:19,代码来源:GalleryPage.java

示例10: init

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
@Override
protected void init(){
	grid = new DescribeGrid(labarr, "data");
	verticalPanel.add(grid);
	grid.addStyleName("bda-descgrid-savedata");
	savebtn.setStyleName("bda-descgrid-savedata-submitbtn");
	SimplePanel simPanel = new SimplePanel();
	simPanel.add( savebtn );
	simPanel.setStyleName("bda-descgrid-savedata-simpanel");
	verticalPanel.add(simPanel);
	savebtn.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			dbController.submitSaveDataset2DB(panel,SaveDatasetPanel.this, dataset,grid);
		}
	});
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:18,代码来源:SaveDatasetPanel.java

示例11: SqlScriptFileConfigTable

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
public SqlScriptFileConfigTable(SqlProgramWidget widget, String name){
	this.widget = widget;
	this.name = name;
	this.insertRow(0);
	Label add = new Label();
	add.addStyleName("admin-user-edit");
	this.setWidget(0, 0, new Label(name));
	this.setWidget(0, 1, new Label());
	this.setWidget(0, 2, add);
	this.setWidget(0, 3, new Label());
	add.addClickHandler(new ClickHandler(){

		@Override
		public void onClick(ClickEvent event) {
			int i = 0;
			while( i < SqlScriptFileConfigTable.this.getRowCount() 
					&& SqlScriptFileConfigTable.this.getWidget(i, 2 ) != event.getSource() ) i ++ ;

			if( i < SqlScriptFileConfigTable.this.getRowCount() ){
				addRow( i, "");
			}

		}

	});
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:27,代码来源:SqlScriptFileConfigTable.java

示例12: SolverStatus

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
public SolverStatus() {
	super("unitime-SolverStatus");
	iStatus = new P("status-label");
	iIcon = new Image(RESOURCES.helpIcon()); iIcon.addStyleName("status-icon");
	iIcon.setVisible(false);
	add(iStatus); add(iIcon);
	RPC.execute(new PageNameRpcRequest("Solver Status"), new AsyncCallback<PageNameInterface>() {
		@Override
		public void onFailure(Throwable caught) {}
		@Override
		public void onSuccess(final PageNameInterface result) {
			iIcon.setTitle(MESSAGES.pageHelp(result.getName()));
			iIcon.setVisible(true);
			iIcon.addClickHandler(new ClickHandler() {
				@Override
				public void onClick(ClickEvent event) {
					if (result.getHelpUrl() == null || result.getHelpUrl().isEmpty()) return;
					UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(result.getName()), result.getHelpUrl());
				}
			});
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:SolverPage.java

示例13: addChip

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
@Override
public void addChip(Chip chip, boolean fireEvents) {
	final ChipPanel panel = new ChipPanel(chip, getChipColor(chip));
	panel.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			remove(panel);
			resizeFilterIfNeeded();
			setAriaLabel(toAriaString());
			ValueChangeEvent.fire(CourseRequestFilterBox.this, getValue());
		}
	});
	insert(panel, getWidgetIndex(iFilterFinder));
	resizeFilterIfNeeded();
	setAriaLabel(toAriaString());
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:CourseRequestBox.java

示例14: LockCell

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
public LockCell(boolean check, String text, String ariaLabel) {
	super(null);
	if (CONSTANTS.listOfClassesUseLockIcon()) {
		iCheck = new AriaToggleButton(RESOURCES.locked(), RESOURCES.unlocked());
	} else {
		iCheck = new AriaCheckBox();
	}
	if (text != null)
		((HasText)iCheck).setText(text);
	iCheck.setValue(check);
	((HasClickHandlers)iCheck).addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			event.stopPropagation();
		}
	});
	if (ariaLabel != null) setAriaLabel(ariaLabel);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:WebTable.java

示例15: IconCell

import com.google.gwt.event.dom.client.ClickEvent; //导入依赖的package包/类
public IconCell(ImageResource resource, final String title, String text) {
	super(null);
	iIcon = new Image(resource);
	iIcon.setTitle(title);
	iIcon.setAltText(title);
	if (text != null && !text.isEmpty()) {
		iLabel = new HTML(text, false);
		iPanel = new HorizontalPanel();
		iPanel.setStyleName("icon");
		iPanel.add(iIcon);
		iPanel.add(iLabel);
		iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
		iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
	}
	iIcon.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			event.stopPropagation();
			UniTimeConfirmationDialog.info(title);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:WebTable.java


注:本文中的com.google.gwt.event.dom.client.ClickEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。