Java 类com.vaadin.ui.Button.ClickListener 实例源码

项目:osc-core    文件:MainUI.java   
private void buildSubmenu(CssLayout submenu, Set<OSCViewProvider<?>> views) {
    for (final OSCViewProvider<?> view : views) {
        String viewName = view.getName();
        NativeButton b = new NativeButton(viewName);
        // selecting default menu button
        if (view.getName().equals(VIEW_FRAGMENT_ALERTS)) {
            b.addStyleName("selected");
        }
        b.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                clearMenuSelection();
                event.getButton().addStyleName("selected");
                if (!MainUI.this.nav.getState().equals(viewName)) {
                    MainUI.this.nav.navigateTo(viewName);
                }
            }
        });
        submenu.setSizeFull();
        submenu.addComponent(b);
    }
}
项目:osc-core    文件:EmailLayout.java   
@SuppressWarnings("serial")
private Button createEditButton() {
    // creating edit button
    this.edit = new Button("Edit");
    this.edit.setEnabled(true);
    this.edit.addStyleName(StyleConstants.BUTTON_TOOLBAR);
    this.edit.addStyleName(StyleConstants.EDIT_BUTTON);
    this.edit.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                editClicked();
            } catch (Exception e) {
                ViewUtil.showError("Error editing email settings", e);
            }
        }
    });
    return this.edit;
}
项目:osc-core    文件:NetworkLayout.java   
@SuppressWarnings("serial")
private Button createIPSettingsEditButton() {
    // creating edit button
    this.editIPSettings = new Button("Edit");
    this.editIPSettings.setEnabled(true);
    this.editIPSettings.addStyleName(StyleConstants.BUTTON_TOOLBAR);
    this.editIPSettings.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                editIPSettingsClicked();
            } catch (Exception e) {
                ViewUtil.showError("Error editing IP settings", e);
            }
        }
    });
    return this.editIPSettings;
}
项目:osc-core    文件:NetworkLayout.java   
@SuppressWarnings("serial")
private Button createNATEditButton() {
    // creating edit button
    this.editNATSettings = new Button("Edit");
    this.editNATSettings.setEnabled(true);
    this.editNATSettings.addStyleName(StyleConstants.BUTTON_TOOLBAR);
    this.editNATSettings.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                editNATSettingsClicked();
            } catch (Exception e) {
                ViewUtil.showError("Error editing NAT settings", e);
            }
        }
    });
    return this.editNATSettings;
}
项目:osc-core    文件:ViewUtil.java   
/**
 * @param toolbar
 *            HorizontalLayout which contains all the action Buttons
 * @param toolbarButton
 *            Which Tool bar button to create (Provided using ENUM constant)
 * @param listner
 *            Click listener called when this button is clicked
 * @return
 */

public static Button buildToolbarButton(HorizontalLayout toolbar, ToolbarButtons toolbarButton,
        ClickListener listner) {
    Button button = new Button(toolbarButton.getText());
    button.addStyleName(StyleConstants.BUTTON_TOOLBAR);
    button.setDescription(toolbarButton.getTooltip());
    button.setStyleName(ValoTheme.BUTTON_LINK);
    if (StringUtils.isNotEmpty(toolbarButton.getImageLocation())) {
        button.setIcon(new ThemeResource(toolbarButton.getImageLocation()), toolbarButton.toString());
    }
    button.setEnabled(false);
    button.setId(toolbarButton.getId());
    button.addClickListener(listner);
    toolbar.addComponent(button);
    return button;
}
项目:osc-core    文件:CRUDBaseSubView.java   
@SuppressWarnings("serial")
private HorizontalLayout createHeader(String title) {
    HorizontalLayout header = ViewUtil.createSubHeader(title, getSubViewHelpGuid());
    Button refresh = new Button();
    refresh.setStyleName(Reindeer.BUTTON_LINK);
    refresh.setDescription("Refresh");
    refresh.setIcon(new ThemeResource("img/Refresh.png"));
    refresh.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            populateTable();
        }
    });
    header.addComponent(refresh);
    return header;
}
项目:osc-core    文件:AdvancedSettingsWindow.java   
public AdvancedSettingsWindow(BaseVCWindow baseVCWindow) throws Exception {
    this.baseVCWindow = baseVCWindow;
    createWindow(ADVANCED_SETTINGS_CAPTION);
    getComponentModel().setOkClickedListener(new ClickListener() {
        /**
         *
         */
        private static final long serialVersionUID = -8326846388022657979L;

        @Override
        public void buttonClick(ClickEvent event) {
            submitForm();

        }
    });
}
项目:osc-core    文件:DeleteWindowUtil.java   
@SuppressWarnings("serial")
public static void deleteVirtualSystem(final ForceDeleteVirtualSystemServiceApi forceDeleteVsService,
        final VirtualSystemDto dto, ServerApi server) {

    final VmidcWindow<OkCancelButtonModel> deleteWindow = WindowUtil
            .createAlertWindow("Force Delete Virtual System", "Force Delete Virtual System - " + dto.getName());

    deleteWindow.getComponentModel().setOkClickedListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                BaseJobResponse response = forceDeleteVsService.dispatch(new BaseDeleteRequest(dto.getId(), true));
                deleteWindow.close();
                if (response.getJobId() != null) {
                    ViewUtil.showJobNotification(response.getJobId(), server);
                }
            } catch (Exception e) {
                ViewUtil.iscNotification(e.getMessage(), Notification.Type.ERROR_MESSAGE);
            }
        }
    });

    ViewUtil.addWindow(deleteWindow);
}
项目:osc-core    文件:DeleteWindowUtil.java   
public static void deleteAlert(final DeleteAlertServiceApi deleteAlertService, final List<AlertDto> dtoList) {
    final VmidcWindow<OkCancelButtonModel> deleteWindow = WindowUtil.createAlertWindow("Delete Alert",
            "Delete selected alert(s)? ");

    deleteWindow.getComponentModel().setOkClickedListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {

            try {
                AlertRequest req = new AlertRequest();
                req.setDtoList(dtoList);
                deleteAlertService.dispatch(req);
                deleteWindow.close();
                log.info("Delete Alert(s) Successful!");
            } catch (Exception e) {
                log.error("Failed to delete Alert(s)", e);
                ViewUtil.iscNotification("Failed to delete Alert(s).", Notification.Type.WARNING_MESSAGE);
            }
        }
    });

    ViewUtil.addWindow(deleteWindow);
}
项目:osc-core    文件:UpdateDistributedApplianceWindow.java   
private VmidcWindow<OkCancelButtonModel> getUpgradeAlertWindow() {
    String fromVersion = this.currentDAObject.getApplianceModel() + "-" + this.currentDAObject.getApplianceSoftwareVersionName();
    String toVersion = ((ApplianceModelSoftwareVersionDto) this.applianceDefinition.getValue()).getName();
    final VmidcWindow<OkCancelButtonModel> upgradeAlert = WindowUtil.createAlertWindow(
            VmidcMessages.getString(VmidcMessages_.DA_UPGRADE_WARNING_TITLE),
            VmidcMessages.getString(VmidcMessages_.DA_UPGRADE_WARNING, fromVersion, toVersion));
    upgradeAlert.getComponentModel().setOkClickedListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            upgradeAlert.close();
            submitRequest();
        }
    });
    return upgradeAlert;
}
项目:imotSpot    文件:DashboardView.java   
private Component buildEditButton() {
    Button result = new Button();
    result.setId(EDIT_ID);
    result.setIcon(FontAwesome.EDIT);
    result.addStyleName("icon-edit");
    result.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    result.setDescription("Add Imot");
    result.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            getUI().addWindow(
                    new AddingImot(DashboardView.this, titleLabel
                            .getValue()));
        }
    });
    return result;
}
项目:imotSpot    文件:ReportsView.java   
private Component buildCreateBox() {
    VerticalLayout createBox = new VerticalLayout();
    createBox.setWidth(160.0f, Unit.PIXELS);
    createBox.setHeight(200.0f, Unit.PIXELS);
    createBox.addStyleName("create");

    Button create = new Button("Create New");
    create.addStyleName(ValoTheme.BUTTON_PRIMARY);
    create.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            addReport(ReportType.EMPTY, null);
        }
    });

    createBox.addComponent(create);
    createBox.setComponentAlignment(create, Alignment.MIDDLE_CENTER);
    return createBox;
}
项目:imotSpot    文件:DashboardMenu.java   
private Component buildToggleButton() {
    Button valoMenuToggleButton = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) {
                getCompositionRoot().removeStyleName(STYLE_VISIBLE);
            } else {
                getCompositionRoot().addStyleName(STYLE_VISIBLE);
            }
        }
    });
    valoMenuToggleButton.setIcon(FontAwesome.LIST);
    valoMenuToggleButton.addStyleName("valo-menu-toggle");
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_SMALL);
    return valoMenuToggleButton;
}
项目:imotSpot    文件:DashboardMenu.java   
public ValoMenuItemButton(final DashboardViewType view) {
    this.view = view;
    setPrimaryStyleName("valo-menu-item");
    setIcon(view.getIcon());
    setCaption(view.getViewName().substring(0, 1).toUpperCase()
            + view.getViewName().substring(1));
    DashboardEventBus.register(this);
    addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            UI.getCurrent().getNavigator()
                    .navigateTo(view.getViewName());
        }
    });

}
项目:imotSpot    文件:MovieDetailsWindow.java   
private Component buildFooter() {
    HorizontalLayout footer = new HorizontalLayout();
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    footer.setWidth(100.0f, Unit.PERCENTAGE);

    Button ok = new Button("Close");
    ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
    ok.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            close();
        }
    });
    ok.focus();
    footer.addComponent(ok);
    footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);
    return footer;
}
项目:vaadin-vertx-samples    文件:DashboardView.java   
private Component buildEditButton() {
    Button result = new Button();
    result.setId(EDIT_ID);
    result.setIcon(FontAwesome.EDIT);
    result.addStyleName("icon-edit");
    result.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    result.setDescription("Edit Dashboard");
    result.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            getUI().addWindow(
                    new DashboardEdit(DashboardView.this, titleLabel
                            .getValue()));
        }
    });
    return result;
}
项目:vaadin-vertx-samples    文件:ReportsView.java   
private Component buildCreateBox() {
    VerticalLayout createBox = new VerticalLayout();
    createBox.setWidth(160.0f, Unit.PIXELS);
    createBox.setHeight(200.0f, Unit.PIXELS);
    createBox.addStyleName("create");

    Button create = new Button("Create New");
    create.addStyleName(ValoTheme.BUTTON_PRIMARY);
    create.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            addReport(ReportType.EMPTY, null);
        }
    });

    createBox.addComponent(create);
    createBox.setComponentAlignment(create, Alignment.MIDDLE_CENTER);
    return createBox;
}
项目:vaadin-vertx-samples    文件:DashboardMenu.java   
private Component buildToggleButton() {
    Button valoMenuToggleButton = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) {
                getCompositionRoot().removeStyleName(STYLE_VISIBLE);
            } else {
                getCompositionRoot().addStyleName(STYLE_VISIBLE);
            }
        }
    });
    valoMenuToggleButton.setIcon(FontAwesome.LIST);
    valoMenuToggleButton.addStyleName("valo-menu-toggle");
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_SMALL);
    return valoMenuToggleButton;
}
项目:vaadin-vertx-samples    文件:DashboardMenu.java   
public ValoMenuItemButton(final DashboardViewType view) {
    this.view = view;
    setPrimaryStyleName("valo-menu-item");
    setIcon(view.getIcon());
    setCaption(view.getViewName().substring(0, 1).toUpperCase()
            + view.getViewName().substring(1));
    DashboardEventBus.register(this);
    addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            UI.getCurrent().getNavigator()
                    .navigateTo(view.getViewName());
        }
    });

}
项目:vaadin-vertx-samples    文件:MovieDetailsWindow.java   
private Component buildFooter() {
    HorizontalLayout footer = new HorizontalLayout();
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    footer.setWidth(100.0f, Unit.PERCENTAGE);

    Button ok = new Button("Close");
    ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
    ok.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            close();
        }
    });
    ok.focus();
    footer.addComponent(ok);
    footer.setComponentAlignment(ok, Alignment.TOP_RIGHT);
    return footer;
}
项目:businesshorizon2    文件:InitialScreenViewImpl.java   
/**
 * Diese Methode fügt einen Button zur Button-Leiste (topRightLayout) an der gewünschten Stelle hinzu
 * und löscht den Button der vorher an dieser Stelle war.
 *
 * @param button
 * : Der Button
 * @param index
 * : Stelle, wo der Button gesetzt werden soll
 * @param listener
 * : Der ClickListener
 * @author Marco Glaser
 */
public void setTopButton(TopBarButton button, int index, ClickListener listener){
    if(listener != null){
        button.getButtonComponent().addListener(listener);
    }
    int maxIndex = topRightLayout.getComponentCount() - 1; //1 abziehen wegen dem Spacing rechts
    if(index < maxIndex){
        Component comp = topRightLayout.getComponent(index);
        if(comp != null){
            topRightLayout.replaceComponent(comp, button);
        }

    }
    else{
        topRightLayout.addComponent(button, index);;
    }
    topRightLayout.setComponentAlignment(button, Alignment.MIDDLE_CENTER);
}
项目:metasfresh-procurement-webui    文件:WeeklyDetailedReportingView.java   
private final Button createTrendButton(final Trend trend)
{
    final Button button = new Button();
    button.setStyleName("no-decoration");
    Trend.applyStyleName(button, trend);
    button.setIcon(trend.getIcon());
    button.addClickListener(new ClickListener()
    {
        @Override
        public void buttonClick(final ClickEvent event)
        {
            onNextWeekTrendButtonPressed(trend);
        }
    });

    trend2button.put(trend, button);
    return button;
}
项目:minimal-j    文件:Vaadin.java   
public VaadinDecoration(String title, Component content, boolean showMinimize, ClickListener closeListener) {
    setMargin(false);
    setSpacing(false);

    HorizontalLayout titleBar = new HorizontalLayout();
    titleBar.setMargin(false);
    titleBar.setWidth("100%");
    Label label = new Label(title);
    titleBar.addComponent(label);
    titleBar.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
    titleBar.setExpandRatio(label, 1.0f);

    Button closeButton = new Button(VaadinIcons.CLOSE);
    closeButton.addStyleName("mjButton");
    closeButton.addClickListener(closeListener);
    titleBar.addComponent(closeButton);
    titleBar.setComponentAlignment(closeButton, Alignment.MIDDLE_RIGHT);

    addComponent(titleBar);
    addComponent(content);
    setExpandRatio(content, 1.0f);
}
项目:incubator-openaz    文件:ObadviceEditorWindow.java   
private void initializeButtons() {
    this.saveButton.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                fieldGroup.commit();
                self.isSaved = true;
                self.close();
            } catch (CommitException e) {
                e.printStackTrace();
            }
        }

    });
}
项目:incubator-openaz    文件:ColumnSelectionWindow.java   
protected void initializeButton() {
    self.buttonSave.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                //
                // Commit
                //
                self.textFieldColumn.commit();
                //
                // If we get here, the value is valid.
                // Mark ourselves as saved and close the window
                //
                self.isSaved = true;
                self.close();
            } catch (SourceException | InvalidValueException e) { //NOPMD
                //
                // Vaadin will display error
                //
            }
        }
    });
}
项目:incubator-openaz    文件:SQLPIPConfigurationComponent.java   
protected void initializeButtons() {
    this.buttonTest.setImmediate(true);
    this.buttonTest.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            Object id = self.comboBoxConnectionType.getValue();
            if (id == null) {
                logger.warn("No combo box selection");
                return;
            }               
            if (id.toString().equals(SQL_TYPE_JDBC)) {
                self.testJDBCConnection();
            } else if (id.toString().equals(SQL_TYPE_JNDI)) {
                self.testJNDIConnection();
            }
        }           
    });
}
项目:VaadHL    文件:BaseWindow.java   
/**
 * Displays the window content in case the window cannot be open due to
 * permissions.
 * 
 * @param msg
 *            the message to display.
 */
protected void setNotPermitedContent(String msg) {

    Button btClose = null;
    btClose = new Button(getI18S("btClose"));
    btClose.addClickListener(new ClickListener() {

        private static final long serialVersionUID = -1610492227149824003L;

        @Override
        public void buttonClick(ClickEvent event) {
            BaseWindow.super.close();
        }
    });
    VerticalLayout p = new VerticalLayout();
    p.addComponent(new Label(msg));
    p.addComponent(btClose);
    p.setMargin(true);
    setContent(p);
}
项目:VaadHL    文件:Action.java   
/**
 * Detach the action run listener from the object.
 * 
 * @param o
 */
protected void detachLsnr(Object o) {
    if (o == null)
        return;
    ObjInfo objInfo = attached.get(o);
    if (objInfo == null)
        return;

    if (o instanceof Button) {
        Button.ClickListener al = (ClickListener) objInfo.listener;
        if (al != null)
            ((Button) o).removeClickListener(al);
    } else if (o instanceof MenuItem) {
        ((MenuItem) o).setCommand(null);
    } else if (o instanceof ContextMenuItem) {
        ((ContextMenuItem) o)
                .removeItemClickListener((ContextMenuItemClickListener) objInfo.listener);
    }
}
项目:SecureBPMN    文件:TaskDetailPanel.java   
protected void initParentTaskLink() {
  if (task.getParentTaskId() != null) {
    final Task parentTask = taskService.createTaskQuery()
      .taskId(task.getParentTaskId()).singleResult();

    Button showParentTaskButton = new Button(i18nManager.getMessage(
            Messages.TASK_SUBTASK_OF_PARENT_TASK, parentTask.getName()));
    showParentTaskButton.addStyleName(Reindeer.BUTTON_LINK);
    showParentTaskButton.addListener(new ClickListener() {
      public void buttonClick(ClickEvent event) {
        viewManager.showTaskPage(parentTask.getId());
      }
    });

    centralLayout.addComponent(showParentTaskButton);
    addEmptySpace(centralLayout);
  }
}
项目:SecureBPMN    文件:AlfrescoProcessInstanceTableItem.java   
public AlfrescoProcessInstanceTableItem(final ProcessInstance processInstance) {
  addItemProperty(PROPERTY_ID, new ObjectProperty<String>(processInstance.getId(), String.class));

  if (processInstance.getBusinessKey() != null) {
    addItemProperty(PROPERTY_BUSINESSKEY, new ObjectProperty<String>(processInstance.getBusinessKey(), String.class));
  }

  Button viewProcessInstanceButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_ACTION_VIEW));
  viewProcessInstanceButton.addStyleName(Reindeer.BUTTON_LINK);
  viewProcessInstanceButton.addListener(new ClickListener() {
    private static final long serialVersionUID = 1L;
    public void buttonClick(ClickEvent event) {
      ExplorerApp.get().getViewManager().showProcessInstancePage(processInstance.getId());
    }
  });

  viewProcessInstanceButton.setIcon(Images.MAGNIFIER_16);
  addItemProperty(PROPERTY_ACTIONS, new ObjectProperty<Component>(viewProcessInstanceButton, Component.class));
}
项目:SecureBPMN    文件:AccountSelectionPopup.java   
protected void initAlfrescoComponent() {
  alfrescoForm = new Form();
  alfrescoForm.setDescription(i18nManager.getMessage(Messages.ALFRESCO_DESCRIPTION));

  final TextField alfrescoServer = new TextField(i18nManager.getMessage(Messages.ALFRESCO_SERVER));
  alfrescoForm.getLayout().addComponent(alfrescoServer);

  final TextField alfrescoUserName = new TextField(i18nManager.getMessage(Messages.ALFRESCO_USERNAME));
  alfrescoForm.getLayout().addComponent(alfrescoUserName);

  final PasswordField alfrescoPassword = new PasswordField(i18nManager.getMessage(Messages.ALFRESCO_PASSWORD));
  alfrescoForm.getLayout().addComponent(alfrescoPassword);

  // Matching listener
  alfrescoClickListener = new ClickListener() {
    public void buttonClick(ClickEvent event) {
      Map<String, Object> accountDetails = createAccountDetails(
              "alfresco", 
              alfrescoUserName.getValue().toString(), 
              alfrescoPassword.getValue().toString(),
              "server", alfrescoServer.getValue().toString()
              ); 
      fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails));
    }
  };
}
项目:SecureBPMN    文件:ChangePasswordPopupWindow.java   
protected void initChangePasswordButton() {
  errorLabel = new Label("&nbsp", Label.CONTENT_XHTML);
  errorLabel.addStyleName(Reindeer.LABEL_SMALL);
  errorLabel.addStyleName(ExplorerLayout.STYLE_LABEL_RED);
  layout.addComponent(errorLabel);

  Button changePasswordButton = new Button(i18nManager.getMessage(Messages.PASSWORD_CHANGE));
  layout.addComponent(changePasswordButton);
  layout.setComponentAlignment(changePasswordButton, Alignment.MIDDLE_CENTER);

  changePasswordButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
      handlePasswordChange();
    }
  });
}
项目:SecureBPMN    文件:UserProfileLink.java   
protected void initPicture(IdentityService identityService, boolean renderPicture, final String userName) {
  if(renderPicture) {
    Picture picture = identityService.getUserPicture(userName);
    if(picture != null) {
      Resource imageResource = new StreamResource(new InputStreamStreamSource(picture.getInputStream()), 
        userName + picture.getMimeType(), ExplorerApp.get());

      Embedded image = new Embedded(null, imageResource);
      image.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
      image.setType(Embedded.TYPE_IMAGE);
      image.setHeight(30, Embedded.UNITS_PIXELS);
      image.setWidth(30, Embedded.UNITS_PIXELS);
      image.addListener(new MouseEvents.ClickListener() {
        private static final long serialVersionUID = 7341560240277898495L;
        public void click(com.vaadin.event.MouseEvents.ClickEvent event) {
          viewManager.showProfilePopup(userName);
        }
      });

      addComponent(image);
      setComponentAlignment(image, Alignment.MIDDLE_LEFT);
    } else {
     // TODO: what when no image is available?
    }
  }
}
项目:SecureBPMN    文件:SelectUsersPopupWindow.java   
protected void initSelectUserButton() {
  selectUserButton = new Button(">");

  selectUserButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
      for (String selectedItemId : (Set<String>) matchingUsersTable.getValue()) {
        // Remove from left table
        Item originalItem = matchingUsersTable.getItem(selectedItemId);

        // And put it in right table
        selectUser(selectedItemId, (String) originalItem.getItemProperty("userName").getValue());

        // Remove from left table (must be done on the end, or item properties will be inaccessible) 
        matchingUsersTable.removeItem(selectedItemId);
      }
    }
  });

  userSelectionLayout.addComponent(selectUserButton);
  userSelectionLayout.setComponentAlignment(selectUserButton, Alignment.MIDDLE_CENTER);
}
项目:SecureBPMN    文件:SelectUsersPopupWindow.java   
protected void initDoneButton() {
  doneButton = new Button("Done");

  doneButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
      // Fire event such that depending UI's can be updated
      fireEvent(new SubmitEvent(doneButton, SubmitEvent.SUBMITTED));

      // close popup window
      close();
    }
  });

  addComponent(doneButton);
  windowLayout.setComponentAlignment(doneButton, Alignment.MIDDLE_RIGHT);
}
项目:SecureBPMN    文件:UrlAttachmentRenderer.java   
public Component getOverviewComponent(final Attachment attachment, final RelatedContentComponent parent) {

  // If the attachment has no description, overview link is link to actual page
  // instead of showing popup with details.
  if(attachment.getDescription() != null && !"".equals(attachment.getDescription())) {
    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;
  } else {
    return new Link(attachment.getName(), new ExternalResource(attachment.getUrl()));
  }
}
项目:SecureBPMN    文件:JobDetailPanel.java   
protected void addActions() {
  Button executeButton = new Button(i18nManager.getMessage(Messages.JOB_EXECUTE));
  executeButton.setIcon(Images.EXECUTE);
  executeButton.addListener(new ClickListener() {
    private static final long serialVersionUID = 1L;
    public void buttonClick(ClickEvent event) {
      try {
        managementService.executeJob(job.getId());
        jobPage.refreshSelectNext();
      } catch (ActivitiException ae) {
        String errorMessage = ae.getMessage() + (ae.getCause() != null ? " (" + ae.getCause().getClass().getName() + ")" : "");
        notificationManager.showErrorNotification(Messages.JOB_ERROR, errorMessage);

        // Refresh the current job
        jobPage.refreshCurrentJobDetails();
      }
    }
  });

  jobPage.getToolBar().removeAllButtons();
  jobPage.getToolBar().addButton(executeButton);
}
项目:SecureBPMN    文件:NewUserPopupWindow.java   
protected void initCreateButton() {
  HorizontalLayout buttonLayout = new HorizontalLayout();
  buttonLayout.setWidth(100, UNITS_PERCENTAGE);
  form.getFooter().setWidth(100, UNITS_PERCENTAGE);
  form.getFooter().addComponent(buttonLayout);

  Button createButton = new Button(i18nManager.getMessage(Messages.USER_CREATE));
  buttonLayout.addComponent(createButton);
  buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);

  createButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
      handleFormSubmit();
    }
  });
}
项目:SecureBPMN    文件:GroupsForUserQuery.java   
public GroupItem(final Group group) {
  Button idButton = new Button(group.getId());
  idButton.addStyleName(Reindeer.BUTTON_LINK);
  idButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
      ExplorerApp.get().getViewManager().showGroupPage(group.getId());
    }
  });
  addItemProperty("id", new ObjectProperty<Button>(idButton, Button.class));

  if (group.getName() != null) {
    addItemProperty("name", new ObjectProperty<String>(group.getName(), String.class));
  }
  if (group.getType() != null) {
    addItemProperty("type", new ObjectProperty<String>(group.getType(), String.class));
  }

  Embedded deleteIcon = new Embedded(null, Images.DELETE);
  deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
  deleteIcon.addListener(new DeleteMembershipListener(identityService, userId, group.getId(), userDetailPanel));
  addItemProperty("actions", new ObjectProperty<Embedded>(deleteIcon, Embedded.class));
}
项目:SecureBPMN    文件:NewGroupPopupWindow.java   
protected void initCreateButton() {
  HorizontalLayout buttonLayout = new HorizontalLayout();
  buttonLayout.setWidth(100, UNITS_PERCENTAGE);
  form.getFooter().setWidth(100, UNITS_PERCENTAGE);
  form.getFooter().addComponent(buttonLayout);

  Button createButton = new Button(i18nManager.getMessage(Messages.GROUP_CREATE));
  buttonLayout.addComponent(createButton);
  buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);

  createButton.addListener(new ClickListener() {
    public void buttonClick(ClickEvent event) {
    handleFormSubmit();
    }
  });
}