本文整理汇总了Java中com.google.gwt.event.shared.EventBus.addHandler方法的典型用法代码示例。如果您正苦于以下问题:Java EventBus.addHandler方法的具体用法?Java EventBus.addHandler怎么用?Java EventBus.addHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.shared.EventBus
的用法示例。
在下文中一共展示了EventBus.addHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ApplicationController
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
@Inject
public ApplicationController( @Nonnull final RosterTypeRepository rosterTypeRepository,
@Nonnull final RosterRepository rosterRepository,
@Nonnull final PersonRepository personRepository,
@Nonnull final RosterService rosterService,
@Nonnull final FrontendContext frontendContext,
@Nonnull final EntityChangeBroker broker,
@Nonnull final EventBus eventBus )
{
AppData.controller = this;
_rosterTypeRepository = rosterTypeRepository;
_rosterRepository = rosterRepository;
_personRepository = personRepository;
_rosterService = rosterService;
_frontendContext = frontendContext;
_broker = broker;
_loginUI = new ReactWidget( React.createElement( Login_.TYPE ) );
_rosterListUI = new RosterListUI( this );
_rosterUI = new RosterUI( this );
_mainPanel = new SimplePanel();
gotoLoginActivity();
broker.addChangeListener( this );
eventBus.addHandler( MetaDataSubscribeCompletedEvent.TYPE, e -> goToRosterListActivity() );
}
示例2: AddRelationshipPopup
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public AddRelationshipPopup(final OntoBrowserServiceAsync service,
final EventBus eventBus) {
this.service = service;
this.eventBus = eventBus;
dialogBox.setText("Add Relationship");
dialogBox.setGlassEnabled(false);
dialogBox.setAnimationEnabled(true);
recentlyViewedDataProvider.addDataDisplay(recentlyViewTable);
recentlyCreatedDataProvider.addDataDisplay(recentlyCreatedTable);
addRelationshipTypes();
setupTable(recentlyViewTable);
setupTable(recentlyCreatedTable);
addDialogWidgets();
addButton.addClickHandler(this);
eventBus.addHandler(ViewTermEvent.TYPE, this);
}
示例3: CodeListView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public CodeListView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus,service);
Image emptyListWidget = new Image(ImageResources.INSTANCE.spinner());
emptyListWidget.setStyleName("float-right");
list.setEmptyListWidget(emptyListWidget);
list.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
list.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
list.setSelectionModel(selection);
selection.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
Term selected = selection.getSelectedObject();
if(selected != null) {
History.newItem(selected.getReferenceId());
}
}
});
codelistContainer.add(list);
initWidget(codelistContainer);
addStyleName("padded-border vert-scroll");
eventBus.addHandler(ViewTermEvent.TYPE, this);
}
示例4: TermDetailsView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public TermDetailsView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus, service);
for(int i = 0; i < LABELS.length; i++) {
grid.setText(i, 0, LABELS[i] + ":");
}
CellFormatter cellFormatter = grid.getCellFormatter();
for(int row = 0; row < grid.getRowCount(); row++) {
cellFormatter.addStyleName(row, 0, "label");
}
panel.add(grid);
initWidget(panel);
addStyleName("padded-border vert-scroll fixed-height");
eventBus.addHandler(ViewTermEvent.TYPE, this);
eventBus.addHandler(TermUpdatedEvent.TYPE, this);
eventBus.addHandler(TermDeletedEvent.TYPE, this);
}
示例5: SVGView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public SVGView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus,service);
if(supportsSVG()) {
panel.getElement().setId("svgPanel");
//svgContainer.getElement().getStyle().setOverflow(Overflow.AUTO);
svgContainer.addClickHandler(this);
panel.add(svgContainer);
initWidget(panel);
addStyleName("padded-border");
eventBus.addHandler(ViewTermEvent.TYPE, this);
} else {
Label label = new Label("Your web browser does not support SVG");
label.addStyleName("centered");
initWidget(label);
}
}
示例6: ReplaceTermPopup
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public ReplaceTermPopup(final OntoBrowserServiceAsync service,
final EventBus eventBus) {
this.service = service;
this.eventBus = eventBus;
dialogBox.setText("Confirm term obsoletion");
dialogBox.setGlassEnabled(false);
dialogBox.setAnimationEnabled(true);
recentlyViewedDataProvider.addDataDisplay(recentlyViewTable);
recentlyCreatedDataProvider.addDataDisplay(recentlyCreatedTable);
setupTable(recentlyViewTable);
setupTable(recentlyCreatedTable);
addDialogWidgets();
commentsField.getElement().getParentElement().addClassName("text-area-right-padded");
commentsField.setWidth("100%");
commentsField.setVisibleLines(2);
obsoleteButton.addClickHandler(this);
eventBus.addHandler(ViewTermEvent.TYPE, this);
}
示例7: RelatedTermsView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public RelatedTermsView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus, service);
table.addStyleName("gwt-CellTable");
table.setWidth("100%");
table.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
table.setSelectionModel(new NoSelectionModel<Relationship>());
table.addColumn(new RelationshipColumn(), "Relationship");
table.addColumn(new RelatedTermColumn(), "Related Term");
table.addColumn(new StatusColumn(), "Status");
panel.add(table);
initWidget(panel);
addStyleName("padded-border vert-scroll fixed-height");
eventBus.addHandler(ViewTermEvent.TYPE, this);
eventBus.addHandler(RelationshipUpdatedEvent.TYPE, this);
eventBus.addHandler(RelationshipDeletedEvent.TYPE, this);
}
示例8: PlaceHandler
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public PlaceHandler(
PlaceHierarchyProvider placeHierarchyProvider,
MasterPage masterPage,
AuthManager authManager,
HistoryProvider historyProvider,
EventBus eventBus,
ConnectionFailedHandler connectionFailedHandler) {
this.placeHierarchyProvider = placeHierarchyProvider;
this.masterPage = masterPage;
this.authManager = authManager;
this.historyProvider = historyProvider;
this.eventBus = eventBus;
this.connectionFailedHandler = connectionFailedHandler;
historyProvider.addHandler(this);
eventBus.addHandler(PlaceRequestEvent.TYPE, this);
placeHierarchyProvider.createPlaceHierarchy();
}
示例9: TermSynonymsView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public TermSynonymsView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus, service);
this.linkedTermsView = new ControlledVocabularyTermLinksView(service);
SynonymColumn synonymColumn = new SynonymColumn();
synonymColumn.setFieldUpdater(new FieldUpdater<Synonym, String>() {
@Override
public void update(int index, Synonym synonym, String value) {
ControlledVocabularyTerm term = synonym.getControlledVocabularyTerm();
if(term != null) {
linkedTermsView.show(term);
}
}
});
synonymColumn.setCellStyleNames("clickable-text nowrap");
table.addStyleName("gwt-CellTable");
table.setWidth("100%");
table.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
table.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
table.setSelectionModel(new NoSelectionModel<Synonym>());
table.addColumn(synonymColumn, "Synonym");
table.addColumn(new TypeColumn(), "Type");
table.addColumn(new ContextColumn(), "Context");
table.addColumn(new SourceColumn(), "Source");
table.addColumn(new ReferenceIdColumn(), "Id");
table.addColumn(new StatusColumn(), "Status");
panel.add(table);
initWidget(panel);
addStyleName("padded-border vert-scroll fixed-height");
eventBus.addHandler(ViewTermEvent.TYPE, this);
eventBus.addHandler(SynonymUpdatedEvent.TYPE, this);
eventBus.addHandler(SynonymDeletedEvent.TYPE, this);
}
示例10: SearchInputView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public SearchInputView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus,service);
DOM.setElementAttribute(searchInput.getElement(),
"placeholder", "Search");
searchInput.addKeyDownHandler(this);
initWidget(searchInput);
addStyleName("search");
eventBus.addHandler(SearchEvent.TYPE, this);
}
示例11: SearchOptionsView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public SearchOptionsView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus, service);
ontologiesDropBox.addItem("all");
ontologiesDropBox.addChangeHandler(this);
includeSynonyms.addClickHandler(this);
initWidget(createPanel());
addStyleName("padded-border");
eventBus.addHandler(SearchEvent.TYPE, this);
service.loadRootTerms(new AsyncCallback<List<Term>>() {
@Override
public void onSuccess(List<Term> terms) {
for(Term term : terms) {
Ontology ontology = term.getOntology();
String name = ontology.getName();
ontologiesDropBox.addItem(name);
}
}
@Override
public void onFailure(Throwable caught) {
GWT.log("Failed to load root terms", caught);
ErrorView.instance().onUncaughtException(caught);
}
});
}
示例12: SearchResultsView
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public SearchResultsView(EventBus eventBus,
OntoBrowserServiceAsync service,
SearchOptionsProvider searchOptions) {
super(eventBus,service);
this.searchOptions = searchOptions;
initWidget(createPanel());
addStyleName("search-results padded-border vert-scroll");
eventBus.addHandler(SearchEvent.TYPE, this);
}
示例13: ApproveRejectSynonymComposite
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public ApproveRejectSynonymComposite(OntoBrowserServiceAsync service,
EventBus eventBus, Curator curator, BusyIndicatorHandler busyIndicatorHandler) {
super(Entity.TERM_SYNONYM, service, eventBus, curator, busyIndicatorHandler,
new EditSynonymPopup(service, eventBus));
this.linkedTermsView = new ControlledVocabularyTermLinksView(service);
eventBus.addHandler(SynonymUpdatedEvent.TYPE, this);
}
示例14: start
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
@Override
public void start(AcceptsOneWidget acceptsOneWidget, EventBus eventBus) {
setView(App.getClientFactory().getManageNotesView());
super.start(acceptsOneWidget, eventBus);
populateNoteListFilter();
getView().disableBulkActions();
eventBus.addHandler(NotesLoadedEvent.TYPE, new NotesLoadedEventHandler() {
@Override
public void onNotesLoaded(List<Note> items) {
NoteList currentList = App.getNoteListService().getNoteList(getView().getNoteListFilter().getSelectedValue().id);
getView().getNotesTable().inputNotes(filterNotes(currentList));
App.getEventBus().fireEvent(new ShowMessageEvent("NEW! Double click a note to edit!"));
}
});
eventBus.addHandler(NoteListsModifiedEvent.TYPE, new NoteListsModifiedEventHandler() {
@Override
public void onNoteListsModified(Map<Long, NoteList> noteLists) {
populateNoteListFilter();
}
});
eventBus.addHandler(NoteListAddedEvent.TYPE, new NoteListAddedHandler() {
@Override
public void onNoteListAdded(ArrayList<NoteList> allLists, NoteList noteList) {
populateNoteListFilter();
}
});
App.getClientNoteItemService().findNotes(getView());
getView().show();
}
示例15: AddSynonymPopup
import com.google.gwt.event.shared.EventBus; //导入方法依赖的package包/类
public AddSynonymPopup(OntoBrowserServiceAsync service,
EventBus eventBus) {
this.service = service;
this.eventBus = eventBus;
synonymField.setMaxLength(MAX_LEN);
synonymField.setVisibleLength(VIS_LEN);
synonymField.addKeyPressHandler(this);
synonymField.addKeyUpHandler(this);
synonymField.addValueChangeHandler(this);
for(Synonym.Type type : Synonym.Type.values()) {
typeDropBox.addItem(type.toString(), type.name());
}
typeDropBox.setSelectedIndex(typeDropBox.getItemCount()-1);
sourceDropBox.addChangeHandler(this);
referenceIdField.setMaxLength(MAX_LEN);
referenceIdField.setVisibleLength(VIS_LEN);
referenceIdField.setEnabled(false);
referenceIdField.addKeyPressHandler(this);
referenceIdField.addKeyUpHandler(this);
referenceIdField.addValueChangeHandler(this);
dialogBox.setText("Add Synonym");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
dialogBox.addStyleName("gwt-ModalDialogBox");
addDialogWidgets();
service.loadPublicDatasources(new AsyncCallback<List<Datasource>>() {
@Override
public void onFailure(Throwable caught) {
GWT.log("Failed to load public datasources", caught);
ErrorView.instance().onUncaughtException(caught);
}
@Override
public void onSuccess(List<Datasource> datasources) {
Collections.sort(datasources, new DatasourceAcronymComparator());
sourceDropBox.addItem("", "");
for(Datasource datasource : datasources) {
String label = datasource.getAcronym() + " - " + datasource.getName();
sourceDropBox.addItem(label, datasource.getAcronym());
}
sourceDropBox.setSelectedIndex(0);
}
});
addButton.addClickHandler(this);
addButton.setEnabled(false);
eventBus.addHandler(ViewTermEvent.TYPE, this);
}