當前位置: 首頁>>代碼示例>>Java>>正文


Java CustomComponent類代碼示例

本文整理匯總了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;
  }
 
開發者ID:Java-Publications,項目名稱:javamagazin-009-microkernel,代碼行數:18,代碼來源:MainView.java

示例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);
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:18,代碼來源:ToolbarLayout.java

示例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);
}
 
開發者ID:Java-Publications,項目名稱:vaadin-016-helloworld-14,代碼行數:16,代碼來源:MenuComponent.java

示例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());
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:28,代碼來源:AttributeSelectionWindow.java

示例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! ");
    }
}
 
開發者ID:antoniomaria,項目名稱:gazpachoquest,代碼行數:12,代碼來源:GazpachoViewDisplay.java

示例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;
}
 
開發者ID:UnifiedViews,項目名稱:Plugin-DevEnv,代碼行數:11,代碼來源:ConfigCopyPaste.java

示例7: removeToolbar

import com.vaadin.ui.CustomComponent; //導入依賴的package包/類
@Override
public void removeToolbar(CustomComponent toolbar) {
	this.removeComponent(toolbar);
	
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:6,代碼來源:ToolbarLayout.java

示例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);
}
 
開發者ID:unicesi,項目名稱:academ,代碼行數:8,代碼來源:PanelContenido.java

示例9: removeToolbar

import com.vaadin.ui.CustomComponent; //導入依賴的package包/類
public void removeToolbar(CustomComponent toolbar); 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:2,代碼來源:IToolbarLayout.java


注:本文中的com.vaadin.ui.CustomComponent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。