com.extjs.gxt.ui.client.widget.button.Button.addSelectionListener()方法的使用及代码示例

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

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

Button.addSelectionListener介绍

[英]Adds a selection listener.
[中]添加一个选择侦听器。

代码示例

代码示例来源:origin: com.extjs/gxt

/**
 * Creates a new button with the given HTML, icon and specified selection
 * listener.
 * 
 * @param html the button text as HTML
 * @param icon the icon
 * @param listener the selection listener
 */
public Button(String html, AbstractImagePrototype icon, SelectionListener<ButtonEvent> listener) {
 this(html, icon);
 addSelectionListener(listener);
}

代码示例来源:origin: com.extjs/gxt

/**
 * Creates a new button with the given HTML and specified selection listener.
 * 
 * @param html the button's text as HTML
 * @param listener the selection listener
 */
public Button(String html, SelectionListener<ButtonEvent> listener) {
 this(html);
 addSelectionListener(listener);
}

代码示例来源:origin: com.isotrol.impe3/impe3-gui-common

/**
 * Creates a "Save" button.<br/>
 * 
 * @param listener
 * @return the created button
 */
public Button createSaveButton(SelectionListener<ButtonEvent> listener) {
  Button button = new Button(messages.labelSave());
  button.setIconStyle(styles.iSave());
  button.addSelectionListener(listener);
  return button;
}

代码示例来源:origin: bedatadriven/activityinfo

private void addButtons() {
  setButtons(Dialog.OKCANCEL);
  getButtonById(Dialog.OK).setText(I18N.CONSTANTS.export());
  getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent buttonEvent) {
      String optionSelected = optionGroup.getValue().getValueAttribute();
      hide();
      if (callback != null) {
        callback.apply(optionSelected);
      }
    }
  });
  getButtonById(Dialog.CANCEL).addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent buttonEvent) {
      hide();
    }
  });
}

代码示例来源:origin: com.isotrol.impe3/impe3-gui-common

/**
 * Creates a icon "Save and close" button.<br/>
 * 
 * @param listener
 * @return the created button
 */
public Button createSaveAndCloseButton(SelectionListener<ButtonEvent> listener) {
  Button button = new Button(messages.labelSaveQuit());
  button.setIconStyle(styles.iSaveQuit());
  button.addSelectionListener(listener);
  return button;
}

代码示例来源:origin: com.isotrol.impe3/impe3-gui-common

/**
 * Creates a generic Button for the specified params.<br/> Does not add it to any container.<br/>
 * @param label text to display on the button
 * @param tooltip tooltip shown when hovering the button. May be <code>null</code>
 * @param style the button style. May be <code>null</code>
 * @param listener button selection listener. May be <code>null</code>
 * @return
 */
public Button createGenericButton(String label, String tooltip, String style,
  SelectionListener<ButtonEvent> listener) {
  Button b = new Button(label);
  if (!Util.emptyString(tooltip)) {
    b.setToolTip(tooltip);
  }
  if (style != null) {
    b.setIconStyle(style);
  }
  if (listener != null) {
    b.addSelectionListener(listener);
  }
  return b;
}

代码示例来源:origin: com.extjs/gxt

Button okBtn = new Button(okText);
okBtn.setItemId(OK);
okBtn.addSelectionListener(l);
setFocusWidget(okBtn);
addButton(okBtn);
Button yesBtn = new Button(yesText);
yesBtn.setItemId(YES);
yesBtn.addSelectionListener(l);
setFocusWidget(yesBtn);
addButton(yesBtn);
Button noBtn = new Button(noText);
noBtn.setItemId(NO);
noBtn.addSelectionListener(l);
setFocusWidget(noBtn);
addButton(noBtn);
Button cancelBtn = new Button(cancelText);
cancelBtn.setItemId(CANCEL);
cancelBtn.addSelectionListener(l);
setFocusWidget(cancelBtn);
addButton(cancelBtn);
Button closeBtn = new Button(closeText);
closeBtn.setItemId(CLOSE);
closeBtn.addSelectionListener(l);
addButton(closeBtn);

代码示例来源:origin: bedatadriven/activityinfo

@Override
protected void createButtons() {
  button = new Button();
  button.setText(I18N.CONSTANTS.cancel());
  button.addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent ce) {
      ExportDialog.this.canceled = true;
      bar.reset();
      hide();
    }
  });
  getButtonBar().add(button);
}

代码示例来源:origin: pl.touk/wonderful-security-lib

@Override
protected Component constructTopComponent() {
  ToolBar toolbar = new ToolBar();
  Button addNewGroup = new Button("Dodaj nową grupę");
  addNewGroup.setStyleName("icon-add");
  addNewGroup.addSelectionListener(new SelectionListener<ButtonEvent>() {
    public void componentSelected(ButtonEvent ce) {
      Dispatcher.get().dispatch(CREATE_NEW_GROUP);
    }
  });
  addNewGroup.setEnabled(ClientSecurity.hasPermission(WsecPermission.WSEC_ADD_GRP_BTN));
  toolbar.add(addNewGroup);
  return toolbar;
}

代码示例来源:origin: pl.touk/wonderful-security-lib

@Override
  protected Component constructTopComponent() {
    ToolBar toolbar = new ToolBar();

    Button addNewRole = new Button("Dodaj nową rolę");
    addNewRole.setIconStyle("icon-add");
    addNewRole.addSelectionListener(new SelectionListener<ButtonEvent>(){
      @Override
      public void componentSelected(ButtonEvent ce) {
        Dispatcher.get().dispatch(WsEvents.CREATE_NEW_ROLE);
      }

    });
    addNewRole.setEnabled(ClientSecurity.hasPermission(WsecPermission.WSEC_ADD_ROLE_BTN));
    toolbar.add( addNewRole);

    return toolbar;
  }
}

代码示例来源:origin: com.extjs/gxt

protected Button createButton(AbstractImagePrototype icon, final String tt, String toolTipTitle) {
 Button item = new Button() {
  @Override
  protected void afterRender() {
   super.afterRender();
   if (GXT.isAriaEnabled()) buttonEl.dom.setTitle(tt);
  }
 };
 item.setIcon(icon);
 item.setTabIndex(-1);
 ToolTipConfig cfg = new ToolTipConfig(toolTipTitle, tt);
 item.setToolTip(cfg);
 if (GXT.isAriaEnabled()) {
  item.setData("gxt-menutext", toolTipTitle);
 }
 item.addSelectionListener(btnListener);
 return item;
}

代码示例来源:origin: bedatadriven/activityinfo

setTopComponent(filterToolBar);
removeSelectedItem.setEnabled(false);
removeSelectedItem.addSelectionListener(new SelectionListener<ButtonEvent>() {
  @Override
  public void componentSelected(ButtonEvent ce) {

代码示例来源:origin: geoserver/geofence

/**
 * Adds the buttons.
 */
public void addButtons() {
  formPanel.setButtonAlign(HorizontalAlignment.LEFT);
  this.saveStatus = new SaveStaus();
  saveStatus.setAutoWidth(true);
  formPanel.getButtonBar().add(saveStatus);
  formPanel.getButtonBar().add(new FillToolItem());
  this.submit = new Button("SUBMIT");
  this.submit.addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent ce) {
      if (formPanel.isValid())
        execute();
    }
  });
  submit.setIconStyle("x-geofence-submit");
  formPanel.addButton(submit);
  this.cancel = new Button("CANCEL");
  this.cancel.addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent ce) {
      cancel();
    }
  });
  this.cancel.setIconStyle("x-geofence-cancel");
  formPanel.addButton(cancel);
}

代码示例来源:origin: bedatadriven/activityinfo

reportBar.getShareButton().addSelectionListener(new SelectionListener<ButtonEvent>() {
reportBar.getSwitchViewButton().addSelectionListener(new SelectionListener<ButtonEvent>() {

代码示例来源:origin: geoserver/geofence

reset.addSelectionListener(new SelectionListener<ButtonEvent>()
login.setIconStyle("x-geofence-login");
login.disable();
login.addSelectionListener(new SelectionListener<ButtonEvent>()

代码示例来源:origin: bedatadriven/activityinfo

dlg.setWidth(400);
dlg.setHeight(425);
dlg.getCancelButton().addSelectionListener(new SelectionListener<ButtonEvent>() {
  @Override
  public void componentSelected(ButtonEvent buttonEvent) {

代码示例来源:origin: bedatadriven/activityinfo

TableViewLinkPanel(final ResourceId formId) {
  this.panel = new ContentPanel();
  panel.setHeaderVisible(false);
  panel.setLayout(new CenterLayout());
  panel.setBodyStyle("font-family: sans-serif;");
  panel.add(new Text(I18N.CONSTANTS.pleaseUseNewDataEntry()));
  Button navigate = new Button(I18N.CONSTANTS.tryNewDataEntryInterface());
  navigate.setScale(Style.ButtonScale.LARGE);
  navigate.addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent buttonEvent) {
      App3.openNewTable(formId);
    }
  });
  panel.addButton(navigate);
  panel.setButtonAlign(Style.HorizontalAlignment.CENTER);
}

代码示例来源:origin: com.isotrol.impe3/impe3-gui-common

bEdit = new Button(buttonEditText);
  bEdit.disable();
  bEdit.addSelectionListener(new SelectionListener<ButtonEvent>() {
    @Override
    public void componentSelected(ButtonEvent ce) {
bRemove.addSelectionListener(new SelectionListener<ButtonEvent>() {
  @Override
  public void componentSelected(ButtonEvent ce) {
bRemoveAll.addSelectionListener(new SelectionListener<ButtonEvent>() {
  @Override
  public void componentSelected(ButtonEvent ce) {

代码示例来源:origin: bedatadriven/activityinfo

private static ContentPanel createRetryPanel(final Throwable caught, final ClickHandler retryCallback) {
    Button retryButton = new Button(I18N.CONSTANTS.retry());
    retryButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
      @Override
      public void componentSelected(ButtonEvent ce) {
        if (retryCallback != null) {
          retryCallback.onClick(null);
        }
      }
    });
    Text label = new Text(ExceptionOracle.getExplanation(caught));
    label.setWidth("50%");

    VBoxLayout layout = new VBoxLayout(VBoxLayout.VBoxLayoutAlign.CENTER);

    ContentPanel panel = new ContentPanel();
    panel.setHeaderVisible(false);
    panel.setLayout(layout);
    panel.add(label, new RowData(1, -1, new Margins(4)));
    panel.add(retryButton, new RowData(-1, -1, new Margins(4)));

    return panel;
  }
}

代码示例来源:origin: pl.touk/wonderful-security-lib

addNewUser.addSelectionListener(new SelectionListener<ButtonEvent>() {
  public void componentSelected(ButtonEvent ce) {
    Dispatcher.get().dispatch(WsEvents.CREATE_NEW_USER);

相关文章