Example #1
0
  private Button customFilterDistributionSetButton(final Long itemId) {
    final Item row1 = getItem(itemId);
    final ProxyDistribution distSet =
        (ProxyDistribution)
            row1.getItemProperty(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET).getValue();
    final String buttonId = "distSetButton";
    Button updateIcon;
    if (distSet == null) {
      updateIcon =
          SPUIComponentProvider.getButton(
              buttonId,
              i18n.get("button.no.auto.assignment"),
              i18n.get("button.auto.assignment.desc"),
              null,
              false,
              null,
              SPUIButtonStyleSmallNoBorder.class);
    } else {
      updateIcon =
          SPUIComponentProvider.getButton(
              buttonId,
              distSet.getNameVersion(),
              i18n.get("button.auto.assignment.desc"),
              null,
              false,
              null,
              SPUIButtonStyleSmallNoBorder.class);
    }

    updateIcon.addClickListener(this::onClickOfDistributionSetButton);
    updateIcon.setData(row1);
    updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");

    return updateIcon;
  }
 private Button getCloseButton() {
   final Button closeBtn =
       SPUIComponentProvider.getButton(
           UIComponentIdProvider.UPLOAD_STATUS_POPUP_CLOSE_BUTTON_ID,
           "",
           "",
           "",
           true,
           FontAwesome.TIMES,
           SPUIButtonStyleSmallNoBorder.class);
   closeBtn.addStyleName(ValoTheme.BUTTON_BORDERLESS);
   closeBtn.addClickListener(event -> onClose());
   return closeBtn;
 }
 private Button getResizeButton() {
   final Button resizeBtn =
       SPUIComponentProvider.getButton(
           UIComponentIdProvider.UPLOAD_STATUS_POPUP_RESIZE_BUTTON_ID,
           "",
           "",
           "",
           true,
           FontAwesome.EXPAND,
           SPUIButtonStyleSmallNoBorder.class);
   resizeBtn.addStyleName(ValoTheme.BUTTON_BORDERLESS);
   resizeBtn.addClickListener(event -> resizeWindow(event));
   return resizeBtn;
 }
  private HorizontalLayout saveConfigurationButtonsLayout() {

    final HorizontalLayout hlayout = new HorizontalLayout();
    hlayout.setSpacing(true);
    saveConfigurationBtn =
        SPUIComponentProvider.getButton(
            SPUIComponetIdProvider.SYSTEM_CONFIGURATION_SAVE,
            "",
            "",
            "",
            true,
            FontAwesome.SAVE,
            SPUIButtonStyleSmallNoBorder.class);
    saveConfigurationBtn.setEnabled(false);
    saveConfigurationBtn.setDescription(i18n.get("configuration.savebutton.tooltip"));
    saveConfigurationBtn.addClickListener(event -> saveConfiguration());
    hlayout.addComponent(saveConfigurationBtn);

    undoConfigurationBtn =
        SPUIComponentProvider.getButton(
            SPUIComponetIdProvider.SYSTEM_CONFIGURATION_CANCEL,
            "",
            "",
            "",
            true,
            FontAwesome.UNDO,
            SPUIButtonStyleSmallNoBorder.class);
    undoConfigurationBtn.setEnabled(false);
    undoConfigurationBtn.setDescription(i18n.get("configuration.cancellbutton.tooltip"));
    undoConfigurationBtn.addClickListener(event -> undoConfiguration());
    hlayout.addComponent(undoConfigurationBtn);

    final Link linkToSystemConfigHelp = DocumentationPageLink.SYSTEM_CONFIGURATION_VIEW.getLink();
    hlayout.addComponent(linkToSystemConfigHelp);

    return hlayout;
  }
 private Button getMinimizeButton() {
   final Button minimizeBtn =
       SPUIComponentProvider.getButton(
           UIComponentIdProvider.UPLOAD_STATUS_POPUP_MINIMIZE_BUTTON_ID,
           "",
           "",
           "",
           true,
           FontAwesome.MINUS,
           SPUIButtonStyleSmallNoBorder.class);
   minimizeBtn.addStyleName(ValoTheme.BUTTON_BORDERLESS);
   minimizeBtn.addClickListener(event -> minimizeWindow());
   minimizeBtn.setEnabled(true);
   return minimizeBtn;
 }
Example #6
0
 private Button createManageMetadataButton(final String nameVersionStr) {
   final Button manageMetadataBtn =
       SPUIComponentProvider.getButton(
           UIComponentIdProvider.DS_TABLE_MANAGE_METADATA_ID + "." + nameVersionStr,
           "",
           "",
           null,
           false,
           FontAwesome.LIST_ALT,
           SPUIButtonStyleSmallNoBorder.class);
   manageMetadataBtn.addStyleName(SPUIStyleDefinitions.ARTIFACT_DTLS_ICON);
   manageMetadataBtn.addStyleName(SPUIStyleDefinitions.DS_METADATA_ICON);
   manageMetadataBtn.setDescription(i18n.get("tooltip.metadata.icon"));
   return manageMetadataBtn;
 }
Example #7
0
 private Button getDeleteButton(final Long itemId) {
   final Item row = getItem(itemId);
   final String tfName = (String) row.getItemProperty(SPUILabelDefinitions.NAME).getValue();
   final Button deleteIcon =
       SPUIComponentProvider.getButton(
           getDeleteIconId(tfName),
           "",
           SPUILabelDefinitions.DELETE_CUSTOM_FILTER,
           ValoTheme.BUTTON_TINY + " " + "redicon",
           true,
           FontAwesome.TRASH_O,
           SPUIButtonStyleSmallNoBorder.class);
   deleteIcon.setData(itemId);
   deleteIcon.addClickListener(this::onDelete);
   return deleteIcon;
 }
Example #8
0
 private void createSaveButton() {
   saveButton =
       SPUIComponentProvider.getButton(
           UIComponentIdProvider.SAVE_BUTTON,
           "Save",
           "",
           "",
           true,
           FontAwesome.SAVE,
           SPUIButtonStyleNoBorderWithIcon.class);
   saveButton.setSizeUndefined();
   saveButton.addStyleName("default-color");
   addCloseListenerForSaveButton();
   saveButton.setEnabled(false);
   buttonsLayout.addComponent(saveButton);
   buttonsLayout.setComponentAlignment(saveButton, Alignment.MIDDLE_RIGHT);
   buttonsLayout.setExpandRatio(saveButton, 1.0F);
 }
Example #9
0
  private Button customFilterDetailButton(final Long itemId) {
    final Item row1 = getItem(itemId);
    final String tfName = (String) row1.getItemProperty(SPUILabelDefinitions.NAME).getValue();

    final Button updateIcon =
        SPUIComponentProvider.getButton(
            getDetailLinkId(tfName),
            tfName,
            SPUILabelDefinitions.UPDATE_CUSTOM_FILTER,
            null,
            false,
            null,
            SPUIButtonStyleSmallNoBorder.class);
    updateIcon.setData(tfName);
    updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");
    updateIcon.addClickListener(this::onClickOfDetailButton);
    return updateIcon;
  }
Example #10
0
  private void createCancelButton() {
    cancelButton =
        SPUIComponentProvider.getButton(
            UIComponentIdProvider.CANCEL_BUTTON,
            "Cancel",
            "",
            "",
            true,
            FontAwesome.TIMES,
            SPUIButtonStyleNoBorderWithIcon.class);
    cancelButton.setSizeUndefined();
    cancelButton.addStyleName("default-color");
    addCloseListenerForCancelButton();
    if (cancelButtonClickListener != null) {
      cancelButton.addClickListener(cancelButtonClickListener);
    }

    buttonsLayout.addComponent(cancelButton);
    buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_LEFT);
    buttonsLayout.setExpandRatio(cancelButton, 1.0F);
  }
Example #11
0
  /** Intialize component. */
  private void buildComponents() {
    filterByStatusFotter.init();

    filterByButtons.addStyleName(SPUIStyleDefinitions.NO_TOP_BORDER);
    targetFilterQueryButtonsTab.init(customTargetTagFilterButtonClick);
    if (permChecker.hasCreateTargetPermission() || permChecker.hasUpdateTargetPermission()) {
      config =
          SPUIComponentProvider.getButton(
              UIComponentIdProvider.ADD_TARGET_TAG,
              "",
              "",
              "",
              true,
              FontAwesome.COG,
              SPUIButtonStyleSmallNoBorder.class);
      config.addClickListener(event -> settingsIconClicked());
    }
    addStyleName(ValoTheme.ACCORDION_BORDERLESS);
    addTabs();
    setSizeFull();
    switchToTabSelectedOnLoad();
    addSelectedTabChangeListener(this);
  }
    private void init() {
      setId(UIComponentIdProvider.DIST_SET_SELECT_CONS_WINDOW_ID);
      setModal(true);
      setResizable(false);

      final VerticalLayout layout = new VerticalLayout();
      layout.setSpacing(true);
      layout.setMargin(true);
      setContent(layout);

      final Long targetsCount =
          targetManagement.countTargetsByTargetFilterQueryAndNonDS(
              distributionSetId, targetFilterQuery);
      Label mainTextLabel;
      if (targetsCount == 0) {
        mainTextLabel = new Label(i18n.get("message.confirm.assign.consequences.none"));
      } else {
        mainTextLabel =
            new Label(
                i18n.get("message.confirm.assign.consequences.text", new Object[] {targetsCount}));
      }

      layout.addComponent(mainTextLabel);

      final HorizontalLayout buttonsLayout = new HorizontalLayout();
      buttonsLayout.setSizeFull();
      buttonsLayout.setSpacing(true);
      buttonsLayout.addStyleName("actionButtonsMargin");
      layout.addComponent(buttonsLayout);

      okButton =
          SPUIComponentProvider.getButton(
              UIComponentIdProvider.SAVE_BUTTON,
              i18n.get("button.ok"),
              "",
              "",
              true,
              FontAwesome.SAVE,
              SPUIButtonStyleNoBorderWithIcon.class);
      okButton.setSizeUndefined();
      okButton.addStyleName("default-color");
      okButton.addClickListener(this);
      buttonsLayout.addComponent(okButton);
      buttonsLayout.setComponentAlignment(okButton, Alignment.MIDDLE_RIGHT);
      buttonsLayout.setExpandRatio(okButton, 1.0F);

      final Button cancelButton =
          SPUIComponentProvider.getButton(
              UIComponentIdProvider.CANCEL_BUTTON,
              i18n.get("button.cancel"),
              "",
              "",
              true,
              FontAwesome.TIMES,
              SPUIButtonStyleNoBorderWithIcon.class);
      cancelButton.setSizeUndefined();
      cancelButton.addStyleName("default-color");
      cancelButton.addClickListener(this);
      buttonsLayout.addComponent(cancelButton);
      buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_LEFT);
      buttonsLayout.setExpandRatio(cancelButton, 1.0F);
    }