当前位置: 首页>>代码示例>>Java>>正文


Java Grid类代码示例

本文整理汇总了Java中com.extjs.gxt.ui.client.widget.grid.Grid的典型用法代码示例。如果您正苦于以下问题:Java Grid类的具体用法?Java Grid怎么用?Java Grid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Grid类属于com.extjs.gxt.ui.client.widget.grid包,在下文中一共展示了Grid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generatePossibleDuplicatesGrid

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
private Grid<ContactDTO> generatePossibleDuplicatesGrid() {
  ColumnConfig nameColumn = new ColumnConfig(ContactDTO.FULLNAME, I18N.CONSTANTS.fullName(), 250);
  ColumnConfig emailColumn = new ColumnConfig(ContactDTO.EMAIL, I18N.CONSTANTS.email(), 250);
  ColumnConfig actionsColumn = new ColumnConfig();
  actionsColumn.setWidth(100);
  actionsColumn.setRenderer(new GridCellRenderer<ContactDTO>() {
    @Override
    public Object render(final ContactDTO contact, String property, ColumnData config, int rowIndex, int colIndex, ListStore store, Grid grid) {
      Button button = Forms.button(I18N.CONSTANTS.dedupeContactUpdateButton());
      button.addSelectionListener(new SelectionListener<ButtonEvent>() {
        @Override
        public void componentSelected(ButtonEvent ce) {
          cardLayout.setActiveItem(secondStepContainer);
          secondStepHandler.initialize(contact.getId(), duplicatedPropertiesGrid.getStore());
          selectedContact = contact;
        }
      });

      return button;
    }
  });

  ColumnModel columnModel = new ColumnModel(Arrays.asList(nameColumn, emailColumn, actionsColumn));
  return new Grid<ContactDTO>(new ListStore<ContactDTO>(), columnModel);
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:26,代码来源:DedupeContactDialog.java

示例2: onAttachTabWidgets

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
 * On attach tab widgets.
 *
 * @param event
 *            the event
 */
private void onAttachTabWidgets(AppEvent event)
{
    if (tabWidget == null)
    {
        tabWidget = (TabWidget) event.getData();
        tabWidget.add(new RulesTabItem(RULES_TAB_ITEM_ID, rulesManagerServiceRemote,
                gsManagerServiceRemote, profilesManagerServiceRemote,
                instancesManagerServiceRemote, workspacesManagerServiceRemote));

        RulesTabItem rulesTabItem = (RulesTabItem) tabWidget.getItemByItemId(RULES_TAB_ITEM_ID);
        final RuleGridWidget rulesInfoWidget = rulesTabItem.getRuleManagementWidget().getRulesInfo();
        final Grid<RuleModel> grid = rulesInfoWidget.getGrid();
        grid.getStore().setSortField(BeanKeyValue.PRIORITY.getValue());
        grid.getStore().setSortDir(SortDir.ASC);
        grid.getStore().sort(BeanKeyValue.PRIORITY.getValue(), SortDir.ASC);
    }
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:24,代码来源:RulesController.java

示例3: render

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public Object render(final RuleModel model, String property,
                ColumnData config, int rowIndex, int colIndex,
                ListStore<RuleModel> store, Grid<RuleModel> grid) {

            if (!init) {
                init = true;
                grid.addListener(Events.ColumnResize, new ResizeListener(20));
            }

            LabelField field = new LabelField();
            field.setId(fieldId);
            field.setName(fieldId);
            field.setEmptyText("*");
            field.setFieldLabel(BeanKeyValue.NAME.getValue());
            field.setValue(BeanKeyValue.NAME.getValue());
            field.setReadOnly(true);

//            field.setWidth(initialWidth - 10);
            field.setAutoWidth(true);
            field.show();

            setFieldValue(model, field);
            
            return field;
        }
 
开发者ID:geoserver,项目名称:geofence,代码行数:26,代码来源:RuleGridWidget.java

示例4: render

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Object render(final ProjectFundingDTO model, final String property, final ColumnData config, final int rowIndex, final int colIndex,
		final ListStore<ProjectFundingDTO> store, final Grid<ProjectFundingDTO> grid) {

	// Creates the button with its icon.
	final PushButton editButton = new PushButton(IconImageBundle.ICONS.editLinkedProject().createImage());
	editButton.setStylePrimaryName(STYLE_EDIT_BUTTON);

	// Sets the button click handler.
	editButton.addClickHandler(new ClickHandler() {

		@Override
		public void onClick(final ClickEvent event) {
			view.getPresenterHandler().onLinkedProjectEditClickEvent(model, projectType);
		}
	});

	// Returns this button.
	return editButton;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:24,代码来源:LinkedProjectsEditButtonCellRender.java

示例5: buildGrid

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public Grid<DiffEntry> buildGrid() {

		final ColumnModel columnModel = new ColumnModel(Arrays.asList(new ColumnConfig[] {
			new ColumnConfig(DiffEntry.FIELD_NAME, 200),
			new ColumnConfig(DiffEntry.DISPLAY_VALUE_1, 200),
			new ColumnConfig(DiffEntry.DISPLAY_VALUE_2, 200)
		}));

		final Grid<DiffEntry> grid = new Grid<DiffEntry>(new ListStore<DiffEntry>(), columnModel);
		grid.setHideHeaders(true);
		grid.setHeight(500);
		grid.setAutoWidth(true);
		grid.getView().setForceFit(true);
		
		return grid;

	}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:18,代码来源:ProjectCoreDiffView.java

示例6: createGrid

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
 * Creates the grid component.
 * 
 * @return The grid component.
 */
private Component createGrid() {

	grid = new Grid<PhaseModelDTO>(new ListStore<PhaseModelDTO>(), new PhaseModelsColumnsProvider() {

		@Override
		protected GridEventHandler<PhaseModelDTO> getGridEventHandler() {
			return gridEventHandler;
		}
	}.getColumnModel());

	grid.setAutoHeight(true);
	grid.getView().setForceFit(true);
	grid.getStore().setSortField(PhaseModelDTO.SUCCESSORS);

	final GridSelectionModel<PhaseModelDTO> selectionModel = new GridSelectionModel<PhaseModelDTO>();
	selectionModel.setSelectionMode(SelectionMode.SINGLE);
	grid.setSelectionModel(selectionModel);

	return grid;
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:26,代码来源:PhaseModelsAdminView.java

示例7: initialize

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
@Override
public void initialize() {
  contactHistoryGrid = new Grid<ContactHistory>(new ListStore<ContactHistory>(), buildColumnModel());
  contactHistoryGrid.getView().setForceFit(true);
  contactHistoryGrid.setAutoHeight(true);
  contactHistoryGrid.addListener(Events.ViewReady, new Listener<BaseEvent>() {
    @Override
    public void handleEvent(BaseEvent be) {
      resizeGrid(contactHistoryGrid, container, true);
    }
  });
  Window.addResizeHandler(new ResizeHandler() {
    @Override
    public void onResize(ResizeEvent event) {
      resizeGrid(contactHistoryGrid, container, true);
    }
  });

  container = Panels.content(null, false, Layouts.vBoxLayout(VBoxLayout.VBoxLayoutAlign.STRETCH, new Layouts.LayoutOptions(new Padding(10))), "x-border-layout-ct");
  container.setScrollMode(Style.Scroll.AUTOY);
  container.add(contactHistoryGrid);
  add(container);
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:24,代码来源:ContactHistoryView.java

示例8: render

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
@Override
public Object render(PivotGridPanel.PivotTableRow model, String property,
		ColumnData config, int rowIndex, int colIndex,
		ListStore<PivotGridPanel.PivotTableRow> store, Grid<PivotGridPanel.PivotTableRow> grid) {
	
	
	Double value = model.get(property);
	if(value == null) {
		return "";
	} else {
		String formattedValue = formatValue(model.getRowAxis(), value);
		if(model.getRowAxis().isTotal()) {
			return "<span class='" + PivotResources.INSTANCE.css().totalCell() + "'>" +
					formattedValue + "</span>";
		} else {
			return formattedValue;
		}
	}
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:20,代码来源:PivotCellRenderer.java

示例9: PasswordAccessAuditDialog

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public PasswordAccessAuditDialog(Password password)
{
    this.setSize("350", "460");
    this.setHeading(textMessages.passwordAccessAuditLog());
    VBoxLayout boxLayout = new VBoxLayout();
    boxLayout.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER);
    this.setLayout(boxLayout);
    this.setModal(true);
    this.setResizable(false);
    
    gridStore = new ListStore<PasswordAccessAuditData>();
    List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    ColumnConfig columnConfigDate = new ColumnConfig(Constants.DATE, textMessages.dateAccessed(), 130);
    columnConfigDate.setDateTimeFormat(DateTimeFormat.getFormat(textMessages.displayDateFormat()));
    configs.add(columnConfigDate);
    ColumnConfig columnConfigUser = new ColumnConfig(Constants.USER, textMessages.userAccessed(), 160);
    configs.add(columnConfigUser);
    
    Grid<PasswordAccessAuditData> grid = new Grid<PasswordAccessAuditData>(gridStore, new ColumnModel(configs));
    grid.setStripeRows(true);
    add(grid);
    grid.setSize("320px", "390px");
    grid.setBorders(true);
    
    Button closeButton = new Button(textMessages.close(), new SelectionListener<ButtonEvent>() {
        @Override
        public void componentSelected(ButtonEvent ce) {
            doClose();
        }
    });
    
    setButtonAlign(HorizontalAlignment.CENTER);
    addButton(closeButton);
    
    loadAccessAuditData(password.getId());
}
 
开发者ID:alfameCom,项目名称:salasanasiilo,代码行数:37,代码来源:PasswordAccessAuditDialog.java

示例10: init

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public void init(Component component) {
	if (component instanceof Grid) {
		this.grid = (Grid) component;
		grid.addListener(CMDBSession.get().getConfig().getGridToolClick(), new Listener<GridEvent>() {
			public void handleEvent(GridEvent e) {
				onMouseDown(e);
			}
		});
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:11,代码来源:MultiColumnConfig.java

示例11: init

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public void init(Component component) {
	if (component instanceof Grid) {
		this.grid = (Grid) component;
		grid.addListener(Events.CellClick, new Listener<GridEvent>() {
			public void handleEvent(GridEvent e) {
				onMouseDown(e);
			}
		});
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:11,代码来源:CITemplateColumnConfig.java

示例12: init

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
public void init(Component component) {
	if (component instanceof Grid) {
		this.grid = (Grid)component;
		this.field.init(component);
		grid.addListener(CMDBSession.get().getConfig().getGridToolClick(), new Listener<GridEvent>() {
			public void handleEvent(GridEvent e) {
				onMouseDown(e);
			}

		});
		
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:14,代码来源:AttributeColumnModel.java

示例13: getGridContextMenu

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
private Menu getGridContextMenu(final Grid grid) {
	Menu menu = new Menu();
	MenuItem item = new MenuItem("Properties", new SelectionListener<ComponentEvent>() {

		@Override
		public void componentSelected(ComponentEvent ce) {
			CellSelectionModel<ModelData> selectionModel = (CellSelectionModel<ModelData>) grid.getSelectionModel();
			ModelData data = selectionModel.getSelectCell().model;
		}
		
	});
	menu.add(item);
	
	return(menu);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:16,代码来源:InstanceList.java

示例14: onTestConnection

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
 *
 * @param event
 */
private void onTestConnection(AppEvent event)
{
    if (tabWidget != null)
    {

        InstancesTabItem instancesTabItem = (InstancesTabItem) tabWidget.getItemByItemId(INSTANCES_TAB_ITEM_ID);
        final InstanceGridWidget instancesInfoWidget =
            instancesTabItem.getInstanceManagementWidget().getInstancesInfo();
        final Grid<GSInstanceModel> grid = instancesInfoWidget.getGrid();

        if ((grid != null) && (grid.getStore() != null) && (event.getData() != null) && (event.getData() instanceof GSInstanceModel))
        {

            GSInstanceModel instance = event.getData();
            
            instancesManagerServiceRemote.testConnection(instance, new AsyncCallback<Void>()
                    {

                public void onFailure(Throwable caught)
                {

                    Dispatcher.forwardEvent(GeofenceEvents.SEND_ERROR_MESSAGE,
                        new String[] {  /* TODO: I18nProvider.getMessages().ruleServiceName() */"Instance Service",
                            /* TODO: I18nProvider.getMessages().ruleFetchFailureMessage() */ "Error occurred testing connection to Instance ("+caught.getMessage()+")!" });
                }

                public void onSuccess(Void result)
                {

             	   Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE,
                            new String[] {  /* TODO: I18nProvider.getMessages().ruleServiceName() */"Instance Service",
                                /* TODO: I18nProvider.getMessages().ruleFetchFailureMessage() */ "Connection to Instance succesful!" });
                }
            });
            
        }
    }
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:43,代码来源:InstanceController.java

示例15: initGrid

import com.extjs.gxt.ui.client.widget.grid.Grid; //导入依赖的package包/类
/**
 * Inits the grid.
 */
public void initGrid()
{
    ColumnModel cm = prepareColumnModel();

    grid = new Grid<RuleModel>(store, cm);
    grid.setBorders(true);

    grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    grid.setHeight("70px");
    grid.setLazyRowRender(0);
    setGridProperties();
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:16,代码来源:EditRuleWidget.java


注:本文中的com.extjs.gxt.ui.client.widget.grid.Grid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。