本文整理汇总了Java中com.vaadin.ui.CustomComponent类的典型用法代码示例。如果您正苦于以下问题:Java CustomComponent类的具体用法?Java CustomComponent怎么用?Java CustomComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CustomComponent类属于com.vaadin.ui包,在下文中一共展示了CustomComponent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMenuButton
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
private Button createMenuButton(VaadinIcons icon, String caption, Supplier<CustomComponent> content) {
final Button button = new Button(caption, (e) -> {
contentLayout.removeAllComponents();
contentLayout.addComponent(content.get());
});
button.setIcon(icon);
button.addStyleName(ValoTheme.BUTTON_HUGE);
button.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
button.addStyleName(ValoTheme.MENU_ITEM);
button.setWidth("100%");
button.setId(buttonID().apply(MainView.class, caption));
return button;
}
示例2: getToolbars
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
@Override
public ComponentContainer[] getToolbars() {
List<CustomComponent> result = new ArrayList<CustomComponent>();
@SuppressWarnings("rawtypes")
Iterator iterator = this.getComponentIterator();
while(iterator.hasNext()){
Component component = (Component) iterator.next();
if(component instanceof CustomComponent){
result.add((CustomComponent) component);
}
}
CustomComponent[] resultToArray = new CustomComponent[result.size()];
return result.toArray(resultToArray);
}
示例3: createMenuButton
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
private Pair<String, Button> createMenuButton(VaadinIcons icon, String caption, Supplier<CustomComponent> content) {
final Button button = new Button(caption, (e) -> {
contentLayout.removeAllComponents();
contentLayout.addComponent(content.get());
});
button.setIcon(icon);
button.addStyleName(ValoTheme.BUTTON_HUGE);
button.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
button.addStyleName(ValoTheme.MENU_ITEM);
button.setWidth("100%");
button.setId(buttonID().apply(this.getClass(), caption));
return new Pair<>(mapToShiroRole(caption), button);
}
示例4: resetAttributeOption
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
protected void resetAttributeOption() {
//
// Remove GUI components from layout
//
this.horizontalLayoutAttribute.removeAllComponents();
this.currentComponent = null;
//
// Grab our currently selected option value
//
Object value = self.optionGroupAttribute.getValue();
//
// What is it set to?
//
if (value.toString().equals(ATTRIBUTE_OPTION_DICTIONARY)) {
this.currentComponent = new AttributeDictionarySelectorComponent(this.datatype, this.defaultAttribute);
} else if (value.toString().equals(ATTRIBUTE_OPTION_STANDARD)) {
this.currentComponent = new AttributeStandardSelectorComponent(this.datatype, this.defaultAttribute);
} else if (value.toString().equals(ATTRIBUTE_OPTION_INPUT)) {
this.currentComponent = new AttributeSimpleCreatorComponent(this.datatype, this.defaultAttribute);
} else {
logger.error("Unknown option" + value);
return;
}
this.currentComponent.addListener(this);
this.horizontalLayoutAttribute.addComponent((CustomComponent) this.currentComponent);
this.currentComponent.fireAttributeChanged(this.currentComponent.getAttribute());
}
示例5: showView
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
@Override
public void showView(View view) {
logger.debug("Displaying View " + view);
if (view instanceof CustomComponent) {
setContent((CustomComponent) view);
} else if (view instanceof ComponentContainer) {
setContent((ComponentContainer) view);
} else {
throw new IllegalStateException("View not supported! ");
}
}
示例6: create
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
/**
*
* @param ctx
* @return Tab that should be added to the dialog.
*/
public static CustomComponent create(UserDialogContext ctx) {
final ConfigCopyPasteTab tab = new ConfigCopyPasteTab(ctx);
tab.buildLayout();
return tab;
}
示例7: removeToolbar
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
@Override
public void removeToolbar(CustomComponent toolbar) {
this.removeComponent(toolbar);
}
示例8: setContenido
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
/***
* Agrega un componente al panel de contenido.
* @param component
*/
public void setContenido(CustomComponent component) {
this.mainLayout.addComponent(component);
}
示例9: removeToolbar
import com.vaadin.ui.CustomComponent; //导入依赖的package包/类
public void removeToolbar(CustomComponent toolbar);