@Override
  public void showLoading(Displayer displayer) {
    currentDisplayer = null;
    VerticalPanel centeredPanel = new VerticalPanel();
    centeredPanel.setWidth("100%");
    centeredPanel.setHeight("100%");
    centeredPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    centeredPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    Image loadingIcon =
        new Image(DataSetClientResources.INSTANCE.images().loadingIcon().getSafeUri());
    loadingIcon.setTitle(DashboardConstants.INSTANCE.loading());
    loadingIcon.setAltText(DashboardConstants.INSTANCE.loading());
    centeredPanel.add(loadingIcon);

    displayerPanel.clear();
    displayerPanel.add(centeredPanel);
  }
예제 #2
0
  public void init(final KieImageType imageType, final int containersRunningCount) {
    if (imageType == null) return;

    final SafeUri imageUri = ClientUtils.getImageUri(imageType);
    typeNameText.setText(imageType.getName());
    if (containersRunningCount < 0) {
      countText.setVisible(false);
    } else if (containersRunningCount == 0
        && showCreateButton
        && !KieImageCategory.OTHERS.equals(imageType.getCategory())) {
      countText.setText(Constants.INSTANCE.createNew());
      countText.setTitle(Constants.INSTANCE.createNewForThisType());
      countText.addStyleName(style.createNewButton());
      countText.addClickHandler(
          new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
              KieImageTypeView.this.fireEvent(new CreateContainerEvent(imageType));
            }
          });
      countText.setVisible(true);
    } else {
      countText.setText(Integer.toString(containersRunningCount));
      countText.removeStyleName(style.createNewButton());
      countText.setVisible(true);
    }

    typeImage.setUrl(imageUri);
    typeImage.setSize(size, size);
    typeImage.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent clickEvent) {
            KieImageTypeView.this.fireEvent(new ImageTypeSelectedEvent(imageType));
          }
        });
    mainPanel.setVisible(true);
  }