com.vaadin.ui.CustomComponent Java Examples

The following examples show how to use com.vaadin.ui.CustomComponent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AttributeSelectionWindow.java    From XACML with MIT License 5 votes vote down vote up
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());
}
 
Example #2
Source File: GazpachoViewDisplay.java    From gazpachoquest with GNU General Public License v3.0 5 votes vote down vote up
@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! ");
    }
}