本文整理汇总了Java中com.vaadin.ui.renderers.ButtonRenderer类的典型用法代码示例。如果您正苦于以下问题:Java ButtonRenderer类的具体用法?Java ButtonRenderer怎么用?Java ButtonRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ButtonRenderer类属于com.vaadin.ui.renderers包,在下文中一共展示了ButtonRenderer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addTestColumnButton
import com.vaadin.ui.renderers.ButtonRenderer; //导入依赖的package包/类
/**
* 添加按钮列
* @param pId
*/
private void addTestColumnButton(String pId) {
Grid.Column column = grid.addColumn(pId,String.class);
column.setWidth(100d);
column.setRenderer(new ButtonRenderer((ClickableRenderer.RendererClickListener) rendererClickEvent -> {
Object itemId = rendererClickEvent.getItemId();
Item item = grid.getContainerDataSource().getItem(itemId);
String ip = (String) item.getItemProperty("IP").getValue();
String port = (String) item.getItemProperty("端口").getValue();
boolean isConnected = DubboSwitchTool.isConnected(ip + ":" + port);
if (isConnected) {
Notification.show("连接成功!",Notification.Type.HUMANIZED_MESSAGE);
return;
}
Notification.show("连接失败!",Notification.Type.ERROR_MESSAGE);
}));
}
开发者ID:xburning,项目名称:dubbo-switch,代码行数:21,代码来源:ZookeeperConsumerManageUI.java
示例2: addColumnButton
import com.vaadin.ui.renderers.ButtonRenderer; //导入依赖的package包/类
/**
* 添加按钮列
* @param pId
*/
private void addColumnButton(String pId) {
Grid.Column column = grid.addColumn(pId,String.class);
column.setWidth(100d);
column.setRenderer(new ButtonRenderer((ClickableRenderer.RendererClickListener) rendererClickEvent -> {
Object itemId = rendererClickEvent.getItemId();
Item item = grid.getContainerDataSource().getItem(itemId);
Long appId = (Long) item.getItemProperty("序号").getValue();
String appName = (String) item.getItemProperty("应用名称").getValue();
if ("清理".equals(pId)) {
zookeeperAppClearUI.show(appId,appName);
UI.getCurrent().addWindow(zookeeperAppClearUI);
} else if ("切换".equals(pId)) {
zookeeperAppSwitchUI.show(appId,appName);
UI.getCurrent().addWindow(zookeeperAppSwitchUI);
}
}));
}
开发者ID:xburning,项目名称:dubbo-switch,代码行数:22,代码来源:ZookeeperAppManageUI.java
示例3: addViewColumnButton
import com.vaadin.ui.renderers.ButtonRenderer; //导入依赖的package包/类
/**
* 添加查看列
* @param pId
*/
private void addViewColumnButton(String pId) {
Grid.Column column = grid.addColumn(pId, String.class);
column.setWidth(100d);
column.setRenderer(new ButtonRenderer((ClickableRenderer.RendererClickListener) rendererClickEvent -> {
Object itemId = rendererClickEvent.getItemId();
Item item = grid.getContainerDataSource().getItem(itemId);
String appName = (String) item.getItemProperty("应用名称").getValue();
zookeeperAppViewUI.show(appName);
UI.getCurrent().addWindow(zookeeperAppViewUI);
}));
}
开发者ID:xburning,项目名称:dubbo-switch,代码行数:16,代码来源:ZookeeperAppManageUI.java
示例4: createImplementation
import com.vaadin.ui.renderers.ButtonRenderer; //导入依赖的package包/类
@Override
protected ButtonRenderer createImplementation() {
if (listener != null) {
return new ButtonRenderer(createClickListenerWrapper(listener), getNullRepresentation());
} else {
return new ButtonRenderer(getNullRepresentation());
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:9,代码来源:WebButtonRenderer.java
示例5: init
import com.vaadin.ui.renderers.ButtonRenderer; //导入依赖的package包/类
@PostConstruct
@SuppressWarnings("unchecked")
public void init() {
grid = new Grid();
grid.setEditorEnabled(true);
grid.setSizeFull();
TextField filter = new TextField();
filter.setInputPrompt(messages.get("filterLabel"));
filter.addTextChangeListener(event -> listEntities(event.getText()));
Button addNewButton = new Button(messages.get("newButtonLabel"), FontAwesome.PLUS);
HorizontalLayout actions = new HorizontalLayout(filter, addNewButton);
actions.setSpacing(true);
grid.removeAllColumns();
java.lang.reflect.Field[] fields = entityClass.getDeclaredFields();
for (java.lang.reflect.Field field : fields) {
if (null != field.getAnnotation(ListColumn.class)) {
grid.addColumn(field.getName());
}
}
Grid.Column editColumn = grid.addColumn(EDIT_PROPERTY_ID);
editColumn.setMaximumWidth(50.0);
editColumn.setHeaderCaption("");
editColumn.setRenderer(new ButtonRenderer(event ->
listeners.forEach(listener ->
listener.editItemClicked((T)event.getItemId()))));
addNewButton.addClickListener(event -> listeners.forEach(EntityListView.Listener::addNewClicked));
addComponent(actions);
addComponent(grid);
listeners.forEach(listener -> listener.viewInitialized(this));
refresh();
}
开发者ID:limbr-management,项目名称:limbr,代码行数:39,代码来源:EntityListViewImpl.java
示例6: getImplementation
import com.vaadin.ui.renderers.ButtonRenderer; //导入依赖的package包/类
@Override
public ButtonRenderer getImplementation() {
return (ButtonRenderer) super.getImplementation();
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:WebButtonRenderer.java
注:本文中的com.vaadin.ui.renderers.ButtonRenderer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论