Java 类com.vaadin.ui.CustomComponent 实例源码

项目:javamagazin-009-microkernel    文件:MainView.java   
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;
  }
项目:konekti    文件:ToolbarLayout.java   
@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);
}
项目:vaadin-016-helloworld-14    文件:MenuComponent.java   
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);
}
项目:incubator-openaz    文件:AttributeSelectionWindow.java   
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());
}
项目:XACML    文件:AttributeSelectionWindow.java   
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());
}
项目:gazpachoquest    文件:GazpachoViewDisplay.java   
@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! ");
    }
}
项目:Plugin-DevEnv    文件:ConfigCopyPaste.java   
/**
 *
 * @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;
}
项目:konekti    文件:ToolbarLayout.java   
@Override
public void removeToolbar(CustomComponent toolbar) {
    this.removeComponent(toolbar);

}
项目:academ    文件:PanelContenido.java   
/***
 * Agrega un componente al panel de contenido.
 * @param component
 */
public void setContenido(CustomComponent component) {
    this.mainLayout.addComponent(component);
}
项目:academ    文件:PanelContenido.java   
/***
 * Agrega un componente al panel de contenido en una posición dada.
 * @param component El componente a agregar.
 * @param cssPosition La posición del componente.
 */
public void setContenido(CustomComponent component, String cssPosition) {
    this.mainLayout.addComponent(component, cssPosition);
}
项目:academ    文件:PanelContenido.java   
/***
 * Agrega un componente al panel de contenido.
 * @param component
 */
public void setContenido(CustomComponent component) {
    this.mainLayout.addComponent(component);
}
项目:academ    文件:PanelContenido.java   
/***
 * Agrega un componente al panel de contenido en una posición dada.
 * @param component El componente a agregar.
 * @param cssPosition La posición del componente.
 */
public void setContenido(CustomComponent component, String cssPosition) {
    this.mainLayout.addComponent(component, cssPosition);
}
项目:konekti    文件:IToolbarLayout.java   
public void removeToolbar(CustomComponent toolbar);