本文整理汇总了Java中com.google.gwt.user.cellview.client.CellList类的典型用法代码示例。如果您正苦于以下问题:Java CellList类的具体用法?Java CellList怎么用?Java CellList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CellList类属于com.google.gwt.user.cellview.client包,在下文中一共展示了CellList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ListView
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
public ListView(final ListPresenter<LISTITEM> presenter, Cell<LISTITEM> itemDisplayCell) {
this.presenter = presenter;
this.cellList = new CellList<LISTITEM>(itemDisplayCell);
cellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
// Add a selection model to handle user selection.
final SingleSelectionModel<LISTITEM> selectionModel = new SingleSelectionModel<LISTITEM>();
cellList.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
LISTITEM selected = selectionModel.getSelectedObject();
if (selected != null) {
presenter.onSelectionChanged(event, selectionModel);
}
}
});
this.pagerTop = new SimplePager();
this.pagerTop.setDisplay(this.cellList);
this.pagerBottom = new SimplePager();
this.pagerBottom.setDisplay(this.cellList);
initWidget((Widget)uiBinder.createAndBindUi(this));
}
示例2: initialize
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
private void initialize() {
Resources resources = GWT.create(Resources.class);
EventCell eventCell = new EventCell(resources.tux());
cellList = new CellList<EventProxy>(eventCell);
cellList.setPageSize(10);
cellList.setKeyboardPagingPolicy(KeyboardPagingPolicy.INCREASE_RANGE);
cellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.BOUND_TO_SELECTION);
final SingleSelectionModel<EventProxy> selectionModel = new SingleSelectionModel<EventProxy>();
cellList.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
presenter.goEventDetailView(selectionModel.getSelectedObject().getId());
}
});
eventPagerPanel.setDisplay(cellList);
}
示例3: StudentEditorPresenter
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
public StudentEditorPresenter(final GwtPreferences preferences) {
this.preferences = preferences;
initWidget(uiBinder.createAndBindUi(this));
TextCell textCell = new TextCell();
studentDisplay = new CellList<String>(textCell);
studentList = new ListDataProvider<>(preferences.getStudentNames());
studentList.addDataDisplay(studentDisplay);
selectionModel = new SingleSelectionModel<>();
studentDisplay.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
@Override
public void onSelectionChange(SelectionChangeEvent event) {
updateSelectedStudent();
oldStudentName = selectionModel.getSelectedObject();
studentName.setText(oldStudentName);
}
});
studentPanel.add(studentDisplay);
selectionModel.setSelected(studentList.getList().get(0), true);
}
示例4: ManifestView
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
public ManifestView() {
CellList.Resources cell_res = GWT.create(CellListResources.class);
Panel main = new FlowPanel();
top = new ScrollPanel(main);
top.setStylePrimaryName("View");
this.cell_list = new CellList<Reference<Sequence>>(new ReferenceCell<Sequence>(), cell_res);
this.selection_model = new SingleSelectionModel<Reference<Sequence>>();
cell_list.addStyleName("CellList");
cell_list.setSelectionModel(selection_model);
Label panel_title = new Label(Messages.INSTANCE.manifestInstruction());
panel_title.setStylePrimaryName("PanelTitle");
this.manifest_label = new Label();
manifest_label.setStylePrimaryName("PanelHeader");
main.add(panel_title);
main.add(manifest_label);
main.add(cell_list);
addContent(top);
}
示例5: EditDatasourcesViewImpl
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
@Inject
public EditDatasourcesViewImpl(final EditDatadourceViewImplUiBinder uiBinder,
final EditDatasourceMessages messages,
final @Named(DatasourceKeyProvider.NAME) DatasourceKeyProvider keyProvider,
final DatasourceCellListResources dsListResources,
final DatasourceCell datasourceCell,
final @NotNull EditWindowFooter editWindowFooter) {
this.messages = messages;
Widget widget = uiBinder.createAndBindUi(this);
setWidget(widget);
this.datasourceList = new CellList<>(datasourceCell, dsListResources, keyProvider);
this.pagerPanel.setIncrementSize(DATASOURCES_LIST_INCREMENT);
this.pagerPanel.setDisplay(this.datasourceList);
this.footer = editWindowFooter;
this.setTitle(messages.editDatasourcesDialogText());
this.getFooter().add(editWindowFooter);
this.datasourceList.setEmptyListWidget(new Label(messages.emptyDatasourceList()));
this.datasourceList.setPageSize(DATASOURCES_LIST_PAGE_SIZE);
this.datasourceList.setKeyboardPagingPolicy(KeyboardPagingPolicy.INCREASE_RANGE);
this.datasourceList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
}
示例6: makeTemplateSelector
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
/**
* Creates the scrollable list of cells each of which serves as a link to a template.
*
* @param list an ArrayList of TemplateInfo
* @return A CellList widget
*/
public CellList<TemplateInfo> makeTemplateSelector(ArrayList<TemplateInfo> list) {
TemplateCell templateCell = new TemplateCell(list.get(0), templateHostUrl);
CellList<TemplateInfo> templateCellList = new CellList<TemplateInfo>(templateCell,TemplateInfo.KEY_PROVIDER);
templateCellList.setPageSize(list.size() + 10);
templateCellList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);
templateCellList.setWidth("250px");
templateCellList.setHeight("400px");
templateCellList.setVisible(true);
// Add a selection model to handle user selection.
final SingleSelectionModel<TemplateInfo> selectionModel =
new SingleSelectionModel<TemplateInfo>(TemplateInfo.KEY_PROVIDER);
templateCellList.setSelectionModel(selectionModel);
selectionModel.setSelected(list.get(0), true);
final TemplateUploadWizard wizard = this;
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
TemplateInfo selected = selectionModel.getSelectedObject();
if (selected != null) {
selectedTemplateNAME = selected.name;
TemplateWidget.setTemplate(selected, wizard.getTemplateUrlHost());
}
}
});
// Set the total row count. This isn't strictly necessary, but it affects
// paging calculations, so its good habit to keep the row count up to date.
templateCellList.setRowCount(list.size(), true);
// Push the data into the widget.
templateCellList.setRowData(0, list);
return templateCellList;
}
示例7: createListPanel
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
/**
* Create the panel
* @return the panel widget
*/
protected void createListPanel() {
CellList.Resources resources = GWT.create(CellListResources.class);
DataSourceCell dataSourceCell = new DataSourceCell( );
dsList = new CellList<DataSourcePageRow>(dataSourceCell,resources);
dsList.setPageSize(3);
scrollPanel.add(dsList);
scrollPanel.setHeight("600px");
}
示例8: showAchievements
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
private void showAchievements(int gameIndex, String categoryName) {
if(lastAchievementWidget != null) {
remove(lastAchievementWidget);
}
AchievementGame game = games.get(gameIndex);
if(categoryName == AchievementGame.FirstCategory) {
List<AchievementSummary> summary = new ArrayList<AchievementSummary>();
summary.add(new AchievementSummary(game.getAchievements()));
CellList<AchievementSummary> summaryList = new CellList<AchievementSummary>(new AchievementSummaryCell());
summaryList.setRowCount(summary.size());
summaryList.setRowData(0, summary);
lastAchievementWidget = summaryList;
add(summaryList);
}
else {
List<Achievement> achievements = game.getAchievements(categoryName);
CellList<Achievement> achievementList = new CellList<Achievement>(new AchievementCell());
achievementList.setRowCount(achievements.size());
achievementList.setRowData(0, achievements);
lastAchievementWidget = achievementList;
add(achievementList);
}
}
示例9: StudentChooserPresenter
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
public StudentChooserPresenter(GwtPreferences preferences) {
this.preferences = preferences;
initWidget(uiBinder.createAndBindUi(this));
TextCell textCell = new TextCell();
studentList = new CellList<String>(textCell);
selectionModel = new MultiSelectionModel<>();
studentList.addCellPreviewHandler(new Handler<String>() {
@Override
public void onCellPreview(CellPreviewEvent<String> event) {
if (BrowserEvents.CLICK.equals(event.getNativeEvent().getType())) {
boolean isSelected = selectionModel.isSelected(event.getValue());
selectionModel.setSelected(event.getValue(), ! isSelected);
event.setCanceled(true);
}
}
});
DefaultSelectionEventManager<String> selectionManager =
DefaultSelectionEventManager.createCheckboxManager();
studentList.setSelectionModel(selectionModel, selectionManager);
studentPanel.add(studentList);
studentList.setRowData(preferences.getStudentNames());
setListBoxValue(
wordLength,
preferences.getUltraghostMinimumWordLength());
setListBoxValue(
vocabularySize,
preferences.getComputerStudentVocabularySize());
}
示例10: MobileTaskListView
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
/**
* Construct a new {@link MobileTaskListView}.
*/
public MobileTaskListView() {
// Create the CellList.
CellListResources cellListRes = GWT.create(CellListResources.class);
taskList = new CellList<TaskProxy>(new TaskProxyCell(), cellListRes);
taskList.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
/*
* Inform the presenter when the user selects a task from the task list. We
* use a NoSelectionModel because we don't want the task to remain selected,
* we just want to be notified of the selection event.
*/
final NoSelectionModel<TaskProxy> selectionModel = new NoSelectionModel<TaskProxy>();
taskList.setSelectionModel(selectionModel);
selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
// Edit the task.
if (presenter != null) {
presenter.selectTask(selectionModel.getLastSelectedObject());
}
}
});
// Initialize the widget.
initWidget(uiBinder.createAndBindUi(this));
}
示例11: createTaskTemplateList
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
private CellList<TaskProxy> createTaskTemplateList() {
CellList<TaskProxy> list =
new CellList<TaskProxy>(new TaskTemplateCell());
list.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
// Create the templates.
List<TaskProxy> templates = new ArrayList<TaskProxy>();
templates.add(new TaskProxyImpl("Call mom", null));
templates.add(new TaskProxyImpl("Register to vote", "Where is my polling location again?"));
templates.add(new TaskProxyImpl("Replace air filter", "Size: 24x13x1"));
templates.add(new TaskProxyImpl("Take out the trash", null));
list.setRowData(templates);
return list;
}
示例12: CollectionView
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
public CollectionView() {
CellList.Resources cell_res = GWT.create(CellListResources.class);
main = new FlowPanel();
top = new ScrollPanel();
top.setStylePrimaryName("View");
cell_list = new CellList<Reference<Manifest>>(
new ReferenceCell<Manifest>(), cell_res);
top.add(cell_list);
cell_list.addStyleName("CellList");
selection_model = new SingleSelectionModel<Reference<Manifest>>();
cell_list.setSelectionModel(selection_model);
Label panel_title = new Label(Messages.INSTANCE.collectionInstruction());
panel_title.setStylePrimaryName("PanelTitle");
main.add(panel_title);
collection_label = new Label();
collection_label.setStylePrimaryName("PanelHeader");
main.add(collection_label);
main.add(top);
addContent(main);
}
示例13: shouldBeAbleToInstantiateCellLists
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
@Test
public void shouldBeAbleToInstantiateCellLists() {
assertNotNull(new CellList<String>(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {}
}));
}
示例14: getCellList
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
@Override
public CellList<EventProxy> getCellList() {
return cellList;
}
示例15: cellListStyle
import com.google.gwt.user.cellview.client.CellList; //导入依赖的package包/类
@Source({CellList.Style.DEFAULT_CSS, "MobileCellList.css"})
CellListStyle cellListStyle();