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


Java EventBus.addHandler方法代码示例

本文整理汇总了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() );
}
 
开发者ID:realityforge,项目名称:replicant-example,代码行数:25,代码来源:ApplicationController.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:22,代码来源:AddRelationshipPopup.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:25,代码来源:CodeListView.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:21,代码来源:TermDetailsView.java

示例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);
	}
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:19,代码来源:SVGView.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:25,代码来源:ReplaceTermPopup.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:22,代码来源:RelatedTermsView.java

示例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();
}
 
开发者ID:inepex,项目名称:ineform,代码行数:20,代码来源:PlaceHandler.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:40,代码来源:TermSynonymsView.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:13,代码来源:SearchInputView.java

示例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);
		}
	});
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:29,代码来源:SearchOptionsView.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:12,代码来源:SearchResultsView.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:8,代码来源:ApproveRejectSynonymComposite.java

示例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();
}
 
开发者ID:turbomanage,项目名称:listmaker,代码行数:30,代码来源:ManageNotesActivity.java

示例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);
}
 
开发者ID:Novartis,项目名称:ontobrowser,代码行数:55,代码来源:AddSynonymPopup.java


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