com.vaadin.ui.Button.addListener()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中com.vaadin.ui.Button.addListener()方法的一些代码示例,展示了Button.addListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.addListener()方法的具体详情如下:
包路径:com.vaadin.ui.Button
类名称:Button
方法名:addListener

Button.addListener介绍

暂无

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Adds the button click listener.
 *
 * @see Registration
 *
 * @param listener
 *            the Listener to be added.
 * @return a registration object for removing the listener
 * @since 8.0
 */
public Registration addClickListener(ClickListener listener) {
  return addListener(ClickEvent.class, listener,
      ClickListener.BUTTON_CLICK_METHOD);
}

代码示例来源:origin: stackoverflow.com

table.add(button).expandX().center();
button.addListener(new ClickListener() {
  @Override public void clicked(InputEvent event, float x, float y) {
    Gdx.app.log("XY", "[" + x + ", " + y + "]");

代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin

private Button createAddDistributionButton(final Window main) {
  Button button = new Button("Add Distribution...");
  button.addListener(new Button.ClickListener() {
    public void buttonClick(ClickEvent event) {
      new AddDistributionWindow(main).show();
    }
  });
  return button;
}

代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin

private Button createAddTargetButton(final Window main) {
  Button addTargetButton = new Button("Add target...");
  addTargetButton.addListener(new Button.ClickListener() {
    public void buttonClick(ClickEvent event) {
      new AddTargetWindow(main).show();
    }
  });
  return addTargetButton;
}

代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin

private Button createAddArtifactButton(final Window main) {
  Button addArtifactButton = new Button("Add artifact...");
  addArtifactButton.addListener(new Button.ClickListener() {
    public void buttonClick(ClickEvent event) {
      showAddArtifactDialog(main);
    }
  });
  return addArtifactButton;
}

代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin

private Button createAddFeatureButton(final Window main) {
  Button button = new Button("Add Feature...");
  button.addListener(new Button.ClickListener() {
    public void buttonClick(ClickEvent event) {
      new AddFeatureWindow(main).show();
    }
  });
  return button;
}

代码示例来源:origin: org.aperteworkflow/gui-commons

public static Button button(String caption, final Runnable onClick) {
  Button b = new Button(caption);
  b.addListener(new Button.ClickListener() {
    @Override
    public void buttonClick(Button.ClickEvent event) {
      onClick.run();
    }
  });
  return b;
}

代码示例来源:origin: org.aperteworkflow/editor

private void initComponent() {
  confirmButton = new Button("confirm.window.confirm");
  confirmButton.addListener(this);
  
  cancelButton = new Button("confirm.window.cancel");
  cancelButton.addListener(this);
  
  messageLabel = new Label("confirm.window.message.default");
  messageLabel.setContentMode(Label.CONTENT_XHTML);
}

代码示例来源:origin: org.activiti/activiti-explorer

public Component getOverviewComponent(final Attachment attachment, final RelatedContentComponent parent) {
 Button attachmentLink = new Button(attachment.getName());
 attachmentLink.addStyleName(Reindeer.BUTTON_LINK);
 
 attachmentLink.addListener(new ClickListener() {
  private static final long serialVersionUID = 1L;
  public void buttonClick(ClickEvent event) {
   parent.showAttachmentDetail(attachment);
  }
 });
 return attachmentLink;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected Button initEditProfileButton() {
 Button editProfileButton = new Button(i18nManager.getMessage(Messages.PROFILE_EDIT));
 editProfileButton.setIcon(Images.EDIT);
 editProfileButton.addListener(new ClickListener() {
  public void buttonClick(ClickEvent event) {
   editable = true;
   initUi();
  }
 });
 return editProfileButton;
}

代码示例来源:origin: org.aperteworkflow/base-widgets

private void showCancelTaskDialog(final PerformedActionParams params) {
  CancelTaskDialog dialog = showDialog(new CancelTaskDialog());
  dialog.getCancelTaskButton().addListener(new Button.ClickListener() {
    @Override
    public void buttonClick(Button.ClickEvent clickEvent) {
      handleCancelTaskButtonClick(params);
    }
  });
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initEditButton(VerticalLayout actionLayout) {
 Button editButton = new Button(i18nManager.getMessage(Messages.USER_EDIT));
 editButton.addStyleName(Reindeer.BUTTON_SMALL);
 actionLayout.addComponent(editButton);
 editButton.addListener(new ClickListener() {
  public void buttonClick(ClickEvent event) {
   editingDetails = true;
   userDetailsLayout.removeAllComponents();
   populateUserDetails(); // the layout will be populated differently since the 'editingDetails' boolean is set
  }
 });
}

代码示例来源:origin: org.opennms.features/jmxconfiggenerator.webui

public static Button createButton(final String buttonCaption, final String iconName,
    final ClickListener clickListener) {
  Button button = new Button();
  button.setCaption(buttonCaption);
  button.setIcon(IconProvider.getIcon(iconName));
  if (clickListener != null) button.addListener(clickListener);
  return button;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initActions() {
 Button newCaseButton = new Button();
 newCaseButton.setCaption(i18nManager.getMessage(Messages.TASK_NEW));
 newCaseButton.setIcon(Images.TASK_16);
 addButton(newCaseButton);
 
 newCaseButton.addListener(new ClickListener() {
  public void buttonClick(ClickEvent event) {
   NewCasePopupWindow newTaskPopupWindow = new NewCasePopupWindow();
   viewManager.showPopupWindow(newTaskPopupWindow);
  }
 });
}

代码示例来源:origin: org.aperteworkflow/editor

private void initComponent() {
  roleNameLabel = new Label(permissionWrapper.getRoleName());
  deleteButton = new Button();
  deleteButton.setCaption("  X  ");
  deleteButton.setStyleName(BaseTheme.BUTTON_LINK);
  deleteButton.addListener(new Button.ClickListener() {
    @Override
    public void buttonClick(Button.ClickEvent event) {
      handler.removePermissionWrapper(permissionWrapper);
    }
  });
}

代码示例来源:origin: org.aperteworkflow/editor

private Component getAddEntryButton() {
  if (addEntryButton == null) {
    I18NSource i18NSource = I18NSource.ThreadUtil.getThreadI18nSource();
    addEntryButton = addIcon(getApplication());
    addEntryButton.setCaption(i18NSource.getMessage("dict.addentry"));
    addEntryButton.addListener(this);
  }
  return addEntryButton;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initSelectButton() {
 final Button selectButton = new Button(i18nManager.getMessage(Messages.USER_SELECT_GROUPS));
 addComponent(selectButton);
 ((VerticalLayout) getContent()).setComponentAlignment(selectButton, Alignment.BOTTOM_RIGHT);
 
 selectButton.addListener(new ClickListener() {
  public void buttonClick(ClickEvent event) {
   fireEvent(new SubmitEvent(selectButton, SubmitEvent.SUBMITTED));
   close();
  }
 });
}

代码示例来源:origin: org.activiti/activiti-explorer

@Override
protected ToolBar createMenuBar() {
 ProcessMenuBar menuBar = new ProcessMenuBar();
 Button newModelButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_NEW));
 newModelButton.addListener(new NewModelClickListener());
 menuBar.addButton(newModelButton);
 Button importModelButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_IMPORT));
 importModelButton.addListener(new ImportModelClickListener());
 menuBar.addButton(importModelButton);
 return menuBar;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initActions() {
 Button createGroupButton = new Button(i18nManager.getMessage(Messages.GROUP_CREATE));
 createGroupButton.setIcon(Images.GROUP_16);
 createGroupButton.addListener(new ClickListener() {
  public void buttonClick(ClickEvent event) {
   NewGroupPopupWindow popup = new NewGroupPopupWindow();
   ExplorerApp.get().getViewManager().showPopupWindow(popup);
  }
 });
 groupPage.getToolBar().removeAllButtons();
 groupPage.getToolBar().addButton(createGroupButton);
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void addDeleteButton() {
 Button deleteProcessInstanceButton = new Button(i18nManager.getMessage(Messages.PROCESS_INSTANCE_DELETE));
 deleteProcessInstanceButton.setIcon(Images.DELETE);
 deleteProcessInstanceButton.addListener(new DeleteProcessInstanceClickListener(processInstance.getId(), processInstancePage));
 
 // Clear toolbar and add 'start' button
 processInstancePage.getToolBar().removeAllButtons();
 processInstancePage.getToolBar().addButton(deleteProcessInstanceButton);
}

相关文章