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


Java Grid.setEditorEnabled方法代碼示例

本文整理匯總了Java中com.vaadin.ui.Grid.setEditorEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java Grid.setEditorEnabled方法的具體用法?Java Grid.setEditorEnabled怎麽用?Java Grid.setEditorEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.Grid的用法示例。


在下文中一共展示了Grid.setEditorEnabled方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildGrid

import com.vaadin.ui.Grid; //導入方法依賴的package包/類
protected void buildGrid() {
    grid = new Grid();
    grid.setSelectionMode(SelectionMode.NONE);
    grid.setSizeFull();
    grid.setEditorEnabled(!readOnly);
    container = new BeanItemContainer<Record>(Record.class);
    grid.setContainerDataSource(container);
    grid.setColumnOrder("entityName", "attributeName", "excelMapping");
    HeaderRow filterRow = grid.appendHeaderRow();
    addColumn("entityName", filterRow);
    addColumn("attributeName", filterRow);
    TextField tfExcelMapping = new TextField();
    tfExcelMapping.addBlurListener(e->saveExcelMappingSettings());
    tfExcelMapping.setWidth(100, Unit.PERCENTAGE);
    tfExcelMapping.setImmediate(true);
    grid.getColumn("excelMapping").setEditorField(tfExcelMapping).setExpandRatio(1);
    addShowPopulatedFilter("excelMapping", filterRow);
    grid.setEditorBuffered(false);
    addComponent(grid);
    setExpandRatio(grid, 1);
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:22,代碼來源:EditExcelReaderPanel.java

示例2: buildGrid

import com.vaadin.ui.Grid; //導入方法依賴的package包/類
protected void buildGrid() {
    grid = new Grid();
    grid.setEditorEnabled(true);
    
    grid.setSizeFull();
    grid.setSelectionMode(SelectionMode.SINGLE);
    grid.setColumns("projectName","newDeployName","newDeployVersion",
            "newDeployType","existingDeployName","existingDeployVersion",
            "existingDeployType","upgrade");        
    container = new BeanItemContainer<>(DeploymentLine.class);
    buildContainer();
    grid.setContainerDataSource(container);
    grid.sort("projectName", SortDirection.DESCENDING);        
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:15,代碼來源:ValidateFlowDeploymentPanel.java

示例3: buildGrid

import com.vaadin.ui.Grid; //導入方法依賴的package包/類
protected void buildGrid() {
    grid = new Grid();
    grid.setSelectionMode(SelectionMode.NONE);
    grid.setSizeFull();
    grid.setEditorEnabled(!readOnly);
    container = new BeanItemContainer<Record>(Record.class);
    grid.setContainerDataSource(container);
    grid.setColumns("entityName", "attributeName", "xpath");
    HeaderRow filterRow = grid.appendHeaderRow();

    addColumn("entityName", filterRow);

    addColumn("attributeName", filterRow);

    ComboBox combo = new ComboBox();
    combo.addValueChangeListener(e->saveXPathSettings());
    combo.setWidth(100, Unit.PERCENTAGE);
    combo.setImmediate(true);
    combo.setNewItemsAllowed(true);
    combo.setInvalidAllowed(true);
    combo.setTextInputAllowed(true);
    combo.setScrollToSelectedItem(true);
    combo.setFilteringMode(FilteringMode.CONTAINS);
    grid.getColumn("xpath").setEditorField(combo).setExpandRatio(1);
    addShowPopulatedFilter("xpath", filterRow);
    grid.setEditorBuffered(false);
    addComponent(grid);
    setExpandRatio(grid, 1);
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:30,代碼來源:EditXmlFormatPanel.java

示例4: GridAdaptor

import com.vaadin.ui.Grid; //導入方法依賴的package包/類
public GridAdaptor(Grid grid, Class<T> beanClass) {
    this.grid = grid;
    this.beanClass = beanClass;
    grid.setEditorEnabled(true);
    grid.addStyleName(id);

    Page.getCurrent().getStyles().add(cssHideButtonsForThisGrid);

}
 
開發者ID:tyl,項目名稱:field-binder,代碼行數:10,代碼來源:GridAdaptor.java

示例5: CheckBoxDemo

import com.vaadin.ui.Grid; //導入方法依賴的package包/類
public CheckBoxDemo() {		
	Random random = new Random(4837291937l);
	BeanItemContainer<SimplePojo> container = new BeanItemContainer<SimplePojo>(SimplePojo.class);
	SimplePojo bean1 = new SimplePojo(0, "Me", true, new Date(), BigDecimal.valueOf(random.nextDouble()*100), Double.valueOf(random.nextInt(5)), Integer.valueOf(random.nextInt(5)));
	SimplePojo bean2 = new SimplePojo(1, "You", false, new Date(), BigDecimal.valueOf(random.nextDouble()*100), Double.valueOf(random.nextInt(5)), Integer.valueOf(random.nextInt(5)));
	SimplePojo bean3 = new SimplePojo(2, "He", true, new Date(), BigDecimal.valueOf(random.nextDouble()*100), Double.valueOf(random.nextInt(5)), Integer.valueOf(random.nextInt(5)));
	container.addBean(bean1);
	container.addBean(bean2);
	container.addBean(bean3);
	byte[] image = Base64.decodeBase64(castle);
	bean1.setImage(image);
	bean2.setImage(image);
	bean3.setImage(image);
	
	Grid grid = new Grid(container);
	grid.setColumns("description","yes","truth","date","number","image");
	grid.setSizeFull();
	grid.setEditorEnabled(true);
	grid.setEditorBuffered(false);
	Grid.Column yes = grid.getColumn("yes");
	yes.setRenderer(new CheckboxRenderer());
	yes.setEditable(true);
	grid.getColumn("image").setEditable(false);
  		grid.getColumn("image").setRenderer(new BlobImageRenderer(30,30,"image/png"));
 
	Grid.Column truth = grid.getColumn("truth");
	truth.setRenderer(new HtmlRenderer(), new StringToBooleanConverter() {
              @Override
              protected String getTrueString() {
                  return FontAwesome.CHECK_CIRCLE_O.getHtml();
              }

              @Override
              protected String getFalseString() {
                  return FontAwesome.CIRCLE_O.getHtml();
              }
          });
	truth.setEditable(false);
  
	setStyleName("demoContentLayout");
	setSizeFull();
	addComponent(grid);
	setComponentAlignment(grid
			, Alignment.MIDDLE_CENTER);
	setMargin(true);
}
 
開發者ID:vaadin,項目名稱:grid-renderers-collection-addon,代碼行數:47,代碼來源:DemoUI.java

示例6: ReqRespTabSheet

import com.vaadin.ui.Grid; //導入方法依賴的package包/類
public ReqRespTabSheet(String caption, boolean editable) {
    setCaption(caption);
    setHeight(15, Unit.EM);
    setWidth(550, Unit.PIXELS);
    addStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR);

    payloadLayout = new VerticalLayout();
    payloadLayout.setSizeFull();
    payload = new TextArea();
    payload.setNullRepresentation("");
    payload.setSizeFull();
    payloadLayout.addComponent(payload);
    addTab(payloadLayout, "Payload");

    VerticalLayout requestHeadersLayout = new VerticalLayout();
    requestHeadersLayout.setSizeFull();
    if (editable) {
        HorizontalLayout requestHeadersButtonLayout = new HorizontalLayout();
        Button addButton = new Button("+", (e) -> add());
        addButton.addStyleName(ValoTheme.BUTTON_SMALL);
        Button deleteButton = new Button("-", (e) -> delete());
        deleteButton.addStyleName(ValoTheme.BUTTON_SMALL);
        requestHeadersButtonLayout.addComponent(addButton);
        requestHeadersButtonLayout.addComponent(deleteButton);
        requestHeadersLayout.addComponent(requestHeadersButtonLayout);
    }

    headersGrid = new Grid();
    headersGrid.setEditorEnabled(editable);
    headersGrid.setEditorSaveCaption("Save");
    headersGrid.setEditorCancelCaption("Cancel");
    headersGrid.setSelectionMode(SelectionMode.SINGLE);
    headersGrid.setSizeFull();
    headersGrid.addColumn("headerName").setHeaderCaption("Header").setEditable(true)
            .setExpandRatio(1);
    headersGrid.addColumn("headerValue").setHeaderCaption("Value").setEditable(true)
            .setExpandRatio(1);
    requestHeadersLayout.addComponent(headersGrid);
    requestHeadersLayout.setExpandRatio(headersGrid, 1);
    addTab(requestHeadersLayout, "Headers");
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:42,代碼來源:CallWebServicePanel.java


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