当前位置: 首页>>代码示例>>Java>>正文


Java Button.setData方法代码示例

本文整理汇总了Java中com.vaadin.ui.Button.setData方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setData方法的具体用法?Java Button.setData怎么用?Java Button.setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Button的用法示例。


在下文中一共展示了Button.setData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDeleteEntry

import com.vaadin.ui.Button; //导入方法依赖的package包/类
private Button createDeleteEntry(CertificateBasicInfoModel certificateModel) {
    String removeBtnLabel = (certificateModel.isConnected()) ? "Force delete" : "Delete";
    final Button deleteArchiveButton = new Button(removeBtnLabel);
    deleteArchiveButton.setData(certificateModel);
    deleteArchiveButton.addClickListener(this.removeButtonListener);

    if (certificateModel.getAlias().contains(getString(KEYPAIR_INTERNAL_DISPLAY_ALIAS))) {
        deleteArchiveButton.setEnabled(false);
    }

    return deleteArchiveButton;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:13,代码来源:SslConfigurationLayout.java

示例2: addVoltronCommandsControls

import com.vaadin.ui.Button; //导入方法依赖的package包/类
private void addVoltronCommandsControls() {
  serverControls = new GridLayout();
  serverControls.setWidth(50, Unit.PERCENTAGE);
  voltronControlLayout.addComponentsAndExpand(serverControls);

  HorizontalLayout row1 = new HorizontalLayout();

  Button clusterStartBtn = new Button();
  clusterStartBtn.setCaption("Start all servers");
  clusterStartBtn.addStyleName("align-bottom");
  clusterStartBtn.addClickListener(event -> {
    for (Component child : serverControls) {
      if (child instanceof Button && "START".equals(child.getCaption()) && child.isEnabled()) {
        ((Button) child).click();
      }
    }
  });
  row1.addComponents(clusterStartBtn);

  if (kitAwareClassLoaderDelegator.isEEKit()) {
    clusterNameTF = new TextField();
    clusterNameTF.setCaption("Cluster name");
    clusterNameTF.setValue("MyCluster");

    Button clusterConfigBtn = new Button();
    clusterConfigBtn.addStyleName("align-bottom");
    clusterConfigBtn.setCaption("Configure");
    clusterConfigBtn.setData("configure");
    clusterConfigBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterReConfigBtn = new Button();
    clusterReConfigBtn.addStyleName("align-bottom");
    clusterReConfigBtn.setCaption("Reconfigure");
    clusterReConfigBtn.setData("reconfigure");
    clusterReConfigBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterBackupBtn = new Button();
    clusterBackupBtn.addStyleName("align-bottom");
    clusterBackupBtn.setCaption("Backup");
    clusterBackupBtn.setData("backup");
    clusterBackupBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterDumpBtn = new Button();
    clusterDumpBtn.addStyleName("align-bottom");
    clusterDumpBtn.setCaption("Dump");
    clusterDumpBtn.setData("dump");
    clusterDumpBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterStopBtn = new Button();
    clusterStopBtn.addStyleName("align-bottom");
    clusterStopBtn.setCaption("Stop cluster");
    clusterStopBtn.setData("stop");
    clusterStopBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    row1.addComponents(clusterNameTF, clusterConfigBtn, clusterReConfigBtn, clusterBackupBtn, clusterDumpBtn, clusterStopBtn);
  }

  voltronControlLayout.addComponentsAndExpand(row1);

  consoles = new TabSheet();
  mainConsole = addConsole("Main", "main");
  voltronControlLayout.addComponentsAndExpand(consoles);
}
 
开发者ID:Terracotta-OSS,项目名称:tinypounder,代码行数:64,代码来源:TinyPounderMainUI.java

示例3: updateServerControls

import com.vaadin.ui.Button; //导入方法依赖的package包/类
private void updateServerControls() {
  int nStripes = serverGrid.getRows() - 1;
  int nServersPerStripe = serverGrid.getColumns() - 1;

  serverControls.removeAllComponents();
  serverControls.setRows(nStripes * nServersPerStripe);
  serverControls.setColumns(5);

  for (int i = consoles.getComponentCount() - 1; i > 0; i--) {
    consoles.removeTab(consoles.getTab(i));
  }

  for (int stripeId = 1; stripeId < serverGrid.getRows(); stripeId++) {
    String stripeName = "stripe-" + stripeId;

    for (int serverId = 1; serverId < serverGrid.getColumns(); serverId++) {
      FormLayout form = (FormLayout) serverGrid.getComponent(serverId, stripeId);
      if (form != null) {
        TextField serverNameTF = (TextField) form.getComponent(0);
        String serverName = serverNameTF.getValue();
        serverControls.addComponent(new Label(serverName));

        Button startBT = new Button();
        startBT.setCaption("START");
        startBT.setData(serverName);
        startBT.setStyleName("align-top");
        serverControls.addComponent(startBT);

        Button stopBT = new Button();
        stopBT.setEnabled(false);
        stopBT.setCaption("STOP");
        stopBT.setStyleName("align-top");
        stopBT.setData(serverName);
        serverControls.addComponent(stopBT);

        Label pid = new Label();
        serverControls.addComponent(pid);

        Label state = new Label();
        serverControls.addComponent(state);

        addConsole(serverName, stripeName + "-" + serverName);

        startBT.addClickListener((Button.ClickListener) event -> {
          startServer(stripeName, (String) event.getButton().getData(), startBT, stopBT, state, pid);
        });
        stopBT.addClickListener((Button.ClickListener) event -> {
          stopServer(stripeName, (String) event.getButton().getData(), stopBT);
        });
      }
    }
  }
}
 
开发者ID:Terracotta-OSS,项目名称:tinypounder,代码行数:54,代码来源:TinyPounderMainUI.java


注:本文中的com.vaadin.ui.Button.setData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。