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

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

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

Button.getId介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

protected String getEntityId(final ClickEvent event) {
  final String buttonId = event.getButton().getId();
  if (!StringUtils.hasText(buttonId)) {
    return "";
  }
  if (buttonId.startsWith(UIComponentIdProvider.UPDATE_TAG_ID)) {
    return buttonId.substring(UIComponentIdProvider.UPDATE_TAG_ID.length());
  }
  if (buttonId.startsWith(UIComponentIdProvider.DELETE_TAG_ID)) {
    return buttonId.substring(UIComponentIdProvider.DELETE_TAG_ID.length());
  }
  return "";
}

代码示例来源:origin: eclipse/hawkbit

protected String getEntityId(final ClickEvent event) {
  final String buttonId = event.getButton().getId();
  if (!StringUtils.hasText(buttonId)) {
    return "";
  }
  if (buttonId.startsWith(UIComponentIdProvider.UPDATE_TAG_ID)) {
    return buttonId.substring(UIComponentIdProvider.UPDATE_TAG_ID.length());
  }
  if (buttonId.startsWith(UIComponentIdProvider.DELETE_TAG_ID)) {
    return buttonId.substring(UIComponentIdProvider.DELETE_TAG_ID.length());
  }
  return "";
}

代码示例来源:origin: eclipse/hawkbit

private static long getDeleteButtonId(final ClickEvent event) {
  final String id = event.getButton().getId();
  return Long.parseLong(id.substring(id.lastIndexOf('.') + 1));
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private static long getDeleteButtonId(final ClickEvent event) {
  final String id = event.getButton().getId();
  return Long.parseLong(id.substring(id.lastIndexOf('.') + 1));
}

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

List<Button> buttons = new ArrayList<>();
/*
 Create Button and call IDEvt method to create new event
 for each button

*/
private void IDEvt(Button btn){

  btn.setId(String.valueOf(IDRank)); 

  btn.setOnMousePressed(new EventHandler<MouseEvent>() {

    @Override
    public void handle(MouseEvent event) {

      System.out.println(btn.getId());

    }
  });

  IDRank++;
 }

代码示例来源:origin: eclipse/hawkbit

@Override
  public void buttonClick(final Button.ClickEvent event) {
    if (event.getButton().getId().equals(okButton.getId())) {
      callback.onConfirmResult(true);
    } else {
      callback.onConfirmResult(false);
    }
    close();
  }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
  public void buttonClick(final Button.ClickEvent event) {
    if (event.getButton().getId().equals(okButton.getId())) {
      callback.onConfirmResult(true);
    } else {
      callback.onConfirmResult(false);
    }
    close();
  }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
protected void filterUnClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    managementUIState.getDistributionTableFilters().setNoTagSelected(false);
  } else {
    managementUIState.getDistributionTableFilters().getDistSetTags().remove(clickedButton.getId());
  }
  eventBus.publish(this, new RefreshDistributionTableByFilterEvent());
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
protected void filterClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    managementUIState.getTargetTableFilters().setNoTagSelected(true);
    eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
  } else {
    managementUIState.getTargetTableFilters().getClickedTargetTags().add(clickedButton.getId());
    eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
  }
}

代码示例来源:origin: eclipse/hawkbit

@Override
protected void filterUnClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    managementUIState.getDistributionTableFilters().setNoTagSelected(false);
  } else {
    managementUIState.getDistributionTableFilters().getDistSetTags().remove(clickedButton.getId());
  }
  eventBus.publish(this, new RefreshDistributionTableByFilterEvent());
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
protected void filterClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    managementUIState.getDistributionTableFilters().setNoTagSelected(true);
  } else {
    managementUIState.getDistributionTableFilters().getDistSetTags().add(clickedButton.getId());
  }
  eventBus.publish(this, new RefreshDistributionTableByFilterEvent());
}

代码示例来源:origin: eclipse/hawkbit

@Override
protected void filterClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    managementUIState.getTargetTableFilters().setNoTagSelected(true);
    eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
  } else {
    managementUIState.getTargetTableFilters().getClickedTargetTags().add(clickedButton.getId());
    eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
  }
}

代码示例来源:origin: eclipse/hawkbit

@Override
protected void filterClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    managementUIState.getDistributionTableFilters().setNoTagSelected(true);
  } else {
    managementUIState.getDistributionTableFilters().getDistSetTags().add(clickedButton.getId());
  }
  eventBus.publish(this, new RefreshDistributionTableByFilterEvent());
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
protected void filterUnClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    if (managementUIState.getTargetTableFilters().isNoTagSelected()) {
      managementUIState.getTargetTableFilters().setNoTagSelected(false);
      eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
    }
  } else {
    if (null != managementUIState.getTargetTableFilters().getClickedTargetTags() && managementUIState
        .getTargetTableFilters().getClickedTargetTags().contains(clickedButton.getId())) {
      managementUIState.getTargetTableFilters().getClickedTargetTags().remove(clickedButton.getId());
      eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
    }
  }
}

代码示例来源:origin: eclipse/hawkbit

@Override
protected void filterUnClicked(final Button clickedButton) {
  if (clickedButton.getData().equals(SPUIDefinitions.NO_TAG_BUTTON_ID)) {
    if (managementUIState.getTargetTableFilters().isNoTagSelected()) {
      managementUIState.getTargetTableFilters().setNoTagSelected(false);
      eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
    }
  } else {
    if (null != managementUIState.getTargetTableFilters().getClickedTargetTags() && managementUIState
        .getTargetTableFilters().getClickedTargetTags().contains(clickedButton.getId())) {
      managementUIState.getTargetTableFilters().getClickedTargetTags().remove(clickedButton.getId());
      eventBus.publish(this, TargetFilterEvent.FILTER_BY_TAG);
    }
  }
}

代码示例来源:origin: eclipse/hawkbit

private void unassignSW(final ClickEvent event, final DistributionSet distributionSet,
    final Set<SoftwareModule> alreadyAssignedSwModules) {
  final SoftwareModule unAssignedSw = getSoftwareModule(event.getButton().getId(), alreadyAssignedSwModules);
  if (distributionSetManagement.isInUse(distributionSet.getId())) {
    uiNotification.displayValidationError(i18n.getMessage("message.error.notification.ds.target.assigned",
        distributionSet.getName(), distributionSet.getVersion()));
  } else {
    final DistributionSet newDistributionSet = distributionSetManagement
        .unassignSoftwareModule(distributionSet.getId(), unAssignedSw.getId());
    manageDistUIState.setLastSelectedEntityId(newDistributionSet.getId());
    eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.SELECTED_ENTITY, newDistributionSet));
    eventBus.publish(this, DistributionsUIEvent.ORDER_BY_DISTRIBUTION);
    uiNotification.displaySuccess(i18n.getMessage("message.sw.unassigned", unAssignedSw.getName()));
  }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private void unassignSW(final ClickEvent event, final DistributionSet distributionSet,
    final Set<SoftwareModule> alreadyAssignedSwModules) {
  final SoftwareModule unAssignedSw = getSoftwareModule(event.getButton().getId(), alreadyAssignedSwModules);
  if (distributionSetManagement.isInUse(distributionSet.getId())) {
    uiNotification.displayValidationError(i18n.getMessage("message.error.notification.ds.target.assigned",
        distributionSet.getName(), distributionSet.getVersion()));
  } else {
    final DistributionSet newDistributionSet = distributionSetManagement
        .unassignSoftwareModule(distributionSet.getId(), unAssignedSw.getId());
    manageDistUIState.setLastSelectedEntityId(newDistributionSet.getId());
    eventBus.publish(this, new DistributionTableEvent(BaseEntityEventType.SELECTED_ENTITY, newDistributionSet));
    eventBus.publish(this, DistributionsUIEvent.ORDER_BY_DISTRIBUTION);
    uiNotification.displaySuccess(i18n.getMessage("message.sw.unassigned", unAssignedSw.getName()));
  }
}

相关文章