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


Java PushButton.addClickHandler方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.PushButton.addClickHandler方法的典型用法代码示例。如果您正苦于以下问题:Java PushButton.addClickHandler方法的具体用法?Java PushButton.addClickHandler怎么用?Java PushButton.addClickHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.PushButton的用法示例。


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

示例1: ComplexColorPicker

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
public ComplexColorPicker() {
  style.ensureInjected();

  // The background color can be set to "none"
  noneBtn = new PushButton(messages.none());
  noneBtn.addStyleName(ComplexColorPicker.style.buttonsMargins());
  noneBtn.setStylePrimaryName(ComplexColorPicker.style.customColorPushbutton());
  noneBtn.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      listener.onNoneColorChoose();
    }
  });

  vp = new VerticalPanel();

  // We use a simple color picker by default
  simplePicker = new SimpleColorPicker(this);
  vp.add(simplePicker);
  vp.add(noneBtn);
  super.add(vp);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:23,代码来源:ComplexColorPicker.java

示例2: createBrowserItemWidget

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
protected Widget createBrowserItemWidget(final int type, boolean enabled) {
  final ClickHandler clickHandler = new ClickHandler() {
    public void onClick(ClickEvent event) {
      switch(type) {
        case FIRST:
          _page = 0;
          break;
        case PREV:
          --_page;
          break;
        case NEXT:
          ++_page;
          break;
        case LAST:
          _page = _pages - 1;
          break;
      }
      fireChange();
    }
  };
  PushButton button = new PushButton();
  button.setStylePrimaryName(STYLES_BROWSER[type]);
  button.setEnabled(enabled);
  if(enabled) button.addClickHandler(clickHandler);
  return button;
}
 
开发者ID:sanderberents,项目名称:gwtlib,代码行数:27,代码来源:PagingBar.java

示例3: render

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Object render(final ProjectFundingDTO model, final String property, final ColumnData config, final int rowIndex, final int colIndex,
		final ListStore<ProjectFundingDTO> store, final Grid<ProjectFundingDTO> grid) {

	// Creates the button with its icon.
	final PushButton editButton = new PushButton(IconImageBundle.ICONS.editLinkedProject().createImage());
	editButton.setStylePrimaryName(STYLE_EDIT_BUTTON);

	// Sets the button click handler.
	editButton.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(final ClickEvent event) {
			view.getPresenterHandler().onLinkedProjectEditClickEvent(model, projectType);
		}
	});

	// Returns this button.
	return editButton;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:24,代码来源:LinkedProjectsEditButtonCellRender.java

示例4: newShiftDateButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/**
 * Returns a new button that shifts the date when clicked.
 * @param seconds How many seconds to shift.
 * @param label The label to put on the button.
 */
private PushButton newShiftDateButton(final int seconds,
                                      final String label) {
  final PushButton button = new PushButton(label);
  button.setStyleName(seconds < 0 ? "datePickerPreviousButton"
                      : "datePickerNextButton");
  button.addClickHandler(new ClickHandler() {
    public void onClick(final ClickEvent event) {
      Date d = box.getValue();
      if (d == null) {
        if (seconds >= 0) {
          return;
        }
        d = new Date();
      }
      d.setTime(d.getTime() + seconds * 1000);
      d.setSeconds(0);
      setDate(d);
    }
  });
  return button;
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:27,代码来源:DateTimeBox.java

示例5: newSetHoursButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/**
 * Returns a new button that sets the hours when clicked.
 * @param hours An hour of the day (0-23).
 * @param label The label to put on the button.
 */
private PushButton newSetHoursButton(final int hours) {
  final PushButton button = new PushButton(Integer.toString(hours));
  button.addClickHandler(new ClickHandler() {
    public void onClick(final ClickEvent event) {
      @SuppressWarnings(/* GWT requires us to use Date */{"deprecation"})
      Date d = box.getValue();
      if (d == null) {
        d = new Date();
        d.setMinutes(0);
      }
      d.setHours(hours);
      d.setSeconds(0);
      setDate(d);
    }
  });
  return button;
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:23,代码来源:DateTimeBox.java

示例6: newSetMinutesButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/**
 * Returns a new button that sets the minutes when clicked.
 * @param minutes A value for minutes (0-59).
 * @param label The label to put on the button.
 */
private PushButton newSetMinutesButton(final int minutes,
                                       final String label) {
  final PushButton button = new PushButton(label);
  button.addClickHandler(new ClickHandler() {
    public void onClick(final ClickEvent event) {
      @SuppressWarnings(/* GWT requires us to use Date */{"deprecation"})
      Date d = box.getValue();
      if (d == null) {
        d = new Date();
      }
      d.setMinutes(minutes);
      d.setSeconds(0);
      setDate(d);
    }
  });
  return button;
}
 
开发者ID:tsuna,项目名称:droopy,代码行数:23,代码来源:DateTimeBox.java

示例7: createPushButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/**
 * Helper method to create push buttons.
 *
 * @param img  image to shown on face of push button
 * @param tip  text to show in tooltip
 * @return  newly created push button
 */
public static PushButton createPushButton(ImageResource img, String tip,
                                          ClickHandler handler) {
  PushButton pb = new PushButton(new Image(img));
  pb.addClickHandler(handler);
  pb.setTitle(tip);
  return pb;
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:15,代码来源:Ode.java

示例8: makeFormButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
public static ButtonBase makeFormButton(String text, ClickHandler handler) {
    PushButton b = new PushButton();
    b.addClickHandler(handler);
    b.setHTML(text.replace(" ", "&nbsp;"));
    return b;
}
 
开发者ID:lsst,项目名称:firefly,代码行数:7,代码来源:GwtUtil.java

示例9: addAction

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
public void addAction(String imageUrl, String title, Command command) {
	Image image = new Image(imageUrl);
	image.setHeight("22px");
	image.setWidth("22px");
	
	PushButton button = new PushButton(image);		
	
	button.addClickHandler(this);
	button.setTitle(title);
	
	button.getElement().setClassName("simple-PushButton");
	
	addButton(button);
	buttonMap.put(button, command);
}
 
开发者ID:Rise-Vision,项目名称:rva,代码行数:16,代码来源:ActionsWidget.java

示例10: createPushButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/** Method to create a Push button for the toolbar **/
private PushButton createPushButton(String url, Integer top, Integer left, Integer width, Integer height, String tip) {
	Image extract = new Image(url, left, top, width, height);
	PushButton tb = new PushButton(extract);
	tb.setHeight(height+"px");
	tb.setWidth(width+"px");
	tb.addClickHandler(evHandler);
	if (tip != null) {
		tb.setTitle(tip);
	}
	return tb;
}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:13,代码来源:RichTextToolbar.java

示例11: LayerSelectorTree

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
public LayerSelectorTree(LayerSelectionHandler layerHandler, String firstText,
        boolean showRefreshButton, HTML titleLabel) {
    super();
    this.layerSelectionHandler = layerHandler;

    layerIdWmsUrlToTitle = new HashMap<String, String>();
    layerIdWmsUrlToMenuEntry = new HashMap<String, LayerMenuItem>();


    this.titleLabel = titleLabel;
    this.titleLabel.setHTML(firstText);
    this.titleLabel.setStylePrimaryName("hiddenButton");
    this.titleLabel.addStyleDependentName("title");

    if (showRefreshButton) {
        PushButton button = new PushButton("Refresh");
        button.addStyleDependentName("CentreAndMargin");
        button.setTitle("Click to refresh the layers list");
        button.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                layerSelectionHandler.refreshLayerList();
            }
        });
        add(button);
    }
    
    tree = new Tree();
    add(tree);
}
 
开发者ID:Reading-eScience-Centre,项目名称:edal-java,代码行数:31,代码来源:LayerSelectorTree.java

示例12: OutputControlPanelImpl

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/**
 * @wbp.parser.constructor
 */
public OutputControlPanelImpl(String outputPanelID) {
    ClientFactory clientFactory = GWT.create(ClientFactory.class);

    setName(outputPanelID);

    FlowPanel mainPanel = new FlowPanel();

    HorizontalPanel horizontalPanel_0 = new HorizontalPanel();
    horizontalPanel_0.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    horizontalPanel_0.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
    horizontalPanel_0.setSpacing(5);
    mainPanel.add(horizontalPanel_0);

    datasetButton = new DatasetButton();
    datasetButton.setName(outputPanelID);
    horizontalPanel_0.add(datasetButton);

    displayButton = new PushButton("Enlarge Image");
    displayButton.setTitle("Show the plot's image at full size in a new window.");
    displayButton.addStyleDependentName("SMALLER");
    displayButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            listener.onDisplayButtonClick(getImageURL());
        }
    });
    displayButton.setEnabled(false);
    horizontalPanel_0.add(displayButton);

    flexTable = new FlexTable();
    VariableControlsActivity variableControlsPresenter = new VariableControlsActivity(clientFactory, outputPanelID);
    variableControls = variableControlsPresenter.init(outputPanelID);
    // horizontalPanel_0.add(variableControls);
    flexTable.setWidget(0, 0, variableControls);

    mainPanel.add(flexTable);

    mainPanel.setVisible(true);
    // mainPanel.setOpen(true);

    initWidget(mainPanel);
    // initWidget(binder.createAndBindUi(this));
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:47,代码来源:OutputControlPanelImpl.java

示例13: DatasetButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
public DatasetButton() {
    choose = new PushButton("Data Set");
    choose.setTitle("Select a Data Set.");
    choose.addStyleDependentName("SMALLER");
    choose.addClickHandler(openClick);
    datasetPanel = new PopupPanel(false);
    datasetPanel.setAnimationEnabled(true);
    datasetWidget = new DatasetWidget();
    datasetWidget.setName(name);
    datasetWidget.setHeight("650px");
    datasetWidget.addSelectionHandler(new SelectionHandler<TreeItem>() {
        @Override
        public void onSelection(SelectionEvent<TreeItem> event) {
            TreeItem item = event.getSelectedItem();
            Object u = item.getUserObject();
            if ( u instanceof VariableSerializable ) {
                selectedVariable = (VariableSerializable) u;
                dataset_name.setText(selectedVariable.getDSName());
                variable_name.setText(selectedVariable.getName());
                datasetWidget.setName(name); // setting the name of this datasetWidget as it will be the source of the re-firing of event
                eventBus.fireEvent(event); // this datasetWidget is now the source                    
            }
        }
    });
    datasetWidget.init();
    popupGrid = new Grid(3, 1);
    close = new Button("close");
    close.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent arg0) {
            datasetPanel.hide();
        }
    });
    verticalPanel.add(dataset_name);
    verticalPanel.add(variable_name);
    selection.add(verticalPanel);
    treePanel.add(datasetWidget);
    popupGrid.setWidget(0, 0, close);
    popupGrid.setWidget(1, 0, selection);
    popupGrid.setWidget(2, 0, treePanel);
    datasetPanel.add(popupGrid);
    datasetPanel.hide();
    initWidget(choose);
}
 
开发者ID:NOAA-PMEL,项目名称:LAS,代码行数:45,代码来源:DatasetButton.java

示例14: createPushButton

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
private PushButton createPushButton(AbstractImagePrototype img, String tip) {
  PushButton pb = new PushButton(img.createImage());
  pb.addClickHandler(handler);
  pb.setTitle(tip);
  return pb;
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:7,代码来源:RichTextToolbar.java

示例15: showErrorDialogue

import com.google.gwt.user.client.ui.PushButton; //导入方法依赖的package包/类
/**
 * Shows an error message at the top of the page (can be closed; auto hide after 10 seconds)
 * @param message Error message to display
 */
private void showErrorDialogue(String message) {
	try {
		if (message == null || message.isEmpty())
			return;
		
		if (errorMessageBox == null) {
			errorMessageBox = new DialogBox(false, false);
			errorMessageBox.getElement().setId("errorMessageBoxDialog");
			
			errorMessageBox.addStyleName("errorMessageBox");
		
			final HorizontalPanel panel = new HorizontalPanel();
			errorMessageBox.add(panel);
			panel.addStyleName("errorMessagePanel");
		
			errorMessage = new Label(); 
			panel.add(errorMessage);
			errorMessage.getElement().getStyle().setMarginRight(5, Unit.PX);
		
			//Close button
			Image img = new Image("img/close.png"); 
			PushButton buttonClose = new PushButton(img); 
			panel.add(buttonClose);
			buttonClose.addClickHandler(new ClickHandler() {
				@Override
				public void onClick(ClickEvent event) {
					errorMessageBox.hide();
				}
			});
		
			mainPanel.add(errorMessageBox);
		}
		errorMessage.setText(message);
		
		//Hide after 10 seconds (can be changed in AppConstants.properties)
		if (errorMessageTimer != null)
			errorMessageTimer.cancel();
		errorMessageTimer = new Timer() {
			public void run() {
				errorMessageBox.hide();
			}
		};
		errorMessageTimer.schedule(Integer.parseInt(CONSTANTS.ErrorMessageDisplayTimeInMilliseconds()));
		
		errorMessageBox.showRelativeTo(documentTitle);
	} catch (Exception exc) {
		logManager.logError(ERROR_UNSPECIFIED, "Error displaying the message dialogue");
		exc.printStackTrace();
	}
}
 
开发者ID:PRImA-Research-Lab,项目名称:prima-aletheia-web-emop,代码行数:55,代码来源:WebLayoutEditor.java


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