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

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

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

Button.setId介绍

暂无

代码示例

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

Button m1, m2, m3, m4;
m1.setId(1);
m2.setId(2);
m3.setId(3);
m4.setId(4);
m1.setOnTouchListener(this);
m2.setOnTouchListener(this);

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

@Override
 public View getView(int position, View convertView, ViewGroup parent) {
     View v = convertView;
     if (v == null) {
       LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
       v = vi.inflate(R.layout.row, null);
     }
     Button b = (Button) convertView.findViewById(R.id.button);
     // here the id
     b.setId(position);
     return v;
 }

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

LinearLayout container = (LinearLayout) findViewById(R.id.container);

for(int i=0; i<guess_world.length(); i++)
    {
      Button inputbox = new Button(context); //or inflate from xml
      inputbox.setId(i);
      // TODO: set width and height using LayoutParameters
      container.addView(inputbox);
    }

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

public Button addMoreButton(String text) {

  Button button = new Button(context);
  button.setId(buttonID);
  LinearLayout.LayoutParams buttonLayoutParams = new LinearLayout.LayoutParams(
      LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);  
  button LayoutParams.setMargins(10, 10, 10, 10); //Add this if you want margin of 10dp 
  button.setLayoutParams(buttonLayoutParams );
  buttonArrayList.add(button);
  buttonID++;
  return button;
}

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

View inflaterLayout;
 LinearLayout myLayout = (LinearLayout)findViewById(R.id.linearLayout2);      
 while (counter < 5) {
   inflaterLayout = LayoutInflater.from(getBaseContext()).inflate(R.layout.newplayerlayout, null);
   myLayout.addView(inflaterLayout); 
   Button testButton = (Button) myLayout.findViewById(R.id.button2);
   testButton.setId(testButtonArray[counter]);
   ((TextView) myLayout.findViewById(R.id.textView1)).setId(testTextArray[counter]);
   testButton.setOnClickListener(btnhandler); // Click Listener here
   counter++;
 }

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

private void addTableRow() {
final TableLayout table = (TableLayout) findViewById(R.id.my_table);
final TableRow tr = (TableRow) getLayoutInflater().inflate(R.layout.table_row_item, null);

// fill cell txt
TextView tv = (TextView) tr.findViewById(R.id.cell);
tv.setText("This is row"+i);
table.addView(tr);

Button btn=(Button) tr.findViewById(R.id.button1);
btn.setId(i);

registerForContextMenu(tr);

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

buttonList = new ArrayList<Button>();
 for (int i=0;i<5;i++){
   Button button = new Button(getApplicationContext());
   button.setOnClickListener(mThisButtonListener);
   button.setId(i);
   button.setTag(i);
   myLayout.addView(button);
   buttonList.add(button);
 }

代码示例来源:origin: uk.q3c.krail/krail

@Override
  protected void setIds() {
    super.setIds();
    buildReportBtn.setId(ID.getId(Optional.of("build report"), this, buildReportBtn));
  }
}

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

for(int i=0;i<totalGroups;i++)
{
  ImageView img;
  TextView tv;
  Button b;

  ... // set other properties of above components

  img.setId(i);
  tv.setId(i);
  b.setId(i);

  ... //handle all events on these components here only

  ... //add all components to your main layout
}

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

buttonList = new ArrayList<Button>();
 for (int i=0;i<2;i++){
   Button button = new Button(getApplicationContext());
   button.setOnClickListener(customListenner);
   button.setAnimation(anim);
   button.setId(i);
   button.setTag(i);
   myLayout.addView(button);
   buttonList.add(button);
 }

代码示例来源:origin: com.github.markash/components

public static Button DASHBOARD_EDIT(final String id, final ClickListener listener) {
    Button button =  ButtonBuilder.build(I8n.Button.EDIT, VaadinIcons.EDIT, listener, Style.Button.ICON_EDIT, ValoTheme.BUTTON_ICON_ONLY);
    button.setId(id);
    button.setDescription("Edit Dashboard");
    return button;
  }
}

代码示例来源:origin: uk.q3c.krail/krail

private void setIds() {
  setId(ID.getId(Optional.empty(), this));
  login_logout_Button.setId(ID.getId(Optional.empty(), this, login_logout_Button));
  usernameLabel.setId(ID.getId(Optional.empty(), this, usernameLabel));
}

代码示例来源:origin: org.opennms.features/vaadin-jmxconfiggenerator

public ButtonPanel(ClickListener listener) {
  next = UIHelper.createButton("", "next", Config.Icons.BUTTON_NEXT, listener);
  previous = UIHelper.createButton("", "previous", Config.Icons.BUTTON_PREVIOUS, listener);
  next.setId("next");
  previous.setId("previous");
  setMargin(true);
  setSpacing(true);
  addComponent(previous);
  addComponent(next);
}

代码示例来源:origin: OpenNMS/opennms

public ButtonPanel(ClickListener listener) {
  next = UIHelper.createButton("", "next", Config.Icons.BUTTON_NEXT, listener);
  previous = UIHelper.createButton("", "previous", Config.Icons.BUTTON_PREVIOUS, listener);
  next.setId("next");
  previous.setId("previous");
  setMargin(true);
  setSpacing(true);
  addComponent(previous);
  addComponent(next);
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

@Override
public void setDebugId(String id) {
  super.setDebugId(id);
  AppUI ui = AppUI.getCurrent();
  if (id != null && ui != null && ui.isPerformanceTestMode()) {
    TestIdManager testIdManager = ui.getTestIdManager();
    for (Map.Entry<Action, Button> entry : actionButtons.entrySet()) {
      Button button = entry.getValue();
      Action action = entry.getKey();
      button.setId(testIdManager.getTestId(id + "_" + action.getId()));
    }
  }
}

代码示例来源:origin: uk.q3c.krail/krail

@Override
protected void setIds() {
  super.setIds();
  submitButton.setId(ID.getId(Optional.empty(), this, submitButton));
  submitButton.setClickShortcut(ShortcutAction.KeyCode.ENTER);
  submitButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
  usernameBox.setId(ID.getId(Optional.of("username"), this, usernameBox));
  passwordBox.setId(ID.getId(Optional.of("password"), this, passwordBox));
  statusMsgLabel.setId(ID.getId(Optional.of("status"), this, statusMsgLabel));
  label.setId(ID.getId(Optional.of("label"), this, label));
}

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

private Object createDeleteButton(final Object itemId) {
  final Button deleteButton = SPUIComponentProvider.getButton("", "", "", "", true, FontAwesome.TRASH_O,
      SPUIButtonStyleNoBorderWithIcon.class);
  final String id = getEntityId(itemId);
  deleteButton.setId("delete.entity." + id);
  deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE));
  deleteButton.addClickListener(this::addDeleteButtonClickListener);
  return deleteButton;
}

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

private void buildSignInButton() {
  final String caption = isDemo ? i18n.getMessage("button.login.agreeandsignin")
      : i18n.getMessage("button.login.signin");
  signIn = new Button(caption);
  signIn.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL + " " + "login-button");
  signIn.setClickShortcut(KeyCode.ENTER);
  signIn.focus();
  signIn.setId("login-signin");
}

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

private void buildSignInButton() {
  final String caption = isDemo
      ? i18n.getMessage("button.login.agreeandsignin")
      : i18n.getMessage("button.login.signin");
  signIn = new Button(caption);
  signIn.addStyleName(ValoTheme.BUTTON_PRIMARY + " " + ValoTheme.BUTTON_SMALL + " " + "login-button");
  signIn.setClickShortcut(KeyCode.ENTER);
  signIn.focus();
  signIn.setId("login-signin");
}

代码示例来源:origin: org.rapidpm.vaadin/nano-vaadin-v08

public BasicTestUI() {
 label.setId(LABEL_ID);
 label.setValue(valueOf(counter));
 button.setId(BUTTON_ID);
 button.setCaption(BUTTON_ID);
 button.addClickListener(e -> label.setValue(valueOf(++counter)));
 setCompositionRoot(new VerticalLayout(button, label));
}

相关文章

微信公众号

最新文章

更多